From 51dec5f9b39bb9927f5e4c5e5be16372bfbbfd4c Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 25 Aug 2025 11:28:14 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20=E8=B4=A8=E9=87=8F=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/PdaApiController.java | 54 +++++++++++++------ .../resources/mapper/PdaBindingMapper.xml | 13 ++--- 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/aucma-api/src/main/java/com/aucma/api/controller/PdaApiController.java b/aucma-api/src/main/java/com/aucma/api/controller/PdaApiController.java index 96abd80..c8e72c0 100644 --- a/aucma-api/src/main/java/com/aucma/api/controller/PdaApiController.java +++ b/aucma-api/src/main/java/com/aucma/api/controller/PdaApiController.java @@ -12,6 +12,8 @@ import com.aucma.report.domain.RecordExceptionProcess; import com.aucma.report.domain.ReportQualityInspection; import com.aucma.report.service.IMaterialCompletionService; import com.aucma.report.service.IReportQualityInspectionService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -28,7 +30,7 @@ import static com.aucma.common.core.domain.AjaxResult.success; @RestController @RequestMapping("/api") public class PdaApiController { - + private static final Logger logger = LoggerFactory.getLogger(PdaApiController.class); @Autowired private IPdaBindingService service; @@ -89,31 +91,39 @@ public class PdaApiController { /** * 质量检测:查询物料名称、前工位返修数据 + * * @param code * @return */ @PostMapping("/check/query") public AjaxResult checkQuery(String code, String station) { + long begin = System.currentTimeMillis(); + logger.info("质量检测checkQuery1:" + code + "工位: " + station); String boxName = service.selectBoxNameByCode(code); if (boxName == null) { // boxName = "固定数据"; return error("条码信息扫描错误!"); } //检验前一工位是否已完成质检 - if (StringUtils.isNotEmpty(station)){ - //箱体发泡检验01工位 对 壳胆绑定进行验证 - if (station.equals("2003")){ + logger.info("质量检测checkQuery2:" + code + "工位:"+ station); + if (StringUtils.isNotEmpty(station)) { + //箱体发泡检验01工位、二线箱体预装检验工位 对 壳胆绑定进行验证 + if (station.equals("2003") || station.equals("2018") || station.equals("2103") || station.equals("2104")) { String result = service.checkShellBinding(code, station); - if (StringUtils.isNotNull(result)){ + logger.info("质量检测checkQuery3:" + code + "工位:" + station); + if (StringUtils.isNotNull(result)) { return error(result); } } String result = qualityService.checkBeforeStationInspection(code, station); - if (StringUtils.isNotNull(result)){ + logger.info("质量检测checkQuery4:" + code + "工位:" + station); + if (StringUtils.isNotNull(result)) { return error(result); } } List list = service.checkSelectRepairInfo(code); + long end = System.currentTimeMillis(); + logger.info("质量检测checkQuery5:" + code + "运行时间:" + (end - begin) + "工位:" + station); return success(boxName, list); } @@ -121,13 +131,16 @@ public class PdaApiController { // 质检提交 @PostMapping("/checkSubmit") public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo) { + long begin = System.currentTimeMillis(); List list = checkInfo.getList(); int size = (list == null || list.isEmpty()) ? 1 : list.size(); + logger.info("质检提交checkSubmit1:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); for (int i = 0; i < size; i++) { ReportQualityInspection inspection = new ReportQualityInspection(); inspection.setBarCode(checkInfo.getCode()); String boxName = service.selectBoxNameBarCode(checkInfo.getCode()); + logger.info("质检提交checkSubmit2:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); inspection.setMaterialName(boxName); String measure = checkInfo.getMeasure(); @@ -147,6 +160,7 @@ public class PdaApiController { BaseProcessStation processStation = new BaseProcessStation(); processStation.setParentId(checkInfo.getStationCode()); List processStations = baseProcessStationService.selectBaseProcessStationList(processStation); + logger.info("质检提交checkSubmit3:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); inspection.setProcessCode(processStations.get(0).getProcessCode()); inspection.setProductLineName(processStations.get(0).getProductLineCode()); } catch (Exception e) { @@ -162,16 +176,19 @@ public class PdaApiController { inspection.setQualityDefectName(list.get(i).getQualityDefectName()); } qualityService.insertReportQualityInspection(inspection); + logger.info("质检提交checkSubmit4:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); //质检处理措施(3=合格,1=返修) if (inspection.getTreatmentMeasure().equals("3")) { try { completionService.inspectionProcessing(inspection); + logger.info("质检提交checkSubmit5:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); } catch (Exception e) { e.printStackTrace(); } } } - + long end = System.currentTimeMillis(); + logger.info("质量检测checkQuery6:" + checkInfo.getCode() + "运行时间:"+ (end - begin) + "工位:" + checkInfo.getStationCode()); return success(); } @@ -189,12 +206,12 @@ public class PdaApiController { @PostMapping("/submitRepair") public AjaxResult submitRepair(@RequestBody RepairSubmitInfoDto info) { int i = service.submitRepair(info); - if (i == 999){ + if (i == 999) { return error("该箱体未审批完成,无法降级!"); } - if(i > 0){ + if (i > 0) { return success("操作成功!"); - }else { + } else { return error("该箱体已完成返修!"); } } @@ -224,10 +241,10 @@ public class PdaApiController { @PostMapping("/rebarCode") public AjaxResult rebarCode(String barCode) { String result = service.rebarCode(barCode, "PDA补码"); - if (StringUtils.isNotEmpty(result)){ + if (StringUtils.isNotEmpty(result)) { return error(result); } - return success( "请到条码打印机旁进行补打条码!"); + return success("请到条码打印机旁进行补打条码!"); } /** @@ -239,7 +256,7 @@ public class PdaApiController { @PostMapping("/unbindBarCode") public AjaxResult unbindBarCode(String barCode) { String result = service.unbindBarCode(barCode); - if (StringUtils.isEmpty(result)){ + if (StringUtils.isEmpty(result)) { return error("条码信息输入错误!"); } return success(result); @@ -248,13 +265,14 @@ public class PdaApiController { /** * PDA降级消息通知 + * * @param userName * @return */ @PostMapping("/messageNotifications") public AjaxResult messageNotifications(String userName) { String result = service.messageNotifications(userName); - if (StringUtils.isEmpty(result)){ + if (StringUtils.isEmpty(result)) { return error("无消息提醒!"); } return success(result); @@ -262,14 +280,15 @@ public class PdaApiController { /** * PDA切换订单 + * * @param barCode * @param stationCode * @return */ @PostMapping("/switchOrders") - public AjaxResult switchOrders(String barCode,String stationCode) { + public AjaxResult switchOrders(String barCode, String stationCode) { String result = service.switchOrders(barCode, stationCode); - if (StringUtils.isEmpty(result)){ + if (StringUtils.isEmpty(result)) { return error("条码信息输入错误!"); } return success(result); @@ -277,12 +296,13 @@ public class PdaApiController { /** * PDA降级信息查询 + * * @param inspectionUserFlag 巡检班长降级标识(1=已降级,2=未降级) * @return */ @PostMapping("/downgradeQuery") public AjaxResult downgradeQuery(String inspectionUserFlag) { - if (StringUtils.isEmpty(inspectionUserFlag)){ + if (StringUtils.isEmpty(inspectionUserFlag)) { return error(); } List list = service.selectExceptionProcessList(inspectionUserFlag); diff --git a/aucma-api/src/main/resources/mapper/PdaBindingMapper.xml b/aucma-api/src/main/resources/mapper/PdaBindingMapper.xml index 3ba125b..23af058 100644 --- a/aucma-api/src/main/resources/mapper/PdaBindingMapper.xml +++ b/aucma-api/src/main/resources/mapper/PdaBindingMapper.xml @@ -65,17 +65,18 @@