From 044c32c15ee9ccac6f3b60eb6745025e2f4480f2 Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期三, 11 十二月 2024 16:59:54 +0800
Subject: [PATCH] 报工回传+库位显示
---
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java | 73 ++++++++++++++++++++++++++++++++++++
1 files changed, 73 insertions(+), 0 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 c7281d2..8104108 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,9 +1,15 @@
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.TaskingService;
import com.mes.utils.Result;
@@ -12,6 +18,7 @@
import org.springframework.web.bind.annotation.*;
import java.util.List;
+import java.util.Map;
/**
* <p>
@@ -30,7 +37,65 @@
private ProjectService projectService;
@Autowired
private MachineMapper machineMapper;
+ @Autowired
+ private TaskingMapper taskingMapper;
+ @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,"瀹屽伐"));
+ return Result.build(200,"鎴愬姛",deleteCount);
+ }catch (Exception e){
+ return Result.build(199,"寮傚父",machine);
+ }
+ }
@ApiOperation("鏌ヨ褰撳墠璁惧锛屾湭瀹屽伐鐘舵�佺殑绾夸笂浠诲姟")
@PostMapping("/findMachineTask")
@ResponseBody
@@ -107,5 +172,13 @@
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