diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/BaseBomDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/BaseBomDTO.java index ee99bd0d..82d3b720 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/BaseBomDTO.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/BaseBomDTO.java @@ -96,6 +96,61 @@ public class BaseBomDTO extends BaseEntity { @Excel(name = "是否在用") private String currentVersion; + private String component; + private String componentName; + private String unit; + private String productGroup; + private String productGroupName; + private String productCode; + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public String getComponentName() { + return componentName; + } + + public void setComponentName(String componentName) { + this.componentName = componentName; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getProductGroup() { + return productGroup; + } + + public void setProductGroup(String productGroup) { + this.productGroup = productGroup; + } + + public String getProductGroupName() { + return productGroupName; + } + + public void setProductGroupName(String productGroupName) { + this.productGroupName = productGroupName; + } + private List children; public List getChildren() { diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/BaseProductDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/BaseProductDTO.java new file mode 100644 index 00000000..ca164f14 --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/BaseProductDTO.java @@ -0,0 +1,687 @@ +package com.op.system.api.domain.mes; + +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.math.BigDecimal; + +/** + * 物料管理 base_product + * + * @author JGY + * @date 2023-07-18 + */ +public class BaseProductDTO extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private String productId; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String productCode; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String productDescZh; + + /** 物料名称 */ + @Excel(name = "物料型号") + private String productModel; + + /** 英文描述 */ + @Excel(name = "英文描述") + private String productDescEn; + + /** 序列号规则代码 */ + @Excel(name = "序列号规则代码") + private String ruleCode; + + /** 旧物料号 */ + @Excel(name = "旧物料号") + private String oldProductCode; + + /** 散件物料号 */ + @Excel(name = "散件物料号") + private String partsProductCode; + + /** 69码 */ + @Excel(name = "69码") + private String skuBarcode; + + /** 长 */ + @Excel(name = "长") + private BigDecimal length; + + /** 宽 */ + @Excel(name = "宽") + private BigDecimal width; + + /** 高 */ + @Excel(name = "高") + private BigDecimal height; + + /** 毛重 */ + @Excel(name = "毛重") + private BigDecimal grossWeight; + + /** 净重 */ + @Excel(name = "净重") + private BigDecimal netWeight; + + /** 皮重 */ + @Excel(name = "皮重") + private BigDecimal tareWeight; + + /** 体积 */ + @Excel(name = "体积") + private BigDecimal volume; + + /** 单价 */ + @Excel(name = "单价") + private BigDecimal unitPrice; + + /** 物料组 */ + @Excel(name = "物料类别组") + private String productGroup; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String productGroupName; + + /** 用户自定义1 */ + @Excel(name = "用户自定义1") + private String userDefined1; + + /** 用户自定义2 */ + @Excel(name = "用户自定义2") + private String userDefined2; + + /** 用户自定义3 */ + @Excel(name = "用户自定义3") + private String userDefined3; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String userDefined4; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String userDefined5; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String userDefined6; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 激活标记 */ + @Excel(name = "激活标记") + private String activeFlag; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String syncFlag; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String primaryUom; + + /** $column.columnComment */ + private String delFlag; + + /** 订单单位 */ + @Excel(name = "订单单位") + private String bstme; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal basicOrder; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal convOrder; + + /** 发货单位 */ + @Excel(name = "发货单位") + private String ausme; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal basicIssue; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal convIssue; + + /** 是否补料(0否 */ + @Excel(name = "是否补料", readConverterExp = "是否补料(0否") + private String appendFlag; + + /** 补料比例 */ + @Excel(name = "补料比例") + private String appendPercent; + + /** 物料类型 */ + @Excel(name = "物料类型") + private String mtart; + + /** 品类 */ + @Excel(name = "品类") + private String category; + + /** 每PC单圈 */ + @Excel(name = "每PC单圈") + private String pc; + + /** 标准效率 */ + @Excel(name = "标准效率") + private BigDecimal iei; + + /** 标准用人 */ + @Excel(name = "标准用人") + private BigDecimal manStandar; + + /** 喷药方式 */ + @Excel(name = "喷药方式") + private String sprayWay; + + /** 白坯直径 */ + @Excel(name = "白坯直径") + private BigDecimal blankDiameter; + + /** 白坯物料号 */ + @Excel(name = "白坯物料号") + private String blankNo; + + /** 标准喷药量(KG/PC) */ + @Excel(name = "标准喷药量", readConverterExp = "K=G/PC") + private BigDecimal sprayVolume; + + /** 药液料号 */ + @Excel(name = "药液料号") + private String liquidNo; + + /** 标准内膜用量(KG/PC) */ + @Excel(name = "标准内膜用量", readConverterExp = "K=G/PC") + private BigDecimal endometrialDosage; + + /** 标准外模用量(KG/PC) */ + @Excel(name = "标准外模用量(KG/PC)") + private BigDecimal outerFilmDosage; + + /** 支架 */ + @Excel(name = "支架") + private Long support; + + /** 支架物料号 */ + @Excel(name = "支架物料号") + private String supportNo; + + /** 吸塑 */ + @Excel(name = "吸塑") + private Long pvc; + + /** 支架盘 */ + @Excel(name = "支架盘") + private Long supportPlate; + + /** 其它 */ + @Excel(name = "其它") + private String other; + + public void setCategory(String category) { + this.category = category; + } + + public String getCategory() { + return category; + } + public void setPc(String pc) { + this.pc = pc; + } + + public String getPc() { + return pc; + } + public void setIei(BigDecimal iei) { + this.iei = iei; + } + + public BigDecimal getIei() { + return iei; + } + public void setManStandar(BigDecimal manStandar) { + this.manStandar = manStandar; + } + + public BigDecimal getManStandar() { + return manStandar; + } + public void setSprayWay(String sprayWay) { + this.sprayWay = sprayWay; + } + + public String getSprayWay() { + return sprayWay; + } + public void setBlankDiameter(BigDecimal blankDiameter) { + this.blankDiameter = blankDiameter; + } + + public BigDecimal getBlankDiameter() { + return blankDiameter; + } + public void setBlankNo(String blankNo) { + this.blankNo = blankNo; + } + + public String getBlankNo() { + return blankNo; + } + public void setSprayVolume(BigDecimal sprayVolume) { + this.sprayVolume = sprayVolume; + } + + public BigDecimal getSprayVolume() { + return sprayVolume; + } + public void setLiquidNo(String liquidNo) { + this.liquidNo = liquidNo; + } + + public String getLiquidNo() { + return liquidNo; + } + public void setEndometrialDosage(BigDecimal endometrialDosage) { + this.endometrialDosage = endometrialDosage; + } + + public BigDecimal getEndometrialDosage() { + return endometrialDosage; + } + public void setOuterFilmDosage(BigDecimal outerFilmDosage) { + this.outerFilmDosage = outerFilmDosage; + } + + public BigDecimal getOuterFilmDosage() { + return outerFilmDosage; + } + public void setSupport(Long support) { + this.support = support; + } + + public Long getSupport() { + return support; + } + public void setSupportNo(String supportNo) { + this.supportNo = supportNo; + } + + public String getSupportNo() { + return supportNo; + } + public void setPvc(Long pvc) { + this.pvc = pvc; + } + + public Long getPvc() { + return pvc; + } + public void setSupportPlate(Long supportPlate) { + this.supportPlate = supportPlate; + } + + public Long getSupportPlate() { + return supportPlate; + } + public void setOther(String other) { + this.other = other; + } + + public String getOther() { + return other; + } + + 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 setProductDescZh(String productDescZh) { + this.productDescZh = productDescZh; + } + + public String getProductDescZh() { + return productDescZh; + } + + public void setProductModel(String productModel) { + this.productModel = productModel; + } + + public String getProductModel() { + return productModel; + } + public void setProductDescEn(String productDescEn) { + this.productDescEn = productDescEn; + } + + public String getProductDescEn() { + return productDescEn; + } + public void setRuleCode(String ruleCode) { + this.ruleCode = ruleCode; + } + + public String getRuleCode() { + return ruleCode; + } + public void setOldProductCode(String oldProductCode) { + this.oldProductCode = oldProductCode; + } + + public String getOldProductCode() { + return oldProductCode; + } + public void setPartsProductCode(String partsProductCode) { + this.partsProductCode = partsProductCode; + } + + public String getPartsProductCode() { + return partsProductCode; + } + public void setSkuBarcode(String skuBarcode) { + this.skuBarcode = skuBarcode; + } + + public String getSkuBarcode() { + return skuBarcode; + } + public void setLength(BigDecimal length) { + this.length = length; + } + + public BigDecimal getLength() { + return length; + } + public void setWidth(BigDecimal width) { + this.width = width; + } + + public BigDecimal getWidth() { + return width; + } + public void setHeight(BigDecimal height) { + this.height = height; + } + + public BigDecimal getHeight() { + return height; + } + public void setGrossWeight(BigDecimal grossWeight) { + this.grossWeight = grossWeight; + } + + public BigDecimal getGrossWeight() { + return grossWeight; + } + public void setNetWeight(BigDecimal netWeight) { + this.netWeight = netWeight; + } + + public BigDecimal getNetWeight() { + return netWeight; + } + public void setTareWeight(BigDecimal tareWeight) { + this.tareWeight = tareWeight; + } + + public BigDecimal getTareWeight() { + return tareWeight; + } + public void setVolume(BigDecimal volume) { + this.volume = volume; + } + + public BigDecimal getVolume() { + return volume; + } + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + public void setProductGroup(String productGroup) { + this.productGroup = productGroup; + } + + public String getProductGroup() { + return productGroup; + } + public void setProductGroupName(String productGroupName) { + this.productGroupName = productGroupName; + } + + public String getProductGroupName() { + return productGroupName; + } + public void setUserDefined1(String userDefined1) { + this.userDefined1 = userDefined1; + } + + public String getUserDefined1() { + return userDefined1; + } + public void setUserDefined2(String userDefined2) { + this.userDefined2 = userDefined2; + } + + public String getUserDefined2() { + return userDefined2; + } + public void setUserDefined3(String userDefined3) { + this.userDefined3 = userDefined3; + } + + public String getUserDefined3() { + return userDefined3; + } + public void setUserDefined4(String userDefined4) { + this.userDefined4 = userDefined4; + } + + public String getUserDefined4() { + return userDefined4; + } + public void setUserDefined5(String userDefined5) { + this.userDefined5 = userDefined5; + } + + public String getUserDefined5() { + return userDefined5; + } + public void setUserDefined6(String userDefined6) { + this.userDefined6 = userDefined6; + } + + public String getUserDefined6() { + return userDefined6; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + public void setActiveFlag(String activeFlag) { + this.activeFlag = activeFlag; + } + + public String getActiveFlag() { + return activeFlag; + } + public void setSyncFlag(String syncFlag) { + this.syncFlag = syncFlag; + } + + public String getSyncFlag() { + return syncFlag; + } + public void setPrimaryUom(String primaryUom) { + this.primaryUom = primaryUom; + } + + public String getPrimaryUom() { + return primaryUom; + } + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + public void setBstme(String bstme) { + this.bstme = bstme; + } + + public String getBstme() { + return bstme; + } + public void setBasicOrder(BigDecimal basicOrder) { + this.basicOrder = basicOrder; + } + + public BigDecimal getBasicOrder() { + return basicOrder; + } + public void setConvOrder(BigDecimal convOrder) { + this.convOrder = convOrder; + } + + public BigDecimal getConvOrder() { + return convOrder; + } + public void setAusme(String ausme) { + this.ausme = ausme; + } + + public String getAusme() { + return ausme; + } + public void setBasicIssue(BigDecimal basicIssue) { + this.basicIssue = basicIssue; + } + + public BigDecimal getBasicIssue() { + return basicIssue; + } + public void setConvIssue(BigDecimal convIssue) { + this.convIssue = convIssue; + } + + public BigDecimal getConvIssue() { + return convIssue; + } + public void setAppendFlag(String appendFlag) { + this.appendFlag = appendFlag; + } + + public String getAppendFlag() { + return appendFlag; + } + public void setAppendPercent(String appendPercent) { + this.appendPercent = appendPercent; + } + + public String getAppendPercent() { + return appendPercent; + } + + public void setMtart(String mtart) { + this.mtart = mtart; + } + + public String getMtart() { + return mtart; + } + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("productId", getProductId()) + .append("productCode", getProductCode()) + .append("productDescZh", getProductDescZh()) + .append("productDescEn", getProductDescEn()) + .append("ruleCode", getRuleCode()) + .append("oldProductCode", getOldProductCode()) + .append("partsProductCode", getPartsProductCode()) + .append("skuBarcode", getSkuBarcode()) + .append("length", getLength()) + .append("width", getWidth()) + .append("height", getHeight()) + .append("grossWeight", getGrossWeight()) + .append("netWeight", getNetWeight()) + .append("tareWeight", getTareWeight()) + .append("volume", getVolume()) + .append("unitPrice", getUnitPrice()) + .append("productGroup", getProductGroup()) + .append("productGroupName", getProductGroupName()) + .append("userDefined1", getUserDefined1()) + .append("userDefined2", getUserDefined2()) + .append("userDefined3", getUserDefined3()) + .append("userDefined4", getUserDefined4()) + .append("userDefined5", getUserDefined5()) + .append("userDefined6", getUserDefined6()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("activeFlag", getActiveFlag()) + .append("syncFlag", getSyncFlag()) + .append("primaryUom", getPrimaryUom()) + .append("delFlag", getDelFlag()) + .append("bstme", getBstme()) + .append("basicOrder", getBasicOrder()) + .append("convOrder", getConvOrder()) + .append("ausme", getAusme()) + .append("basicIssue", getBasicIssue()) + .append("convIssue", getConvIssue()) + .append("appendFlag", getAppendFlag()) + .append("appendPercent", getAppendPercent()) + .append("mtart", getMtart()) + .append("category", getCategory()) + .append("pc", getPc()) + .append("iei", getIei()) + .append("manStandar", getManStandar()) + .append("sprayWay", getSprayWay()) + .append("blankDiameter", getBlankDiameter()) + .append("blankNo", getBlankNo()) + .append("sprayVolume", getSprayVolume()) + .append("liquidNo", getLiquidNo()) + .append("endometrialDosage", getEndometrialDosage()) + .append("outerFilmDosage", getOuterFilmDosage()) + .append("support", getSupport()) + .append("supportNo", getSupportNo()) + .append("pvc", getPvc()) + .append("supportPlate", getSupportPlate()) + .append("other", getOther()) + .toString(); + } +} diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapRFW.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapRFW.java index e5100666..70b251f3 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapRFW.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapRFW.java @@ -42,7 +42,7 @@ public class SapRFW { } - public static class lt_gs + public class lt_gs { String conf_activity1; String conf_activity2; @@ -112,7 +112,7 @@ public class SapRFW { } } - public static class lt_hw{ + public class lt_hw{ String material; String entry_qnt; diff --git a/op-modules/op-mes/push-mes.bat b/op-modules/op-mes/push-mes.bat new file mode 100644 index 00000000..e95aae00 --- /dev/null +++ b/op-modules/op-mes/push-mes.bat @@ -0,0 +1,41 @@ +@echo off +echo --------------------------------Զǰ޸-------------------------------------- +set jarName=op-modules-mes.jar +set profile=dev +set imageURI=192.168.202.36:30002/op-lanju/op-mes +rem echo ȡǰַ +for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c +rem echo ȡǰʱַ +for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b +rem echo 統ǰСʱС10ո滻Ϊ0 +set T=%T: =0% +rem echo ʾʱַ +set imageVersion=%D%%T% +::Ϣ +echo jar:%jarName% +echo :%profile% +echo ַ:%imageURI% +echo 汾:%imageVersion% + +echo --------------------------------mvn package...-------------------------------- +::call mvn clean package -Dmaven.test.skip=true + +cd .\target +SET df=Dockerfile +if exist %df% ( + del /f /s /q .\Dockerfile +) +echo --------------------------------Dockerfile-------------------------------- +echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig +echo COPY %jarName% /application.jar >> Dockerfile +echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile +echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile +dir +echo --------------------------------docker login...------------------------------- +docker login 192.168.202.36:30002 -u deploy -p Deploy@2023 +echo --------------------------------docker build...------------------------------- +docker build -t %imageURI%:%imageVersion% . +echo --------------------------------docker push...-------------------------------- +docker push %imageURI%:%imageVersion% +@pause \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkConsumeController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkConsumeController.java index 9448e5cb..4794e870 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkConsumeController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkConsumeController.java @@ -4,6 +4,8 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.op.common.core.utils.uuid.IdUtils; +import com.op.system.api.domain.dto.BaseBomDTO; +import com.op.system.api.domain.mes.BaseProductDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -25,7 +27,7 @@ import com.op.common.core.web.page.TableDataInfo; /** * 生产报工物料消耗Controller - * + * * @author Open Platform * @date 2023-08-24 */ @@ -38,7 +40,7 @@ public class MesReportWorkConsumeController extends BaseController { /** * 查询生产报工物料消耗列表 */ - @RequiresPermissions("mes:reportWorkConsume:list") + //@RequiresPermissions("mes:reportWorkConsume:list") @GetMapping("/list") public TableDataInfo list(MesReportWorkConsume mesReportWorkConsume) { startPage(); @@ -49,7 +51,7 @@ public class MesReportWorkConsumeController extends BaseController { /** * 导出生产报工物料消耗列表 */ - @RequiresPermissions("mes:reportWorkConsume:export") + //@RequiresPermissions("mes:reportWorkConsume:export") @Log(title = "生产报工物料消耗", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, MesReportWorkConsume mesReportWorkConsume) { @@ -61,7 +63,7 @@ public class MesReportWorkConsumeController extends BaseController { /** * 获取生产报工物料消耗详细信息 */ - @RequiresPermissions("mes:reportWorkConsume:query") + //@RequiresPermissions("mes:reportWorkConsume:query") @GetMapping(value = "/{recordId}") public AjaxResult getInfo(@PathVariable("recordId") String recordId) { return success(mesReportWorkConsumeService.selectMesReportWorkConsumeByRecordId(recordId)); @@ -70,18 +72,17 @@ public class MesReportWorkConsumeController extends BaseController { /** * 新增生产报工物料消耗 */ - @RequiresPermissions("mes:reportWorkConsume:add") + //@RequiresPermissions("mes:reportWorkConsume:add") @Log(title = "生产报工物料消耗", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody MesReportWorkConsume mesReportWorkConsume) { - mesReportWorkConsume.setRecordId(IdUtils.fastSimpleUUID()); return toAjax(mesReportWorkConsumeService.insertMesReportWorkConsume(mesReportWorkConsume)); } /** * 修改生产报工物料消耗 */ - @RequiresPermissions("mes:reportWorkConsume:edit") + //@RequiresPermissions("mes:reportWorkConsume:edit") @Log(title = "生产报工物料消耗", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MesReportWorkConsume mesReportWorkConsume) { @@ -91,7 +92,7 @@ public class MesReportWorkConsumeController extends BaseController { /** * 删除生产报工物料消耗 */ - @RequiresPermissions("mes:reportWorkConsume:remove") + //@RequiresPermissions("mes:reportWorkConsume:remove") @Log(title = "生产报工物料消耗", businessType = BusinessType.DELETE) @DeleteMapping("/{recordIds}") public AjaxResult remove(@PathVariable String[] recordIds) { @@ -108,4 +109,14 @@ public class MesReportWorkConsumeController extends BaseController { List list = mesReportWorkConsumeService.selectMesReportWorkConsumeList(mesReportWorkConsume); return getDataTable(list); } + + /** + * 查询BOM物料管理列表 + */ + @GetMapping("/getMesListBom") + public TableDataInfo getMesListBom(BaseBomDTO dto) { + startPage(); + List list = mesReportWorkConsumeService.getMesListBom(dto); + return getDataTable(list); + } } 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 c553b752..f2c6b4da 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 @@ -9,6 +9,7 @@ import java.util.*; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import com.op.common.core.domain.ExcelCol; +import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.common.core.utils.uuid.IdUtils; @@ -16,6 +17,7 @@ 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.device.EquEquipmentDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import org.apache.commons.lang.StringUtils; import org.apache.poi.xssf.streaming.SXSSFWorkbook; @@ -55,6 +57,15 @@ public class MesReportWorkController extends BaseController { @GetMapping("/list") public TableDataInfo list(MesReportWork mesReportWork) { startPage(); + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){ + mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start + LocalDate date = LocalDate.now(); + LocalDate dateEnd = date.plusDays(1); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + mesReportWork.setCreateTimeEnd(dateEndStr);//end + } List list = mesReportWorkService.selectMesReportWorkList(mesReportWork); return getDataTable(list); } @@ -66,6 +77,15 @@ public class MesReportWorkController extends BaseController { //@Log(title = "报工报表", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, MesReportWork mesReportWork) { + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){ + mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start + LocalDate date = LocalDate.now(); + LocalDate dateEnd = date.plusDays(1); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + mesReportWork.setCreateTimeEnd(dateEndStr);//end + } List list = mesReportWorkService.selectMesReportWorkList(mesReportWork); ExcelUtil util = new ExcelUtil(MesReportWork.class); util.exportExcel(response, list, "报工报表数据"); @@ -101,6 +121,15 @@ public class MesReportWorkController extends BaseController { return toAjax(mesReportWorkService.updateMesReportWork(mesReportWork)); } + /** + * 报工 + */ + @RequiresPermissions("mes:reportWork:edit") + @PutMapping("/reportSap") + public R reportSap(@RequestBody MesReportWork mesReportWork) { + return mesReportWorkService.reportSap(mesReportWork); + } + /** * 删除报工报表 */ @@ -316,7 +345,7 @@ public class MesReportWorkController extends BaseController { } /** - * 查询人员列表 + * 查询工单列表 */ @GetMapping("/getMesListWorkOrder") public TableDataInfo getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO) { @@ -325,6 +354,17 @@ public class MesReportWorkController extends BaseController { return getDataTable(list); } + /** + * 查询工线体列表 + */ + @GetMapping("/getMesListEquip") + public TableDataInfo getMesListEquip(EquEquipmentDTO equEquipmentDTO) { + startPage(); + List list = mesReportWorkService.getMesListEquip(equEquipmentDTO); + return getDataTable(list); + } + + public static void main(String args[]){ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:00:00"); try { diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java index 478b2352..0f9e9ade 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java @@ -20,14 +20,14 @@ public class MesReportWork extends BaseEntity { /** 记录id */ private String id; - /** 报工类型,报工类型:SELF自行报工、UNI统一报工 */ - @Excel(name = "报工类型,报工类型:SELF自行报工、UNI统一报工") - private String reportType; - /** 报工单编号 */ @Excel(name = "报工单编号") private String reportCode; + /** 报工类型,报工类型:SELF自行报工、UNI统一报工 */ + @Excel(name = "报工类型,报工类型:SELF上位机报工、UNI系统报工") + private String reportType; + /** 生产工单编码 */ @Excel(name = "生产工单编码") private String workorderCode; @@ -57,11 +57,11 @@ public class MesReportWork extends BaseEntity { private BigDecimal quantityFeedback; /** 合格数量 */ - @Excel(name = "合格数量") + //@Excel(name = "合格数量") private BigDecimal quantityQualified; /** 不合格数量 */ - @Excel(name = "不合格数量") + //@Excel(name = "不合格数量") private BigDecimal quantityUnqualified; /** 报工人员 */ @@ -73,7 +73,7 @@ public class MesReportWork extends BaseEntity { private String nickName; /** 报工途径:PAD、MOBILE、PC */ - @Excel(name = "报工途径:PAD、MOBILE、PC") + //@Excel(name = "报工途径:PAD、MOBILE、PC") private String feedbackChannel; /** 报工时间 */ @@ -109,20 +109,27 @@ public class MesReportWork extends BaseEntity { @Excel(name = "班次编码") private String shiftCode; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "SAP报工时间") + private Date uploadTime; + @Excel(name = "SAP报工状态0待报工1成功2失败") + private String uploadStatus; + @Excel(name = "SAP报工信息") + private String uploadMsg; /** 预留字段1 */ - @Excel(name = "预留字段1") + //@Excel(name = "预留字段1") private String attr1; /** 预留字段2 */ - @Excel(name = "预留字段2") + //@Excel(name = "预留字段2") private String attr2; /** 预留字段3 */ - @Excel(name = "预留字段3") + //@Excel(name = "预留字段3") private String attr3; /** 预留字段4 */ - @Excel(name = "预留字段4") + //@Excel(name = "预留字段4") private String attr4; @Excel(name = "计划生产日期") private String productDate; @@ -140,9 +147,6 @@ public class MesReportWork extends BaseEntity { private String factoryName; private String carCode; private String carName; - private Date uploadTime; - private String uploadStatus; - private String uploadMsg; private String workorderCodeSap; private String routeCode; private String sac1; @@ -152,6 +156,42 @@ public class MesReportWork extends BaseEntity { private String sac5; private String sac6; private String prodType; + private String createTimeStart; + private String createTimeEnd; + private String feedbackTimeStart; + private String feedbackTimeEnd; + + public String getFeedbackTimeStart() { + return feedbackTimeStart; + } + + public void setFeedbackTimeStart(String feedbackTimeStart) { + this.feedbackTimeStart = feedbackTimeStart; + } + + public String getFeedbackTimeEnd() { + return feedbackTimeEnd; + } + + public void setFeedbackTimeEnd(String feedbackTimeEnd) { + this.feedbackTimeEnd = feedbackTimeEnd; + } + + public String getCreateTimeStart() { + return createTimeStart; + } + + public void setCreateTimeStart(String createTimeStart) { + this.createTimeStart = createTimeStart; + } + + public String getCreateTimeEnd() { + return createTimeEnd; + } + + public void setCreateTimeEnd(String createTimeEnd) { + this.createTimeEnd = createTimeEnd; + } public String getProdType() { return prodType; diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java index daea4877..1113aea8 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java @@ -3,17 +3,18 @@ package com.op.mes.mapper; import java.util.List; import com.op.mes.domain.MesReportWorkConsume; +import com.op.system.api.domain.dto.BaseBomDTO; /** * 生产报工物料消耗Mapper接口 - * + * * @author Open Platform * @date 2023-08-24 */ public interface MesReportWorkConsumeMapper { /** * 查询生产报工物料消耗 - * + * * @param recordId 生产报工物料消耗主键 * @return 生产报工物料消耗 */ @@ -21,7 +22,7 @@ public interface MesReportWorkConsumeMapper { /** * 查询生产报工物料消耗列表 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 生产报工物料消耗集合 */ @@ -29,7 +30,7 @@ public interface MesReportWorkConsumeMapper { /** * 新增生产报工物料消耗 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 结果 */ @@ -37,7 +38,7 @@ public interface MesReportWorkConsumeMapper { /** * 修改生产报工物料消耗 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 结果 */ @@ -45,7 +46,7 @@ public interface MesReportWorkConsumeMapper { /** * 删除生产报工物料消耗 - * + * * @param recordId 生产报工物料消耗主键 * @return 结果 */ @@ -53,11 +54,13 @@ public interface MesReportWorkConsumeMapper { /** * 批量删除生产报工物料消耗 - * + * * @param recordIds 需要删除的数据主键集合 * @return 结果 */ public int deleteMesReportWorkConsumeByRecordIds(String[] recordIds); List selectMesReportWorkConsumeListById(MesReportWorkConsume mesReportWorkConsume); + + List getMesListBom(BaseBomDTO dto); } 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 ae5bd792..5d133a95 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 @@ -104,4 +104,6 @@ public interface MesReportWorkMapper { List getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO); @MapKey("equipmentCode") Map getEquipInfoByCodes(String substring); + + List getMesListEquip(EquEquipmentDTO qo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkConsumeService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkConsumeService.java index b60e9f5e..61b93cdd 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkConsumeService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkConsumeService.java @@ -2,17 +2,19 @@ package com.op.mes.service; import java.util.List; import com.op.mes.domain.MesReportWorkConsume; +import com.op.system.api.domain.dto.BaseBomDTO; +import com.op.system.api.domain.mes.BaseProductDTO; /** * 生产报工物料消耗Service接口 - * + * * @author Open Platform * @date 2023-08-24 */ public interface IMesReportWorkConsumeService { /** * 查询生产报工物料消耗 - * + * * @param recordId 生产报工物料消耗主键 * @return 生产报工物料消耗 */ @@ -28,7 +30,7 @@ public interface IMesReportWorkConsumeService { /** * 查询生产报工物料消耗列表 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 生产报工物料消耗集合 */ @@ -36,7 +38,7 @@ public interface IMesReportWorkConsumeService { /** * 新增生产报工物料消耗 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 结果 */ @@ -44,7 +46,7 @@ public interface IMesReportWorkConsumeService { /** * 修改生产报工物料消耗 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 结果 */ @@ -52,7 +54,7 @@ public interface IMesReportWorkConsumeService { /** * 批量删除生产报工物料消耗 - * + * * @param recordIds 需要删除的生产报工物料消耗主键集合 * @return 结果 */ @@ -60,9 +62,11 @@ public interface IMesReportWorkConsumeService { /** * 删除生产报工物料消耗信息 - * + * * @param recordId 生产报工物料消耗主键 * @return 结果 */ public int deleteMesReportWorkConsumeByRecordId(String recordId); + + public List getMesListBom(BaseBomDTO dto); } 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 5877ab8a..1fd73c96 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 @@ -3,10 +3,12 @@ package com.op.mes.service; import java.util.HashMap; import java.util.List; +import com.op.common.core.domain.R; 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.device.EquEquipmentDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; /** @@ -83,4 +85,7 @@ public interface IMesReportWorkService { List getMesListUser(SysUser sysUser); List getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO); + + List getMesListEquip(EquEquipmentDTO equEquipmentDTO); + R reportSap(MesReportWork mesReportWork); } 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 203a6c7a..6ee2091d 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 @@ -271,29 +271,33 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { @Override public R reportWork(MesReportWork mesReportWork) { - DynamicDataSourceContextHolder.push("ds_"+mesReportWork.getFactoryCode());// 这是数据源的key + if(StringUtils.isNotBlank(mesReportWork.getFactoryCode())){//已经加上ds_ + DynamicDataSourceContextHolder.push(mesReportWork.getFactoryCode());// 这是数据源的key + } + mesReportWork.setUploadStatus("1");//除了1报工成功的,都需要报工 mesReportWork.setProdType("prod"); List reportWorks = mesReportWorkMapper.getReportWorkList(mesReportWork); if(CollectionUtils.isEmpty(reportWorks)){ - return R.fail("未查询报工单"); + return R.fail("未查询到报工单"); } MesReportWork work = reportWorks.get(0); SapRFW sapRFW = new SapRFW(); sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号 sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量 - SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改 + SapRFW.lt_gs ltgs = sapRFW.new lt_gs();//生产订单报工工时修改 ltgs.setConf_activity1(work.getSac1());//人工 ltgs.setConf_activity2(work.getSac2()); ltgs.setConf_activity3(work.getSac3());//机器 ltgs.setConf_activity4(work.getSac4()); ltgs.setConf_activity5(work.getSac5());//折旧 ltgs.setConf_activity6(work.getSac6()); - SapRFW.lt_hw lthw = sapRFW.getLt_hw();//MES生产订单报工货物移动修改 + sapRFW.setLt_gs(ltgs); + SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改 lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; lthw.setMaterial(work.getProcessCode()); - + sapRFW.setLt_hw(lthw); //添加调用sap日志 SysSapLog sysSapLog = new SysSapLog(); sysSapLog.setId(IdUtils.fastSimpleUUID()); @@ -318,8 +322,8 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { ProOrderWorkorder topOrder = this.getTopOrder(work.getWorkorderCode()); if(proResult.getQuantityFeedback().compareTo(new BigDecimal(topOrder.getQuantitySplit()))>=0){ //工单完成,关闭工单 - remoteSapService.sapCloseOrder(work.getOrderCode()); - work.setStatus("w4"); + remoteSapService.sapCloseOrder(work.getWorkorderCodeSap()); + work.setStatus("w3"); work.setUpdateTime(DateUtils.getNowDate()); //pro_work_order status->w4报工 mesReportWorkMapper.updateWorkOrderStatus(work); diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkConsumeServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkConsumeServiceImpl.java index 875e24eb..06677fa3 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkConsumeServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkConsumeServiceImpl.java @@ -4,6 +4,9 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.system.api.domain.dto.BaseBomDTO; +import com.op.system.api.domain.mes.BaseProductDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.mes.mapper.MesReportWorkConsumeMapper; @@ -12,7 +15,7 @@ import com.op.mes.service.IMesReportWorkConsumeService; /** * 生产报工物料消耗Service业务层处理 - * + * * @author Open Platform * @date 2023-08-24 */ @@ -23,7 +26,7 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer /** * 查询生产报工物料消耗 - * + * * @param recordId 生产报工物料消耗主键 * @return 生产报工物料消耗 */ @@ -35,7 +38,7 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer /** * 查询生产报工物料消耗列表 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 生产报工物料消耗 */ @@ -59,20 +62,21 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer /** * 新增生产报工物料消耗 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 结果 */ @Override @DS("#header.poolName") public int insertMesReportWorkConsume(MesReportWorkConsume mesReportWorkConsume) { + mesReportWorkConsume.setRecordId(IdUtils.fastSimpleUUID()); mesReportWorkConsume.setCreateTime(DateUtils.getNowDate()); return mesReportWorkConsumeMapper.insertMesReportWorkConsume(mesReportWorkConsume); } /** * 修改生产报工物料消耗 - * + * * @param mesReportWorkConsume 生产报工物料消耗 * @return 结果 */ @@ -85,7 +89,7 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer /** * 批量删除生产报工物料消耗 - * + * * @param recordIds 需要删除的生产报工物料消耗主键 * @return 结果 */ @@ -97,7 +101,7 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer /** * 删除生产报工物料消耗信息 - * + * * @param recordId 生产报工物料消耗主键 * @return 结果 */ @@ -106,4 +110,12 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer public int deleteMesReportWorkConsumeByRecordId(String recordId) { return mesReportWorkConsumeMapper.deleteMesReportWorkConsumeByRecordId(recordId); } + + @Override + @DS("#header.poolName") + public List getMesListBom(BaseBomDTO dto) { + return mesReportWorkConsumeMapper.getMesListBom(dto); + } + + } 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 22b335cf..0a9a4707 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 @@ -8,8 +8,10 @@ import java.util.*; import com.alibaba.fastjson2.JSONArray; import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.constant.SecurityConstants; import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.ServletUtils; import com.op.mes.domain.*; import com.op.mes.domain.dto.LineChartDto; import com.op.mes.domain.dto.LineChartSeriesDto; @@ -18,6 +20,7 @@ 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.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.mes.mapper.MesReportWorkMapper; @@ -58,7 +61,32 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { @Override @DS("#header.poolName") public List selectMesReportWorkList(MesReportWork mesReportWork) { - return mesReportWorkMapper.selectMesReportWorkList(mesReportWork); + List dtos = mesReportWorkMapper.selectMesReportWorkList(mesReportWork); + for(MesReportWork dto:dtos){ + ProOrderWorkorder topOrder = this.getTopOrder(dto.getWorkorderCode()); + dto.setQuantity(new BigDecimal(topOrder.getQuantitySplit())); + dto.setUnit(topOrder.getUnit()); + if("1".equals(dto.getUploadStatus())){ + dto.setUploadStatus("sap报工成功"); + }else if("2".equals(dto.getUploadStatus())){ + dto.setUploadStatus("sap报工失败"); + }else if("0".equals(dto.getUploadStatus())){ + dto.setUploadStatus("待报工sap"); + } + } + + return dtos; + } + + //根据工单子单编码获取最顶级订单的母单 + private ProOrderWorkorder getTopOrder(String workorderCode) { + //pro_order_workorder + ProOrderWorkorder topOrder = mesReportWorkMapper.getOrderByCode(workorderCode); + while (!"0".equals(topOrder.getParentOrder()) && StringUtils.isNotEmpty(topOrder.getParentOrder())) { + //pro_order_workorder + topOrder = mesReportWorkMapper.getOrderByCode(topOrder.getParentOrder()); + } + return topOrder; } /** @@ -71,13 +99,27 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { @DS("#header.poolName") public int insertMesReportWork(MesReportWork mesReportWork) { mesReportWork.setCreateTime(DateUtils.getNowDate()); - 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); + mesReportWork.setProdType("prod"); + mesReportWorkMapper.insertMesReportWork(mesReportWork); +//新增的时候直接报工 +// mesReportWork.setFactoryCode(ServletUtils.getRequest().getHeader("PoolName")); +// R s = iWCSInterfaceService.reportWork(mesReportWork); +// System.out.println("管理系统报工:"+s.getCode()+",message:"+s.getMsg()); + return 1; + } + + @Override + @DS("#header.poolName") + public R reportSap(MesReportWork mesReportWork) { + mesReportWork.setFactoryCode(ServletUtils.getRequest().getHeader("PoolName")); + R s = iWCSInterfaceService.reportWork(mesReportWork); + //System.out.println("管理系统报工:"+s.getCode()+",message:"+s.getMsg()); + return s; } /** @@ -319,6 +361,12 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { return mesReportWorkMapper.getMesListUser(sysUser); } + @Override + @DS("#header.poolName") + public List getMesListEquip(EquEquipmentDTO qo) { + return mesReportWorkMapper.getMesListEquip(qo); + } + @Override @DS("#header.poolName") public List getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO) { @@ -338,11 +386,15 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { prodLineName.append(equipMap.get(equipCode).getEquipmentName()+ ","); } dto.setProdLineCode(prodLineName.toString()); + + //把母单的排产数量搞出来 + ProOrderWorkorder topOrder = this.getTopOrder(dto.getWorkorderCode()); + dto.setQuantitySplit(topOrder.getQuantitySplit()); + dto.setUnit(topOrder.getUnit()); } 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/MesReportWorkConsumeMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml index 37d1d449..2b003bf2 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml @@ -60,8 +60,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where record_id = #{recordId} + - + insert into mes_report_work_consume record_id, 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 b15b612d..291fe4f9 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 @@ -37,6 +37,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + @@ -79,40 +83,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quantity_unqualified, user_name, nick_name, feedback_channel, feedback_time, record_user, status, remark, work_time, machine_code, machine_name, team_code, shift_code, attr1, attr2, attr3, attr4, create_by, - create_time, update_time, update_by + create_time, update_time, update_by, + upload_time,upload_status,upload_msg from mes_report_work @@ -369,17 +375,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + insert into mes_report_work @@ -451,6 +465,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, update_time, update_by, + prod_type, #{id}, @@ -485,6 +500,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateTime}, #{updateBy}, + #{prodType}, @@ -528,22 +544,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update mes_report_work - upload_time = #{uploadTime}, + upload_time = #{uploadTime}, upload_status = #{uploadStatus}, upload_msg = #{uploadMsg}, - where id = #{id} + where 1=1 + + and id = #{id} + + + and report_code = #{reportCode} + update pro_order_workorder set status = #{status} where workorder_code = #{workorderCode} - delete from mes_report_work where id = #{id} + update mes_report_work set del_flag = '1' where id = #{id} - delete from mes_report_work where id in + update mes_report_work set del_flag = '1' where id in #{id} diff --git a/op-modules/op-plan/push-plan.bat b/op-modules/op-plan/push-plan.bat new file mode 100644 index 00000000..645c2921 --- /dev/null +++ b/op-modules/op-plan/push-plan.bat @@ -0,0 +1,41 @@ +@echo off +echo --------------------------------Զǰ޸-------------------------------------- +set jarName=op-modules-plan.jar +set profile=dev +set imageURI=192.168.202.36:30002/op-lanju/op-plan +rem echo ȡǰַ +for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c +rem echo ȡǰʱַ +for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b +rem echo 統ǰСʱС10ո滻Ϊ0 +set T=%T: =0% +rem echo ʾʱַ +set imageVersion=%D%%T% +::Ϣ +echo jar:%jarName% +echo :%profile% +echo ַ:%imageURI% +echo 汾:%imageVersion% + +echo --------------------------------mvn package...-------------------------------- +::call mvn clean package -Dmaven.test.skip=true + +cd .\target +SET df=Dockerfile +if exist %df% ( + del /f /s /q .\Dockerfile +) +echo --------------------------------Dockerfile-------------------------------- +echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig +echo COPY %jarName% /application.jar >> Dockerfile +echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile +echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile +dir +echo --------------------------------docker login...------------------------------- +docker login 192.168.202.36:30002 -u deploy -p Deploy@2023 +echo --------------------------------docker build...------------------------------- +docker build -t %imageURI%:%imageVersion% . +echo --------------------------------docker push...-------------------------------- +docker push %imageURI%:%imageVersion% +@pause \ No newline at end of file diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index bc6e778c..d81f148c 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -89,6 +89,8 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { for (ProOrderWorkorder workorder : workorderList) { String prodLineName = ""; String equipCods = "'"; + System.out.println("workorder_id:"+workorder.getWorkorderId()); + System.out.println("prodLineCode:"+workorder.getProdLineCode()); JSONArray codeArray = JSONArray.parseArray(workorder.getProdLineCode()); for (int c = 0; c < codeArray.size(); c++) { equipCods += codeArray.getJSONArray(c).getString(1) + "','"; diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java index ef97ae9f..0e624b7d 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java @@ -118,24 +118,6 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService { proOrder.setProdDesc(""); proWhiteOrderMapper.insertProOrder(proOrder); -// System.out.println("源code---->"+proOrder.getProdCode()); -// System.out.println("源desc---->"+proOrder.getProdDesc()); -// -// System.out.println("code---------->"); -// for (String code : prodCodes) { -// System.out.println(code); -// } -// System.out.println("desc----------->"); -// for (String desc : prodDescs) { -// System.out.println(desc); -// } -// -// System.out.println("这里是母订单信息"); -// System.out.println("母订单code"+proOrder.getOrderCode()); -// -// -// System.out.println("这里是子订单信息"); - // 设置子订单信息 for (int i = 0; i< prodCodes.length; i++){ @@ -161,9 +143,6 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService { childProOrder.setUpdateTime(DateUtils.getNowDate()); // 将子订单插入数据库 proWhiteOrderMapper.insertProOrder(childProOrder); - -// System.out.println("子订单code"+i+childProOrder.getOrderCode()); -// System.out.println("子订单parentCode"+i+childProOrder.getParentOrder()); } return 1; diff --git a/op-modules/op-quality/push-quality.bat b/op-modules/op-quality/push-quality.bat new file mode 100644 index 00000000..e53c0253 --- /dev/null +++ b/op-modules/op-quality/push-quality.bat @@ -0,0 +1,40 @@ +@echo off +echo --------------------------------Զǰ޸-------------------------------------- +set jarName=op-modules-quality.jar +set profile=dev +set imageURI=192.168.202.36:30002/op-lanju/op-quality +rem echo ȡǰַ +for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c +rem echo ȡǰʱַ +for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b +rem echo 統ǰСʱС10ո滻Ϊ0 +set T=%T: =0% +rem echo ʾʱַ +set imageVersion=%D%%T% +::Ϣ +echo jar:%jarName% +echo :%profile% +echo ַ:%imageURI% +echo 汾:%imageVersion% + +echo --------------------------------mvn package...-------------------------------- +::call mvn clean package -Dmaven.test.skip=true + +cd .\target +SET df=Dockerfile +if exist %df% ( + del /f /s /q .\Dockerfile +) +echo --------------------------------Dockerfile-------------------------------- +echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo COPY %jarName% /application.jar >> Dockerfile +echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile +echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile +dir +echo --------------------------------docker login...------------------------------- +docker login 192.168.202.36:30002 -u deploy -p Deploy@2023 +echo --------------------------------docker build...------------------------------- +docker build -t %imageURI%:%imageVersion% . +echo --------------------------------docker push...-------------------------------- +docker push %imageURI%:%imageVersion% +@pause \ No newline at end of file diff --git a/op-modules/op-system/src/main/java/com/op/system/mapper/SysDatasourceMapper.java b/op-modules/op-system/src/main/java/com/op/system/mapper/SysDatasourceMapper.java index a86c4f10..2c444b5a 100644 --- a/op-modules/op-system/src/main/java/com/op/system/mapper/SysDatasourceMapper.java +++ b/op-modules/op-system/src/main/java/com/op/system/mapper/SysDatasourceMapper.java @@ -75,4 +75,6 @@ public interface SysDatasourceMapper int deleteUserRoleInfos(@Param("datasourceId") String datasourceId, @Param("userIds") Long[] userIds); List selectDBListByDept(SysDatasource qo); + + void deletUserDB(String userCode); } diff --git a/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java b/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java index a12e690e..d9bcfd2a 100644 --- a/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java +++ b/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java @@ -249,6 +249,10 @@ public class SysUserServiceImpl implements ISysUserService { // 新增用户与园区数据源 SysDatasource qo = new SysDatasource(); qo.setDeptId(user.getDeptId());// + + //先删掉 + sysDatasourceMapper.deletUserDB(user.getUserId().toString()); + //再添加 List dbs = sysDatasourceMapper.selectDBListByDept(qo); List list = new ArrayList(); for (SysDatasource db : dbs) { diff --git a/op-modules/op-system/src/main/resources/mapper/system/SysDatasourceMapper.xml b/op-modules/op-system/src/main/resources/mapper/system/SysDatasourceMapper.xml index 574232b0..e1c22cd1 100644 --- a/op-modules/op-system/src/main/resources/mapper/system/SysDatasourceMapper.xml +++ b/op-modules/op-system/src/main/resources/mapper/system/SysDatasourceMapper.xml @@ -188,4 +188,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userId} + + delete from sys_user_datasource where user_id =#{userCode} + diff --git a/op-modules/op-technology/push-technology.bat b/op-modules/op-technology/push-technology.bat new file mode 100644 index 00000000..5ba367d8 --- /dev/null +++ b/op-modules/op-technology/push-technology.bat @@ -0,0 +1,40 @@ +@echo off +echo --------------------------------Զǰ޸-------------------------------------- +set jarName=op-modules-technology.jar +set profile=dev +set imageURI=192.168.202.36:30002/op-lanju/op-technology +rem echo ȡǰַ +for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c +rem echo ȡǰʱַ +for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b +rem echo 統ǰСʱС10ո滻Ϊ0 +set T=%T: =0% +rem echo ʾʱַ +set imageVersion=%D%%T% +::Ϣ +echo jar:%jarName% +echo :%profile% +echo ַ:%imageURI% +echo 汾:%imageVersion% + +echo --------------------------------mvn package...-------------------------------- +::call mvn clean package -Dmaven.test.skip=true + +cd .\target +SET df=Dockerfile +if exist %df% ( + del /f /s /q .\Dockerfile +) +echo --------------------------------Dockerfile-------------------------------- +echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo COPY %jarName% /application.jar >> Dockerfile +echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile +echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile +dir +echo --------------------------------docker login...------------------------------- +docker login 192.168.202.36:30002 -u deploy -p Deploy@2023 +echo --------------------------------docker build...------------------------------- +docker build -t %imageURI%:%imageVersion% . +echo --------------------------------docker push...-------------------------------- +docker push %imageURI%:%imageVersion% +@pause \ No newline at end of file diff --git a/op-modules/op-wms/push-wms.bat b/op-modules/op-wms/push-wms.bat new file mode 100644 index 00000000..080ce1b8 --- /dev/null +++ b/op-modules/op-wms/push-wms.bat @@ -0,0 +1,40 @@ +@echo off +echo --------------------------------Զǰ޸-------------------------------------- +set jarName=op-modules-wms.jar +set profile=dev +set imageURI=192.168.202.36:30002/op-lanju/op-wms +rem echo ȡǰַ +for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c +rem echo ȡǰʱַ +for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b +rem echo 統ǰСʱС10ո滻Ϊ0 +set T=%T: =0% +rem echo ʾʱַ +set imageVersion=%D%%T% +::Ϣ +echo jar:%jarName% +echo :%profile% +echo ַ:%imageURI% +echo 汾:%imageVersion% + +echo --------------------------------mvn package...-------------------------------- +::call mvn clean package -Dmaven.test.skip=true + +cd .\target +SET df=Dockerfile +if exist %df% ( + del /f /s /q .\Dockerfile +) +echo --------------------------------Dockerfile-------------------------------- +echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo COPY %jarName% /application.jar >> Dockerfile +echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile +echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile +dir +echo --------------------------------docker login...------------------------------- +docker login 192.168.202.36:30002 -u deploy -p Deploy@2023 +echo --------------------------------docker build...------------------------------- +docker build -t %imageURI%:%imageVersion% . +echo --------------------------------docker push...-------------------------------- +docker push %imageURI%:%imageVersion% +@pause \ No newline at end of file