From 8452e5b19e09574aad99df9bd91ad819a3f9d6ff Mon Sep 17 00:00:00 2001 From: A0010407 Date: Mon, 11 Dec 2023 10:54:39 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EquCheckItemController.java | 30 ++ .../device/domain/dto/SummaryReportDTO.java | 477 ++++++++++++++++++ .../op/device/mapper/EquCheckItemMapper.java | 22 + .../device/service/IEquCheckItemService.java | 24 +- .../service/impl/DevicePDAServiceImpl.java | 3 + .../service/impl/EquCheckItemServiceImpl.java | 50 +- .../mapper/device/EquCheckItemMapper.xml | 45 ++ 7 files changed, 643 insertions(+), 8 deletions(-) create mode 100644 op-modules/op-device/src/main/java/com/op/device/domain/dto/SummaryReportDTO.java diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquCheckItemController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquCheckItemController.java index bce69c03..fbb07ad1 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/EquCheckItemController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquCheckItemController.java @@ -3,7 +3,10 @@ package com.op.device.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.op.device.domain.EquRepairOrder; +import com.op.device.domain.WorkCenter; import com.op.device.domain.dto.EquCheckItemDTO; +import com.op.device.domain.dto.SummaryReportDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -118,4 +121,31 @@ public class EquCheckItemController extends BaseController { public AjaxResult remove(@PathVariable String[] itemIds) { return equCheckItemService.deleteEquCheckItemByItemIds(itemIds); } + + //检查标准汇总 点检、巡检、保养 + @RequiresPermissions("device:item:summaryReport") + @GetMapping("/summaryReport") + public AjaxResult getSummaryReport(EquCheckItem equCheckItem) { + return equCheckItemService.getSummaryReport(equCheckItem); + } + + /** + * 获取工作中心 + * + * @return + */ + @GetMapping("/getWorkCenter") + public AjaxResult getWorkCenter() { + return equCheckItemService.getWorkCenter(); + } + + + /** + * 点检、巡检、保养计划工单匹配检查项 + * @return + */ + @GetMapping("/matchList") + public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO) { + return equCheckItemService.selectMatchListByEquipmentCode(summaryReportDTO); + } } diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/dto/SummaryReportDTO.java b/op-modules/op-device/src/main/java/com/op/device/domain/dto/SummaryReportDTO.java new file mode 100644 index 00000000..26e486e2 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/domain/dto/SummaryReportDTO.java @@ -0,0 +1,477 @@ +package com.op.device.domain.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.device.domain.EquCheckItemDetail; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +// 检查项维护页面DTO +public class SummaryReportDTO { + /** 主键 */ + private String itemId ; + /** 检查项编码 */ + private String itemCode ; + /** 检查项名称 */ + private String itemName ; + /** 检查项方法/工具 */ + private String itemMethod ; + /** 维护类型编码 */ + private String itemType ; + /** 维护类型名称 */ + private String itemTypeName ; + /** 检查项备注 */ + private String itemRemark ; + // 检查工具 + private String itemTools; + //标准类型 + private String standardType; + //标准名称 + private String standardName; + // 循环周期类型 + private String itemLoopType; + // 循环周期 + private int itemLoop; + /** 主键 */ + private String orderId; + //设备 + private String equipmentCode; + /** 维修前达标 */ + private String detailReach; + //维修后是否达标 + private String repairReach; + /** 主键 */ + private String detailId ; + /** 主键 */ + private String id ; + + //1号 + private String one ; + //2号 + private String two ; + //3号 + private String three ; + //4号 + private String four ; + //5号 + private String five ; + //6号 + private String six ; + //7号 + private String seven ; + //8号 + private String eight ; + //9号 + private String nine ; + //10号 + private String ten ; + //11号 + private String eleven ; + //12号 + private String twelve ; + //13号 + private String thirteen ; + //14号 + private String fourteen; + //15号 + private String fifteen; + //16号 + private String sixteen; + //17号 + private String seventeen; + //18号 + private String eighteen; + //19号 + private String nineteen; + //20号 + private String twenty; + //21号 + private String twentyOne; + //22号 + private String twentyTwo; + //23号 + private String twentyThree; + //24号 + private String twentyFour; + //25号 + private String twentyFive; + //26号 + private String twentySix; + //27号 + private String twentySeven; + //28号 + private String twentyEight; + //29号 + private String twentyNine; + //30号 + private String thirty; + //31号 + private String thirtyOne; + + /** 实际结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date orderEnd; + + /** 时间 */ + private String yearMouth; + + public void setId(String id) { + this.id = id; + } + public String getId() { + return id; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + public String getOrderId() { + return orderId; + } + + public String getItemTools() { + return itemTools; + } + public void setItemTools(String itemTools) { + this.itemTools = itemTools; + } + + public String getItemId() { + return itemId; + } + public void setItemId(String itemId) { + this.itemId = itemId; + } + + public String getItemCode() { + return itemCode; + } + public void setItemCode(String itemCode) { + this.itemCode = itemCode; + } + + public String getItemName() { + return itemName; + } + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public String getItemMethod() { + return itemMethod; + } + public void setItemMethod(String itemMethod) { + this.itemMethod = itemMethod; + } + + public String getItemType() { + return itemType; + } + public void setItemType(String itemType) { + this.itemType = itemType; + } + + public String getItemTypeName() { + return itemTypeName; + } + public void setItemTypeName(String itemTypeName) { + this.itemTypeName = itemTypeName; + } + + public String getItemRemark() { + return itemRemark; + } + public void setItemRemark(String itemRemark) { + this.itemRemark = itemRemark; + } + + public String getStandardType() { + return standardType; + } + public void setStandardType(String standardType) { + this.standardType = standardType; + } + + public String getStandardName() { + return standardName; + } + public void setStandardName(String standardName) { + this.standardName = standardName; + } + + public int getItemLoop() { + return itemLoop; + } + public void setItemLoop(int itemLoop) { + this.itemLoop = itemLoop; + } + + public String getItemLoopType() { + return itemLoopType; + } + public void setItemLoopType(String itemLoopType) { + this.itemLoopType = itemLoopType; + } + + public void setEquipmentCode(String equipmentCode) { + this.equipmentCode = equipmentCode; + } + public String getEquipmentCode() { + return equipmentCode; + } + + public void setDetailId(String detailId) { + this.detailId = detailId; + } + public String getDetailId() { + return detailId; + } + + public String getRepairReach() { + return repairReach; + } + public void setRepairReach(String repairReach) { + this.repairReach = repairReach; + } + + public String getDetailReach() { + return detailReach; + } + public void setDetailReach(String detailReach) { + this.detailReach = detailReach; + } + + public void setOrderEnd(Date orderEnd) { + this.orderEnd = orderEnd; + } + public Date getOrderEnd() { + return orderEnd; + } + + public void setYearMouth(String yearMouth) { + this.yearMouth = yearMouth; + } + public String getYearMouth() { + return yearMouth; + } + + public void setOne(String one) { + this.one = one; + } + public String getOne() { + return one; + } + + public void setTwo(String two) { + this.two = two; + } + public String getTwo() { + return two; + } + + public void setThree(String three) { + this.three = three; + } + public String getThree() { + return three; + } + + public void setFour(String four) { + this.four = four; + } + public String getFour() { + return four; + } + + public void setFive(String five) { + this.five = five; + } + public String getFive() { + return five; + } + + public void setSix(String six) { + this.six = six; + } + public String getSix() { + return six; + } + + public void setSeven(String seven) { + this.seven = seven; + } + public String getSeven() { + return seven; + } + + public void setEight(String eight) { + this.eight = eight; + } + public String getEight() { + return eight; + } + + public void setNine(String nine) { + this.nine = nine; + } + public String getNine() { + return nine; + } + + public void setTen(String ten) { + this.ten = ten; + } + public String getTen() { + return ten; + } + + public void setEleven(String eleven) { + this.eleven = eleven; + } + public String getEleven() { + return eleven; + } + + public void setTwelve(String twelve) { + this.twelve = twelve; + } + public String getTwelve() { + return twelve; + } + + public void setThirteen(String thirteen) { + this.thirteen = thirteen; + } + public String getThirteen() { + return thirteen; + } + + public void setFourteen(String fourteen) { + this.fourteen = fourteen; + } + public String getFourteen() { + return fourteen; + } + + public void setFifteen(String fifteen) { + this.fifteen = fifteen; + } + public String getFifteen() { + return fifteen; + } + + public void setSixteen(String sixteen) { + this.sixteen = sixteen; + } + public String getSixteen() { + return sixteen; + } + + public void setSeventeen(String seventeen) { + this.seventeen = seventeen; + } + public String getSeventeen() { + return seventeen; + } + + public void setEighteen(String eighteen) { + this.eighteen = eighteen; + } + public String getEighteen() { + return eighteen; + } + + public void setNineteen(String nineteen) { + this.nineteen = nineteen; + } + public String getNineteen() { + return nineteen; + } + + public void setTwenty(String twenty) { + this.twenty = twenty; + } + public String getTwenty() { + return twenty; + } + + public void setTwentyOne(String twentyOne) { + this.twentyOne = twentyOne; + } + public String getTwentyOne() { + return twentyOne; + } + + public void setTwentyTwo(String twentyTwo) { + this.twentyTwo = twentyTwo; + } + public String getTwentyTwo() { + return twentyTwo; + } + + public void setTwentyThree(String twentyThree) { + this.twentyThree = twentyThree; + } + public String getTwentyThree() { + return twentyThree; + } + + public void setTwentyFour(String twentyFour) { + this.twentyFour = twentyFour; + } + public String getTwentyFour() { + return twentyFour; + } + + public void setTwentyFive(String twentyFive) { + this.twentyFive = twentyFive; + } + public String getTwentyFive() { + return twentyFive; + } + + public void setTwentySix(String twentySix) { + this.twentySix = twentySix; + } + public String getTwentySix() { + return twentySix; + } + + public void setTwentySeven(String twentySeven) { + this.twentySeven = twentySeven; + } + public String getTwentySeven() { + return twentySeven; + } + + public void setTwentyEight(String twentyEight) { + this.twentyEight = twentyEight; + } + public String getTwentyEight() { + return twentyEight; + } + + public void setTwentyNine(String twentyNine) { + this.twentyNine = twentyNine; + } + public String getTwentyNine() { + return twentyNine; + } + + public void setThirty(String thirty) { + this.thirty = thirty; + } + public String getThirty() { + return thirty; + } + + public void setThirtyOne(String thirtyOne) { + this.thirtyOne = thirtyOne; + } + public String getThirtyOne() { + return thirtyOne; + } + +} diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemMapper.java index 2790b7ca..0e2a7297 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemMapper.java @@ -4,6 +4,8 @@ import java.util.List; import com.op.device.domain.EquCheckItem; import com.op.device.domain.EquPlanDetail; +import com.op.device.domain.WorkCenter; +import com.op.device.domain.dto.SummaryReportDTO; import com.op.device.domain.vo.EquCheckItemVO; import org.apache.ibatis.annotations.Param; @@ -94,4 +96,24 @@ public interface EquCheckItemMapper { * @return */ List checkDelItem(String itemCode); + + ////////////////////////////////////////////////汇总页面 + /** + * 检查标准汇总 点检、巡检、保养 + * @param equCheckItem + * @return + */ + List getSummaryReport(EquCheckItem equCheckItem); + + /** + * 工作中心 + * @return + */ + List selectWorkCenter(); + + /** + * 点检、巡检、保养计划工单匹配检查项 + * @return + */ + List selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquCheckItemService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquCheckItemService.java index b3df8267..1067bd78 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IEquCheckItemService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquCheckItemService.java @@ -4,7 +4,9 @@ import java.util.List; import com.op.common.core.web.domain.AjaxResult; import com.op.device.domain.EquCheckItem; +import com.op.device.domain.EquRepairOrder; import com.op.device.domain.dto.EquCheckItemDTO; +import com.op.device.domain.dto.SummaryReportDTO; import com.op.device.domain.vo.EquCheckItemVO; /** @@ -66,11 +68,29 @@ public interface IEquCheckItemService { * 获取全部设备list信息 * @return */ - AjaxResult getEquipmentList(); + public AjaxResult getEquipmentList(); /** * 通过检查项code查询关联设备code列表 * @return */ - AjaxResult getEquipmentCodeListByItemCode(String itemCode); + public AjaxResult getEquipmentCodeListByItemCode(String itemCode); + + /** + * 检查标准汇总 点检、巡检、保养 + * @return + */ + public AjaxResult getSummaryReport(EquCheckItem equCheckItem); + + /** + * 获取工作中心 + * @return + */ + public AjaxResult getWorkCenter(); + + /** + * 点检、巡检、保养计划工单匹配检查项 + * @return + */ + public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java index 77e4a4af..6efcb059 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java @@ -693,6 +693,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService { //维修工单结束时间 equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate()); + //计算维修工单用时 + //获取工单的开始时间 + ////更新每一项点检/巡检检查项信息 //判空 if(StringUtils.isNotEmpty(equRepairWorkOrder.getDetailList())){ diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java index 4d2e6c04..af72ccf5 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java @@ -1,7 +1,9 @@ package com.op.device.service.impl; +import java.text.DateFormat; import java.text.Format; import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; @@ -9,10 +11,9 @@ import com.op.common.core.context.SecurityContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.web.domain.AjaxResult; -import com.op.device.domain.EquCheckItemDetail; -import com.op.device.domain.EquItemEquipment; -import com.op.device.domain.EquPlanDetail; +import com.op.device.domain.*; import com.op.device.domain.dto.EquCheckItemDTO; +import com.op.device.domain.dto.SummaryReportDTO; import com.op.device.domain.vo.EquCheckItemVO; import com.op.device.mapper.EquCheckItemDetailMapper; import com.op.device.mapper.EquItemEquipmentMapper; @@ -160,14 +161,14 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService { @Transactional public AjaxResult updateEquCheckItem(EquCheckItemDTO equCheckItemDTO) { - // 校验检查项是否已存在 + // 检验 EquCheckItem checkQuery = new EquCheckItem(); checkQuery.setItemType(equCheckItemDTO.getItemType()); checkQuery.setItemName(equCheckItemDTO.getItemName()); List check = equCheckItemMapper.selectEquCheckItemList(checkQuery); - if (check.size() > 0) { + if (check.size()>0) { if (!check.get(0).getItemCode().equals(equCheckItemDTO.getItemCode())) { - return error(500, "检查项已存在!不可修改!"); + return error(500,"检查项已存在!不可修改!"); } } @@ -329,4 +330,41 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService { equItemEquipmentMapper.insertEquItemEquipment(equItemEquipment); } } + + /** + * 检查标准汇总 点检、巡检、保养 + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult getSummaryReport(EquCheckItem equCheckItem){ + List summaryReportList = equCheckItemMapper.getSummaryReport(equCheckItem); + return success(summaryReportList); + } + + /** + * 获取工作中心 + * + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult getWorkCenter() { + List workCenterList = equCheckItemMapper.selectWorkCenter(); + return success(workCenterList); + } + + + /** + * 点检、巡检、保养计划工单匹配检查项 + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO){ + DateFormat df = new SimpleDateFormat("yyyy-MM"); + summaryReportDTO.setYearMouth(df.format(summaryReportDTO.getOrderEnd())); + List matchList = equCheckItemMapper.selectMatchListByEquipmentCode(summaryReportDTO); + return success(matchList); + } } diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml index 15da5410..ea4a816c 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml @@ -168,4 +168,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{itemId} + + + + + + + \ No newline at end of file From 47318ca385c104f1db48e8f97affb816b3e0ada1 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 11 Dec 2023 12:04:32 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QcCheckReportIncomeController.java | 7 +-- .../QcCheckTypeProjectController.java | 11 +++++ .../controller/QcStaticTableController.java | 9 ++++ .../op/quality/controller/QuaController.java | 12 ++--- .../com/op/quality/domain/QcCheckProject.java | 37 ++++++++++++++ .../quality/mapper/QcCheckProjectMapper.java | 15 +++--- .../mapper/QcCheckReportIncomeMapper.java | 5 +- .../mapper/QcCheckTypeProjectMapper.java | 5 ++ .../service/IQcCheckProjectService.java | 14 +++--- .../service/IQcCheckReportIncomeService.java | 1 + .../service/IQcCheckTypeProjectService.java | 19 ++++--- .../impl/QcCheckReportIncomeServiceImpl.java | 1 + .../impl/QcCheckTaskIncomeServiceImpl.java | 5 +- .../impl/QcCheckTypeProjectServiceImpl.java | 25 ++++++++++ .../impl/QcMaterialGroupServiceImpl.java | 4 +- .../service/impl/QcProCheckServiceImpl.java | 2 +- .../mapper/quality/QcCheckProjectMapper.xml | 8 ++- .../quality/QcCheckTypeProjectMapper.xml | 49 +++++++++++++++++-- 18 files changed, 184 insertions(+), 45 deletions(-) diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java index 80182e83..b9a1d728 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java @@ -9,10 +9,7 @@ import com.op.common.log.annotation.Log; import com.op.common.log.enums.BusinessType; import com.op.common.security.annotation.RequiresPermissions; import com.op.common.security.utils.SecurityUtils; -import com.op.quality.domain.QcBomComponent; -import com.op.quality.domain.QcCheckTaskDetail; -import com.op.quality.domain.QcCheckReportIncome; -import com.op.quality.domain.QcSupplier; +import com.op.quality.domain.*; import com.op.quality.service.IQcCheckReportIncomeService; import com.op.system.api.domain.SysUser; import org.apache.commons.lang.StringUtils; @@ -49,7 +46,7 @@ public class QcCheckReportIncomeController extends BaseController { LocalDate date = LocalDate.now(); LocalDate dateEnd = date.plusDays(1); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + String dateEndStr = dtf.format(dateEnd)+" 23:59:59"; qcCheckReportIncome.setCheckTimeEnd(dateEndStr);//end } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java index ce30450f..bab92760 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java @@ -3,6 +3,7 @@ package com.op.quality.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcMaterialGroup; import com.op.quality.service.IQcMaterialGroupService; import org.springframework.beans.factory.annotation.Autowired; @@ -105,5 +106,15 @@ public class QcCheckTypeProjectController extends BaseController { public AjaxResult changeStatus(@RequestBody QcCheckTypeProject qcCheckTypeProject) { return toAjax(qcCheckTypeProjectService.changeStatus(qcCheckTypeProject)); } + @GetMapping("/getProjectInfoList") + public TableDataInfo getProjectInfoList(QcCheckProject qcCheckProject) { + startPage(); + List list = qcCheckTypeProjectService.getProjectInfoList(qcCheckProject); + return getDataTable(list); + } + @PostMapping("/submitProjects") + public AjaxResult submitProjects(@RequestBody List typeProjects) { + return toAjax(qcCheckTypeProjectService.submitProjects(typeProjects)); + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java index c863f96f..1db2db04 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java @@ -138,6 +138,15 @@ public class QcStaticTableController extends BaseController { String key = keyPre+ymd; QcStaticTable mdata = seriesdtos.get(key); if(mdata != null){ + if(mdata.getaNoOkquality()==null){ + mdata.setaNoOkquality(new BigDecimal("0")); + } + if(mdata.getbNoOkquality()==null){ + mdata.setbNoOkquality(new BigDecimal("0")); + } + if(mdata.getcNoOkquality()==null){ + mdata.setcNoOkquality(new BigDecimal("0")); + } BigDecimal defectRate = (mdata.getaNoOkquality().add(mdata.getbNoOkquality()).multiply(new BigDecimal("0.65")) .add(mdata.getcNoOkquality()).multiply(new BigDecimal(0.35))) .divide(new BigDecimal(mdata.getSampleQuality())) diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java index 08608f66..03afa953 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java @@ -234,7 +234,7 @@ public class QuaController extends BaseController { */ @GetMapping("/pdaMaterialTree") public AjaxResult pdaMaterialTree(QcMaterialGroup materialGroup) { - DynamicDataSourceContextHolder.push("ds_"+materialGroup.getFactoryCode()); + DynamicDataSourceContextHolder.push(materialGroup.getFactoryCode()); return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup)); } @@ -244,7 +244,7 @@ public class QuaController extends BaseController { @GetMapping("/getCheckTypeProjectList") public TableDataInfo list(QcCheckTypeProject qcCheckTypeProject) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTypeProject.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTypeProject.getFactoryCode()); startPage(); List list = qcMaterialGroupService.getCheckTypeProjectList(qcCheckTypeProject); return getDataTable(list); @@ -252,7 +252,7 @@ public class QuaController extends BaseController { @GetMapping("/getUnqualifiedList") public TableDataInfo getUnqualifiedList(QcCheckUnqualified qcCheckUnqualified) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckUnqualified.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckUnqualified.getFactoryCode()); startPage(); qcCheckUnqualified.setDelFlag("0"); List list = qcCheckUnqualifiedService.selectQcCheckUnqualifiedList(qcCheckUnqualified); @@ -262,7 +262,7 @@ public class QuaController extends BaseController { /**获取来料工单列表**/ @GetMapping("/getLLWorkOrder") public TableDataInfo getLLWorkOrder(QcCheckTaskIncome qcCheckTaskIncome) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode()); startPage(); List list = qcCheckTaskIncomeService.getLLWorkOrder(qcCheckTaskIncome); return getDataTable(list); @@ -270,7 +270,7 @@ public class QuaController extends BaseController { /**获取生产工单列表**/ @GetMapping("/getWorkOrder") public TableDataInfo getWorkOrder(QcCheckTaskIncome qcCheckTaskIncome) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode()); startPage(); List list = qcCheckTaskIncomeService.getWorkOrder(qcCheckTaskIncome); return getDataTable(list); @@ -278,7 +278,7 @@ public class QuaController extends BaseController { @PutMapping("/getBatchList") public List getBatchList(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode()); return qcCheckTaskIncomeService.getBatchList(qcCheckTaskIncome); } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java index e01a6f67..141dea06 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckProject.java @@ -57,6 +57,43 @@ public class QcCheckProject extends BaseEntity { private String judge; + private String defectLevel; + private String materialCode; + private String typeCode; + private String groupId; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getTypeCode() { + return typeCode; + } + + public void setTypeCode(String typeCode) { + this.typeCode = typeCode; + } + + public String getDefectLevel() { + return defectLevel; + } + + public void setDefectLevel(String defectLevel) { + this.defectLevel = defectLevel; + } + public String getJudge() { return judge; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java index 7e7be901..7a1c30d6 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckProjectMapper.java @@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Mapper; /** * 检验项目维护Mapper接口 - * + * * @author Open Platform * @date 2023-10-13 */ @@ -15,7 +15,7 @@ import org.apache.ibatis.annotations.Mapper; public interface QcCheckProjectMapper { /** * 查询检验项目维护 - * + * * @param id 检验项目维护主键 * @return 检验项目维护 */ @@ -23,7 +23,7 @@ public interface QcCheckProjectMapper { /** * 查询检验项目维护列表 - * + * * @param qcCheckProject 检验项目维护 * @return 检验项目维护集合 */ @@ -31,7 +31,7 @@ public interface QcCheckProjectMapper { /** * 新增检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -39,7 +39,7 @@ public interface QcCheckProjectMapper { /** * 修改检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -47,7 +47,7 @@ public interface QcCheckProjectMapper { /** * 删除检验项目维护 - * + * * @param id 检验项目维护主键 * @return 结果 */ @@ -55,11 +55,12 @@ public interface QcCheckProjectMapper { /** * 批量删除检验项目维护 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteQcCheckProjectByIds(String[] ids); public QcCheckProject selectSerialNumber(); + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java index 7c6e169d..ec72b606 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckReportIncomeMapper.java @@ -1,9 +1,6 @@ package com.op.quality.mapper; -import com.op.quality.domain.QcBomComponent; -import com.op.quality.domain.QcCheckReportIncome; -import com.op.quality.domain.QcCheckTaskDetail; -import com.op.quality.domain.QcSupplier; +import com.op.quality.domain.*; import com.op.system.api.domain.SysUser; import org.apache.ibatis.annotations.Mapper; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java index 15c7b8f3..8b7f3a76 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java @@ -3,11 +3,13 @@ package com.op.quality.mapper; import java.util.List; import java.util.Map; +import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTypeProject; import com.op.system.api.domain.SysDictData; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 物料检验项目维护Mapper接口 @@ -72,4 +74,7 @@ public interface QcCheckTypeProjectMapper { List getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject); @MapKey("dictValue") Map getDictMap(SysDictData sysDictData); + List getProjectInfoList(QcCheckProject qcCheckProject); + + int insertQcCheckTypeProjects(@Param("list") List typeProjects); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java index c928bc11..0f399923 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckProjectService.java @@ -5,14 +5,14 @@ import com.op.quality.domain.QcCheckProject; /** * 检验项目维护Service接口 - * + * * @author Open Platform * @date 2023-10-13 */ public interface IQcCheckProjectService { /** * 查询检验项目维护 - * + * * @param id 检验项目维护主键 * @return 检验项目维护 */ @@ -20,7 +20,7 @@ public interface IQcCheckProjectService { /** * 查询检验项目维护列表 - * + * * @param qcCheckProject 检验项目维护 * @return 检验项目维护集合 */ @@ -28,7 +28,7 @@ public interface IQcCheckProjectService { /** * 新增检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -36,7 +36,7 @@ public interface IQcCheckProjectService { /** * 修改检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -44,7 +44,7 @@ public interface IQcCheckProjectService { /** * 批量删除检验项目维护 - * + * * @param ids 需要删除的检验项目维护主键集合 * @return 结果 */ @@ -52,7 +52,7 @@ public interface IQcCheckProjectService { /** * 删除检验项目维护信息 - * + * * @param id 检验项目维护主键 * @return 结果 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportIncomeService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportIncomeService.java index 7206e83b..1c1c937e 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportIncomeService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportIncomeService.java @@ -71,4 +71,5 @@ public interface IQcCheckReportIncomeService { List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail); public List getPrintData(QcCheckReportIncome qcCheckReportIncome); + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java index f2f751eb..aeffa6f9 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTypeProjectService.java @@ -1,18 +1,20 @@ package com.op.quality.service; import java.util.List; + +import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcCheckTypeProject; /** * 物料检验项目维护Service接口 - * + * * @author Open Platform * @date 2023-10-17 */ public interface IQcCheckTypeProjectService { /** * 查询物料检验项目维护 - * + * * @param id 物料检验项目维护主键 * @return 物料检验项目维护 */ @@ -20,7 +22,7 @@ public interface IQcCheckTypeProjectService { /** * 查询物料检验项目维护列表 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 物料检验项目维护集合 */ @@ -28,7 +30,7 @@ public interface IQcCheckTypeProjectService { /** * 新增物料检验项目维护 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 结果 */ @@ -36,7 +38,7 @@ public interface IQcCheckTypeProjectService { /** * 修改物料检验项目维护 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 结果 */ @@ -44,7 +46,7 @@ public interface IQcCheckTypeProjectService { /** * 批量删除物料检验项目维护 - * + * * @param ids 需要删除的物料检验项目维护主键集合 * @return 结果 */ @@ -52,7 +54,7 @@ public interface IQcCheckTypeProjectService { /** * 删除物料检验项目维护信息 - * + * * @param id 物料检验项目维护主键 * @return 结果 */ @@ -61,4 +63,7 @@ public interface IQcCheckTypeProjectService { * 状态修改 */ public int changeStatus(QcCheckTypeProject qcCheckTypeProject); + List getProjectInfoList(QcCheckProject qcCheckProject); + + int submitProjects(List typeProjects); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java index 7cec9cea..48e93eba 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java @@ -196,6 +196,7 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi } @Override + @DS("#header.poolName") public List getPrintData(QcCheckReportIncome qcCheckReportIncome) { return null; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index 4b21103b..ff07a171 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -321,7 +321,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { @Override public int commitCheckResults(List details) { - DynamicDataSourceContextHolder.push("ds_"+details.get(0).getFactoryCode()); + DynamicDataSourceContextHolder.push(details.get(0).getFactoryCode()); Date nowTime = DateUtils.getNowDate(); String factoryCode = details.get(0).getFactoryCode(); String updateBy = details.get(0).getUpdateBy(); @@ -341,8 +341,9 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome(); qcCheckTask.setUpdateBy(updateBy); qcCheckTask.setRecordId(belongId); - qcCheckTask.setCheckResult("2");//检测状态0待检测1检测中2检测完成 + qcCheckTask.setCheckStatus("2");//检测状态0待检测1检测中2检测完成 qcCheckTask.setUpdateTime(nowTime); + qcCheckTask.setCheckTime(nowTime); qcCheckTask.setCheckResult(result);//检验结果Y合格 N不合格 /**qc_check_task**/ n = qcCheckTaskIncomeMapper.updateQcCheckTask(qcCheckTask); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java index d0999d1c..64cb7814 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java @@ -1,5 +1,6 @@ package com.op.quality.service.impl; +import java.util.Date; import java.util.List; import java.util.Map; @@ -8,6 +9,7 @@ import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.security.utils.SecurityUtils; +import com.op.quality.domain.QcCheckProject; import com.op.system.api.domain.SysDictData; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -131,4 +133,27 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService qcCheckTypeProject.setUpdateTime(DateUtils.getNowDate()); return qcCheckTypeProjectMapper.updateQcCheckTypeProject(qcCheckTypeProject); } + + @Override + @DS("#header.poolName") + public List getProjectInfoList(QcCheckProject qcCheckProject) { + return qcCheckTypeProjectMapper.getProjectInfoList(qcCheckProject); + } + + @Override + @DS("#header.poolName") + public int submitProjects(List typeProjects) { + int m = 0; + Date nowTime = DateUtils.getNowDate(); + String createBy = SecurityUtils.getUsername(); + for(QcCheckTypeProject typeProject:typeProjects){ + typeProject.setId(IdUtils.fastSimpleUUID()); + typeProject.setCreateBy(createBy); + typeProject.setCreateTime(nowTime); + } + m = qcCheckTypeProjectMapper.insertQcCheckTypeProjects(typeProjects); + return m; + } + + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java index 6dcdabe5..013988ee 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java @@ -194,7 +194,9 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { Map dictMap = qcCheckTypeProjectMapper.getDictMap(sData); if(dictMap != null){ for(QcCheckTypeProject dto:dtos){ - dto.setUnit(dictMap.get(dto.getUnit()).getDictLabel()); + if(StringUtils.isNotBlank(dto.getUnit())){ + dto.setUnit(dictMap.get(dto.getUnit()).getDictLabel()); + } } } return dtos; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java index 183e628f..b3ce675d 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java @@ -126,7 +126,7 @@ public class QcProCheckServiceImpl implements QcProCheckService { @Override public List getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail) { - DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskDetail.getFactoryCode()); + DynamicDataSourceContextHolder.push(qcCheckTaskDetail.getFactoryCode()); return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail); } diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml index 2a8c2f3a..5ee4c824 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckProjectMapper.xml @@ -22,13 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan, - judge + judge,defect_level from qc_check_project @@ -74,6 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag, sample_plan, judge, + defect_level, + #{id}, @@ -93,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{delFlag}, #{samplePlan}, #{judge}, + #{defectLevel}, @@ -115,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag = #{delFlag}, sample_plan = #{samplePlan}, judge = #{judge}, + defect_level = #{defectLevel}, where id = #{id} @@ -135,4 +140,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM qc_check_project WHERE CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120) + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml index f7f78a07..c62ff584 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml @@ -152,8 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT ctp.id, ctp.project_id projectId, - cp.rule_name ruleName, - cp.property_code propertyCode, + qcp.rule_name ruleName, + qcp.property_code propertyCode, ctp.type_id typeId, ct.check_name, ctp.standard_value standardValue, @@ -166,11 +166,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" qcp.check_tool checkTool, qcp.check_mode checkMode FROM qc_check_type_project ctp - LEFT JOIN qc_check_project cp ON ctp.project_id = cp.id + LEFT JOIN qc_check_project qcp ON ctp.project_id = qcp.id left join qc_check_type ct on ct.id = ctp.type_id left join base_product p on p.product_code = ctp.material_code - AND ctp.del_flag = '0' AND cp.del_flag = '0' + AND ctp.del_flag = '0' AND qcp.del_flag = '0' and ctp.group_id = #{groupId} order by ctp.type_id @@ -231,6 +231,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{sort}, + + insert into qc_check_type_project( + id,project_id,project_no,type_id, + standard_value,upper_diff,down_diff,unit, + sample,sort, + create_by,create_time, + group_id,material_code,property_code + )values + + ( + #{item.id},#{item.projectId},#{item.projectNo},#{item.typeId}, + #{item.standardValue},#{item.upperDiff},#{item.downDiff},#{item.unit}, + #{item.sample},#{item.sort}, + #{item.createBy},#{item.createTime}, + #{item.groupId},#{item.materialCode},#{item.propertyCode} + ) + + update qc_check_type_project @@ -270,4 +288,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + From 449967fc123701e2d9563791397294e628bdf9ca Mon Sep 17 00:00:00 2001 From: A0010407 Date: Mon, 11 Dec 2023 14:10:57 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E9=A1=B9=E4=B8=80=E6=AC=A1=E6=8F=90=E4=BA=A4=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E7=85=A7=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EquRepairWorkOrderServiceImpl.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java index 076051d4..a3bb4b66 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java @@ -182,6 +182,29 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService //更新标准表 for(EquOrderStandard equOrderStandard:equRepairWorkOrder.getStandardList()){ + //先删除每个检查项标准图片 + String imageType = "4"; + equOrderStandardMapper.deleteBaseFileBySourceId(equOrderStandard.getId(),imageType); + //图片批量新增 + if (StringUtils.isNotEmpty(equOrderStandard.getPicturePath())) { + String[] ids = equOrderStandard.getPicturePath().split(","); + List files = new ArrayList<>(); + BaseFileData file = null; + for (String id : ids) { + file = new BaseFileData(); + file.setFileId(IdUtils.fastSimpleUUID()); + file.setFileName(id.split("&fileName=")[1]); + file.setFileAddress(id); + file.setSourceId(equOrderStandard.getId()); + file.setCreateBy(SecurityUtils.getUsername()); + file.setCreateTime(new Date()); + //图片类型 维修后 + file.setImageType("4"); + files.add(file); + } + equOrderStandardMapper.insertBaseFileBatch(files); + } + equOrderStandard.setUpdateBy(SecurityUtils.getUsername()); equOrderStandard.setUpdateTime(DateUtils.getNowDate()); equOrderStandardMapper.updateStandardAfterRepair(equOrderStandard); From e1be6cb0a62d38e738282f548bfcb3a627f8ac6a Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 11 Dec 2023 14:48:13 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E6=8A=A5=E5=B7=A5=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IWCInterfaceServiceImpl.java | 30 +++++++++++++++---- .../mapper/mes/MesReportWorkMapper.xml | 14 ++++++--- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index b0921e1c..1a262655 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -320,6 +320,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { //母工单报工 logger.info("==========================母工单报工开始"); pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback()); + pHzWork.setSac1(sHzWorks.getSac1()); this.reportHzToSap(pHzWork); logger.info("==========================母工单报工结束"); //最终报工标识:关闭子母工单 @@ -349,17 +350,34 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { return R.ok(); } + /** + * 子单进行报工的时候公式调整如下(数值单位不用管): + * 机器=sum(工时数/用人数) + * 人工 = 用人数*机器 + * 折旧 = 机器 + * 其它 = 人工 + * + * 母单进行报工的时候公式调整如下: + * 机器=子单机器 + * 人工 = 管理系统维护的用人数*机器 + * 折旧 = 机器 + * 其它 = 人工 + * @param workOrder + * @return + */ private R reportHzToSap(MesReportWork workOrder){ SapRFW sapRFW = new SapRFW(); sapRFW.setAufnr(workOrder.getWorkorderCodeSap());//虚拟工单号 sapRFW.setGamng(workOrder.getQuantityFeedback().toString());//报工数量 SapRFW.lt_gs ltgs = new SapRFW.lt_gs();//生产订单报工工时修改 - ltgs.setConf_activity1(workOrder.getSac1());//人工 - ltgs.setConf_activity2(workOrder.getSac2()); - ltgs.setConf_activity3(workOrder.getSac3());//机器 - ltgs.setConf_activity4(workOrder.getSac4()); - ltgs.setConf_activity5(workOrder.getSac5());//折旧 - ltgs.setConf_activity6(workOrder.getSac6()); + ltgs.setConf_activity1(workOrder.getSac1());//机器 + BigDecimal newMan = new BigDecimal(workOrder.getSac1()) + .multiply(new BigDecimal(workOrder.getSac2())); + ltgs.setConf_activity2(newMan.toString());//人工 + ltgs.setConf_activity3(workOrder.getSac1());//折旧 + ltgs.setConf_activity4(newMan.toString());//其它 +// ltgs.setConf_activity5(workOrder.getSac5()); +// ltgs.setConf_activity6(workOrder.getSac6()); sapRFW.setLt_gs(ltgs); List lt_hwList =new ArrayList<>(); MesReportWorkConsume consumeqo = new MesReportWorkConsume(); diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 5c6c1630..044f19ae 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -319,7 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from mes_material_transfer_result mt left join base_equipment equ on mt.equipmentCode = equ.equipment_code left join pro_order_workorder pow on pow.workorder_id = mt.OrderCode - where 1=1 + where mt.rfid_status = '1' and CONVERT(varchar(30),mt.update_time, 120) >= #{productDateStart} and #{productDateEnd} > CONVERT(varchar(30),mt.update_time, 120) @@ -360,7 +360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" equipmentCode, OrderCode from mes_material_transfer_result - where 1=1 + where rfid_status = '1' and CONVERT(varchar(30),update_time, 120) >= #{productDateStart} and #{productDateEnd} > CONVERT(varchar(30),update_time, 120) )mt @@ -552,26 +552,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mrw.quantity_feedback quantityFeedback, mrw.product_code productCode, mrw.product_name productName, + mrw.sac1, + mrw.sac2 + from ( select workorder_code, sum(quantity_feedback) quantity_feedback, + sum(round( work_time/use_man,2)) sac1, + use_man sac2, product_code, product_name from mes_report_work where upload_status != #{uploadStatus} and prod_type = #{prodType} and workorder_code = #{workorderCode} - group by workorder_code,product_code,product_name + group by workorder_code,product_code,product_name,use_man ) mrw left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code - left join pro_route rte on rte.route_code = ow.route_code + - + select + womsn.storage_id, + womsn.storage_type, + womsn.material_code, + womsn.material_desc, + womsn.amount, + womsn.storage_amount, + womsn.sap_factory_code, + womsn.wl_name, + womsn.del_flag, + womsn.spare_use_life, + womsn.spare_name, + womsn.spare_mode, + womsn.spare_manufacturer, + womsn.spare_supplier, + womsn.spare_replacement_cycle, + womsn.spare_measurement_unit, + womsn.spare_conversion_unit, + womsn.spare_conversion_ratio, + womsn.spare_inventory_floor, + womsn.spare_inventory_upper, + womsn.spare_type, + womsn.create_by, + womsn.gmt_create, + womsn.last_modified_by, + womsn.gmt_modified, + womsn.active_flag, + womsn.factory_code, + womsna.id, + womsna.primary_code, + womsna.own_equipment_name, + womsna.unit_quantity, + womsna.safe_stock, + womsna.unit_price, + womsna.procurement_method, + womsna.procurement_cycle, + womsna.opening_balance, + womsna.output_records, + womsna.input_records, + womsna.end_inventory, + womsna.end_money, + womsna.substitute_parts, + womsna.own_equipment_code + from wms_ods_mate_storage_news womsn + left join wms_ods_mate_storage_news_attached womsna on womsn.material_code = womsna.primary_code - and storage_id = #{storageId} - and wh_code = #{whCode} - and region_code = #{regionCode} - and wa_code = #{waCode} - and storage_type = #{storageType} - and wl_code = #{wlCode} - and material_code like concat('%', #{materialCode}, '%') - and material_desc like concat('%', #{materialDesc}, '%') - and amount = #{amount} - and storage_amount = #{storageAmount} - and occupy_amount = #{occupyAmount} - and lpn = #{lpn} - and product_batch = #{productBatch} - and receive_date = #{receiveDate} - and product_date = #{productDate} - and user_defined1 = #{userDefined1} - and user_defined2 = #{userDefined2} - and user_defined3 = #{userDefined3} - and user_defined4 = #{userDefined4} - and user_defined5 = #{userDefined5} - and user_defined6 = #{userDefined6} - and user_defined7 = #{userDefined7} - and user_defined8 = #{userDefined8} - and user_defined9 = #{userDefined9} - and user_defined10 = #{userDefined10} - and gmt_create = #{gmtCreate} - and last_modified_by = #{lastModifiedBy} - and gmt_modified = #{gmtModified} - and active_flag = #{activeFlag} - and factory_code = #{factoryCode} - and sap_factory_code = #{sapFactoryCode} - and wl_name like concat('%', #{wlName}, '%') - and spare_use_life = #{spareUseLife} - and spare_name like concat('%', #{spareName}, '%') - and spare_mode like concat('%', #{spareMode}, '%') - and spare_manufacturer = #{spareManufacturer} - and spare_supplier = #{spareSupplier} - and spare_replacement_cycle = #{spareReplacementCycle} - and spare_measurement_unit = #{spareMeasurementUnit} - and spare_conversion_unit = #{spareConversionUnit} - and spare_conversion_ratio = #{spareConversionRatio} - and spare_inventory_floor = #{spareInventoryFloor} - and spare_inventory_upper = #{spareInventoryUpper} - and spare_type = #{spareType} - and del_flag = '0' + and womsn.storage_id = #{storageId} + and womsn.wh_code = #{whCode} + and womsn.region_code = #{regionCode} + and womsn.wa_code = #{waCode} + and womsn.storage_type = #{storageType} + and womsn.wl_code = #{wlCode} + and womsn.material_code like concat('%', #{materialCode}, '%') + and womsn.material_desc like concat('%', #{materialDesc}, '%') + and womsn.amount = #{amount} + and womsn.storage_amount = #{storageAmount} + and womsn.occupy_amount = #{occupyAmount} + and womsn.lpn = #{lpn} + and womsn.product_batch = #{productBatch} + and womsn.receive_date = #{receiveDate} + and womsn.product_date = #{productDate} + and womsn.user_defined1 = #{userDefined1} + and womsn.user_defined2 = #{userDefined2} + and womsn.user_defined3 = #{userDefined3} + and womsn.user_defined4 = #{userDefined4} + and womsn.user_defined5 = #{userDefined5} + and womsn.user_defined6 = #{userDefined6} + and womsn.user_defined7 = #{userDefined7} + and womsn.user_defined8 = #{userDefined8} + and womsn.user_defined9 = #{userDefined9} + and womsn.user_defined10 = #{userDefined10} + and womsn.gmt_create = #{gmtCreate} + and womsn.last_modified_by = #{lastModifiedBy} + and womsn.gmt_modified = #{gmtModified} + and womsn.active_flag = #{activeFlag} + and womsn.factory_code = #{factoryCode} + and womsn.sap_factory_code = #{sapFactoryCode} + and womsn.wl_name like concat('%', #{wlName}, '%') + and womsn.spare_use_life = #{spareUseLife} + and womsn.spare_name like concat('%', #{spareName}, '%') + and womsn.spare_mode like concat('%', #{spareMode}, '%') + and womsn.spare_manufacturer = #{spareManufacturer} + and womsn.spare_supplier like concat('%', #{spareSupplier}, '%') + and womsn.spare_replacement_cycle = #{spareReplacementCycle} + and womsn.spare_measurement_unit = #{spareMeasurementUnit} + and womsn.spare_conversion_unit = #{spareConversionUnit} + and womsn.spare_conversion_ratio = #{spareConversionRatio} + and womsn.spare_inventory_floor = #{spareInventoryFloor} + and womsn.spare_inventory_upper = #{spareInventoryUpper} + and womsn.spare_type = #{spareType} + + and womsna.own_equipment_name like concat('%', #{ownEquipmentName}, '%') + and womsn.del_flag = '0' From 43620145443bb77319aeee036f0d83bfe4468331 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 13 Dec 2023 08:46:38 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=B7=A5=E5=8D=95=E6=89=8D=E8=83=BD=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=8A=A5=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IWCInterfaceServiceImpl.java | 2 +- .../mapper/mes/MesReportWorkMapper.xml | 18 +++-- .../controller/QcInterfaceController.java | 54 +++++++++++++ .../com/op/quality/domain/QcInterface.java | 79 +++++++++++++++++++ .../mapper/QcCheckTaskIncomeMapper.java | 2 + .../op/quality/mapper/QcInterfaceMapper.java | 24 ++++++ .../quality/service/IQcInterfaceService.java | 21 +++++ .../impl/QcCheckTaskIncomeServiceImpl.java | 2 + .../impl/QcCheckTaskProduceServiceImpl.java | 1 + .../QcCheckTaskWarehousingServiceImpl.java | 1 + .../service/impl/QcInterfaceServiceImpl.java | 69 ++++++++++++++++ .../impl/QcUserMaterialServiceImpl.java | 1 + .../quality/QcCheckTaskIncomeMapper.xml | 3 + .../mapper/quality/QcInterfaceMapper.xml | 60 ++++++++++++++ .../mapper/quality/QcUserMaterialMapper.xml | 6 +- 15 files changed, 331 insertions(+), 12 deletions(-) create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/controller/QcInterfaceController.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/domain/QcInterface.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/mapper/QcInterfaceMapper.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/service/IQcInterfaceService.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcInterfaceServiceImpl.java create mode 100644 op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index ef4d597c..474a82bb 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -267,7 +267,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { new LinkedBlockingQueue()); try { dateSources.forEach(dateSource -> { - if("ds_1000".equals(dateSource.get("poolName"))){//只有999白坯工厂有这种情况 + if("ds_999".equals(dateSource.get("poolName"))){//只有999白坯工厂有这种情况 logger.info("++++++++++++" + dateSource.get("poolName") + "++++开始++++++++++"); Runnable run = () -> dateBKFunc(dateSource.get("poolName"),tables); executorService.execute(run); diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index f02ed4b0..d160f047 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -471,9 +471,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + insert into qc_check_task diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml new file mode 100644 index 00000000..d93c44fc --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml @@ -0,0 +1,60 @@ + + + + + + + + + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml index ab560425..df89fef3 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -125,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" erwo.del_flag, erwo.factory_code, erwo.fault_type, + erwo.equipment_status_description, be.equipment_name, et.team_name, et.team_person @@ -204,6 +207,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" erwo.del_flag, erwo.factory_code, erwo.fault_type, + erwo.equipment_status_description, be.equipment_name, et.team_name, et.team_person @@ -252,6 +256,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" erwo.update_by, erwo.factory_code, erwo.fault_type, + erwo.equipment_status_description, be.equipment_name, be.equipment_spec, be.equipment_type_name, @@ -316,6 +321,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag, factory_code, fault_type, + equipment_status_description, #{workId}, @@ -353,6 +359,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{delFlag}, #{factoryCode}, #{fault_type}, + equipment_status_description, @@ -393,6 +400,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag = #{delFlag}, factory_code = #{factoryCode}, fault_type = #{faultType}, + equipment_status_description = #{equipmentStatusDescription}, where work_id = #{workId} and del_flag = '0' diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java index 05ebd03c..5869a1c3 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java @@ -211,6 +211,10 @@ public class BaseEquipment extends BaseEntity { @Excel(name = "设备状态") private String equipmentStatus; + /** 设备类别 */ + @Excel(name = "设备类别") + private String equipmentCategory; + private String imageFileList; private String barCodeFileList; @@ -651,6 +655,14 @@ public class BaseEquipment extends BaseEntity { return equipmentStatus; } + //设备类别 + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + public String getEquipmentCategory() { + return equipmentCategory; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml index 10c447e1..c120ca67 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml @@ -48,6 +48,7 @@ + @@ -162,7 +163,8 @@ department, equipment_head, factory_code, - equipment_status + equipment_status, + equipment_category from base_equipment @@ -205,6 +207,7 @@ and sap_asset = #{sapAsset} and factory_code = #{factoryCode} and equipment_status = #{equipmentStatus} + and equipment_category = #{equipmentCategory} and del_flag ='0' @@ -259,6 +262,7 @@ equipment_head, factory_code, equipment_status, + equipment_category, #{equipmentCode}, @@ -302,6 +306,7 @@ #{equipmentHead}, #{factoryCode}, equipmentStatus, + equipmentCategory, @@ -349,6 +354,7 @@ equipment_head = #{equipmentHead}, factory_code = #{factoryCode}, equipment_status = #{equipmentStatus}, + equipment_category = #{equipmentCategory}, where equipment_id = #{equipmentId} From 628b391937cd1eacec91fbac6bcabbcc73c7756f Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 13 Dec 2023 12:05:52 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/mes/MesReportWorkConsumeMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml index 1d3c7ed6..58883193 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml @@ -106,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mrwc.recoil from mes_report_work_consume mrwc left join pro_order_workorder pow on pow.workorder_code = mrwc.workorder_code - where mrwc.del_flag = '0' + where mrwc.del_flag = '0' and pow.del_flag = '0' and pow.parent_order = #{workorderCode} From ed67be03ca30ab949ba4944b915b015e468f6d9d Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 13 Dec 2023 14:25:38 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E5=AD=90=E5=8D=95=E6=8A=A5=E5=B7=A5?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=90=8E=E5=86=8D=E6=8A=A5=E6=AF=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IWCInterfaceServiceImpl.java | 64 ++++++++----------- 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 474a82bb..a20c67ac 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -310,44 +310,32 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { } //子工单报工 logger.info("==========================子工单报工开始"); - this.reportHzToSap(sHzWorks); - logger.info("==========================子工单报工结束"); - mesReportWork.setWorkorderCode(sapWorkOrders.get(0).getWorkorderCode()); - MesReportWork pHzWork = mesReportWorkMapper.getReportWorkHz(mesReportWork); - if(pHzWork==null){ - return R.fail("未查询到母报工单"); - } - //母工单报工 - logger.info("==========================母工单报工开始"); - pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback()); - pHzWork.setSac1(sHzWorks.getSac1()); - R sapR = this.reportHzToSap(pHzWork); - logger.info("==========================母工单报工结束"); - //最终报工标识且sap报工成功:关闭子母工单 - MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork); - if("1".equals(endReport.getEndReport())&&sapR.getCode()==200){ - /** - logger.info("报工======母sap工单编码:"+sapWorkOrders.get(0).getWorkorderCodeSap()+ - "子sap工单编码:"+sapWorkOrders.get(1).getWorkorderCodeSap() - ); - //关闭母子订单//订单的订单编码 - SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery(); - sapCloseOrderQuery.setLeadOrder(sapWorkOrders.get(0).getWorkorderCodeSap()); - sapCloseOrderQuery.setOrder(sapWorkOrders.get(1).getWorkorderCodeSap()); - R closeR = remoteSapService.sapCloseOrder(sapCloseOrderQuery); - logger.info("报工======关闭母子sap工单"+sapCloseOrderQuery.getLeadOrder()+":"+ - sapCloseOrderQuery.getOrder()+":"+ - closeR.getCode()+","+ - closeR.getMsg()+","+ - closeR.getData()); - **/ - MesReportWork rworkVo = new MesReportWork(); - rworkVo.setStatus("w3"); - rworkVo.setUpdateTime(DateUtils.getNowDate()); - rworkVo.setUpdateBy(SecurityUtils.getUsername()); - rworkVo.setWorkorderCode(belongWorkOrder); - //pro_work_order status->w3报工--belong_work_order - mesReportWorkMapper.updateOrderWorkStatus(rworkVo); + R sapRson = this.reportHzToSap(sHzWorks); + logger.info("==========================子工单报工结束:"+JSONObject.toJSONString(sapRson)); + if(sapRson.getCode()== 200){ + //一定是子单报工成功返回后,再母单报工 + mesReportWork.setWorkorderCode(sapWorkOrders.get(0).getWorkorderCode()); + MesReportWork pHzWork = mesReportWorkMapper.getReportWorkHz(mesReportWork); + if(pHzWork==null){ + return R.fail("未查询到母报工单"); + } + //母工单报工 + logger.info("==========================母工单报工开始"); + pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback()); + pHzWork.setSac1(sHzWorks.getSac1()); + R sapR = this.reportHzToSap(pHzWork); + logger.info("==========================母工单报工结束"+JSONObject.toJSONString(sapR)); + //最终报工标识且sap报工成功:关闭子母工单 + MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork); + if("1".equals(endReport.getEndReport())&&sapR.getCode()==200){ + MesReportWork rworkVo = new MesReportWork(); + rworkVo.setStatus("w3"); + rworkVo.setUpdateTime(DateUtils.getNowDate()); + rworkVo.setUpdateBy(SecurityUtils.getUsername()); + rworkVo.setWorkorderCode(belongWorkOrder); + //pro_work_order status->w3报工--belong_work_order + mesReportWorkMapper.updateOrderWorkStatus(rworkVo); + } } return R.ok(); } From 0b0ad3d1ab0fcc63f793340b831154d7946c38a0 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 13 Dec 2023 15:01:52 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E8=AE=BE=E5=A4=87=E7=BB=84=E7=BA=BF?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseEquipmentController.java | 15 +++++++++++---- .../com/op/wms/mapper/BaseEquipmentMapper.java | 3 +++ .../op/wms/service/IBaseEquipmentService.java | 8 ++++---- .../service/impl/BaseEquipmentServiceImpl.java | 18 +++++++++++++++++- .../mapper/wms/BaseEquipmentMapper.xml | 11 +++++++++++ 5 files changed, 46 insertions(+), 9 deletions(-) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java index 54c29ff6..30f9c1ff 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java @@ -11,9 +11,7 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.common.security.utils.SecurityUtils; import com.op.system.api.domain.SysUser; -import com.op.wms.domain.BaseTeamUser; -import com.op.wms.domain.EquSpareEquipment; -import com.op.wms.domain.WmsSparePartsLedger; +import com.op.wms.domain.*; import com.op.wms.service.IBaseEquipmentService; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; @@ -28,7 +26,6 @@ import org.springframework.web.bind.annotation.RestController; import com.op.common.log.annotation.Log; import com.op.common.log.enums.BusinessType; import com.op.common.security.annotation.RequiresPermissions; -import com.op.wms.domain.BaseEquipment; import com.op.common.core.web.controller.BaseController; import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.utils.poi.ExcelUtil; @@ -241,4 +238,14 @@ public class BaseEquipmentController extends BaseController { return getDataTable(list); } + /** + * 查询组线/辅助设备 + */ + @GetMapping("/getAuxiliaryEquipmentList") + public TableDataInfo getAuxiliaryEquipmentList(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment) { + startPage(); + List list = baseEquipmentService.selectAuxiliaryEquipmentList(equBindAuxiliaryEquipment); + return getDataTable(list); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java index bd505a4e..d77bd129 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java @@ -117,4 +117,7 @@ public interface BaseEquipmentMapper { //删除 void deleteAuxiliaryEquipmentByCode(String equipmentCode); + + //查询组线/辅助设备 + List selectAuxiliaryEquipmentList(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java index a8180e81..2c786021 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java @@ -3,10 +3,7 @@ package com.op.wms.service; import java.util.List; import com.op.common.core.web.domain.AjaxResult; -import com.op.wms.domain.BaseEquipment; -import com.op.wms.domain.BaseTeamUser; -import com.op.wms.domain.EquSpareEquipment; -import com.op.wms.domain.WmsSparePartsLedger; +import com.op.wms.domain.*; /** * 设备管理Service接口 @@ -83,4 +80,7 @@ public interface IBaseEquipmentService { //查询人员列表 List getPersonList(BaseTeamUser baseTeamUser); + + //查询组线/辅助设备 + List selectAuxiliaryEquipmentList(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java index 47942426..e699f36a 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java @@ -335,10 +335,14 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment(); equBindAuxiliaryEquipment.setAuxiliaryEquipmentCode(code); equBindAuxiliaryEquipment.setEquipmentCode(baseEquipment.getEquipmentCode()); + equBindAuxiliaryEquipment.setEquipmentName(baseEquipment.getEquipmentName()); equBindAuxiliaryEquipment.setCreateBy(SecurityUtils.getUsername()); equBindAuxiliaryEquipment.setCreateTime(DateUtils.getNowDate()); equBindAuxiliaryEquipment.setId(IdUtils.fastSimpleUUID()); - equBindAuxiliaryEquipment.setAuxiliaryEquipmentName(baseEquipment.getEquipmentName()); + //工厂号 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + equBindAuxiliaryEquipment.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); baseEquipmentMapper.bindAuxiliaryEquipment(equBindAuxiliaryEquipment); } } @@ -552,4 +556,16 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { return baseTeamUserMapper.getPersonList(baseTeamUser); } + /** + * 查询设备管理列表 + * + * @param equBindAuxiliaryEquipment 设备管理 + * @return 设备管理 + */ + @Override + @DS("#header.poolName") + public List selectAuxiliaryEquipmentList(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment) { + return baseEquipmentMapper.selectAuxiliaryEquipmentList(equBindAuxiliaryEquipment); + } + } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml index c120ca67..6615e765 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml @@ -581,4 +581,15 @@ where equipment_id = #{equipmentId} + + + \ No newline at end of file From e855f5ad3cc6a1278577b1f0a372d046134c3e48 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Wed, 13 Dec 2023 15:41:48 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E5=AE=8C=E5=A5=BD=E7=8E=87init=E3=80=81?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E9=80=89=E6=8B=A9=E9=80=BB=E8=BE=91=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=BB=84=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EquOperationController.java | 97 +++++++ .../device/controller/EquPlanController.java | 10 + .../com/op/device/domain/EquEquipment.java | 32 +++ .../com/op/device/domain/EquOperation.java | 265 ++++++++++++++++++ .../java/com/op/device/domain/Equipment.java | 11 + .../op/device/mapper/EquEquipmentMapper.java | 7 + .../op/device/mapper/EquOperationMapper.java | 61 ++++ .../device/service/IEquOperationService.java | 60 ++++ .../op/device/service/IEquPlanService.java | 6 + .../service/impl/EquOperationServiceImpl.java | 97 +++++++ .../service/impl/EquPlanServiceImpl.java | 13 +- .../mapper/device/EquCheckItemMapper.xml | 2 +- .../mapper/device/EquEquipmentMapper.xml | 32 ++- .../mapper/device/EquOperationMapper.xml | 163 +++++++++++ 14 files changed, 853 insertions(+), 3 deletions(-) create mode 100644 op-modules/op-device/src/main/java/com/op/device/controller/EquOperationController.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/mapper/EquOperationMapper.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/service/IEquOperationService.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/service/impl/EquOperationServiceImpl.java create mode 100644 op-modules/op-device/src/main/resources/mapper/device/EquOperationMapper.xml diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquOperationController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquOperationController.java new file mode 100644 index 00000000..ca85f185 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquOperationController.java @@ -0,0 +1,97 @@ +package com.op.device.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +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.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.device.domain.EquOperation; +import com.op.device.service.IEquOperationService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 设备运行记录Controller + * + * @author Open Platform + * @date 2023-12-13 + */ +@RestController +@RequestMapping("/operation") +public class EquOperationController extends BaseController { + @Autowired + private IEquOperationService equOperationService; + + /** + * 查询设备运行记录列表 + */ + @RequiresPermissions("device:operation:list") + @GetMapping("/list") + public TableDataInfo list(EquOperation equOperation) { + startPage(); + List list = equOperationService.selectEquOperationList(equOperation); + return getDataTable(list); + } + + /** + * 导出设备运行记录列表 + */ + @RequiresPermissions("device:operation:export") + @Log(title = "设备运行记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EquOperation equOperation) { + List list = equOperationService.selectEquOperationList(equOperation); + ExcelUtil util = new ExcelUtil(EquOperation.class); + util.exportExcel(response, list, "设备运行记录数据"); + } + + /** + * 获取设备运行记录详细信息 + */ + @RequiresPermissions("device:operation:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(equOperationService.selectEquOperationById(id)); + } + + /** + * 新增设备运行记录 + */ + @RequiresPermissions("device:operation:add") + @Log(title = "设备运行记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EquOperation equOperation) { + return toAjax(equOperationService.insertEquOperation(equOperation)); + } + + /** + * 修改设备运行记录 + */ + @RequiresPermissions("device:operation:edit") + @Log(title = "设备运行记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EquOperation equOperation) { + return toAjax(equOperationService.updateEquOperation(equOperation)); + } + + /** + * 删除设备运行记录 + */ + @RequiresPermissions("device:operation:remove") + @Log(title = "设备运行记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(equOperationService.deleteEquOperationByIds(ids)); + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquPlanController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquPlanController.java index 026a10b6..3cd95dbb 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/EquPlanController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquPlanController.java @@ -92,6 +92,16 @@ public class EquPlanController extends BaseController { return getDataTable(list); } + /** + * 获取设备组线列表 + * @return + */ + @RequiresPermissions("device:inspectionPlan:list") + @GetMapping("/getGroupLine") + public AjaxResult getGroupLine(){ + return equPlanService.getGroupLine(); + } + /** * 查询计划列表 */ diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquEquipment.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquEquipment.java index 3b2755e8..1be5b8df 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquEquipment.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquEquipment.java @@ -158,6 +158,38 @@ public class EquEquipment extends BaseEntity { @Excel(name = "设备状态") private String equipmentStatus; + // 设备组线/辅助设备标识 + private String equipmentCategory; + + // 组线编码 + private String groupLine; + // 组线名称 + private String groupLineName; + + public String getGroupLineName() { + return groupLineName; + } + + public void setGroupLineName(String groupLineName) { + this.groupLineName = groupLineName; + } + + public String getGroupLine() { + return groupLine; + } + + public void setGroupLine(String groupLine) { + this.groupLine = groupLine; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + public void setEquipmentId(Long equipmentId) { this.equipmentId = equipmentId; } diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java new file mode 100644 index 00000000..dee5e756 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java @@ -0,0 +1,265 @@ +package com.op.device.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 设备运行记录对象 equ_operation + * + * @author Open Platform + * @date 2023-12-13 + */ +public class EquOperation extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键 */ + private String id; + + /** 车间 */ + @Excel(name = "车间") + private String workshop; + + /** 组线 */ + @Excel(name = "组线") + private String groupLine; + + /** 设备 */ + @Excel(name = "设备") + private String equipmentName; + + /** 设备编码 */ + @Excel(name = "设备编码") + private String equipmentCode; + + /** 故障时间 */ + @Excel(name = "故障时间") + private String faultTime; + + /** 实际运行时间;运行时间-故障时间 */ + @Excel(name = "实际运行时间;运行时间-故障时间") + private String actualOperationTime; + + /** 运行时间 */ + @Excel(name = "运行时间") + private String operationTime; + + /** 故障率 */ + @Excel(name = "故障率") + private String failureRate; + + /** 故障描述 */ + @Excel(name = "故障描述") + private String failureDescription; + + /** 原因分析 */ + @Excel(name = "原因分析") + private String reasonAnalyze; + + /** 处理方式 */ + @Excel(name = "处理方式") + private String handlingMethod; + + /** 维修人 */ + @Excel(name = "维修人") + private String repairPerson; + + /** 设备状态描述 */ + @Excel(name = "设备状态描述") + private String equStatusDes; + + /** 更换备件 */ + @Excel(name = "更换备件") + private String replaceSpare; + + /** 工厂 */ + @Excel(name = "工厂") + private String factoryCode; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String attr1; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String attr2; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private String attr3; + + /** 删除标识 */ + private String delFlag; + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + public void setWorkshop(String workshop) { + this.workshop = workshop; + } + + public String getWorkshop() { + return workshop; + } + public void setGroupLine(String groupLine) { + this.groupLine = groupLine; + } + + public String getGroupLine() { + return groupLine; + } + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentName() { + return equipmentName; + } + public void setEquipmentCode(String equipmentCode) { + this.equipmentCode = equipmentCode; + } + + public String getEquipmentCode() { + return equipmentCode; + } + public void setFaultTime(String faultTime) { + this.faultTime = faultTime; + } + + public String getFaultTime() { + return faultTime; + } + public void setActualOperationTime(String actualOperationTime) { + this.actualOperationTime = actualOperationTime; + } + + public String getActualOperationTime() { + return actualOperationTime; + } + public void setOperationTime(String operationTime) { + this.operationTime = operationTime; + } + + public String getOperationTime() { + return operationTime; + } + public void setFailureRate(String failureRate) { + this.failureRate = failureRate; + } + + public String getFailureRate() { + return failureRate; + } + public void setFailureDescription(String failureDescription) { + this.failureDescription = failureDescription; + } + + public String getFailureDescription() { + return failureDescription; + } + public void setReasonAnalyze(String reasonAnalyze) { + this.reasonAnalyze = reasonAnalyze; + } + + public String getReasonAnalyze() { + return reasonAnalyze; + } + public void setHandlingMethod(String handlingMethod) { + this.handlingMethod = handlingMethod; + } + + public String getHandlingMethod() { + return handlingMethod; + } + public void setRepairPerson(String repairPerson) { + this.repairPerson = repairPerson; + } + + public String getRepairPerson() { + return repairPerson; + } + public void setEquStatusDes(String equStatusDes) { + this.equStatusDes = equStatusDes; + } + + public String getEquStatusDes() { + return equStatusDes; + } + public void setReplaceSpare(String replaceSpare) { + this.replaceSpare = replaceSpare; + } + + public String getReplaceSpare() { + return replaceSpare; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("workshop", getWorkshop()) + .append("groupLine", getGroupLine()) + .append("equipmentName", getEquipmentName()) + .append("equipmentCode", getEquipmentCode()) + .append("faultTime", getFaultTime()) + .append("actualOperationTime", getActualOperationTime()) + .append("operationTime", getOperationTime()) + .append("failureRate", getFailureRate()) + .append("failureDescription", getFailureDescription()) + .append("reasonAnalyze", getReasonAnalyze()) + .append("handlingMethod", getHandlingMethod()) + .append("repairPerson", getRepairPerson()) + .append("equStatusDes", getEquStatusDes()) + .append("replaceSpare", getReplaceSpare()) + .append("factoryCode", getFactoryCode()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/Equipment.java b/op-modules/op-device/src/main/java/com/op/device/domain/Equipment.java index 990c3745..652a68aa 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/Equipment.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/Equipment.java @@ -151,6 +151,17 @@ public class Equipment extends BaseEntity { @Excel(name = "设备状态") private String equipmentStatus; + // 设备组线/辅助设备标识 + private String equipmentCategory; + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + public void setEquipmentId(Long equipmentId) { this.equipmentId = equipmentId; } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquEquipmentMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquEquipmentMapper.java index d293d8db..f2a179f3 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquEquipmentMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquEquipmentMapper.java @@ -2,6 +2,7 @@ package com.op.device.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.device.domain.EquEquipment; +import com.op.device.domain.Equipment; import java.util.List; @@ -62,4 +63,10 @@ public interface EquEquipmentMapper { //查询设备类型 List getEquipmentTypeList(EquEquipment equEquipment); + + // 查询设备组线 + List selectEqupmentGroupLine(); + + // 查询设备信息 + List selectEquipmentList(EquEquipment equEquipment); } \ No newline at end of file diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOperationMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOperationMapper.java new file mode 100644 index 00000000..45f54f25 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOperationMapper.java @@ -0,0 +1,61 @@ +package com.op.device.mapper; + +import java.util.List; + +import com.op.device.domain.EquOperation; + +/** + * 设备运行记录Mapper接口 + * + * @author Open Platform + * @date 2023-12-13 + */ +public interface EquOperationMapper { + /** + * 查询设备运行记录 + * + * @param id 设备运行记录主键 + * @return 设备运行记录 + */ + public EquOperation selectEquOperationById(String id); + + /** + * 查询设备运行记录列表 + * + * @param equOperation 设备运行记录 + * @return 设备运行记录集合 + */ + public List selectEquOperationList(EquOperation equOperation); + + /** + * 新增设备运行记录 + * + * @param equOperation 设备运行记录 + * @return 结果 + */ + public int insertEquOperation(EquOperation equOperation); + + /** + * 修改设备运行记录 + * + * @param equOperation 设备运行记录 + * @return 结果 + */ + public int updateEquOperation(EquOperation equOperation); + + /** + * 删除设备运行记录 + * + * @param id 设备运行记录主键 + * @return 结果 + */ + public int deleteEquOperationById(String id); + + /** + * 批量删除设备运行记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEquOperationByIds(String[] ids); +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquOperationService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquOperationService.java new file mode 100644 index 00000000..eb9514a9 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquOperationService.java @@ -0,0 +1,60 @@ +package com.op.device.service; + +import java.util.List; +import com.op.device.domain.EquOperation; + +/** + * 设备运行记录Service接口 + * + * @author Open Platform + * @date 2023-12-13 + */ +public interface IEquOperationService { + /** + * 查询设备运行记录 + * + * @param id 设备运行记录主键 + * @return 设备运行记录 + */ + public EquOperation selectEquOperationById(String id); + + /** + * 查询设备运行记录列表 + * + * @param equOperation 设备运行记录 + * @return 设备运行记录集合 + */ + public List selectEquOperationList(EquOperation equOperation); + + /** + * 新增设备运行记录 + * + * @param equOperation 设备运行记录 + * @return 结果 + */ + public int insertEquOperation(EquOperation equOperation); + + /** + * 修改设备运行记录 + * + * @param equOperation 设备运行记录 + * @return 结果 + */ + public int updateEquOperation(EquOperation equOperation); + + /** + * 批量删除设备运行记录 + * + * @param ids 需要删除的设备运行记录主键集合 + * @return 结果 + */ + public int deleteEquOperationByIds(String[] ids); + + /** + * 删除设备运行记录信息 + * + * @param id 设备运行记录主键 + * @return 结果 + */ + public int deleteEquOperationById(String id); +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquPlanService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquPlanService.java index ed731a5b..f199659b 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IEquPlanService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquPlanService.java @@ -101,4 +101,10 @@ public interface IEquPlanService { * @return */ AjaxResult initUpdatePlanInfo(EquPlan equPlan); + + /** + * 获取设备组线信息列表 + * @return + */ + AjaxResult getGroupLine(); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOperationServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOperationServiceImpl.java new file mode 100644 index 00000000..98e86d53 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOperationServiceImpl.java @@ -0,0 +1,97 @@ +package com.op.device.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.device.mapper.EquOperationMapper; +import com.op.device.domain.EquOperation; +import com.op.device.service.IEquOperationService; + +/** + * 设备运行记录Service业务层处理 + * + * @author Open Platform + * @date 2023-12-13 + */ +@Service +public class EquOperationServiceImpl implements IEquOperationService { + @Autowired + private EquOperationMapper equOperationMapper; + + /** + * 查询设备运行记录 + * + * @param id 设备运行记录主键 + * @return 设备运行记录 + */ + @Override + @DS("#header.poolName") + public EquOperation selectEquOperationById(String id) { + return equOperationMapper.selectEquOperationById(id); + } + + /** + * 查询设备运行记录列表 + * + * @param equOperation 设备运行记录 + * @return 设备运行记录 + */ + @Override + @DS("#header.poolName") + public List selectEquOperationList(EquOperation equOperation) { + return equOperationMapper.selectEquOperationList(equOperation); + } + + /** + * 新增设备运行记录 + * + * @param equOperation 设备运行记录 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertEquOperation(EquOperation equOperation) { + equOperation.setCreateTime(DateUtils.getNowDate()); + return equOperationMapper.insertEquOperation(equOperation); + } + + /** + * 修改设备运行记录 + * + * @param equOperation 设备运行记录 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateEquOperation(EquOperation equOperation) { + equOperation.setUpdateTime(DateUtils.getNowDate()); + return equOperationMapper.updateEquOperation(equOperation); + } + + /** + * 批量删除设备运行记录 + * + * @param ids 需要删除的设备运行记录主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteEquOperationByIds(String[] ids) { + return equOperationMapper.deleteEquOperationByIds(ids); + } + + /** + * 删除设备运行记录信息 + * + * @param id 设备运行记录主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteEquOperationById(String id) { + return equOperationMapper.deleteEquOperationById(id); + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java index 80d08108..610eb572 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java @@ -243,7 +243,8 @@ public class EquPlanServiceImpl implements IEquPlanService { @Override @DS("#header.poolName") public List getEquList(EquEquipment equEquipment) { - return equEquipmentMapper.selectEquEquipmentList(equEquipment); + equEquipment.setEquipmentCategory("0"); + return equEquipmentMapper.selectEquipmentList(equEquipment); } /** @@ -362,6 +363,16 @@ public class EquPlanServiceImpl implements IEquPlanService { return success(plan); } + /** + * 获取设备组线信息 + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult getGroupLine() { + return success(equEquipmentMapper.selectEqupmentGroupLine()); + } + /** * 插入设备、人员、检查项、标准、备件 * diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml index ea4a816c..c3f2095d 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml @@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -87,6 +88,7 @@ and plc_ip = #{plcIp} and plc_port = #{plcPort} and sap_asset = #{sapAsset} + and equipment_category = #{equipmentCategory} @@ -138,6 +140,7 @@ plc_port, del_flag, sap_asset, + equipment_category, #{equipmentId}, @@ -180,6 +183,7 @@ #{plcPort}, #{delFlag}, #{sapAsset}, + #{equipmentCategory}, @@ -225,6 +229,7 @@ plc_port = #{plcPort}, del_flag = #{delFlag}, sap_asset = #{sapAsset}, + equipment_category = #{equipmentCategory}, where equipment_id = #{equipmentId} @@ -247,4 +252,29 @@ group by equipment_type_code,equipment_type_name + + + + \ No newline at end of file diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOperationMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOperationMapper.xml new file mode 100644 index 00000000..ac8d4e8d --- /dev/null +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOperationMapper.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, workshop, group_Line, equipment_name, equipment_code, fault_time, actual_operation_time, operation_time, failure_rate, failure_description, reason_analyze, handling_method, repair_person, equ_status_des, replace_spare, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_operation + + + + + + + + insert into equ_operation + + id, + workshop, + group_Line, + equipment_name, + equipment_code, + fault_time, + actual_operation_time, + operation_time, + failure_rate, + failure_description, + reason_analyze, + handling_method, + repair_person, + equ_status_des, + replace_spare, + factory_code, + attr1, + attr2, + attr3, + del_flag, + create_by, + create_time, + update_by, + update_time, + + + #{id}, + #{workshop}, + #{groupLine}, + #{equipmentName}, + #{equipmentCode}, + #{faultTime}, + #{actualOperationTime}, + #{operationTime}, + #{failureRate}, + #{failureDescription}, + #{reasonAnalyze}, + #{handlingMethod}, + #{repairPerson}, + #{equStatusDes}, + #{replaceSpare}, + #{factoryCode}, + #{attr1}, + #{attr2}, + #{attr3}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update equ_operation + + workshop = #{workshop}, + group_Line = #{groupLine}, + equipment_name = #{equipmentName}, + equipment_code = #{equipmentCode}, + fault_time = #{faultTime}, + actual_operation_time = #{actualOperationTime}, + operation_time = #{operationTime}, + failure_rate = #{failureRate}, + failure_description = #{failureDescription}, + reason_analyze = #{reasonAnalyze}, + handling_method = #{handlingMethod}, + repair_person = #{repairPerson}, + equ_status_des = #{equStatusDes}, + replace_spare = #{replaceSpare}, + factory_code = #{factoryCode}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from equ_operation where id = #{id} + + + + delete from equ_operation where id in + + #{id} + + + \ No newline at end of file From aa2ca2b13c2c929bc388a4f035ba900d648b4f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=9D=B0?= <2658502433@qq.com> Date: Wed, 13 Dec 2023 16:34:11 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E6=89=93=E5=8D=B0=E9=A2=86=E6=96=99?= =?UTF-8?q?=E5=8D=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/mes/MesPrepareDetailMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareDetailMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareDetailMapper.xml index 1c7db985..80e2e6bc 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareDetailMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareDetailMapper.xml @@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + From cfeda7559dca6755e0098e23abe7238905ae0c25 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 13 Dec 2023 17:04:08 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E8=AE=BE=E5=A4=87=E7=BB=84=E7=BA=BF?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/wms/service/impl/BaseEquipmentServiceImpl.java | 5 +++-- .../src/main/resources/mapper/wms/BaseEquipmentMapper.xml | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java index e699f36a..7f01eb2a 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java @@ -139,8 +139,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { @Override @DS("#header.poolName") public int insertBaseEquipment(BaseEquipment baseEquipment) { - Date createTime = DateUtils.getNowDate(); - baseEquipment.setCreateTime(createTime); + baseEquipment.setCreateTime(DateUtils.getNowDate()); + baseEquipment.setCreateBy(SecurityUtils.getUsername()); String equipmentTypeName = baseEquipmentMapper.getEquipmentTypeName(baseEquipment); String workCenterName = baseEquipmentMapper.getWorkCenterName(baseEquipment); baseEquipment.setWorkshopName(workCenterName); @@ -245,6 +245,7 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { public int updateBaseEquipment(BaseEquipment baseEquipment) { baseEquipment.setUpdateTime(DateUtils.getNowDate()); + baseEquipment.setUpdateBy(SecurityUtils.getUsername()); String equipmentTypeName = baseEquipmentMapper.getEquipmentTypeName(baseEquipment); String workCenterName = baseEquipmentMapper.getWorkCenterName(baseEquipment); baseEquipment.setWorkshopName(workCenterName); diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml index 6615e765..b17b1ead 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml @@ -305,8 +305,8 @@ #{sapAsset}, #{equipmentHead}, #{factoryCode}, - equipmentStatus, - equipmentCategory, + #{equipmentStatus}, + #{equipmentCategory}, @@ -581,7 +581,6 @@ where equipment_id = #{equipmentId} - - + select + mp.workorder_name workorderCode, + mpd.material_code materialCode, + mpd.material_name materialName, + mpd.quantity, + mpd.unit, + mpd.status, + mpd.fund_quanlity fundQuanlity, + mpd.factory_code factoryCode, + ow.product_date productDate + from pro_order_workorder ow + left join mes_prepare mp on ow.workorder_code = mp.workorder_code + left join mes_prepare_detail mpd on mp.prepare_id = mpd.prepare_id + where ow.belong_work_order = #{workorderCode} + order by mp.workorder_name desc diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareMapper.xml index 9cfc6423..71e99649 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareMapper.xml @@ -39,63 +39,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select prepare_id, workorder_code, workorder_name, parent_order, order_id, order_code, product_id, product_code, prod_type, product_name, product_spc, wet_detail_plan_id, product_date, shift_id, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, material_code, material_name, material_spc, unit, quantity from mes_prepare + select prepare_id, workorder_code, workorder_name, parent_order, order_id, order_code, product_id, + product_code, prod_type, product_name, product_spc, wet_detail_plan_id, product_date, + shift_id, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, + update_by, update_time, factory_code, material_code, material_name, material_spc, unit, quantity + from mes_prepare - select - ms.prepare_id, - ms.workorder_code, - ms.workorder_name, - ms.parent_order, - ms.order_id, - ms.order_code, - ms.product_id, - ms.product_code, - ms.prod_type, - ms.product_name, - ms.product_spc, - ms.wet_detail_plan_id, - ms.product_date, - ms.shift_id, - ms.ancestors, - ms.status, - ms.remark, - ms.attr1, - ms.attr2, - ms.attr3, - ms.attr4, - ms.create_by, - ms.create_time, - ms.update_by, - ms.update_time, - ms.factory_code, - msd.prepare_id id, - msd.material_code, - msd.material_name, - msd.material_spc, - msd.unit, - msd.quantity - from mes_prepare ms,mes_prepare_detail msd + ms.workorder_name workorderCodeSap, + ow.workorder_code workorderCode, + ow.product_code productCode, + ow.product_name productName, + ow.product_date productDate, + ow.quantity_split quantity, + ow.unit + from mes_prepare ms + left join pro_order_workorder ow on ms.workorder_code = ow.workorder_code - and workorder_code like concat('%', #{workorderCode}, '%') - and workorder_name like concat('%', #{workorderName}, '%') - and parent_order = #{parentOrder} - and order_id like concat('%', #{orderId}, '%') - and order_code = #{orderCode} - and product_id = #{productId} - and product_code like concat('%', #{productCode}, '%') - and prod_type = #{prodType} - and product_name like concat('%', #{productName}, '%') - and product_spc = #{productSpc} - and wet_detail_plan_id = #{wetDetailPlanId} - and product_date = #{productDate} - and shift_id = #{shiftId} - and ancestors = #{ancestors} - and ms.status = #{status} - and factory_code = #{factoryCode} + ow.del_flag = '0' and ow.parent_order = '0' + and ow.workorder_code like concat('%', #{workorderCode}, '%') + and ms.workorder_name like concat('%', #{workorderCodeSap}, '%') + and ow.product_code like concat('%', #{productCode}, '%') + and ow.product_name like concat('%', #{productName}, '%') + and ow.product_date = #{productDate} and ms.del_flag = '0' + order by ow.product_date desc diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml index d93c44fc..6de815bf 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml @@ -57,4 +57,101 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" group by qctd.project_no,qctd.rule_name + + + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml index 861aa428..79ff3c66 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml @@ -24,8 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" qct.supplier_code supplierCode,qct.supplier_name supplierName, count(0) batchs,sum(qct.quality) nums from qc_check_task qct - left join qc_check_type qc on qc.order_code = qct.check_type - where qc.type_code = #{qc.typeCode} + where qct.type_code = #{qc.typeCode} and qct.del_flag = '0' and CONVERT(varchar(7),qct.income_time, 120) = #{qc.yearMonth} @@ -44,8 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" qct.supplier_code supplierCode,qct.supplier_name supplierName, sum(qct.noOk_quality) noOkNums from qc_check_task qct - left join qc_check_type qc on qc.order_code = qct.check_type - where qc.type_code = #{qc.typeCode} + where qct.type_code = #{qc.typeCode} and qct.del_flag = '0' and CONVERT(varchar(7),qct.income_time, 120) = #{qc.yearMonth} @@ -66,8 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" qct.cNoOkquality, qct.income_time from qc_check_task qct - left join qc_check_type qc on qc.order_code = qct.check_type - where qct.del_flag = '0' and qc.type_code = 'produce' + where qct.del_flag = '0' and qct.type_code = 'produce' and qct.material_code in (${materialCode}) and qct.supplier_code = #{workCenter} and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart} @@ -77,8 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select distinct qct.material_code materialCode, qct.material_name materialName from qc_check_task qct - left join qc_check_type qc on qc.order_code = qct.check_type - where qct.del_flag = '0' and qc.type_code = 'produce' + where qct.del_flag = '0' and qct.type_code = 'produce' and qct.material_code in (${materialCode}) and qct.supplier_code = #{workCenter} and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart} @@ -95,8 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sum(qct.cNoOkquality) cNoOkquality, CONVERT(varchar(7),qct.income_time, 120) incomeTime from qc_check_task qct - left join qc_check_type qc on qc.order_code = qct.check_type - where qct.del_flag = '0' and qc.type_code = 'produce' + where qct.del_flag = '0' and qct.type_code = 'produce' and qct.material_code in (${materialCode}) and qct.supplier_code = #{workCenter} and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart} From e3c8a23b7b2cc472336d94132fdf64bb92d01875 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 13 Dec 2023 22:01:36 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E7=94=B3=E9=A2=86=20?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EquSpareApplyServiceImpl.java | 75 +++++++++---------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java index f9a85cd9..8e17be26 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java @@ -86,48 +86,44 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService { @Override @DS("#header.poolName") public AjaxResult insertEquSpareApply(EquSpareApply equSpareApply) { - try { - //equSpareApply.getSpareApplyLists().size() 是在维修申领备件的时候进行的操作 批量新增 - if(equSpareApply.getSpareApplyLists().size() >= 1){ - List list = equSpareApply.getSpareApplyLists(); - for(EquSpareApply applyList:list){ - applyList.setApplyId(IdUtils.fastSimpleUUID()); - //生成领料单code //申领单号 - String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber()); - String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + applyList.getWorkCode().substring(2); - //申领单号 - equSpareApply.setApplyCode("AW" + code + serialNum); - //领用时间 - applyList.setApplyTime(DateUtils.getNowDate()); - //申领人 - applyList.setApplyPeople(SecurityUtils.getUsername()); - //工厂号 - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - String key = "#header.poolName"; - applyList.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); - //创建人、创建时间 - applyList.setCreateTime(DateUtils.getNowDate()); - applyList.setCreateBy(SecurityUtils.getUsername()); - equSpareApplyMapper.insertEquSpareApply(applyList); - //更新完备品申领单后,更新库存 - SparePartsLedger sparePartsLedger = new SparePartsLedger(); - sparePartsLedger.setStorageId(applyList.getStorageId()); - BigDecimal applyNum = applyList.getSpareQuantity(); - BigDecimal amount = applyList.getAmount(); - sparePartsLedger.setAmount(amount.subtract(applyNum)); - sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger); + if(equSpareApply.getSpareApplyLists() != null){ + List list = equSpareApply.getSpareApplyLists(); + for(EquSpareApply applyList:list){ + applyList.setApplyId(IdUtils.fastSimpleUUID()); + String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber()); + if(applyList.getWorkCode() != null){ + String code = applyList.getWorkCode(); + applyList.setApplyCode("AW" + code.substring(2) + serialNum); } - }else{ + //领用时间 + applyList.setApplyTime(DateUtils.getNowDate()); + //申领人 + applyList.setApplyPeople(SecurityUtils.getUsername()); + //工厂号 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + applyList.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); + //创建人、创建时间 + applyList.setCreateTime(DateUtils.getNowDate()); + applyList.setCreateBy(SecurityUtils.getUsername()); + equSpareApplyMapper.insertEquSpareApply(applyList); + //更新完备品申领单后,更新库存 + SparePartsLedger sparePartsLedger = new SparePartsLedger(); + sparePartsLedger.setStorageId(applyList.getStorageId()); + BigDecimal applyNum = applyList.getSpareQuantity(); + BigDecimal amount = applyList.getAmount(); + sparePartsLedger.setAmount(amount.subtract(applyNum)); + sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger); + } + }else if(equSpareApply.getSpareApplyLists() == null){ equSpareApply.setApplyId(IdUtils.fastSimpleUUID()); String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber()); - if(equSpareApply.getWorkCode().length() == 12){ - //生成领料单code 十五位单号 - equSpareApply.setApplyCode("A" + equSpareApply.getWorkCode() + serialNum); - }else if(equSpareApply.getWorkCode().length() > 12){ - equSpareApply.setApplyCode("AW" + equSpareApply.getWorkCode().substring(2) + serialNum); - }else{ + if(equSpareApply.getWorkCode() != null){ + String code = equSpareApply.getWorkCode(); + equSpareApply.setApplyCode("AW" + code.substring(2) + serialNum); + } else{ //普通申领单 - equSpareApply.setApplyCode("AN" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equSpareApply.getSpareUseEquipment() + serialNum); + equSpareApply.setApplyCode("AW" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equSpareApply.getSpareUseEquipment() + serialNum); } //领用时间 equSpareApply.setApplyTime(DateUtils.getNowDate()); @@ -151,9 +147,6 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService { sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger); } return success("新增申领记录成功!"); - } catch (Exception e) { - return error(); - } } /**