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 bce69c032..fbb07ad1f 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/controller/EquOperationController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquOperationController.java new file mode 100644 index 000000000..ca85f185e --- /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 026a10b6a..3cd95dbb0 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/EquCheckItem.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquCheckItem.java index 7afc7db7f..3063c2cae 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquCheckItem.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquCheckItem.java @@ -30,7 +30,7 @@ public class EquCheckItem extends BaseEntity { private String itemName; /** 检查项方法/工具 */ - @Excel(name = "检查项方法/工具") + @Excel(name = "检查项方法") private String itemMethod; /** 维护类型编码 */ @@ -50,19 +50,15 @@ public class EquCheckItem extends BaseEntity { private String factoryCode; /** 备用字段1 */ - @Excel(name = "备用字段1") private String attr1; /** 备用字段2 */ - @Excel(name = "备用字段2") private String attr2; /** 备用字段3 */ - @Excel(name = "备用字段3") private String attr3; /** 删除标识 */ - @Excel(name = "删除标识") private String delFlag; /** 创建时间 */ @@ -96,12 +92,15 @@ public class EquCheckItem extends BaseEntity { private String updateTimeEnd; // 检查项工具 + @Excel(name = "检查项工具") private String itemTools; // 循环周期类型 + @Excel(name = "循环周期类型") private String itemLoopType; // 循环周期 + @Excel(name = "循环周期") private int itemLoop; public int getItemLoop() { 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 3b2755e8c..1be5b8dff 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/EquFaultType.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java index 0afa56733..c389e4dcb 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java @@ -41,19 +41,15 @@ public class EquFaultType extends BaseEntity { private String factoryCode; /** 备用字段1 */ - @Excel(name = "备用字段1") private String attr1; /** 备用字段2 */ - @Excel(name = "备用字段2") private String attr2; /** 备用字段3 */ - @Excel(name = "备用字段3") private String attr3; /** 删除标志 */ - @Excel(name = "删除标志") private String delFlag; // 创建日期范围list 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 000000000..dee5e7563 --- /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/EquPlan.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java index ea70141f1..c3e6c8ac0 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java @@ -31,19 +31,16 @@ public class EquPlan extends BaseEntity { private String planName; /** 车间 */ - @Excel(name = "车间") + @Excel(name = "车间编码") private String planWorkshop; /** 产线 */ - @Excel(name = "产线") private String planProdLine; /** 设备名称 */ - @Excel(name = "设备名称") private String equipmentName; /** 设备编码 */ - @Excel(name = "设备编码") private String equipmentCode; /** 循环周期 */ @@ -65,7 +62,6 @@ public class EquPlan extends BaseEntity { private Date planLoopEnd; /** 巡检人员 */ - @Excel(name = "巡检人员") private String planPerson; /** 计划状态 */ @@ -77,11 +73,9 @@ public class EquPlan extends BaseEntity { private String planRestrict; /** 维护类型 */ - @Excel(name = "维护类型") private String planType; /** 是否委外 */ - @Excel(name = "是否委外") private String planOutsource; /** 委外工单编码 */ @@ -93,19 +87,15 @@ public class EquPlan extends BaseEntity { private String factoryCode; /** 备用字段1 */ - @Excel(name = "备用字段1") private String attr1; /** 备用字段2 */ - @Excel(name = "备用字段2") private String attr2; /** 备用字段3 */ - @Excel(name = "备用字段3") private String attr3; /** 删除标志 */ - @Excel(name = "删除标志") private String delFlag; // 创建日期范围list @@ -136,12 +126,14 @@ public class EquPlan extends BaseEntity { private String workCenterName; // 保养类型 + @Excel(name = "保养类型") private String upkeep; // 计划保养时间计算规则 private String calculationRule; // 是否停机保养 + @Excel(name = "是否停机保养") private String shutDown; private String planEquId; @@ -157,12 +149,16 @@ public class EquPlan extends BaseEntity { private Date getLoopEndArrayEnd; + @Excel(name = "委外人员") private String workPerson; + @Excel(name = "委外单位") private String workOutsourcingUnit; + @Excel(name = "联系方式") private String workConnection; + @Excel(name = "委外原因") private String workReason; public String getWorkOutsourcingUnit() { diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java index e0d7c617f..843946fdc 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java @@ -139,6 +139,9 @@ public class EquRepairWorkOrder extends BaseEntity { /** 联系方式 */ private String workConnection; + /** 设备状态描述 */ + private String equipmentStatusDescription; + // 设备 /** 设备名称 */ @Excel(name = "设备名称") @@ -722,6 +725,14 @@ public class EquRepairWorkOrder extends BaseEntity { this.faultType = faultType; } + //设备状态描述 + public String getEquipmentStatusDescription() { + return equipmentStatusDescription; + } + public void setEquipmentStatusDescription(String equipmentStatusDescription) { + this.equipmentStatusDescription = equipmentStatusDescription; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 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 990c37450..652a68aa7 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/domain/SparePartsLedger.java b/op-modules/op-device/src/main/java/com/op/device/domain/SparePartsLedger.java index 1f4ea83a4..095351258 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/SparePartsLedger.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/SparePartsLedger.java @@ -203,6 +203,174 @@ public class SparePartsLedger extends BaseEntity { @Excel(name = "备件类型", readConverterExp = "备=件用") private String spareType; +//////////////////////////////////////////////////////////附属表 + + /** id */ + private String id; + + /** 主表备件编码 */ + @Excel(name = "主表备件编码") + private String primaryCode; + + /** 所属设备名称 */ + @Excel(name = "所属设备名称") + private String ownEquipmentName; + + /** 单机装配数量 */ + @Excel(name = "单机装配数量") + private String unitQuantity; + + /** 安全库存 */ + @Excel(name = "安全库存") + private String safeStock; + + /** 单价 */ + @Excel(name = "单价") + private BigDecimal unitPrice; + + /** 采购方式 */ + @Excel(name = "采购方式") + private String procurementMethod; + + /** 采购周期 */ + @Excel(name = "采购周期") + private String procurementCycle; + + /** 期初结存 */ + @Excel(name = "期初结存") + private String openingBalance; + + /** 出库记录 */ + @Excel(name = "出库记录") + private String outputRecords; + + /** 入库记录 */ + @Excel(name = "入库记录") + private String inputRecords; + + /** 期末盘点 */ + @Excel(name = "期末盘点") + private String endInventory; + + /** 期末金额 */ + @Excel(name = "期末金额") + private BigDecimal endMoney; + + /** 代用件 */ + @Excel(name = "代用件") + private String substituteParts; + + /** 所属设备编码 */ + @Excel(name = "所属设备编码") + private String ownEquipmentCode; + + public void setId(String id) { + this.id = id; + } + public String getId() { + return id; + } + + public void setPrimaryCode(String primaryCode) { + this.primaryCode = primaryCode; + } + public String getPrimaryCode() { + return primaryCode; + } + + public void setOwnEquipmentName(String ownEquipmentName) { + this.ownEquipmentName = ownEquipmentName; + } + public String getOwnEquipmentName() { + return ownEquipmentName; + } + + public void setUnitQuantity(String unitQuantity) { + this.unitQuantity = unitQuantity; + } + public String getUnitQuantity() { + return unitQuantity; + } + + public void setSafeStock(String safeStock) { + this.safeStock = safeStock; + } + public String getSafeStock() { + return safeStock; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setProcurementMethod(String procurementMethod) { + this.procurementMethod = procurementMethod; + } + public String getProcurementMethod() { + return procurementMethod; + } + + public void setProcurementCycle(String procurementCycle) { + this.procurementCycle = procurementCycle; + } + public String getProcurementCycle() { + return procurementCycle; + } + + public void setOpeningBalance(String openingBalance) { + this.openingBalance = openingBalance; + } + public String getOpeningBalance() { + return openingBalance; + } + + public void setOutputRecords(String outputRecords) { + this.outputRecords = outputRecords; + } + public String getOutputRecords() { + return outputRecords; + } + + public void setInputRecords(String inputRecords) { + this.inputRecords = inputRecords; + } + public String getInputRecords() { + return inputRecords; + } + + public void setEndInventory(String endInventory) { + this.endInventory = endInventory; + } + public String getEndInventory() { + return endInventory; + } + + public void setEndMoney(BigDecimal endMoney) { + this.endMoney = endMoney; + } + public BigDecimal getEndMoney() { + return endMoney; + } + + public void setSubstituteParts(String substituteParts) { + this.substituteParts = substituteParts; + } + public String getSubstituteParts() { + return substituteParts; + } + + public void setOwnEquipmentCode(String ownEquipmentCode) { + this.ownEquipmentCode = ownEquipmentCode; + } + public String getOwnEquipmentCode() { + return ownEquipmentCode; + } + + ///////////////////////////// + // 领用数量-保养备件领用使用 private BigDecimal applyNum; public BigDecimal getApplyNum() { 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 000000000..26e486e2f --- /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 2790b7cab..0e2a72971 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/mapper/EquEquipmentMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquEquipmentMapper.java index d293d8dbe..f2a179f3b 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 000000000..45f54f25c --- /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/IEquCheckItemService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquCheckItemService.java index b3df82679..1067bd780 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/IEquOperationService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquOperationService.java new file mode 100644 index 000000000..eb9514a94 --- /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 ed731a5b7..f199659bd 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/DevicePDAServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java index 77e4a4af4..6efcb059f 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 4d2e6c046..af72ccf5d 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/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 000000000..98e86d53e --- /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 80d081080..610eb572f 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/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java index 076051d48..a3bb4b662 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); 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 f9a85cd96..8e17be26e 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(); - } } /** 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 15da54108..c3f2095da 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" + SELECT + eci.item_type_name AS itemTypeName, + eci.item_name AS itemName, + eci.item_method AS itemMethod, + eci.item_tools AS itemTools, + eci.item_loop_type AS itemLoopType, + eci.item_loop AS itemLoop, + ecid.detail_id AS detailId, + ecid.standard_type AS standardType, + ecid.standard_name AS standardName + FROM equ_check_item eci + left join equ_check_item_detail ecid on eci.item_code = ecid.parent_code + where eci.del_flag = '0' + + + + + + \ No newline at end of file diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquEquipmentMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquEquipmentMapper.xml index 69bb6a855..fa2fe8c45 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquEquipmentMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquEquipmentMapper.xml @@ -45,10 +45,11 @@ + - select equipment_id, equipment_code, equipment_name, equipment_brand, equipment_spec, equipment_type_id, equipment_type_code, equipment_type_name, workshop_id, workshop_code, workshop_name, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, workshop_section, equipment_location, hourly_unit_price, equipment_barcode, equipment_barcode_image, manufacturer, supplier, use_life, buy_time, asset_original_value, net_asset_value, asset_head, fixed_asset_code, department, unit_working_hours, plc_ip, plc_port, del_flag, sap_asset from base_equipment + select equipment_id, equipment_code, equipment_name, equipment_brand, equipment_spec, equipment_type_id, equipment_type_code, equipment_type_name, workshop_id, workshop_code, workshop_name, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, workshop_section, equipment_location, hourly_unit_price, equipment_barcode, equipment_barcode_image, manufacturer, supplier, use_life, buy_time, asset_original_value, net_asset_value, asset_head, fixed_asset_code, department, unit_working_hours, plc_ip, plc_port, del_flag, sap_asset,equipment_category from base_equipment @@ -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 000000000..ac8d4e8d1 --- /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 diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml index 549eed372..0a0ab9fbc 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml @@ -74,7 +74,7 @@ and plan_loop_start = #{planLoopStart} and plan_loop_end = #{planLoopEnd} and order_start = #{orderStart} - and order_end = #{orderEnd} + and order_end = #{ord5erEnd} and order_status = #{orderStatus} and order_cost = #{orderCost} and plan_person like concat('%', #{planPerson}, '%') diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquRepairWorkOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquRepairWorkOrderMapper.xml index e62d33486..c814bafb0 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquRepairWorkOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquRepairWorkOrderMapper.xml @@ -41,6 +41,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -85,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code ,fault_type from equ_repair_work_order + select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code ,fault_type,equipment_status_description from equ_repair_work_order - + 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' diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesPrepareDetailMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesPrepareDetailMapper.java index dcf271f2e..141e92581 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesPrepareDetailMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesPrepareDetailMapper.java @@ -67,8 +67,8 @@ public interface MesPrepareDetailMapper { /** * 通过主领料单id查询领料详情list - * @param prepareId + * @param workorderCode * @return */ - List selectPrintPrepareDetailList(String prepareId); + List selectPrintPrepareDetailList(String workorderCode); } 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 b0921e1ce..a20c67ace 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); @@ -310,56 +310,64 @@ 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()); - this.reportHzToSap(pHzWork); - logger.info("==========================母工单报工结束"); - //最终报工标识:关闭子母工单 - MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork); - if("1".equals(endReport.getEndReport())){ - 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(); } + /** + * 子单进行报工的时候公式调整如下(数值单位不用管): + * 机器=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(); @@ -387,6 +395,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { } else { workOrder.setUploadStatus("2"); workOrder.setUploadMsg(r.getMsg()); + return r; } workOrder.setUploadTime(DateUtils.getNowDate()); mesReportWorkMapper.updateSyncSapStatus(workOrder); diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareDetailServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareDetailServiceImpl.java index fe9e92508..c4f01a1aa 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareDetailServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareDetailServiceImpl.java @@ -16,7 +16,7 @@ import com.op.mes.service.IMesPrepareDetailService; /** * mes备料单明细Service业务层处理 - * + * * @author Open Platform * @date 2023-08-04 */ @@ -29,7 +29,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService { /** * 查询mes备料单明细 - * + * * @param recordId mes备料单明细主键 * @return mes备料单明细 */ @@ -40,7 +40,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService { /** * 查询mes备料单明细列表 - * + * * @param mesPrepareDetail mes备料单明细 * @return mes备料单明细 */ @@ -51,7 +51,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService { /** * 新增mes备料单明细 - * + * * @param mesPrepareDetail mes备料单明细 * @return 结果 */ @@ -63,7 +63,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService { /** * 修改mes备料单明细 - * + * * @param mesPrepareDetail mes备料单明细 * @return 结果 */ @@ -75,7 +75,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService { /** * 批量删除mes备料单明细 - * + * * @param recordIds 需要删除的mes备料单明细主键 * @return 结果 */ @@ -86,7 +86,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService { /** * 删除mes备料单明细信息 - * + * * @param recordId mes备料单明细主键 * @return 结果 */ @@ -103,7 +103,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService { @DS("#header.poolName") public AjaxResult printPrepareByCode(String workorderCode) { MesPrepare mesPrepare = mesPrepareMapper.selectMesPrepareByCode(workorderCode); - List mesPrepareDetailList = mesPrepareDetailMapper.selectPrintPrepareDetailList(mesPrepare.getPrepareId()); + List mesPrepareDetailList = mesPrepareDetailMapper.selectPrintPrepareDetailList(workorderCode); PrintPrepareVo printPrepareVo = new PrintPrepareVo(); printPrepareVo.setMesPrepare(mesPrepare); printPrepareVo.setMesPrepareDetailList(mesPrepareDetailList); 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 1c7db9850..20656537f 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" - + @@ -63,12 +63,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where record_id = #{recordId} - + 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 9cfc64233..71e99649a 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-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 5c6c16309..d160f0473 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 @@ -466,14 +466,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select workorder_code_sap workorderCodeSap, workorder_code workorderCode from pro_order_workorder - where belong_work_order = #{workorderCode} and del_flag = '0' + where belong_work_order = #{workorderCode} and del_flag = '0' and status = 'w2' order by parent_order + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml index 25cb8c802..7e77b84b2 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml @@ -154,6 +154,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where powb.del_flag = '0' and pow.del_flag = '0' and pow.workorder_code = #{workorderCode} + insert into qc_check_task @@ -188,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" factory_code, del_flag, check_type, + type_code, #{recordId}, @@ -220,6 +224,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{factoryCode}, #{delFlag}, #{checkType}, + #{typeCode}, diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml index 7ff9ec49a..dca2af4f6 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml @@ -145,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" factory_code, del_flag, check_type, + type_code, #{recordId}, @@ -181,6 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{factoryCode}, #{delFlag}, #{checkType}, + #{typeCode}, diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskWarehousingMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskWarehousingMapper.xml index 6def797c1..9f4ebe86e 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskWarehousingMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskWarehousingMapper.xml @@ -128,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" factory_code, del_flag, check_type, + type_code, #{recordId}, @@ -159,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{factoryCode}, #{delFlag}, #{checkType}, + #{typeCode}, 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 f7f78a071..c62ff5845 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} + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml index 2d46fce69..f808da1ef 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml @@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from wms_raw_order_in wroi left join base_supplier bs on bs.supplier_code = wroi.supply_code where wroi.active_flag = '1' and wroi.quality_status = '0' - and wroi.order_no like contact like ('%',#{orderNo}) + and wroi.order_no like concat like ('%',#{orderNo}) 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 000000000..6de815bf6 --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcInterfaceMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + 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 861aa428b..79ff3c66f 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} 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 ab5604250..df89fef34 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" @@ -259,6 +262,7 @@ equipment_head, factory_code, equipment_status, + equipment_category, #{equipmentCode}, @@ -301,7 +305,8 @@ #{sapAsset}, #{equipmentHead}, #{factoryCode}, - equipmentStatus, + #{equipmentStatus}, + #{equipmentCategory}, @@ -349,6 +354,7 @@ equipment_head = #{equipmentHead}, factory_code = #{factoryCode}, equipment_status = #{equipmentStatus}, + equipment_category = #{equipmentCategory}, where equipment_id = #{equipmentId} @@ -575,4 +581,14 @@ where equipment_id = #{equipmentId} + + \ No newline at end of file