From 9f051a12773d96a1b46da7c90d5753829ac72db3 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Fri, 3 Nov 2023 18:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=B3=BB=E7=BB=9F=E6=8A=A5?= =?UTF-8?q?=E5=B7=A51.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/domain/device/EquEquipmentDTO.java | 450 ++++++++++++++ .../api/domain/mes/ProOrderWorkorderDTO.java | 576 ++++++++++++++++++ .../controller/MesReportWorkController.java | 21 + .../op/mes/mapper/MesReportWorkMapper.java | 11 + .../op/mes/service/IMesReportWorkService.java | 6 + .../impl/MesReportWorkServiceImpl.java | 42 +- .../mapper/mes/MesReportWorkMapper.xml | 69 ++- 7 files changed, 1173 insertions(+), 2 deletions(-) create mode 100644 op-api/op-api-system/src/main/java/com/op/system/api/domain/device/EquEquipmentDTO.java create mode 100644 op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/ProOrderWorkorderDTO.java diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/EquEquipmentDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/EquEquipmentDTO.java new file mode 100644 index 00000000..1cbb4b54 --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/EquEquipmentDTO.java @@ -0,0 +1,450 @@ +package com.op.system.api.domain.device; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 设备管理对象 base_equipment + * + * @author Open Platform + * @date 2023-10-17 + */ +public class EquEquipmentDTO extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 设备ID */ + private Long equipmentId; + + /** 设备编码 */ + @Excel(name = "设备编码") + private String equipmentCode; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String equipmentName; + + /** 品牌 */ + @Excel(name = "品牌") + private String equipmentBrand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String equipmentSpec; + + /** 设备类型ID */ + @Excel(name = "设备类型ID") + private Long equipmentTypeId; + + /** 设备类型编码 */ + @Excel(name = "设备类型编码") + private String equipmentTypeCode; + + /** 设备类型名称 */ + @Excel(name = "设备类型名称") + private String equipmentTypeName; + + /** 所属车间ID */ + @Excel(name = "所属车间ID") + private Long workshopId; + + /** 所属工作中心编码 */ + @Excel(name = "所属工作中心编码") + private String workshopCode; + + /** 所属工作中心名称 */ + @Excel(name = "所属工作中心名称") + private String workshopName; + + /** 设备状态,0异常 */ + @Excel(name = "设备状态,0异常") + private String status; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private Long attr3; + + /** 预留字段4 */ + @Excel(name = "预留字段4") + private Long attr4; + + /** 工段 */ + @Excel(name = "工段") + private String workshopSection; + + /** 设备位置 */ + @Excel(name = "设备位置") + private String equipmentLocation; + + /** 工时单价 */ + @Excel(name = "工时单价") + private Long hourlyUnitPrice; + + /** 设备条码 */ + @Excel(name = "设备条码") + private String equipmentBarcode; + + /** 设备条码图片 */ + @Excel(name = "设备条码图片") + private String equipmentBarcodeImage; + + /** 生产厂商 */ + @Excel(name = "生产厂商") + private String manufacturer; + + /** 供应商 */ + @Excel(name = "供应商") + private String supplier; + + /** 使用寿命 */ + @Excel(name = "使用寿命") + private String useLife; + + /** 购买时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "购买时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date buyTime; + + /** 资产原值 */ + @Excel(name = "资产原值") + private String assetOriginalValue; + + /** 资产净值 */ + @Excel(name = "资产净值") + private String netAssetValue; + + /** 资产负责人 */ + @Excel(name = "资产负责人") + private String assetHead; + + /** 固定资产编码 */ + @Excel(name = "固定资产编码") + private String fixedAssetCode; + + /** 部门 */ + @Excel(name = "部门") + private String department; + + /** 单台能力工时 */ + @Excel(name = "单台能力工时") + private String unitWorkingHours; + + /** PLCIP */ + @Excel(name = "PLCIP") + private String plcIp; + + /** PLC端口 */ + @Excel(name = "PLC端口") + private Long plcPort; + + /** 删除标志1删除,0正常 */ + private String delFlag; + + /** SAP资产号 */ + @Excel(name = "SAP资产号") + private String sapAsset; + + public void setEquipmentId(Long equipmentId) { + this.equipmentId = equipmentId; + } + + public Long getEquipmentId() { + return equipmentId; + } + public void setEquipmentCode(String equipmentCode) { + this.equipmentCode = equipmentCode; + } + + public String getEquipmentCode() { + return equipmentCode; + } + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentName() { + return equipmentName; + } + public void setEquipmentBrand(String equipmentBrand) { + this.equipmentBrand = equipmentBrand; + } + + public String getEquipmentBrand() { + return equipmentBrand; + } + public void setEquipmentSpec(String equipmentSpec) { + this.equipmentSpec = equipmentSpec; + } + + public String getEquipmentSpec() { + return equipmentSpec; + } + public void setEquipmentTypeId(Long equipmentTypeId) { + this.equipmentTypeId = equipmentTypeId; + } + + public Long getEquipmentTypeId() { + return equipmentTypeId; + } + public void setEquipmentTypeCode(String equipmentTypeCode) { + this.equipmentTypeCode = equipmentTypeCode; + } + + public String getEquipmentTypeCode() { + return equipmentTypeCode; + } + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + public void setWorkshopId(Long workshopId) { + this.workshopId = workshopId; + } + + public Long getWorkshopId() { + return workshopId; + } + public void setWorkshopCode(String workshopCode) { + this.workshopCode = workshopCode; + } + + public String getWorkshopCode() { + return workshopCode; + } + public void setWorkshopName(String workshopName) { + this.workshopName = workshopName; + } + + public String getWorkshopName() { + return workshopName; + } + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + 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(Long attr3) { + this.attr3 = attr3; + } + + public Long getAttr3() { + return attr3; + } + public void setAttr4(Long attr4) { + this.attr4 = attr4; + } + + public Long getAttr4() { + return attr4; + } + public void setWorkshopSection(String workshopSection) { + this.workshopSection = workshopSection; + } + + public String getWorkshopSection() { + return workshopSection; + } + public void setEquipmentLocation(String equipmentLocation) { + this.equipmentLocation = equipmentLocation; + } + + public String getEquipmentLocation() { + return equipmentLocation; + } + public void setHourlyUnitPrice(Long hourlyUnitPrice) { + this.hourlyUnitPrice = hourlyUnitPrice; + } + + public Long getHourlyUnitPrice() { + return hourlyUnitPrice; + } + public void setEquipmentBarcode(String equipmentBarcode) { + this.equipmentBarcode = equipmentBarcode; + } + + public String getEquipmentBarcode() { + return equipmentBarcode; + } + public void setEquipmentBarcodeImage(String equipmentBarcodeImage) { + this.equipmentBarcodeImage = equipmentBarcodeImage; + } + + public String getEquipmentBarcodeImage() { + return equipmentBarcodeImage; + } + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturer() { + return manufacturer; + } + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + public String getSupplier() { + return supplier; + } + public void setUseLife(String useLife) { + this.useLife = useLife; + } + + public String getUseLife() { + return useLife; + } + public void setBuyTime(Date buyTime) { + this.buyTime = buyTime; + } + + public Date getBuyTime() { + return buyTime; + } + public void setAssetOriginalValue(String assetOriginalValue) { + this.assetOriginalValue = assetOriginalValue; + } + + public String getAssetOriginalValue() { + return assetOriginalValue; + } + public void setNetAssetValue(String netAssetValue) { + this.netAssetValue = netAssetValue; + } + + public String getNetAssetValue() { + return netAssetValue; + } + public void setAssetHead(String assetHead) { + this.assetHead = assetHead; + } + + public String getAssetHead() { + return assetHead; + } + public void setFixedAssetCode(String fixedAssetCode) { + this.fixedAssetCode = fixedAssetCode; + } + + public String getFixedAssetCode() { + return fixedAssetCode; + } + public void setDepartment(String department) { + this.department = department; + } + + public String getDepartment() { + return department; + } + public void setUnitWorkingHours(String unitWorkingHours) { + this.unitWorkingHours = unitWorkingHours; + } + + public String getUnitWorkingHours() { + return unitWorkingHours; + } + public void setPlcIp(String plcIp) { + this.plcIp = plcIp; + } + + public String getPlcIp() { + return plcIp; + } + public void setPlcPort(Long plcPort) { + this.plcPort = plcPort; + } + + public Long getPlcPort() { + return plcPort; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + public void setSapAsset(String sapAsset) { + this.sapAsset = sapAsset; + } + + public String getSapAsset() { + return sapAsset; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("equipmentId", getEquipmentId()) + .append("equipmentCode", getEquipmentCode()) + .append("equipmentName", getEquipmentName()) + .append("equipmentBrand", getEquipmentBrand()) + .append("equipmentSpec", getEquipmentSpec()) + .append("equipmentTypeId", getEquipmentTypeId()) + .append("equipmentTypeCode", getEquipmentTypeCode()) + .append("equipmentTypeName", getEquipmentTypeName()) + .append("workshopId", getWorkshopId()) + .append("workshopCode", getWorkshopCode()) + .append("workshopName", getWorkshopName()) + .append("status", getStatus()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("workshopSection", getWorkshopSection()) + .append("equipmentLocation", getEquipmentLocation()) + .append("hourlyUnitPrice", getHourlyUnitPrice()) + .append("equipmentBarcode", getEquipmentBarcode()) + .append("equipmentBarcodeImage", getEquipmentBarcodeImage()) + .append("manufacturer", getManufacturer()) + .append("supplier", getSupplier()) + .append("useLife", getUseLife()) + .append("buyTime", getBuyTime()) + .append("assetOriginalValue", getAssetOriginalValue()) + .append("netAssetValue", getNetAssetValue()) + .append("assetHead", getAssetHead()) + .append("fixedAssetCode", getFixedAssetCode()) + .append("department", getDepartment()) + .append("unitWorkingHours", getUnitWorkingHours()) + .append("plcIp", getPlcIp()) + .append("plcPort", getPlcPort()) + .append("delFlag", getDelFlag()) + .append("sapAsset", getSapAsset()) + .toString(); + } +} diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/ProOrderWorkorderDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/ProOrderWorkorderDTO.java new file mode 100644 index 00000000..3652eb5a --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/ProOrderWorkorderDTO.java @@ -0,0 +1,576 @@ +package com.op.system.api.domain.mes; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.TreeEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; +import java.util.List; + +/** + * 生产工单对象 pro_order_workorder + * + * @author Open Platform + * @date 2023-07-18 + */ +public class ProOrderWorkorderDTO extends TreeEntity { + private static final long serialVersionUID = 1L; + + /** 工单ID */ + private String workorderId; + + /** 工单编码 */ + @Excel(name = "子工单编号") + private String workorderCode; + + /** 工单名称 */ + private String workorderName; + + /** 订单id */ + private String orderId; + + /** 订单编码 */ + @Excel(name = "子订单编码") + private String orderCode; + + /** 产品ID */ + private String productId; + + /** 产品编号 */ + @Excel(name = "产品编码") + private String productCode; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 规格型号 */ + private String productSpc; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 已生产数量 */ + @Excel(name = "已生产数量") + private Long quantityProduced; + + /** 已拆分数量 */ + @Excel(name = "已拆分数量") + private Long quantitySplit; + + /** 工艺编码 */ + @Excel(name = "工艺编码") + private String routeCode; + + // 工艺名称 + private String routeName; + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + /** 产线编码 */ + @Excel(name = "线体") + private String prodLineCode; + + private String[][] prodLineCodeArray; + + // TODO 暂时存放线体编码 + private String prodLineName; + + public String getProdLineName() { + return prodLineName; + } + + public void setProdLineName(String prodLineName) { + this.prodLineName = prodLineName; + } + + /** 工单生产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "工单生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productDate; + + // 工单生产日期开始 + private String productDateStart; + + // 工单生产日期结束 + private String productDateEnd; + /** 班次 */ + @Excel(name = "班次",readConverterExp = "2=夜班,5=白班") + private String shiftId; + private String shiftName; + + /** 父工单 */ + private String parentOrder; + + /** 所有父节点ID */ + private String ancestors; + + /** 单据状态 */ + @Excel(name = "工单状态",readConverterExp = "w0=未派发,w1=排队,w2=活动,w3=报工") + private String status; + private String statusArray; + /** 预留字段1 */ + private String attr1; + + /** 预留字段2 */ + private String attr2; + + /** 预留字段3 */ + private String attr3; + + /** 预留字段4 */ + private String attr4; + + /** 产品类型 */ + @Excel(name = "产品类型",readConverterExp = "white=白坯,prod=成品") + private String prodType; + + /** 是否为底层节点 1是 0不是 */ + private Integer endFlag; + + public Integer getEndFlag() { + return endFlag; + } + + public void setEndFlag(Integer endFlag) { + this.endFlag = endFlag; + } + + /** 班次名称(数据库无该字段,需自行查询) */ + private String shiftDesc; + + // 车数 + private Integer carNum; + private Integer sortNo; + + public Integer getCarNum() { + return carNum; + } + + public void setCarNum(Integer carNum) { + this.carNum = carNum; + } + + // 料罐id(湿料计划模块使用) + private Integer bucketId; + + // 料罐编码(湿料计划模块使用) + private String bucketCode; + + // 物料id(湿料计划模块使用) + private Integer materialId; + + // 物料编码(湿料计划模块使用) + private String materialCode; + + // 物料名称(湿料计划模块使用) + private String materialName; + // 供湿料计划使用 + private String materialName1; + + // 计划日期(湿料计划模块使用) + private Date planTime; + + // 料罐名称(湿料计划模块使用) + private String bucketName; + // 供湿料计划使用 + private String bucketName1; + + public String getMaterialName1() { + return materialName1; + } + + public void setMaterialName1(String materialName1) { + this.materialName1 = materialName1; + } + + public String getBucketName1() { + return bucketName1; + } + + public void setBucketName1(String bucketName1) { + this.bucketName1 = bucketName1; + } + + private String prepareId; + + private String workorderCodeSap; + + public String getWorkorderCodeSap() { + return workorderCodeSap; + } + + public void setWorkorderCodeSap(String workorderCodeSap) { + this.workorderCodeSap = workorderCodeSap; + } + + public String getPrepareId() { + return prepareId; + } + + public void setPrepareId(String prepareId) { + this.prepareId = prepareId; + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public Integer getBucketId() { + return bucketId; + } + + public void setBucketId(Integer bucketId) { + this.bucketId = bucketId; + } + + public String getBucketCode() { + return bucketCode; + } + + public void setBucketCode(String bucketCode) { + this.bucketCode = bucketCode; + } + + public Integer getMaterialId() { + return materialId; + } + + public void setMaterialId(Integer materialId) { + this.materialId = materialId; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public Date getPlanTime() { + return planTime; + } + + public void setPlanTime(Date planTime) { + this.planTime = planTime; + } + + public String getShiftDesc() { + return shiftDesc; + } + + public void setShiftDesc(String shiftDesc) { + this.shiftDesc = shiftDesc; + } + + /** 批次号 */ + private List batchCodeList; + + public List getBatchCodeList() { + return batchCodeList; + } + + public void setBatchCodeList(List batchCodeList) { + this.batchCodeList = batchCodeList; + } + + /** $column.columnComment */ + private String factoryCode; + + public void setWorkorderId(String workorderId) { + this.workorderId = workorderId; + } + + public String getWorkorderId() { + return workorderId; + } + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + public String getWorkorderCode() { + return workorderCode; + } + public void setWorkorderName(String workorderName) { + this.workorderName = workorderName; + } + + public String getWorkorderName() { + return workorderName; + } + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public String getOrderId() { + return orderId; + } + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getOrderCode() { + return orderCode; + } + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductId() { + return productId; + } + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductCode() { + return productCode; + } + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductName() { + return productName; + } + public void setProductSpc(String productSpc) { + this.productSpc = productSpc; + } + + public String getProductSpc() { + return productSpc; + } + public void setUnit(String unit) { + this.unit = unit; + } + + public String getUnit() { + return unit; + } + public void setQuantityProduced(Long quantityProduced) { + this.quantityProduced = quantityProduced; + } + + public Long getQuantityProduced() { + return quantityProduced; + } + public void setQuantitySplit(Long quantitySplit) { + this.quantitySplit = quantitySplit; + } + + public Long getQuantitySplit() { + return quantitySplit; + } + public void setRouteCode(String routeCode) { + this.routeCode = routeCode; + } + + public String getRouteCode() { + return routeCode; + } + public void setProdLineCode(String prodLineCode) { + this.prodLineCode = prodLineCode; + } + + public String getProdLineCode() { + return prodLineCode; + } + public void setProductDate(Date productDate) { + this.productDate = productDate; + } + + public Date getProductDate() { + return productDate; + } + public void setShiftId(String shiftId) { + this.shiftId = shiftId; + } + + public String getShiftId() { + return shiftId; + } + public void setParentOrder(String parentOrder) { + this.parentOrder = parentOrder; + } + + public String getParentOrder() { + return parentOrder; + } + public void setAncestors(String ancestors) { + this.ancestors = ancestors; + } + + public String getStatusArray() { + return statusArray; + } + + public void setStatusArray(String statusArray) { + this.statusArray = statusArray; + } + + public String getAncestors() { + return ancestors; + } + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + 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 setAttr4(String attr4) { + this.attr4 = attr4; + } + + public String getAttr4() { + return attr4; + } + public void setProdType(String prodType) { + this.prodType = prodType; + } + + public String getProdType() { + return prodType; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + public String getProductDateStart() { + return productDateStart; + } + + public void setProductDateStart(String productDateStart) { + this.productDateStart = productDateStart; + } + + public String getProductDateEnd() { + return productDateEnd; + } + + public void setProductDateEnd(String productDateEnd) { + this.productDateEnd = productDateEnd; + } + + public String[][] getProdLineCodeArray() { + return prodLineCodeArray; + } + + public void setProdLineCodeArray(String[][] prodLineCodeArray) { + this.prodLineCodeArray = prodLineCodeArray; + } + + public Integer getSortNo() { + return sortNo; + } + + public void setSortNo(Integer sortNo) { + this.sortNo = sortNo; + } + + public String getShiftName() { + return shiftName; + } + + public void setShiftName(String shiftName) { + this.shiftName = shiftName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("workorderId", getWorkorderId()) + .append("workorderCode", getWorkorderCode()) + .append("workorderName", getWorkorderName()) + .append("orderId", getOrderId()) + .append("orderCode", getOrderCode()) + .append("productId", getProductId()) + .append("productCode", getProductCode()) + .append("productName", getProductName()) + .append("productSpc", getProductSpc()) + .append("unit", getUnit()) + .append("quantityProduced", getQuantityProduced()) + .append("quantitySplit", getQuantitySplit()) + .append("routeCode", getRouteCode()) + .append("prodLineCode", getProdLineCode()) + .append("productDate", getProductDate()) + .append("shiftId", getShiftId()) + .append("parentOrder", getParentOrder()) + .append("ancestors", getAncestors()) + .append("status", getStatus()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("prodType", getProdType()) + .append("factoryCode", getFactoryCode()) + .append("batchCodeList",getBatchCodeList()) + .append("endFlag",getEndFlag()) + .append("shiftDesc",getShiftDesc()) + .append("bucketId",getBucketId()) + .append("bucketCode",getBucketCode()) + .append("materialId",getMaterialId()) + .append("materialCode",getMaterialCode()) + .append("materialName",getMaterialName()) + .append("planTime",getPlanTime()) + .append("bucketName",getBucketName()) + .append("routeName",getRouteName()) + .append("prodLineName",getProdLineName()) + .append("carNum",getCarNum()) + .append("materialName1",getMaterialName1()) + .append("bucketName",getBucketName1()) + .toString(); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java index 2a381148..c553b752 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java @@ -15,6 +15,8 @@ import com.op.common.core.utils.uuid.IdUtils; import com.op.mes.domain.*; import com.op.mes.domain.dto.LineChartDto; import com.op.mes.domain.dto.SysFactoryDto; +import com.op.system.api.domain.SysUser; +import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import org.apache.commons.lang.StringUtils; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; @@ -303,6 +305,25 @@ public class MesReportWorkController extends BaseController { } } + /** + * 查询人员列表 + */ + @GetMapping("/getMesListUser") + public TableDataInfo getMesListUser(SysUser sysUser) { + startPage(); + List list = mesReportWorkService.getMesListUser(sysUser); + return getDataTable(list); + } + + /** + * 查询人员列表 + */ + @GetMapping("/getMesListWorkOrder") + public TableDataInfo getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO) { + startPage(); + List list = mesReportWorkService.getMesListWorkOrder(proOrderWorkorderDTO); + return getDataTable(list); + } public static void main(String args[]){ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:00:00"); diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java index 575ddcd8..ae5bd792 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java @@ -5,6 +5,9 @@ import java.util.Map; import com.op.mes.domain.*; import com.op.mes.domain.dto.SysFactoryDto; +import com.op.system.api.domain.SysUser; +import com.op.system.api.domain.device.EquEquipmentDTO; +import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; @@ -93,4 +96,12 @@ public interface MesReportWorkMapper { MesReportWork getProdResult(MesReportWork work); ProOrderWorkorder getOrderByCode(String workorderCode); + + List getMesListUser(SysUser sysUser); + + int getTodayMaxNum(MesReportWork mesReportWork); + + List getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO); + @MapKey("equipmentCode") + Map getEquipInfoByCodes(String substring); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java index 3a358882..5877ab8a 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java @@ -6,6 +6,8 @@ import java.util.List; import com.op.mes.domain.*; import com.op.mes.domain.dto.LineChartDto; import com.op.mes.domain.dto.SysFactoryDto; +import com.op.system.api.domain.SysUser; +import com.op.system.api.domain.mes.ProOrderWorkorderDTO; /** * 报工报表Service接口 @@ -77,4 +79,8 @@ public interface IMesReportWorkService { List getHourProductionList(MesHourReport mesHourReport); List getProShifts(); + + List getMesListUser(SysUser sysUser); + + List getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 40addf16..22b335cf 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -6,13 +6,18 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import com.alibaba.fastjson2.JSONArray; import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; import com.op.mes.domain.*; import com.op.mes.domain.dto.LineChartDto; import com.op.mes.domain.dto.LineChartSeriesDto; import com.op.mes.domain.dto.SysFactoryDto; import com.op.mes.service.IWCSInterfaceService; +import com.op.system.api.domain.SysUser; +import com.op.system.api.domain.device.EquEquipmentDTO; +import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.mes.mapper.MesReportWorkMapper; @@ -66,7 +71,12 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { @DS("#header.poolName") public int insertMesReportWork(MesReportWork mesReportWork) { mesReportWork.setCreateTime(DateUtils.getNowDate()); - iWCSInterfaceService.reportWork(mesReportWork); + R s = iWCSInterfaceService.reportWork(mesReportWork); + System.out.println("管理系统报工:"+s.getCode()+",message:"+s.getMsg()); + String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, mesReportWork.getFeedbackTime()); + int liushuiNum = mesReportWorkMapper.getTodayMaxNum(mesReportWork); + String liushuiStr = String.format("%04d", liushuiNum); + mesReportWork.setReportCode(bpDD+liushuiStr); return mesReportWorkMapper.insertMesReportWork(mesReportWork); } @@ -303,6 +313,36 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { return mesReportWorkMapper.selectProShift(); } + @Override + @DS("master") + public List getMesListUser(SysUser sysUser) { + return mesReportWorkMapper.getMesListUser(sysUser); + } + + @Override + @DS("#header.poolName") + public List getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO) { + List dtos = mesReportWorkMapper.getMesListWorkOrder(proOrderWorkorderDTO); + for(ProOrderWorkorderDTO dto:dtos){ + StringBuilder prodLineName = new StringBuilder(""); + StringBuilder equipCods = new StringBuilder("'"); + JSONArray codeArray = JSONArray.parseArray(dto.getProdLineCode()); + for(int c=0;c equipMap = mesReportWorkMapper.getEquipInfoByCodes(equipCods.substring(1));//设备字典 + for (int c = 0; c < codeArray.size(); c++) { + String equipCode = codeArray.getJSONArray(c).getString(1); + prodLineName.append(equipMap.get(equipCode).getEquipmentName()+ ","); + } + dto.setProdLineCode(prodLineName.toString()); + } + return dtos; + } + + public static void main(String[] args) { Calendar calendar = Calendar.getInstance(); Date now = calendar.getTime(); 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 995453ab..b15b612d 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 @@ -38,7 +38,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, report_type, report_code, workorder_code, product_code, product_name, spec, unit, quantity, quantity_feedback, quantity_qualified, @@ -348,6 +382,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quantity_split quantitySplit from pro_order_workorder where workorder_code = #{workorderCode} + + + + insert into mes_report_work