Merge remote-tracking branch 'origin/master'
| | |
| | | package com.mes.damage.controller; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | * @since 2024-06-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/glassinfo/damage") |
| | | @RequestMapping("/damage") |
| | | public class DamageController { |
| | | |
| | | @Autowired |
| | | private DamageService damageService; |
| | | @ApiOperation("报工数据查询") |
| | | @GetMapping("/selectDamage") |
| | | public Result selectDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedureId)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | | @GetMapping("/submitDamage") |
| | | public Result submitDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | damageService.submitDamage(startTime,endTime,type,status,workingProcedureId); |
| | | return Result.build(200,"报工成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据修改") |
| | | @GetMapping("/updateDamage") |
| | | public Result updateDamage(List<Damage> damageList) { |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"修改成功",1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-06-13 |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工序 |
| | | */ |
| | | private Integer workingProcedureId; |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | |
| | | private Integer deviceId; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | |
| | | /** |
| | | * 生产时间 |
| | | */ |
| | | private LocalDateTime damageTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 类型:0:报工 1:破损 2:拿走 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 状态:0:未报工 1:已报工 |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private Integer processId; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | private Integer orderNumber; |
| | | |
| | | /** |
| | | * 工艺确认序号 |
| | | */ |
| | | private Integer technologyNumber; |
| | | |
| | | /** |
| | | * 破损类型 |
| | | */ |
| | | private String breakageType; |
| | | |
| | | /** |
| | | * 破损原因 |
| | | */ |
| | | private String breakageReason; |
| | | |
| | | /** |
| | | * 责任工序 |
| | | */ |
| | | private String responsibleProcess; |
| | | |
| | | /** |
| | | * 责任人员 |
| | | */ |
| | | private String responsiblePersonnel; |
| | | |
| | | /** |
| | | * 责任班组 |
| | | */ |
| | | private String responsibleTeam; |
| | | |
| | | /** |
| | | * 责任设备 |
| | | */ |
| | | private String responsibleEquipment; |
| | | |
| | | /** |
| | | * 报工班组名称 |
| | | */ |
| | | private String teamsGroupsName; |
| | | |
| | | /** |
| | | * 报工设备名称 |
| | | */ |
| | | private String deviceName; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.damage.service; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface DamageService extends IService<Damage> { |
| | | |
| | | List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void insertDamage(String glassId); |
| | | } |
| | |
| | | package com.mes.damage.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class DamageServiceImpl extends ServiceImpl<DamageMapper, Damage> implements DamageService { |
| | | |
| | | @Override |
| | | public List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | LambdaQueryWrapper<Damage> damageSelectWrapper =new LambdaQueryWrapper<>(); |
| | | damageSelectWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | | damageSelectWrapper.eq(Damage::getType,type); |
| | | } |
| | | if (status!=0){ |
| | | damageSelectWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedureId,workingProcedureId); |
| | | } |
| | | return baseMapper.selectList(damageSelectWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | LambdaUpdateWrapper<Damage> damageUpdateWrapper=new LambdaUpdateWrapper<>(); |
| | | damageUpdateWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | | damageUpdateWrapper.eq(Damage::getType,type); |
| | | } |
| | | if (status!=0){ |
| | | damageUpdateWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageUpdateWrapper.eq(Damage::getWorkingProcedureId,workingProcedureId); |
| | | } |
| | | Damage damage=new Damage(); |
| | | damage.setStatus(2); |
| | | baseMapper.update(damage,damageUpdateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void insertDamage(String glassId){ |
| | | LambdaQueryWrapper<GlassInfo> glassInfoSelectWrapper=new LambdaQueryWrapper<>(); |
| | | GlassInfo glassInfo=new GlassInfo(); |
| | | } |
| | | } |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @ApiOperation("玻璃详情查询") |
| | | @PostMapping("/selectBigStorageCageDetails") |
| | | public Result selectBigStorageCageDetails(String glassId) { |
| | | BigStorageCageDetails bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(glassId); |
| | | public Result selectBigStorageCageDetails(@RequestBody Map map) { |
| | | List<BigStorageCageDetails> bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(map.get("glassId").toString()); |
| | | return Result.build(200,"查询成功",bigStorageCageDetails); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情添加") |
| | | @PostMapping("/insertBigStorageCageDetails") |
| | | public Result insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result insertBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.insertBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"添加成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情删除") |
| | | @PostMapping("/deleteBigStorageCageDetails") |
| | | public Result deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result deleteBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.deleteBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务破损0/拿走1") |
| | | @PostMapping("/damageBigStorageCageDetails") |
| | | public Result damageBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails,int status) { |
| | | public Result damageBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails,int status) { |
| | | bigStorageCageDetailsService.damageBigStorageCageDetails(bigStorageCageDetails.getGlassId(),status); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"破损/拿走成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务完成") |
| | | @PostMapping("/finishBigStorageCageDetails") |
| | | public Result finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result finishBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.finishBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"任务完成成功",1); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务出片") |
| | | @PostMapping("/outBigStorageCageDetails") |
| | | public Result outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) { |
| | | public Result outBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | |
| | | bigStorageCageDetailsService.outBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"破损成功",1); |
| | | return Result.build(200,"出片添加成功",1); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | void damageBigStorageCageDetails(String glassId,int status); |
| | | |
| | | BigStorageCageDetails selectBigStorageCageDetails(String glassId); |
| | | List<BigStorageCageDetails> selectBigStorageCageDetails(String glassId); |
| | | |
| | | void insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | } |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | | baseMapper.deleteById(bigStorageCageDetails.getId()); |
| | | bigStorageCageDetails.setState(Const.BIG_STORAGE_OUTSIDE); |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | //todo:插入破损数据 |
| | | |
| | |
| | | |
| | | //查询玻璃信息 |
| | | @Override |
| | | public BigStorageCageDetails selectBigStorageCageDetails(String glassId) { |
| | | public List<BigStorageCageDetails> selectBigStorageCageDetails(String glassId) { |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId, glassId); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetails.setGap(galssGap); |
| | | return bigStorageCageDetails; |
| | | if(glassInfo!=null){ |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetails.setGap(galssGap); |
| | | } |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=new ArrayList<>(); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | return bigStorageCageDetailsList; |
| | | } |
| | | |
| | | //理片笼详情添加 |
| | |
| | | public List<BigStorageCage> querybigStorageCageDetail(int deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper =new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.lt(BigStorageCageDetails::getState, Const.BIG_STORAGE_OUTSIDE); |
| | | if(deviceId!=0){ |
| | | bigStorageCageWrapper.eq(BigStorageCage::getDeviceId,deviceId); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getDeviceId,deviceId); |
| | |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 5000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @ApiOperation("出片任务删除") |
| | | @PostMapping("/deleteTemperingGlassInfo") |
| | | public Result deleteTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo) { |
| | | public Result deleteTemperingGlassInfo(@RequestBody TemperingGlassInfo temperingGlassInfo) { |
| | | temperingGlassInfoService.removeById(temperingGlassInfo.getId()); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | @ApiOperation("出片任务破损0/拿走1") |
| | | @PostMapping("/damageTemperingGlassInfo") |
| | | public Result damageTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo,int status) { |
| | | public Result damageTemperingGlassInfo(@RequestBody TemperingGlassInfo temperingGlassInfo,int status) { |
| | | bigStorageCageDetailsService.damageBigStorageCageDetails(temperingGlassInfo.getGlassId(),status); |
| | | return Result.build(200,"破损成功",1); |
| | | } |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.job.PlcStorageCageTask; |
| | |
| | | BigStorageCageService bigStorageCageService; |
| | | @Autowired |
| | | PlcStorageCageTask plcStorageCageTask; |
| | | @Autowired |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | log.info("获取大理片笼信息:{}", bigStorageCageService.selectBigStorageCageUsage()); |
| | | } |
| | | |
| | | @Test |
| | | public void selectBigStorageCageDetails() { |
| | | log.info("获取大理片笼信息:{}", bigStorageCageDetailsService.selectBigStorageCageDetails("P24060403|3|6")); |
| | | } |
| | | |
| | | } |