From dedf9da2dc20825fbd3dee51f0a0546782ec0f9d Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期四, 03 四月 2025 07:27:32 +0800 Subject: [PATCH] 中间表客户增加两个字段:订单号,计划产量日期;用于看板分组和统计 --- JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java | 141 ++++++++++++++++++++++++++++++++--------------- 1 files changed, 96 insertions(+), 45 deletions(-) diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java index b11911c..156a2d2 100644 --- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java +++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java @@ -1,8 +1,17 @@ package com.mes.md.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.mes.md.entity.KBBTLensSorting; +import com.mes.md.entity.LineConfiguration; import com.mes.md.entity.Machine; import com.mes.md.entity.Tasking; +import com.mes.md.mapper.KBBTLensSortingMapper; +import com.mes.md.mapper.MachineMapper; +import com.mes.md.mapper.TaskingMapper; +import com.mes.md.service.ProjectService; +import com.mes.md.service.TaskingLogService; import com.mes.md.service.TaskingService; import com.mes.utils.Result; import io.swagger.annotations.ApiOperation; @@ -10,6 +19,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Map; /** * <p> @@ -24,52 +34,71 @@ public class TaskingController { @Autowired private TaskingService taskingService; - -// @ApiOperation("鍒囨崲妯″紡") -// @PostMapping("/updateLoadState") //鍒囨崲妯″紡" -// @ResponseBody -// public Result<Boolean> updateStatus(@RequestBody Integer state) { -// if(state == 1){ -// boolean result =taskingService.updateStatus(state); -// return Result.build(1,"瀹氬埗妯″紡",result); -// }else { -// boolean result =taskingService.updateStatus(state); -// return Result.build(0,"鏍囧噯妯″紡",result); -// } -// } -// @ApiOperation("鐐瑰嚮鏆傚仠璁惧") -// @PostMapping("/updateLoadStatus") //鐐瑰嚮鏆傚仠璁惧 -// @ResponseBody -// public Result<Boolean> updateLoadStatus(@RequestBody Integer state) { -// if(state == 1){ -// boolean result =taskingService.updateLoadState(state); -// return Result.build(1,"鎴愬姛",result); -// }else { -// boolean result =taskingService.updateLoadState(state); -// return Result.build(0,"鎴愬姛",result); -// } -// } -// @ApiOperation("鐐瑰嚮鐮存崯") -// @PostMapping("/updateDamage") //鏆傚仠涓婄墖浠诲姟 -// @ResponseBody -// public Result<Tasking> updateDamage(@RequestBody Tasking tasking) { -// -// boolean result =taskingService.updateDamage(tasking); -// return Result.build(1,"瀹氬埗妯″紡",null); -// -// -// } -// @ApiOperation("鏌ヨ褰撳墠妯″紡杩囧幓鐨勭幓鐠�") -// @PostMapping("/selectTasking") //鏆傚仠涓婄墖浠诲姟 -// @ResponseBody -// public Result<List<Tasking>> selectTasking() { -// -// List<Tasking> tasking =taskingService.selectTasking(); -// return Result.build(1,"瀹氬埗妯″紡",tasking); -// } + @Autowired + private ProjectService projectService; + @Autowired + private MachineMapper machineMapper; + @Autowired + private TaskingMapper taskingMapper; + @Autowired + private TaskingLogService taskingLogService; + @Autowired + private KBBTLensSortingMapper kBBTLensSortingMapper; + @ApiOperation("鏌ヨ搴撲綅淇℃伅 杩斿洖缁撴灉") + @PostMapping("/findKBBTLensSorting") + @ResponseBody + public Result findKBBTLensSorting(@RequestBody Map<String, String> map) { + try { + String scanId=map.get("scanId").toString(); + if (!scanId.isEmpty()){ + List<KBBTLensSorting> list=kBBTLensSortingMapper.selectList(new QueryWrapper<KBBTLensSorting>().lambda() + .eq(KBBTLensSorting::getBarcode,scanId)); + return Result.build(200,"鎴愬姛",list); + } + return Result.build(199,"鍓嶇浼犲�糔ULL",map); + }catch (Exception e){ + return Result.build(199,"寮傚父",map); + } + } + @ApiOperation("鎵爜鎴愬姛鍚庤繑鍥炵粨鏋� machineId,scanId") + @PostMapping("/scanMachineAdd") + @ResponseBody + public Result scanMachineAdd(@RequestBody Map<String, String> map) { + try { + String machineId=map.get("machineId").toString(); + String scanId=map.get("scanId").toString(); + if (!scanId.isEmpty()&&!machineId.isEmpty()){ + Machine machine = machineMapper.selectById(machineId); + int addCount =taskingService.scanMachineAdd(machine,scanId); + return Result.build(200,"鎴愬姛",addCount); + } + return Result.build(199,"鍓嶇浼犲�糔ULL",map); + }catch (Exception e){ + return Result.build(199,"寮傚父",map); + } + } + @ApiOperation("鎶ュ伐鎻愪氦 ") + @PostMapping("/reportForWork") + @ResponseBody + public Result reportForWork(@RequestBody Machine machine) { + try { + int deleteCount=taskingMapper.deleteJoin(new MPJLambdaWrapper<Tasking>() + .selectAll(Tasking.class) + .innerJoin(LineConfiguration.class,LineConfiguration::getId,Tasking::getLineConfigurationId) + .innerJoin(Machine.class,Machine::getId,LineConfiguration::getMachineId) + .eq(LineConfiguration::getMachineId,machine.getId()) + .eq(Tasking::getGlassState,"姝e父") + .eq(Tasking::getState,"绾夸笂") + .ne(Tasking::getWorkState,"瀹屽伐")); + taskingLogService.reportTaskingLog(); + return Result.build(200,"鎴愬姛",deleteCount); + }catch (Exception e){ + return Result.build(199,"寮傚父",machine); + } + } @ApiOperation("鏌ヨ褰撳墠璁惧锛屾湭瀹屽伐鐘舵�佺殑绾夸笂浠诲姟") @PostMapping("/findMachineTask") @ResponseBody @@ -116,10 +145,18 @@ } @ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��") + @PostMapping("/glassTopLineList") + @ResponseBody + public Result glassTopLineList(@RequestBody List<Tasking> taskingList) { + int count =taskingService.glassTopLine(taskingList); + return Result.build(200,"淇敼鎴愬姛锛�"+count,count); + } + + @ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��") @PostMapping("/glassTopLine") @ResponseBody - public Result glassTopLine(@RequestBody List<Tasking> taskingList) { - int count =taskingService.glassTopLine(taskingList); + public Result glassTopLine(@RequestBody Tasking tasking) { + int count =taskingService.glassTopLine(tasking); return Result.build(200,"淇敼鎴愬姛锛�"+count,count); } @@ -130,7 +167,21 @@ int count =taskingService.glassDownLine(tasking); return Result.build(200,"淇敼鎴愬姛锛�"+count,count); } + @ApiOperation("鐜荤拑 銆愪笅绾裤��") + @PostMapping("/glassAgainTopLine") + @ResponseBody + public Result glassAgainTopLine(@RequestBody Tasking tasking) { + int count =taskingService.stopTasking(tasking); + return Result.build(200,"淇敼鎴愬姛锛�"+count,count); + } + @ApiOperation("鎻愪氦 鎵爜鎶ュ伐 ") + @PostMapping("/scanReport") + @ResponseBody + public Result scanReport(@RequestBody Tasking tasking) { + int count =taskingService.stopTasking(tasking); + return Result.build(200,"淇敼鎴愬姛锛�"+count,count); + } } -- Gitblit v1.8.0