diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java index 9f82aed..5e710dd 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java @@ -201,6 +201,8 @@ public class MesBaseBarcodeInfo extends BaseEntity private String rawFlag; + private String prdBarcodeInfo; + public String getLocationCode() { return locationCode; @@ -651,6 +653,14 @@ public class MesBaseBarcodeInfo extends BaseEntity this.rawFlag = rawFlag; } + public String getPrdBarcodeInfo() { + return prdBarcodeInfo; + } + + public void setPrdBarcodeInfo(String prdBarcodeInfo) { + this.prdBarcodeInfo = prdBarcodeInfo; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesPurchaseOrder.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesPurchaseOrder.java index 79fa79e..a42835f 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesPurchaseOrder.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesPurchaseOrder.java @@ -295,6 +295,8 @@ public class MesPurchaseOrder extends BaseEntity { private String projectNo; + private Long materialBomId; + public Long getSerialNumber() { return serialNumber; @@ -760,6 +762,14 @@ public class MesPurchaseOrder extends BaseEntity { this.projectNo = projectNo; } + public Long getMaterialBomId() { + return materialBomId; + } + + public void setMaterialBomId(Long materialBomId) { + this.materialBomId = materialBomId; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-api/hw-api-printer/src/main/java/com/hw/printer/api/domain/vo/PrintContentVo.java b/hw-api/hw-api-printer/src/main/java/com/hw/printer/api/domain/vo/PrintContentVo.java index 60cac22..c732adb 100644 --- a/hw-api/hw-api-printer/src/main/java/com/hw/printer/api/domain/vo/PrintContentVo.java +++ b/hw-api/hw-api-printer/src/main/java/com/hw/printer/api/domain/vo/PrintContentVo.java @@ -29,6 +29,10 @@ public class PrintContentVo { public static final String PRINT_TEMPLATE_RAW = "raw"; public static final String PRINT_TEMPLATE_PRODUCT = "product"; public static final String PRINT_TEMPLATE_BIND = "bind"; + public static final String PRINT_TEMPLATE_SMALL = "small"; + + public static final String SMALL_LABEL_KEY_TEXT = "text"; + public static final String SMALL_LABEL_KEY_QRCODE = "qrcode"; private String key; diff --git a/hw-api/hw-api-wms/src/main/java/com/hw/wms/api/domain/WmsWarehouseMaterial.java b/hw-api/hw-api-wms/src/main/java/com/hw/wms/api/domain/WmsWarehouseMaterial.java index 49defc8..67bdd7d 100644 --- a/hw-api/hw-api-wms/src/main/java/com/hw/wms/api/domain/WmsWarehouseMaterial.java +++ b/hw-api/hw-api-wms/src/main/java/com/hw/wms/api/domain/WmsWarehouseMaterial.java @@ -34,6 +34,9 @@ public class WmsWarehouseMaterial extends BaseEntity private String materialName; + private String materialSpec; + + public Long getWarehouseMaterialId() { return warehouseMaterialId; } @@ -104,6 +107,14 @@ public class WmsWarehouseMaterial extends BaseEntity this.materialName = materialName; } + public String getMaterialSpec() { + return materialSpec; + } + + public void setMaterialSpec(String materialSpec) { + this.materialSpec = materialSpec; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/PrintConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/PrintConstants.java new file mode 100644 index 0000000..7e08d00 --- /dev/null +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/PrintConstants.java @@ -0,0 +1,44 @@ +package com.hw.common.core.constant; + +/** + * @Description: 打印常量定义 + * @ClassName: PrintConstants + * @Author : xins + * @Date :2024-11-7 13:51 + * @Version :1.0 + */ +public class PrintConstants { + + public static final int TYPE_TEXT = 1; + public static final int TYPE_CHECKBOX = 2; + public static final int TYPE_QRCODE = 3; + + public static final String PRINT_TYPE_RAW_LABEL = "1"; + public static final String PRINT_TYPE_PRODUCT_LABEL = "3"; + + public static final String RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME = "materialName"; + public static final String RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE = "materialCode"; + public static final String RAW_MATERIAL_LABEL_KEY_PO_NO = "poNo"; + public static final String RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC = "materialSpec"; + public static final String RAW_MATERIAL_LABEL_KEY_PRE_MATERIAL_YES = "preMaterialYes"; + public static final String RAW_MATERIAL_LABEL_KEY_PRE_MATERIAL_NO = "preMaterialNo"; + public static final String RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE = "saleOrderCode"; + public static final String RAW_MATERIAL_LABEL_KEY_QTY = "qty"; + public static final String RAW_MATERIAL_LABEL_KEY_BATCH_CODE = "batchCode"; + public static final String RAW_MATERIAL_LABEL_KEY_QC_RESULT_YES = "qcResultYes"; + public static final String RAW_MATERIAL_LABEL_KEY_QC_RESULT_NO = "qcResultNo"; + public static final String RAW_MATERIAL_LABEL_KEY_QRCODE = "qrcode"; + public static final String RAW_MATERIAL_LABEL_KEY_BARCODE = "barcode"; + + public static final String PRODUCT_PLAN_CODE = "productPlanCode"; + + + public static final String PRINT_TEMPLATE_RAW = "raw"; + public static final String PRINT_TEMPLATE_PRODUCT = "product"; + public static final String PRINT_TEMPLATE_BIND = "bind"; + public static final String PRINT_TEMPLATE_SMALL = "small"; + + public static final String SMALL_LABEL_KEY_TEXT = "text"; + public static final String SMALL_LABEL_KEY_QRCODE = "qrcode"; + +} diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MailUtils.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MailUtils.java index 4d447c6..37e831f 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MailUtils.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MailUtils.java @@ -42,7 +42,7 @@ public class MailUtils { // 发送邮件 Transport.send(message); - System.out.println("邮件已成功发送!"); +// System.out.println("邮件已成功发送!"); } catch (MessagingException e) { e.printStackTrace(); throw new RuntimeException(e); @@ -90,7 +90,7 @@ public class MailUtils { // 发送邮件 Transport.send(message); - System.out.println("邮件已成功发送!"); +// System.out.println("邮件已成功发送!"); } catch (MessagingException e) { e.printStackTrace(); throw new RuntimeException(e); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceLedgerController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceLedgerController.java index ae561cd..ede4e27 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceLedgerController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceLedgerController.java @@ -114,4 +114,30 @@ public class DmsBaseDeviceLedgerController extends BaseController { return toAjax(dmsBaseDeviceLedgerService.deleteDmsBaseDeviceLedgerByDeviceIds(deviceIds)); } + + + /** + * 查询设备台账信息列表 + */ +// @RequiresPermissions("dms:ledger:list") + @GetMapping("/listAll") + public AjaxResult listAll(DmsBaseDeviceLedger dmsBaseDeviceLedger) + { + List list = dmsBaseDeviceLedgerService.selectDmsBaseDeviceLedgerList(dmsBaseDeviceLedger); + return success(list); + } + + /** + * 打印库位条码 + * + * @param deviceCodes + * @return + */ + @RequiresPermissions("wms:ledger:printDeviceLabels") + @Log(title = "设备", businessType = BusinessType.PRINT) + @GetMapping(value = "/printDeviceLabels/{deviceCodes}") + public AjaxResult printDeviceLabels(@PathVariable String[] deviceCodes) { + return success(dmsBaseDeviceLedgerService.printLabels(deviceCodes)); + } + } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceActivityController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceActivityController.java index c732577..7806499 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceActivityController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceActivityController.java @@ -106,6 +106,6 @@ public class DmsBillsInspectInstanceActivityController extends BaseController @GetMapping("/selectUserIdByDmsBillsInspectInstanceActivityId/{lubeInstanceId}/userId/{userId}") public boolean selectUserIdByDmsBillsInspectInstanceActivityId(@PathVariable("lubeInstanceId") Long lubeInstanceId,@PathVariable("userId") Long userId){ boolean b = dmsBillsInspectInstanceActivityService.selectUserIdByDmsBillsInspectInstanceActivityId(lubeInstanceId, userId); - return b; + return true; } } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsInspectInstance.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsInspectInstance.java index 3c2b0bd..82965b7 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsInspectInstance.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsInspectInstance.java @@ -80,6 +80,15 @@ public class DmsBillsInspectInstance extends BaseEntity /**多个状态时使用,以,隔开*/ private String inspectStatusStr; + private String planInspectCode; + public String getPlanInspectCode() + { + return planInspectCode; + } + public void setPlanInspectCode(String planInspectCode) + { + this.planInspectCode = planInspectCode; + } private List dmsInspectInstanceDetailList; diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceActivity.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceActivity.java index d9c4e74..9263fa0 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceActivity.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceActivity.java @@ -100,6 +100,8 @@ public class DmsFaultInstanceActivity extends BaseEntity private List fileUrls; + private List dmsInstanceFileList; + public Long getWfLength() { return wfLength; } @@ -288,6 +290,14 @@ public class DmsFaultInstanceActivity extends BaseEntity this.fileUrls = fileUrls; } + public List getDmsInstanceFileList() { + return dmsInstanceFileList; + } + + public void setDmsInstanceFileList(List dmsInstanceFileList) { + this.dmsInstanceFileList = dmsInstanceFileList; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsInstanceFile.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsInstanceFile.java index 345e8c0..db28149 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsInstanceFile.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsInstanceFile.java @@ -33,6 +33,8 @@ public class DmsInstanceFile extends BaseEntity //file-list中需要有url才能正确预览图片 private String url; + private String name; + public String getUrl() { return url; } @@ -78,6 +80,14 @@ public class DmsInstanceFile extends BaseEntity return filePath; } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsPlanInspect.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsPlanInspect.java index 019c30c..249e239 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsPlanInspect.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsPlanInspect.java @@ -14,6 +14,7 @@ import com.hw.common.core.web.domain.BaseEntity; * @author Open Platform * @date 2024-01-17 */ + public class DmsPlanInspect extends BaseEntity { private static final long serialVersionUID = 1L; @@ -69,7 +70,14 @@ public class DmsPlanInspect extends BaseEntity private Long timeLimitDays; private Long timeLimitHours; + private String routeName; + public void setRouteName(String routeName) { + this.routeName = routeName; + } + public String getRouteName() { + return routeName; + } public Long getTimeLimitDays() { diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBaseInspectRouteMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBaseInspectRouteMapper.java index e048fdd..3219875 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBaseInspectRouteMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBaseInspectRouteMapper.java @@ -2,6 +2,7 @@ package com.hw.dms.mapper; import java.util.List; import com.hw.dms.domain.DmsBaseInspectRoute; +import org.apache.ibatis.annotations.Param; /** * 巡检线路信息Mapper接口 @@ -60,4 +61,6 @@ public interface DmsBaseInspectRouteMapper public int deleteDmsBaseInspectRouteByInspectRouteIds(Long[] inspectRouteIds); Long selectAmountByInspectRouteId(Long InspectRouteId); + + String selectRouteName(@Param("inspectRouteId") Long inspectRouteId); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailProjectMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailProjectMapper.java index bd4c0c7..9a59bb2 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailProjectMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailProjectMapper.java @@ -80,5 +80,5 @@ public interface DmsInspectInstanceDetailProjectMapper * */ List selectDmsInspectInstanceDetailProjectByInspectInstanceId(@Param("inspectInstanceId") Long inspectInstanceId, @Param("lineStep") Long lineStep); - Long selectProjectByStandardId(String inspectStandard); + Long selectProjectByStandardId(@Param("inspectStandard") String inspectStandard); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInstanceFileMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInstanceFileMapper.java index d637578..d1e8a2f 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInstanceFileMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInstanceFileMapper.java @@ -75,4 +75,13 @@ public interface DmsInstanceFileMapper * 更新时删除原有文件 * */ int deleteDmsInstanceFileByUpdate(Long targetId); + + /** + * 查询工单文件;转换字段名称,供前端页面统一展示 + * + * @param dmsInstanceFile 工单文件;手工创建,从故障报修开始 + * @return 工单文件;手工创建,从故障报修开始集合 + */ + public List selectDmsInstanceFileConvertList(DmsInstanceFile dmsInstanceFile); + } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanMaintDetailMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanMaintDetailMapper.java index 0db79c2..c82ac4c 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanMaintDetailMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanMaintDetailMapper.java @@ -2,6 +2,7 @@ package com.hw.dms.mapper; import java.util.List; import com.hw.dms.domain.DmsPlanMaintDetail; +import org.apache.ibatis.annotations.Param; /** * 保养计划明细Mapper接口 @@ -74,4 +75,5 @@ public interface DmsPlanMaintDetailMapper List selectDmsPlanMaintDetailListByPlanMaintId(Long planMaintId); + Long selectStandardId(@Param("stationId") Long stationId); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsBaseDeviceLedgerService.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsBaseDeviceLedgerService.java index 09fd2a8..570bab8 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsBaseDeviceLedgerService.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsBaseDeviceLedgerService.java @@ -69,4 +69,13 @@ public interface IDmsBaseDeviceLedgerService * @return 设备台账信息 */ public DmsBaseDeviceLedger selectDmsBaseDeviceLedgerByDeviceCode(String deviceCode); + + + /** + * 打印设备码 + * + * @param deviceCodes + * @return + */ + public int printLabels(String[] deviceCodes); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceLedgerServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceLedgerServiceImpl.java index bb47cc8..5f52ef7 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceLedgerServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceLedgerServiceImpl.java @@ -1,12 +1,17 @@ package com.hw.dms.service.impl; import java.util.List; +import java.util.concurrent.TimeUnit; +import com.hw.common.core.constant.PrintConstants; import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; +import com.hw.common.core.utils.StringUtils; +import com.hw.common.core.utils.ip.IpUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import com.hw.dms.mapper.DmsBaseDeviceLedgerMapper; import com.hw.dms.domain.DmsBaseDeviceLedger; @@ -23,6 +28,9 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi @Autowired private DmsBaseDeviceLedgerMapper dmsBaseDeviceLedgerMapper; + @Autowired + private StringRedisTemplate redisTemplate; + /** * 查询设备台账信息 * @@ -60,7 +68,7 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi DeviceLedger.setDeviceCode(dmsBaseDeviceLedger.getDeviceCode()); List dmsBaseDeviceLedgerList = dmsBaseDeviceLedgerMapper. selectDmsBaseDeviceLedgerList(DeviceLedger); - if (dmsBaseDeviceLedgerList.size()>0) { + if (dmsBaseDeviceLedgerList.size() > 0) { throw new ServiceException("设备编号已存在"); } dmsBaseDeviceLedger.setCreateBy(loginUser.getUsername()); @@ -131,4 +139,44 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi return dmsBaseDeviceLedger; } + + /** + * 打印设备码 + * + * @param deviceCodes + * @return + */ + @Override + public int printLabels(String[] deviceCodes) { + com.alibaba.fastjson.JSONArray printInfoJsonArr = new com.alibaba.fastjson.JSONArray(); + com.alibaba.fastjson.JSONObject printContentJson = new com.alibaba.fastjson.JSONObject(); + for (String deviceCode : deviceCodes) { + com.alibaba.fastjson.JSONObject printInfoObject = new com.alibaba.fastjson.JSONObject(); + if (StringUtils.isNotEmpty(deviceCode)) { + printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_TEXT, deviceCode); + printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_QRCODE, deviceCode); + printInfoJsonArr.add(printInfoObject); + } else { + throw new ServiceException("请选择有设备编号的设备进行打印"); + } + } + String printTemplate = PrintConstants.PRINT_TEMPLATE_SMALL; + printContentJson.put("template", printTemplate); + printContentJson.put("printContent", printInfoJsonArr.toString()); + + try { +// String hostIp = IpUtils.getIpAddr(); + String hostIp="10.10.3.119"; + String printKey = "print_" + hostIp; + redisTemplate.opsForList().rightPush(printKey, printContentJson.toString()); + redisTemplate.expire(printKey,1, TimeUnit.DAYS); +// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString()); + } catch (Exception e) { + throw new ServiceException("打印失败:" + e.getMessage()); + } + + return 1; + + } + } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsInspectInstanceServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsInspectInstanceServiceImpl.java index 6a466fe..f21bc61 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsInspectInstanceServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsInspectInstanceServiceImpl.java @@ -127,6 +127,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta dmsInspectInstanceDetail.setDeviceId(deviceId); dmsInspectInstanceDetail.setInstanceDetailStatus("1"); dmsInspectInstanceDetail.setInspectStandard(dmsInspectRouteDetail.getInspectStandard()); + dmsInspectInstanceDetail.setInspectStatus("0"); dmsInspectInstanceDetailMapper.insertDmsInspectInstanceDetail(dmsInspectInstanceDetail); Long projectId = dmsInspectInstanceDetailMapper.selectProjectId(dmsInspectRouteDetail.getInspectStandard()); DmsInspectProjectDevice queryInspectProjectDevice = new DmsInspectProjectDevice(); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFaultInstanceActivityServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFaultInstanceActivityServiceImpl.java index e16f01c..7ce62c4 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFaultInstanceActivityServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFaultInstanceActivityServiceImpl.java @@ -2,10 +2,13 @@ package com.hw.dms.service.impl; import java.util.Arrays; import java.util.List; + +import com.hw.common.core.constant.DmsConstants; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.dms.domain.*; import com.hw.dms.mapper.DmsBillsFaultInstanceMapper; +import com.hw.dms.mapper.DmsInstanceFileMapper; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,6 +28,8 @@ public class DmsFaultInstanceActivityServiceImpl implements IDmsFaultInstanceAct private DmsFaultInstanceActivityMapper dmsFaultInstanceActivityMapper; @Autowired private DmsBillsFaultInstanceMapper dmsBillsFaultInstanceMapper; + @Autowired + private DmsInstanceFileMapper dmsInstanceFileMapper; /** * 查询故障报修工单实例节点 @@ -47,7 +52,16 @@ public class DmsFaultInstanceActivityServiceImpl implements IDmsFaultInstanceAct @Override public List selectDmsFaultInstanceActivityList(DmsFaultInstanceActivity dmsFaultInstanceActivity) { - return dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityList(dmsFaultInstanceActivity); + List dmsFaultInstanceActivities = dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityList(dmsFaultInstanceActivity); + for(DmsFaultInstanceActivity dfia:dmsFaultInstanceActivities){ + DmsInstanceFile queryInstanceFile = new DmsInstanceFile(); + queryInstanceFile.setTargetType(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY); + queryInstanceFile.setTargetId(dfia.getInstanceActivityId()); + List dmsInstanceFiles = dmsInstanceFileMapper.selectDmsInstanceFileConvertList(queryInstanceFile); + dfia.setDmsInstanceFileList(dmsInstanceFiles); + } + + return dmsFaultInstanceActivities; } /** diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsInspectInstanceDetailProjectServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsInspectInstanceDetailProjectServiceImpl.java index 8f325cc..44c933e 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsInspectInstanceDetailProjectServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsInspectInstanceDetailProjectServiceImpl.java @@ -96,6 +96,10 @@ public class DmsInspectInstanceDetailProjectServiceImpl implements IDmsInspectIn @Override public List selectDmsInspectInstanceDetailProjectByInspectInstanceId(Long inspectInstanceId, Long lineStep) { - return dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectByInspectInstanceId(inspectInstanceId,lineStep); + List detailProjects = dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectByInspectInstanceId(inspectInstanceId, lineStep); + for (DmsInspectInstanceDetailProject detailProject : detailProjects) { + detailProject.setProjectStepOrder(lineStep); + } + return detailProjects; } } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanInspectServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanInspectServiceImpl.java index 0e35967..44a68c3 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanInspectServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanInspectServiceImpl.java @@ -85,6 +85,12 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService public List selectDmsPlanInspectList(DmsPlanInspect dmsPlanInspect) { List dmsPlanInspects = dmsPlanInspectMapper.selectDmsPlanInspectList(dmsPlanInspect); + for (DmsPlanInspect planInspect : dmsPlanInspects) { + String routeName = dmsBaseInspectRouteMapper.selectRouteName(planInspect.getInspectRouteId()); + planInspect.setRouteName(routeName); + } + + for (DmsPlanInspect d : dmsPlanInspects) { Long timeLimit = d.getTimeLimit(); d.setTimeLimitDays(timeLimit / (24 * 60 * 60L)); diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseInspectProjectMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseInspectProjectMapper.xml index 0409f3c..3d7b212 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseInspectProjectMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseInspectProjectMapper.xml @@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" inspect_project_code, inspect_project, + inspect_project_property, inspect_type, record_method, up_limit, @@ -64,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{inspectProjectCode}, #{inspectProject}, + #{inspectProjectProperty}, #{inspectType}, #{recordMethod}, #{upLimit}, diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseInspectRouteMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseInspectRouteMapper.xml index 7be4441..2692899 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseInspectRouteMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseInspectRouteMapper.xml @@ -102,4 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsFaultInstanceMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsFaultInstanceMapper.xml index a564841..b33bda8 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsFaultInstanceMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsFaultInstanceMapper.xml @@ -210,6 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and is_flag = #{isFlag} and device_id = #{deviceId} + order by dbfi.repair_instance_id desc diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceMapper.xml index 36dc725..0766671 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceMapper.xml @@ -26,32 +26,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select inspect_instance_id, plan_inspect_id, wf_process_id, inspect_type, bills_inspect_code, plan_begin_time,plan_end_time, real_begin_time, real_end_time, inspect_status, is_flag, remark, create_by, create_time, update_by, update_time from dms_bills_inspect_instance + select + a.inspect_instance_id, + a.plan_inspect_id, + a.wf_process_id, + a.inspect_type, + a.bills_inspect_code, + a.plan_begin_time, + a.plan_end_time, + a.real_begin_time, + a.real_end_time, + a.inspect_status, + a.is_flag, + b.remark, + a.create_by, + a.create_time, + a.update_by, + a.update_time, + b.plan_inspect_code, + b.performer + from + dms_bills_inspect_instance a left join dms_plan_inspect b on a.plan_inspect_id = b.plan_inspect_id - select dbii.inspect_instance_id, dbii.plan_inspect_id, dbii.wf_process_id, dbii.inspect_type, dbii.bills_inspect_code, - dbii.plan_begin_time,dbii.plan_end_time, dbii.real_begin_time, dbii.real_end_time, dbii.inspect_status,dbii.create_time, - dbir.route_name - from dms_bills_inspect_instance dbii left join dms_base_inspect_route dbir on dbii.inspect_route_id=dbir.inspect_route_id + select + dbii.inspect_instance_id, + dbii.plan_inspect_id, + dbii.wf_process_id, + dbii.inspect_type, + dbii.bills_inspect_code, + dbii.plan_begin_time, + dbii.plan_end_time, + dbii.real_begin_time, + dbii.real_end_time, + dbii.inspect_status, + dbii.create_time, + dbir.route_name,a.plan_inspect_code + from + dms_bills_inspect_instance dbii + left join dms_base_inspect_route dbir on + dbii.inspect_route_id = dbir.inspect_route_id left join dms_plan_inspect a on dbii.plan_inspect_id = a.plan_inspect_id and dbii.inspect_route_id = #{inspectRouteId} diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml index c6d2999..47064eb 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml @@ -29,23 +29,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select maint_instance_id, plan_maint_id, wf_process_id, bills_maint_code, plan_begin_time, real_begin_time, plan_end_time, real_end_time, maint_status, maint_comp_rate, is_flag, remark, create_by, create_time, update_by, update_time from dms_bills_maint_instance + select + a.maint_instance_id, + a.plan_maint_id, + a.wf_process_id, + a.bills_maint_code, + a.plan_begin_time, + a.real_begin_time, + a.plan_end_time, + a.real_end_time, + a.maint_status, + a.maint_comp_rate, + a.is_flag, + a.create_by, + a.create_time, + a.update_by, + a.update_time, + b.maint_supervisor, + b.remark + from + dms_bills_maint_instance a left join dms_plan_maint b on a.plan_maint_id = b.plan_maint_id diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml index c096d24..5b712fd 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml @@ -76,4 +76,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from dms_instance_file where target_type = 1 and target_id =#{targetId} + + + + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml index 7b86ae4..632f7fb 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml @@ -138,16 +138,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java index 48b4077..015bc87 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java @@ -112,7 +112,7 @@ public class TWTempertureDataController extends BaseController } } - System.out.println(JSONArray.toJSONString(list)); +// System.out.println(JSONArray.toJSONString(list)); return success(list); } diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java index 9d51cab..9be2db6 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java @@ -570,7 +570,7 @@ public class RecordAlarmDataServiceImpl implements IRecordAlarmDataService { public R dnthAlarmTask() { List types = recordAlarmRuleMapper.selectEnergyTypes(); for (RecordAlarmRule rule : types) { - System.out.println("kaishile"); +// System.out.println("kaishile"); Long timeRange = rule.getTimeRange(); if (timeRange == 0){ timeRange = 1L; diff --git a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpSyncServiceImpl.java b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpSyncServiceImpl.java index 22fba6b..5adf608 100644 --- a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpSyncServiceImpl.java +++ b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpSyncServiceImpl.java @@ -63,7 +63,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { * @Description:从金蝶ERP同步单位信息,递归使用 */ public int syncDeptInfoFromErp1(int startRow) throws Exception { - System.out.println("startRow=" + startRow); +// System.out.println("startRow=" + startRow); K3CloudApi api = new K3CloudApi(); JSONObject queryJson = new JSONObject(); String formId = "BD_Department"; @@ -88,7 +88,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { if (StringUtils.isEmpty(result)) { return 1; } - System.out.println("部门单据查询接口: " + result); +// System.out.println("部门单据查询接口: " + result); JSONArray resultArray = JSONArray.parseArray(result); if (resultArray == null) { return 1; @@ -150,7 +150,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { // } // } - System.out.println("size:" + resultArray.size()); +// System.out.println("size:" + resultArray.size()); // System.out.println(resultArray); //如果返回的数组的数量等于分页数量,则继续获取下一页数据 if (resultArray.size() == limit) { @@ -183,7 +183,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { * @Description:从金蝶ERP同步单位信息,递归使用 */ public int syncUnitInfoFromErp(int startRow, String maxErpModifyDate) throws Exception { - System.out.println("startRow=" + startRow + ",,,maxErpModifyDate=" + maxErpModifyDate); +// System.out.println("startRow=" + startRow + ",,,maxErpModifyDate=" + maxErpModifyDate); K3CloudApi api = new K3CloudApi(); JSONObject queryJson = new JSONObject(); String formId = "BD_Unit"; @@ -201,7 +201,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { queryJson.put("SubSystemId", ""); //条件查询 - System.out.println("maxErpModifyDate=" + maxErpModifyDate); +// System.out.println("maxErpModifyDate=" + maxErpModifyDate); if (StringUtils.isNotEmpty(maxErpModifyDate)) { String filterString = "FModifyDate >'" + maxErpModifyDate + "'"; queryJson.put("FilterString", filterString); @@ -274,7 +274,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { } } - System.out.println("size:" + resultArray.size()); +// System.out.println("size:" + resultArray.size()); // System.out.println(resultArray); //如果返回的数组的数量等于分页数量,则继续获取下一页数据 if (resultArray.size() == limit) { @@ -305,7 +305,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { * @Description:从金蝶ERP同步供应商信息,递归使用 */ public int syncSupplierInfoFromErp(int startRow, String maxErpModifyDate) throws Exception { - System.out.println("startRow=" + startRow + ",,,maxErpModifyDate=" + maxErpModifyDate); +// System.out.println("startRow=" + startRow + ",,,maxErpModifyDate=" + maxErpModifyDate); K3CloudApi api = new K3CloudApi(); JSONObject queryJson = new JSONObject(); String formId = "BD_Supplier"; @@ -323,7 +323,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { queryJson.put("SubSystemId", ""); //条件查询 - System.out.println("maxErpModifyDate=" + maxErpModifyDate); +// System.out.println("maxErpModifyDate=" + maxErpModifyDate); if (StringUtils.isNotEmpty(maxErpModifyDate)) { String filterString = "FModifyDate >'" + maxErpModifyDate + "'"; queryJson.put("FilterString", filterString); @@ -1042,7 +1042,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { mesPurchaseOrder.setTondBase(tondBase); mesPurchaseOrder.setSupplierId(supplierId); mesPurchaseOrder.setUpdateTime(currentDate); - mesPurchaseOrder.setOrderStatus(MesConstants.MES_PURCHASE_ORDER_STATUS_TOPURCHASE); + if (approveDate != null) { mesPurchaseOrder.setApproveDate(conversionERPTime(approveDate)); @@ -1066,6 +1066,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { mesPurchaseOrder.setPurchaseOrderId(existedPurchaseOrder.getPurchaseOrderId()); toUpdatePurchaseOrderList.add(mesPurchaseOrder); } else { + mesPurchaseOrder.setOrderStatus(MesConstants.MES_PURCHASE_ORDER_STATUS_TOPURCHASE); toInsertPurchaseOrderList.add(mesPurchaseOrder); } } catch (Exception e) { diff --git a/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java b/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java index dd05331..65aa741 100644 --- a/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java +++ b/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java @@ -132,7 +132,7 @@ public class RyTask } public void syncRawMaterialDeliveryInformationToERP(){ - System.out.println("++定时同步原材料入库信息给ERP++syncRawMaterialDeliveryInformationToERP"); + System.out.println("++定时同步原材料出库信息给ERP++syncRawMaterialDeliveryInformationToERP"); remoteWmsService.synchronizeRawMaterialDeliveryInformationToERP(SecurityConstants.INNER); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java index 515655b..bd9ac2a 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java @@ -11,9 +11,11 @@ import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo; import com.hw.mes.api.domain.MesBaseStationInfo; +import com.hw.mes.api.domain.MesSaleOrderRelate; import com.hw.mes.domain.MesMaterialBom; import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlanDetail; +import com.hw.mes.domain.MesSaleOrder; import com.hw.mes.domain.vo.*; import com.hw.mes.service.*; import org.springframework.beans.factory.annotation.Autowired; @@ -51,6 +53,9 @@ public class MesApiController extends BaseController { @Autowired private IMesBaseMaterialInfoService mesBaseMaterialInfoService; + @Autowired + private IMesSaleOrderService mesSaleOrderService; + /** * 查询当前登录工位信息 @@ -387,4 +392,12 @@ public class MesApiController extends BaseController { public AjaxResult productPlanDetailContinue(@Validated @RequestBody MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) { return success(productPlanDetailService.productPlanDetailContinue(mesProductPlanDetailPauseVo)); } + + + @GetMapping("/selectSaleOrderRelates") + public TableDataInfo selectSaleOrderRelates(MesSaleOrderRelate mesSaleOrderRelate) { + startPage(); + List list = mesSaleOrderService.selectMesSaleOrderRelateJoinProductList(mesSaleOrderRelate); + return getDataTable(list); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java index 818f8fa..1e7115d 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java @@ -10,6 +10,7 @@ import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBindBarcode; import com.hw.mes.api.domain.MesPurchaseOrder; +import com.hw.mes.domain.MesPrdBarcodeInfo; import com.hw.mes.service.IMesBaseMaterialInfoService; import com.hw.mes.service.IMesPurchaseOrderService; import org.springframework.beans.factory.annotation.Autowired; @@ -432,4 +433,14 @@ public class MesBaseBarcodeInfoController extends BaseController return R.ok(mesBaseBarcodeInfoService.getBarcodeInfoByBindBarcode(bindBarcode)); } + + /** + * 查询条码信息列表 + */ + @RequiresPermissions("mes:barcode:listPrdBarcode") + @GetMapping("/listPrdBarcode") + public AjaxResult listPrdBarcode(MesPrdBarcodeInfo mesPrdBarcodeInfo) + { + return success(mesBaseBarcodeInfoService.selectMesPrdBarcodeInfoList(mesPrdBarcodeInfo)); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java index 688c681..1116658 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java @@ -295,4 +295,21 @@ public class MesProductPlanController extends BaseController { } } + + + /** + * 生成生产明细统计 + */ + @Log(title = "生产明细统计", businessType = BusinessType.START) + @PostMapping("/generateProduceStatisticsDetail") +// @InnerAuth + public R generateProduceStatisticsDetail() { + try { + mesProductPlanDetailService.generateProduceStatisticsDetail(""); + return R.ok(); + } catch (Exception e) { + e.printStackTrace(); + return R.fail(e.getMessage()); + } + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java index 9323a98..030b00b 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java @@ -5,7 +5,10 @@ import javax.servlet.http.HttpServletResponse; import com.hw.common.core.domain.R; import com.hw.common.security.annotation.InnerAuth; +import com.hw.mes.api.domain.MesOrderBind; +import com.hw.mes.domain.MesMaterialBom; import com.hw.mes.domain.MesSaleOrder; +import com.hw.mes.service.IMesMaterialBomService; import com.hw.mes.service.IMesOrderBindService; import com.hw.mes.service.IMesSaleOrderService; import org.springframework.beans.factory.annotation.Autowired; @@ -43,6 +46,9 @@ public class MesPurchaseOrderController extends BaseController @Autowired private IMesSaleOrderService mesSaleOrderService; + @Autowired + private IMesMaterialBomService mesMaterialBomService; + @Autowired private IMesOrderBindService mesOrderBindService; @@ -78,7 +84,7 @@ public class MesPurchaseOrderController extends BaseController @GetMapping(value = "/{purchaseOrderId}") public AjaxResult getInfo(@PathVariable("purchaseOrderId") Long purchaseOrderId) { - return success(mesPurchaseOrderService.selectMesPurchaseOrderByPurchaseOrderId(purchaseOrderId)); + return success(mesPurchaseOrderService.selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(purchaseOrderId)); } /** @@ -235,6 +241,18 @@ public class MesPurchaseOrderController extends BaseController } + /** + * 获取生产bom列表 + * @param mesMaterialBom + * @return + */ + @GetMapping("/getMaterialBoms") + public AjaxResult getMaterialBoms(MesMaterialBom mesMaterialBom) + { + List list = mesMaterialBomService.selectMesMaterialBomList(mesMaterialBom); + return success(list); + } + /** * 自动出库不在特定日期raw_instock记录中的采购订单信息(group by) @@ -247,6 +265,17 @@ public class MesPurchaseOrderController extends BaseController } + /** + * 查询采购订单绑定销售订单信息 + */ + @GetMapping("/getOrderBinds") + public AjaxResult getOrderBinds(MesOrderBind mesOrderBind) + { + List list = mesOrderBindService.selectMesOrderBindJoinProductList(mesOrderBind); + return success(list); + } + + /** * 获取采购订单信息详细信息 diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPrdBarcodeInfo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPrdBarcodeInfo.java new file mode 100644 index 0000000..22a6e67 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPrdBarcodeInfo.java @@ -0,0 +1,140 @@ +package com.hw.mes.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 小包条码对象 mes_prd_barcode_info + * + * @author xins + * @date 2024-11-07 + */ +public class MesPrdBarcodeInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long prdBarcodeId; + + /** 小包条码内容 */ + @Excel(name = "小包条码内容") + private String prdBarcodeInfo; + + /** 喷码标识,1-已喷印,0-未喷印 */ + @Excel(name = "喷码标识,1-已喷印,0-未喷印") + private String printFlag; + + /** 关联mes_base_barcode_info里的大条码 */ + @Excel(name = "关联mes_base_barcode_info里的大条码") + private String mesBarcodeInfo; + + /** 绑定托盘号 */ + @Excel(name = "绑定托盘号") + private String palletInfoCode; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date creatTime; + + /** 喷印时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "喷印时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date printTime; + + /** 绑定时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date bindTime; + + public void setPrdBarcodeId(Long prdBarcodeId) + { + this.prdBarcodeId = prdBarcodeId; + } + + public Long getPrdBarcodeId() + { + return prdBarcodeId; + } + public void setPrdBarcodeInfo(String prdBarcodeInfo) + { + this.prdBarcodeInfo = prdBarcodeInfo; + } + + public String getPrdBarcodeInfo() + { + return prdBarcodeInfo; + } + public void setPrintFlag(String printFlag) + { + this.printFlag = printFlag; + } + + public String getPrintFlag() + { + return printFlag; + } + public void setMesBarcodeInfo(String mesBarcodeInfo) + { + this.mesBarcodeInfo = mesBarcodeInfo; + } + + public String getMesBarcodeInfo() + { + return mesBarcodeInfo; + } + public void setPalletInfoCode(String palletInfoCode) + { + this.palletInfoCode = palletInfoCode; + } + + public String getPalletInfoCode() + { + return palletInfoCode; + } + public void setCreatTime(Date creatTime) + { + this.creatTime = creatTime; + } + + public Date getCreatTime() + { + return creatTime; + } + public void setPrintTime(Date printTime) + { + this.printTime = printTime; + } + + public Date getPrintTime() + { + return printTime; + } + public void setBindTime(Date bindTime) + { + this.bindTime = bindTime; + } + + public Date getBindTime() + { + return bindTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("prdBarcodeId", getPrdBarcodeId()) + .append("prdBarcodeInfo", getPrdBarcodeInfo()) + .append("printFlag", getPrintFlag()) + .append("mesBarcodeInfo", getMesBarcodeInfo()) + .append("palletInfoCode", getPalletInfoCode()) + .append("creatTime", getCreatTime()) + .append("printTime", getPrintTime()) + .append("bindTime", getBindTime()) + .toString(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetail.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetail.java new file mode 100644 index 0000000..d04737e --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetail.java @@ -0,0 +1,339 @@ +package com.hw.mes.domain; + +import java.util.List; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 生产统计明细对象 mes_produce_statistics_detail + * + * @author xins + * @date 2024-11-07 + */ +public class MesProduceStatisticsDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long statisticsDetailId; + + /** 生产工单ID */ + @Excel(name = "生产工单ID") + private Long productOrderId; + + /** 销售订单ID */ + @Excel(name = "销售订单ID") + private Long saleOrderId; + + /** 销售订单号 */ + @Excel(name = "销售订单号") + private String saleorderCode; + + /** 生产计划ID */ + @Excel(name = "生产计划ID") + private Long planId; + + /** 计划编号,关联mes_product_plan_info的plan_code */ + @Excel(name = "计划编号,关联mes_product_plan_info的plan_code") + private String planCode; + + /** 生产计划明细ID */ + @Excel(name = "生产计划明细ID") + private Long planDetailId; + + /** 生产计划明细编号 */ + @Excel(name = "生产计划明细编号") + private String planDetailCode; + + /** 生产成品ID */ + @Excel(name = "生产成品ID") + private Long productId; + + /** 生产成名编码 */ + @Excel(name = "生产成名编码") + private String productCode; + + /** 生产成品名称 */ + @Excel(name = "生产成品名称") + private String productName; + + /** 生产成品规格 */ + @Excel(name = "生产成品规格") + private String productSpec; + + /** 操作人员ID,关联sys_user的user_id */ + @Excel(name = "操作人员ID,关联sys_user的user_id") + private Long userId; + + /** 操作人员名称,关联sys_user的nick_name */ + @Excel(name = "操作人员名称,关联sys_user的nick_name") + private String nickName; + + /** 工序ID */ + @Excel(name = "工序ID") + private Long processId; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 计划开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date planBeginTime; + + /** 计划结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date planEndTime; + + /** 开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date realBeginTime; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date realEndTime; + + /** 生产用时(单位:S) */ + @Excel(name = "生产用时(单位:S)") + private Long produceTime; + + /** 生产统计明细使用物料情况;车间生产派工信息 */ + private List mesProduceStatisticsDetailMaterialList; + + public void setStatisticsDetailId(Long statisticsDetailId) + { + this.statisticsDetailId = statisticsDetailId; + } + + public Long getStatisticsDetailId() + { + return statisticsDetailId; + } + public void setProductOrderId(Long productOrderId) + { + this.productOrderId = productOrderId; + } + + public Long getProductOrderId() + { + return productOrderId; + } + public void setSaleOrderId(Long saleOrderId) + { + this.saleOrderId = saleOrderId; + } + + public Long getSaleOrderId() + { + return saleOrderId; + } + public void setSaleorderCode(String saleorderCode) + { + this.saleorderCode = saleorderCode; + } + + public String getSaleorderCode() + { + return saleorderCode; + } + public void setPlanId(Long planId) + { + this.planId = planId; + } + + public Long getPlanId() + { + return planId; + } + public void setPlanCode(String planCode) + { + this.planCode = planCode; + } + + public String getPlanCode() + { + return planCode; + } + public void setPlanDetailId(Long planDetailId) + { + this.planDetailId = planDetailId; + } + + public Long getPlanDetailId() + { + return planDetailId; + } + public void setPlanDetailCode(String planDetailCode) + { + this.planDetailCode = planDetailCode; + } + + public String getPlanDetailCode() + { + return planDetailCode; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long 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 setProductSpec(String productSpec) + { + this.productSpec = productSpec; + } + + public String getProductSpec() + { + return productSpec; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setNickName(String nickName) + { + this.nickName = nickName; + } + + public String getNickName() + { + return nickName; + } + public void setProcessId(Long processId) + { + this.processId = processId; + } + + public Long getProcessId() + { + return processId; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + public void setPlanBeginTime(Date planBeginTime) + { + this.planBeginTime = planBeginTime; + } + + public Date getPlanBeginTime() + { + return planBeginTime; + } + public void setPlanEndTime(Date planEndTime) + { + this.planEndTime = planEndTime; + } + + public Date getPlanEndTime() + { + return planEndTime; + } + public void setRealBeginTime(Date realBeginTime) + { + this.realBeginTime = realBeginTime; + } + + public Date getRealBeginTime() + { + return realBeginTime; + } + public void setRealEndTime(Date realEndTime) + { + this.realEndTime = realEndTime; + } + + public Date getRealEndTime() + { + return realEndTime; + } + public void setProduceTime(Long produceTime) + { + this.produceTime = produceTime; + } + + public Long getProduceTime() + { + return produceTime; + } + + public List getMesProduceStatisticsDetailMaterialList() + { + return mesProduceStatisticsDetailMaterialList; + } + + public void setMesProduceStatisticsDetailMaterialList(List mesProduceStatisticsDetailMaterialList) + { + this.mesProduceStatisticsDetailMaterialList = mesProduceStatisticsDetailMaterialList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("statisticsDetailId", getStatisticsDetailId()) + .append("productOrderId", getProductOrderId()) + .append("saleOrderId", getSaleOrderId()) + .append("saleorderCode", getSaleorderCode()) + .append("planId", getPlanId()) + .append("planCode", getPlanCode()) + .append("planDetailId", getPlanDetailId()) + .append("planDetailCode", getPlanDetailCode()) + .append("productId", getProductId()) + .append("productCode", getProductCode()) + .append("productName", getProductName()) + .append("productSpec", getProductSpec()) + .append("userId", getUserId()) + .append("nickName", getNickName()) + .append("processId", getProcessId()) + .append("processName", getProcessName()) + .append("planBeginTime", getPlanBeginTime()) + .append("planEndTime", getPlanEndTime()) + .append("realBeginTime", getRealBeginTime()) + .append("realEndTime", getRealEndTime()) + .append("produceTime", getProduceTime()) + .append("createTime", getCreateTime()) + .append("mesProduceStatisticsDetailMaterialList", getMesProduceStatisticsDetailMaterialList()) + .toString(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetailMaterial.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetailMaterial.java new file mode 100644 index 0000000..465a098 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetailMaterial.java @@ -0,0 +1,122 @@ +package com.hw.mes.domain; + +import java.math.BigDecimal; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 生产统计明细使用物料情况;车间生产派工对象 mes_produce_statistics_detail_material + * + * @author xins + * @date 2024-11-07 + */ +public class MesProduceStatisticsDetailMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long statisticsDetailMaterialId; + + /** 生产统计明细ID */ + @Excel(name = "生产统计明细ID") + private Long statisticsDetailId; + + /** 物料ID */ + @Excel(name = "物料ID") + private Long materialId; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料规格 */ + @Excel(name = "物料规格") + private String materialSpec; + + /** 使用数量 */ + @Excel(name = "使用数量") + private BigDecimal usedAmount; + + public void setStatisticsDetailMaterialId(Long statisticsDetailMaterialId) + { + this.statisticsDetailMaterialId = statisticsDetailMaterialId; + } + + public Long getStatisticsDetailMaterialId() + { + return statisticsDetailMaterialId; + } + public void setStatisticsDetailId(Long statisticsDetailId) + { + this.statisticsDetailId = statisticsDetailId; + } + + public Long getStatisticsDetailId() + { + return statisticsDetailId; + } + public void setMaterialId(Long materialId) + { + this.materialId = materialId; + } + + public Long getMaterialId() + { + return materialId; + } + public void setMaterialCode(String materialCode) + { + this.materialCode = materialCode; + } + + public String getMaterialCode() + { + return materialCode; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setMaterialSpec(String materialSpec) + { + this.materialSpec = materialSpec; + } + + public String getMaterialSpec() + { + return materialSpec; + } + public void setUsedAmount(BigDecimal usedAmount) + { + this.usedAmount = usedAmount; + } + + public BigDecimal getUsedAmount() + { + return usedAmount; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("statisticsDetailMaterialId", getStatisticsDetailMaterialId()) + .append("statisticsDetailId", getStatisticsDetailId()) + .append("materialId", getMaterialId()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("materialSpec", getMaterialSpec()) + .append("usedAmount", getUsedAmount()) + .toString(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java index b6592b6..ee34dc8 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java @@ -200,6 +200,9 @@ public class MesProductPlan extends BaseEntity private Long productId;//针对内部生产5楼的成品ID + private String materialClassfication; + + public Long getSaleOrderId() { return saleOrderId; } @@ -597,6 +600,14 @@ public class MesProductPlan extends BaseEntity this.productId = productId; } + public String getMaterialClassfication() { + return materialClassfication; + } + + public void setMaterialClassfication(String materialClassfication) { + this.materialClassfication = materialClassfication; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java index 6afb942..1c0e64b 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java @@ -71,6 +71,11 @@ public class MesProductPlanDetail extends BaseEntity private String rawMaterialBarcode; + private String statisticsFlag;//统计标识,用来查询判断条件使用 + + private String nickName; + + public void setPlanDetailId(Long planDetailId) { this.planDetailId = planDetailId; @@ -211,6 +216,22 @@ public class MesProductPlanDetail extends BaseEntity this.rawMaterialBarcode = rawMaterialBarcode; } + public String getStatisticsFlag() { + return statisticsFlag; + } + + public void setStatisticsFlag(String statisticsFlag) { + this.statisticsFlag = statisticsFlag; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java index 50959e0..d850c44 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java @@ -199,6 +199,8 @@ public class MesSaleOrder extends BaseEntity { private Long virtualSaleOrderId; + private String parentIds; + public String getMaterialModel() { return materialModel; @@ -464,6 +466,14 @@ public class MesSaleOrder extends BaseEntity { this.virtualSaleOrderId = virtualSaleOrderId; } + public String getParentIds() { + return parentIds; + } + + public void setParentIds(String parentIds) { + this.parentIds = parentIds; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesStatusChangeInfo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesStatusChangeInfo.java new file mode 100644 index 0000000..4f91739 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesStatusChangeInfo.java @@ -0,0 +1,145 @@ +package com.hw.mes.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 状态变化信息对象 mes_status_change_info + * + * @author xins + * @date 2024-11-07 + */ +public class MesStatusChangeInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long statusChangeInfoId; + + /** 变化类型(1:mes_product_order) */ + @Excel(name = "变化类型", readConverterExp = "1=:mes_product_order") + private String changeType; + + /** 变化ID */ + @Excel(name = "变化ID") + private Long changeId; + + /** 老状态 */ + @Excel(name = "老状态") + private String oldStatus; + + /** 新状态 */ + @Excel(name = "新状态") + private String newStatus; + + /** 创建人 */ + @Excel(name = "创建人") + private String changeBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date changeTime; + + private Long productOrderId; + + private Long planDetailId; + + + public void setStatusChangeInfoId(Long statusChangeInfoId) + { + this.statusChangeInfoId = statusChangeInfoId; + } + + public Long getStatusChangeInfoId() + { + return statusChangeInfoId; + } + public void setChangeType(String changeType) + { + this.changeType = changeType; + } + + public String getChangeType() + { + return changeType; + } + public void setChangeId(Long changeId) + { + this.changeId = changeId; + } + + public Long getChangeId() + { + return changeId; + } + public void setOldStatus(String oldStatus) + { + this.oldStatus = oldStatus; + } + + public String getOldStatus() + { + return oldStatus; + } + public void setNewStatus(String newStatus) + { + this.newStatus = newStatus; + } + + public String getNewStatus() + { + return newStatus; + } + public void setChangeBy(String changeBy) + { + this.changeBy = changeBy; + } + + public String getChangeBy() + { + return changeBy; + } + public void setChangeTime(Date changeTime) + { + this.changeTime = changeTime; + } + + public Date getChangeTime() + { + return changeTime; + } + + public Long getProductOrderId() { + return productOrderId; + } + + public void setProductOrderId(Long productOrderId) { + this.productOrderId = productOrderId; + } + + public Long getPlanDetailId() { + return planDetailId; + } + + public void setPlanDetailId(Long planDetailId) { + this.planDetailId = planDetailId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("statusChangeInfoId", getStatusChangeInfoId()) + .append("changeType", getChangeType()) + .append("changeId", getChangeId()) + .append("oldStatus", getOldStatus()) + .append("newStatus", getNewStatus()) + .append("changeBy", getChangeBy()) + .append("changeTime", getChangeTime()) + .toString(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesOrderBindMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesOrderBindMapper.java index 33c5d3c..feb7eb5 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesOrderBindMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesOrderBindMapper.java @@ -60,11 +60,20 @@ public interface MesOrderBindMapper public int deleteMesOrderBindByOrderBindIds(Long[] orderBindIds); /** - * 查询采购销售订单绑定信息列表,Join material + * 查询采购销售订单绑定信息列表,Join material and product and saleorder * * @param mesOrderBind 采购销售订单绑定信息 * @return 采购销售订单绑定信息集合 */ public List selectMesOrderBindJoinList(MesOrderBind mesOrderBind); + + /** + * 查询采购销售订单绑定信息列表,Join product + * + * @param mesOrderBind 采购销售订单绑定信息 + * @return 采购销售订单绑定信息集合 + */ + public List selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind); + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPrdBarcodeInfoMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPrdBarcodeInfoMapper.java new file mode 100644 index 0000000..f2c0086 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPrdBarcodeInfoMapper.java @@ -0,0 +1,61 @@ +package com.hw.mes.mapper; + +import java.util.List; +import com.hw.mes.domain.MesPrdBarcodeInfo; + +/** + * 小包条码Mapper接口 + * + * @author xins + * @date 2024-11-07 + */ +public interface MesPrdBarcodeInfoMapper +{ + /** + * 查询小包条码 + * + * @param prdBarcodeId 小包条码主键 + * @return 小包条码 + */ + public MesPrdBarcodeInfo selectMesPrdBarcodeInfoByPrdBarcodeId(Long prdBarcodeId); + + /** + * 查询小包条码列表 + * + * @param mesPrdBarcodeInfo 小包条码 + * @return 小包条码集合 + */ + public List selectMesPrdBarcodeInfoList(MesPrdBarcodeInfo mesPrdBarcodeInfo); + + /** + * 新增小包条码 + * + * @param mesPrdBarcodeInfo 小包条码 + * @return 结果 + */ + public int insertMesPrdBarcodeInfo(MesPrdBarcodeInfo mesPrdBarcodeInfo); + + /** + * 修改小包条码 + * + * @param mesPrdBarcodeInfo 小包条码 + * @return 结果 + */ + public int updateMesPrdBarcodeInfo(MesPrdBarcodeInfo mesPrdBarcodeInfo); + + /** + * 删除小包条码 + * + * @param prdBarcodeId 小包条码主键 + * @return 结果 + */ + public int deleteMesPrdBarcodeInfoByPrdBarcodeId(Long prdBarcodeId); + + /** + * 批量删除小包条码 + * + * @param prdBarcodeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesPrdBarcodeInfoByPrdBarcodeIds(Long[] prdBarcodeIds); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProduceStatisticsDetailMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProduceStatisticsDetailMapper.java new file mode 100644 index 0000000..a6e5e52 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProduceStatisticsDetailMapper.java @@ -0,0 +1,87 @@ +package com.hw.mes.mapper; + +import java.util.List; +import com.hw.mes.domain.MesProduceStatisticsDetail; +import com.hw.mes.domain.MesProduceStatisticsDetailMaterial; + +/** + * 生产统计明细Mapper接口 + * + * @author xins + * @date 2024-11-07 + */ +public interface MesProduceStatisticsDetailMapper +{ + /** + * 查询生产统计明细 + * + * @param statisticsDetailId 生产统计明细主键 + * @return 生产统计明细 + */ + public MesProduceStatisticsDetail selectMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId); + + /** + * 查询生产统计明细列表 + * + * @param mesProduceStatisticsDetail 生产统计明细 + * @return 生产统计明细集合 + */ + public List selectMesProduceStatisticsDetailList(MesProduceStatisticsDetail mesProduceStatisticsDetail); + + /** + * 新增生产统计明细 + * + * @param mesProduceStatisticsDetail 生产统计明细 + * @return 结果 + */ + public int insertMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail); + + /** + * 修改生产统计明细 + * + * @param mesProduceStatisticsDetail 生产统计明细 + * @return 结果 + */ + public int updateMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail); + + /** + * 删除生产统计明细 + * + * @param statisticsDetailId 生产统计明细主键 + * @return 结果 + */ + public int deleteMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId); + + /** + * 批量删除生产统计明细 + * + * @param statisticsDetailIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesProduceStatisticsDetailByStatisticsDetailIds(Long[] statisticsDetailIds); + + /** + * 批量删除生产统计明细使用物料情况;车间生产派工 + * + * @param statisticsDetailIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailIds(Long[] statisticsDetailIds); + + /** + * 批量新增生产统计明细使用物料情况;车间生产派工 + * + * @param mesProduceStatisticsDetailMaterialList 生产统计明细使用物料情况;车间生产派工列表 + * @return 结果 + */ + public int batchMesProduceStatisticsDetailMaterial(List mesProduceStatisticsDetailMaterialList); + + + /** + * 通过生产统计明细主键删除生产统计明细使用物料情况;车间生产派工信息 + * + * @param statisticsDetailId 生产统计明细ID + * @return 结果 + */ + public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailId(Long statisticsDetailId); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java index ce07f8d..a182ced 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java @@ -94,4 +94,12 @@ public interface MesProductPlanDetailMapper public MesProductPlanDetail selectMesProductPlanDetailByMaterialBarcode(String materialBarcode); + /** + * 查询生产计划明细列表,供生成统计数据使用 + * + * @param mesProductPlanDetail 生产计划明细 + * @return 生产计划明细集合 + */ + public List selectMesProductPlanDetailList4Statistics(MesProductPlanDetail mesProductPlanDetail); + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanMapper.java index 97766d7..eca448b 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanMapper.java @@ -145,4 +145,13 @@ public interface MesProductPlanMapper public List selectOnlyConflictMesProductPlans(MesProductPlan mesProductPlan); + /** + * 查询生产派工 + * + * @param planId 生产计划ID + * @return 生产派工 + */ + public MesProductPlan selectOnlyMesProductPlanByPlanId(Long planId); + + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseOrderMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseOrderMapper.java index 7b30fc4..aa977d9 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseOrderMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseOrderMapper.java @@ -151,5 +151,14 @@ public interface MesPurchaseOrderMapper */ public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId); + /** + * 查询采购订单信息,Join material + * + * @param purchaseOrderId 采购订单信息主键 + * @return 采购订单信息 + */ + public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId); + + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesStatusChangeInfoMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesStatusChangeInfoMapper.java new file mode 100644 index 0000000..4e0c020 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesStatusChangeInfoMapper.java @@ -0,0 +1,70 @@ +package com.hw.mes.mapper; + +import java.util.List; +import com.hw.mes.domain.MesStatusChangeInfo; + +/** + * 状态变化信息Mapper接口 + * + * @author xins + * @date 2024-11-07 + */ +public interface MesStatusChangeInfoMapper +{ + /** + * 查询状态变化信息 + * + * @param statusChangeInfoId 状态变化信息主键 + * @return 状态变化信息 + */ + public MesStatusChangeInfo selectMesStatusChangeInfoByStatusChangeInfoId(Long statusChangeInfoId); + + /** + * 查询状态变化信息列表 + * + * @param mesStatusChangeInfo 状态变化信息 + * @return 状态变化信息集合 + */ + public List selectMesStatusChangeInfoList(MesStatusChangeInfo mesStatusChangeInfo); + + /** + * 新增状态变化信息 + * + * @param mesStatusChangeInfo 状态变化信息 + * @return 结果 + */ + public int insertMesStatusChangeInfo(MesStatusChangeInfo mesStatusChangeInfo); + + /** + * 修改状态变化信息 + * + * @param mesStatusChangeInfo 状态变化信息 + * @return 结果 + */ + public int updateMesStatusChangeInfo(MesStatusChangeInfo mesStatusChangeInfo); + + /** + * 删除状态变化信息 + * + * @param statusChangeInfoId 状态变化信息主键 + * @return 结果 + */ + public int deleteMesStatusChangeInfoByStatusChangeInfoId(Long statusChangeInfoId); + + /** + * 批量删除状态变化信息 + * + * @param statusChangeInfoIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesStatusChangeInfoByStatusChangeInfoIds(Long[] statusChangeInfoIds); + + /** + * 查询状态变化信息列表,根据productOrderId和planDetailId + * + * @param mesStatusChangeInfo 状态变化信息 + * @return 状态变化信息集合 + */ + public List selectMesStatusChangeInfoListByProduce(MesStatusChangeInfo mesStatusChangeInfo); + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java index 6e9403a..42a21ac 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java @@ -2,6 +2,7 @@ package com.hw.mes.service; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBindBarcode; +import com.hw.mes.domain.MesPrdBarcodeInfo; import com.hw.mes.domain.vo.MesBindBarcodeVo; import org.springframework.transaction.annotation.Transactional; @@ -240,4 +241,13 @@ public interface IMesBaseBarcodeInfoService { * @param mesBaseBarcodeInfo 条码信息 */ public int updateMergeRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo); + + + /** + * 获取小包条码信息 + * @param mesPrdBarcodeInfo + * @return + */ + public List selectMesPrdBarcodeInfoList(MesPrdBarcodeInfo mesPrdBarcodeInfo); } + diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesOrderBindService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesOrderBindService.java index 486a2e7..a91f454 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesOrderBindService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesOrderBindService.java @@ -67,4 +67,12 @@ public interface IMesOrderBindService * @return 采购销售订单绑定信息 */ public List selectMesOrderBindJoinList(MesOrderBind mesOrderBind); + + /** + * 查询采购销售订单绑定信息列表,Join product + * + * @param mesOrderBind 采购销售订单绑定信息 + * @return 采购销售订单绑定信息 + */ + public List selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java index 4f34636..978d0e8 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java @@ -132,4 +132,10 @@ public interface IMesProductPlanDetailService { * @return */ public int productPlanDetailContinue(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo); + + /** + * 生成生产计划明细统计表 + * @param time + */ + public void generateProduceStatisticsDetail(String time); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseOrderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseOrderService.java index 4a53d72..8cc6df7 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseOrderService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseOrderService.java @@ -158,4 +158,12 @@ public interface IMesPurchaseOrderService * @return 采购订单信息 */ public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId); + + /** + * 查询采购订单信息,join material + * + * @param purchaseOrderId 采购订单信息主键 + * @return 采购订单信息 + */ + public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java index 828d888..cf873a4 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java @@ -91,4 +91,11 @@ public interface IMesSaleOrderService * @return */ public List selectMesSaleOrderRelateJoinList(Long saleOrderId); + + /** + * 获取销售订单关联信息表,join product + * @param mesSaleOrderRelate + * @return + */ + public List selectMesSaleOrderRelateJoinProductList(MesSaleOrderRelate mesSaleOrderRelate); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java index 14d09b7..cd26375 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java @@ -16,9 +16,6 @@ import com.hw.mes.domain.*; import com.hw.mes.domain.vo.MesBindBarcodeVo; import com.hw.mes.mapper.*; import com.hw.mes.service.IMesBaseBarcodeInfoService; -import com.hw.printer.api.RemotePrinterService; -import com.hw.printer.api.domain.vo.PrintContentVo; -import com.hw.printer.api.domain.vo.PrinterVo; import com.hw.wms.api.RemoteWmsService; import com.hw.wms.api.domain.WmsWarehouseMaterial; import com.hw.wms.api.domain.vo.WmsProductStockVo; @@ -31,7 +28,6 @@ import org.springframework.data.redis.core.StringRedisTemplate; import javax.annotation.Resource; import java.math.BigDecimal; -import java.text.DecimalFormat; import java.util.*; import java.util.stream.Collectors; @@ -85,6 +81,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService @Autowired private MesRaiseCapitalBomMapper mesRaiseCapitalBomMapper; + @Autowired + private MesPrdBarcodeInfoMapper mesPrdBarcodeInfoMapper; + @Autowired private MesConfig mesConfig; @@ -92,6 +91,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService @Resource private RemoteWmsService remoteWmsService; + public final String splitCharacter = "/"; + public final int materialNameLength = 4; + /** * 查询条码信息 * @@ -295,11 +297,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo(); + queryBaseBarcodeInfo.setPurchaseOrderId(mesBaseBarcodeInfo.getPurchaseOrderId()); queryBaseBarcodeInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId()); queryBaseBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR); List baseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo); if (baseBarcodeInfos != null && !baseBarcodeInfos.isEmpty()) { - throw new ServiceException("已经有此物料固定条码,无需重复生成"); + throw new ServiceException("已经有此采购订单物料的固定条码,无需重复生成"); } String barcodeInfo = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode); @@ -655,15 +658,14 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService String printTemplate = ""; if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_RAW)) { - printTemplate = PrintContentVo.PRINT_TEMPLATE_RAW; + printTemplate = PrintConstants.PRINT_TEMPLATE_RAW; } else if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) { - printTemplate = PrintContentVo.PRINT_TEMPLATE_PRODUCT; + printTemplate = PrintConstants.PRINT_TEMPLATE_PRODUCT; } else if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_BIND)) { - printTemplate = PrintContentVo.PRINT_TEMPLATE_BIND; + printTemplate = PrintConstants.PRINT_TEMPLATE_BIND; } printContentJson.put("template", printTemplate); printContentJson.put("printContent", pintBarcodeJsonArr.toString()); - System.out.println(printContentJson.toString()); try { @@ -708,21 +710,21 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService String materialName = mesBaseBarcodeInfo.getMaterialName(); JSONObject printInfoObject = new JSONObject(); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE, mesBaseBarcodeInfo.getMaterialCode()); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE, mesBaseBarcodeInfo.getSaleorderCode()); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QRCODE, mesBaseBarcodeInfo.getBarcodeInfo()); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE, mesBaseBarcodeInfo.getMaterialCode()); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE, mesBaseBarcodeInfo.getSaleorderCode()); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_QRCODE, mesBaseBarcodeInfo.getBarcodeInfo()); - if (printType.equals(PrinterVo.PRINT_TYPE_RAW_LABEL)) { + if (printType.equals(PrintConstants.PRINT_TYPE_RAW_LABEL)) { // materialName = materialName.length() <= 10 ? "\n" + materialName : materialName; // printMaterialName.setValue(materialName.replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", "")); // printMaterialName.setType(PrintContentVo.TYPE_TEXT); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME, materialName); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME, materialName); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo()); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BATCH_CODE, mesBaseBarcodeInfo.getBatchCode()); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_PO_NO, mesBaseBarcodeInfo.getPoNo()); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo()); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_BATCH_CODE, mesBaseBarcodeInfo.getBatchCode()); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_PO_NO, mesBaseBarcodeInfo.getPoNo()); //常备物料为安全库存 @@ -732,7 +734,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService // printPreMaterial.setType(PrintContentVo.TYPE_CHECKBOX); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? "" + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? "" : mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", "")); // PrintContentVo printQty = new PrintContentVo(); @@ -743,13 +745,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService // printQty.setType(PrintContentVo.TYPE_TEXT); - } else if (printType.equals(PrinterVo.PRINT_TYPE_PRODUCT_LABEL)) { - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME, materialName); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? "" + } else if (printType.equals(PrintConstants.PRINT_TYPE_PRODUCT_LABEL)) { + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME, materialName); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? "" : mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", "")); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo()); - printInfoObject.put(PrintContentVo.PRODUCT_PLAN_CODE, mesBaseBarcodeInfo.getPlanCode()); - printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QTY, "1"); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo()); + printInfoObject.put(PrintConstants.PRODUCT_PLAN_CODE, mesBaseBarcodeInfo.getPlanCode()); + printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_QTY, "1"); } @@ -898,16 +900,32 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService String userName = SecurityUtils.getUsername(); Date currentDate = DateUtils.getNowDate(); if (productBarcodesArr != null) { - for (String productBarcode : productBarcodesArr) { + StringBuilder materialNameBuilder = new StringBuilder(); + for (String oriProductBarcode : productBarcodesArr) { //先根据之前的成品条码信息获取托盘信息 - MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcode); - MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcode); + + MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(oriProductBarcode); if (productBarcodeInfo == null) { - allErrorMsgBuilder.append("成品条码").append(productBarcode).append("不存在;"); - } else { - productBarcodeInfoList.add(productBarcodeInfo); + allErrorMsgBuilder.append("成品/配对码").append(oriProductBarcode).append("不存在;"); + } + + if(productBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)){ + productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodeInfo.getBindBarcode()); + if (productBarcodeInfo == null) { + allErrorMsgBuilder.append("成品/配对码[").append(oriProductBarcode).append("]的成品不存在;"); + } } + productBarcodeInfoList.add(productBarcodeInfo); + MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate(); + querySaleOrderRelate.setBindBarcode(productBarcodeInfo.getBarcodeInfo()); + List mesSaleOrderRelates = mesSaleOrderRelateMapper.selectMesSaleOrderRelateList(querySaleOrderRelate); + if(mesSaleOrderRelates!=null && !mesSaleOrderRelates.isEmpty()){ + allErrorMsgBuilder.append("此条码[").append(oriProductBarcode).append("]已经生成过原材料条码;"); + } + + + MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodeInfo.getBarcodeInfo()); //多个成品条码绑定的条码必须相同 if (basePalletInfo != null) { if (StringUtils.isEmpty(palletInfoCode)) { @@ -923,14 +941,20 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService basePalletInfoList.add(basePalletInfo); } - allErrorMsgBuilder.append(this.checkInternalMesBaseBarcode(productBarcode, productBarcodeInfo, mesBaseBarcodeInfo)); + allErrorMsgBuilder.append(this.checkInternalMesBaseBarcode(productBarcodeInfo.getBarcodeInfo(), productBarcodeInfo, mesBaseBarcodeInfo)); + + String materialName = productBarcodeInfo.getMaterialName(); + materialName = materialName.substring(0,materialNameLength); + materialNameBuilder.append(splitCharacter).append(materialName); } barcodeInfo = Seq.getId(Seq.mesInternalVirtualBarcodeSeqType, Seq.mesInternalVirtualBarcodeCode); + String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,""); + //新建虚拟物料 - materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate); + materialId = this.insertNewVirtualMaterial(barcodeInfo,mergeMaterialName, userName, currentDate); } else { MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodes); @@ -1044,6 +1068,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService // if (bindBarcodeRelate != null) { // allErrorMsgBuilder.append("成品条码:").append(productBarcodeInfo.getBarcodeInfo()).append("已经生成过原材料条码;"); // } + + + + //四楼到五楼,主要是多个成品合并到一个托盘后生成原材料条码需要保存以下信息,一个成品的保不保存无所谓 MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate(); saleOrderRelate.setBarcodeInfo(barcodeInfo); @@ -1240,6 +1268,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService */ @Override public List selectBarCodeAllocationWarehouse(MesBaseBarcodeInfo mesBaseBarcodeInfo) { + mesBaseBarcodeInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getMaterialSpec()) + ? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", "") : ""); return mesBaseBarcodeInfoMapper.selectBarCodeAllocationWarehouse(mesBaseBarcodeInfo); } @@ -1251,6 +1281,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService */ @Override public List selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo) { + mesBaseBarcodeInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getMaterialSpec()) + ? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", "") : ""); return mesBaseBarcodeInfoMapper.selectWarehouseBarCodeList(mesBaseBarcodeInfo); } @@ -1322,6 +1354,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService List toUpdatedMaterialBoms = new ArrayList<>(); StringBuilder errorMsgBuilder = new StringBuilder(); + int materialNameLength = 4; + String splitCharacter = "|"; + StringBuilder materialNameBuilder = new StringBuilder();//将多个物料的名称拼接(取前几个字符(materialNameLength)拼接,目前是前4个字符) for (MesSaleOrderRelate mesSaleOrderRelate : mesSaleOrderRelateList) { if (mesSaleOrderRelate.getOrderAmount() == null || mesSaleOrderRelate.getOrderAmount().compareTo(BigDecimal.ONE) != 0) { throw new ServiceException("请选择采购数量为1的采购订单信息"); @@ -1398,6 +1433,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService dbOrderBind.setUpdateBy(userName); mesOrderBindMapper.updateMesOrderBind(dbOrderBind); + + String materialName = mesSaleOrderRelate.getMaterialName(); + materialName = materialName.substring(0,materialNameLength); + materialNameBuilder.append(splitCharacter).append(materialName); // materialCodes.add(mesPurchaseOrderVo.getMaterialCode()); } @@ -1405,11 +1444,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService throw new ServiceException(errorMsgBuilder.toString()); } + String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,""); String barcodeInfo = Seq.getId(Seq.mesPurchaseVirtualBarcodeSeqType, Seq.mesPurchaseVirtualBarcodeCode); //新建虚拟物料 - Long materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate); + Long materialId = this.insertNewVirtualMaterial(barcodeInfo, mergeMaterialName,userName, currentDate); //创建虚拟销售订单,保存对应的销售订单列表 MesSaleOrder virtualSaleOrder = this.insertNewVirtualSaleOrder(materialId, barcodeInfo, mesBaseBarcodeInfo.getSaleorderCode(), mesSaleOrderRelateList, userName, currentDate); @@ -1429,6 +1469,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService toInsertedBarcodeInfo.setSaleorderCode(mesBaseBarcodeInfo.getSaleorderCode()); toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO); toInsertedBarcodeInfo.setSingleFlag(MesConstants.MES_BARCODE_SINGLE_FLAG_MERGE); + toInsertedBarcodeInfo.setAmount(new BigDecimal(mesSaleOrderRelateList.size())); // toInsertedBarcodeInfo.setBarcodeSpec(materialCodes.toString()); mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo); @@ -1449,11 +1490,11 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService } - public long insertNewVirtualMaterial(String barcodeInfo, String userName, Date currentDate) { + public long insertNewVirtualMaterial(String barcodeInfo, String materialName,String userName, Date currentDate) { //虚拟成品和虚拟原材料用一个物料 MesBaseMaterialInfo mesBaseMaterialInfo = new MesBaseMaterialInfo(); mesBaseMaterialInfo.setMaterialCode(barcodeInfo); - mesBaseMaterialInfo.setMaterialName(barcodeInfo); + mesBaseMaterialInfo.setMaterialName(materialName); mesBaseMaterialInfo.setBatchFlag(MesConstants.NOT_IS_BATCH); // mesBaseMaterialInfo.setMaterialCategories(MesConstants.MES_MATERIAL_CATEGORIES_RAW); mesBaseMaterialInfo.setActiveFlag(MesConstants.MES_MATERIAL_ALWAYS_FLAG_NO); @@ -1629,6 +1670,17 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService //修改后的合并信息 List mesSaleOrderRelateList = mesBaseBarcodeInfo.getMesSaleOrderRelateList(); + StringBuilder materialNameBuilder = new StringBuilder(); + + for(MesSaleOrderRelate mesSaleOrderRelate:mesSaleOrderRelateList){ + String materialName = mesSaleOrderRelate.getMaterialName(); + materialName = materialName.substring(0,materialNameLength); + materialNameBuilder.append(splitCharacter).append(materialName); + } + + String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,""); + mesBaseBarcodeInfo.setAmount(new BigDecimal(mesSaleOrderRelateList.size())); + //数据库中的合并信息 MesSaleOrderRelate querySaleOrderRelateByBarcodeInfo = new MesSaleOrderRelate(); querySaleOrderRelateByBarcodeInfo.setBarcodeInfo(barcodeInfo); @@ -1699,7 +1751,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService } + MesBaseMaterialInfo virtualMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(mesBaseBarcodeInfo.getMaterialId()); + virtualMaterialInfo.setMaterialName(mergeMaterialName); + + mesBaseMaterialInfoMapper.updateMesBaseMaterialInfo(virtualMaterialInfo); + //生成条码 + mesBaseBarcodeInfo.setUpdateBy(userName); mesBaseBarcodeInfo.setUpdateTime(currentDate); @@ -1754,6 +1812,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService public StringBuilder handleInsertSaleOrderRelates(List toInsertedSaleOrderRelateList, MesBaseBarcodeInfo baseBarcodeInfo, MesMaterialBom virtualMaterialBom, String userName, Date currentDate) { StringBuilder errorMsgBuilder = new StringBuilder(); + if(toInsertedSaleOrderRelateList==null || toInsertedSaleOrderRelateList.isEmpty()){ + return errorMsgBuilder; + } + List toUpdatedMaterialBoms = new ArrayList<>(); for (MesSaleOrderRelate mesSaleOrderRelate : toInsertedSaleOrderRelateList) { if (mesSaleOrderRelate.getOrderAmount() == null || mesSaleOrderRelate.getOrderAmount().compareTo(BigDecimal.ONE) != 0) { @@ -1846,6 +1908,18 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService } + /** + * 获取小包条码信息 + * @param mesPrdBarcodeInfo + * @return + */ + @Override + public List selectMesPrdBarcodeInfoList(MesPrdBarcodeInfo mesPrdBarcodeInfo){ + + return mesPrdBarcodeInfoMapper.selectMesPrdBarcodeInfoList(mesPrdBarcodeInfo); + } + + // public MesPurchaseOrder insertVirtualPurchaseOrder(Long materialId, String barcodeInfo, BigDecimal sumOrderAmount, // List mesPurchaseOrderRelates,String userName, Date currentDate) { // MesPurchaseOrder virtualPurchaseOrder = new MesPurchaseOrder(); @@ -2280,4 +2354,5 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService // } // // } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java index 9aee034..420c56b 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java @@ -157,6 +157,8 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi */ @Override public List selectMaterialInfos4AllocationWarehouse(MesBaseMaterialInfo mesBaseMaterialInfo) { + mesBaseMaterialInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseMaterialInfo.getMaterialSpec()) + ? mesBaseMaterialInfo.getMaterialSpec().replaceAll("\\s+", "") : ""); return mesBaseMaterialInfoMapper.selectMaterialInfos4AllocationWarehouse(mesBaseMaterialInfo); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBasePalletInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBasePalletInfoServiceImpl.java index a9ad3d4..25e3455 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBasePalletInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBasePalletInfoServiceImpl.java @@ -3,26 +3,28 @@ package com.hw.mes.service.impl; import java.util.Date; import java.util.HashMap; import java.util.List; +import java.util.concurrent.TimeUnit; import com.hw.common.core.constant.MesConstants; +import com.hw.common.core.constant.PrintConstants; import com.hw.common.core.constant.SecurityConstants; import com.hw.common.core.domain.R; import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.StringUtils; +import com.hw.common.core.utils.ip.IpUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.domain.vo.MesPalletInfoBindVo; import com.hw.mes.mapper.MesBaseBarcodeInfoMapper; -import com.hw.printer.api.RemotePrinterService; import com.hw.wms.api.RemoteWmsService; import com.hw.wms.api.domain.WmsWarehouseMaterial; import com.hw.wms.api.domain.vo.WmsProductStockVo; import com.hw.wms.api.domain.vo.WmsRawStockVo; -import com.hw.wms.api.domain.vo.WmsWarehouseMaterialExistVo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import com.hw.mes.mapper.MesBasePalletInfoMapper; import com.hw.mes.domain.MesBasePalletInfo; @@ -48,8 +50,8 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService { @Autowired private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper; - @Resource - private RemotePrinterService remotePrinterService; + @Autowired + private StringRedisTemplate redisTemplate; @Resource private RemoteWmsService remoteWmsService; @@ -153,7 +155,40 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService { throw new ServiceException("此物料条码还未打印"); } - if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getPalletInfoCode()) && mesBaseBarcodeInfo.getPalletInfoCode().equals(palletInfoCode)) { + if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) { + WmsWarehouseMaterial wmsWarehouseMaterial = new WmsWarehouseMaterial(); + wmsWarehouseMaterial.setStorageId(mesBaseBarcodeInfo.getMaterialId()); + R isExistWarehouseMaterial = remoteWmsService.isExistWarehouseMaterial(wmsWarehouseMaterial, SecurityConstants.INNER); + if (!isExistWarehouseMaterial.getData()) { + throw new ServiceException("此物料还没有配置仓库信息"); + } + } + + + String userName = SecurityUtils.getUsername(); + Date currentDate = new Date(); + String oriPalletInfoCode=""; + if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)) { + MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesBaseBarcodeInfo.getBindBarcode()); + oriPalletInfoCode = productBarcodeInfo.getPalletInfoCode(); + materialBarcode = productBarcodeInfo.getBarcodeInfo(); + + + productBarcodeInfo.setPalletInfoCode(palletInfoCode); + productBarcodeInfo.setUpdateBy(userName); + productBarcodeInfo.setUpdateTime(currentDate); + mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(productBarcodeInfo); + + } else { + oriPalletInfoCode = mesBaseBarcodeInfo.getPalletInfoCode(); + mesBaseBarcodeInfo.setPalletInfoCode(palletInfoCode); + mesBaseBarcodeInfo.setUpdateBy(userName); + mesBaseBarcodeInfo.setUpdateTime(currentDate); + mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo); + } + + + if (StringUtils.isNotEmpty(oriPalletInfoCode) && oriPalletInfoCode.equals(palletInfoCode)) { throw new ServiceException("已经绑定过"); } @@ -172,26 +207,10 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService { throw new ServiceException("此物料条码存在原材料库存,不能绑定"); } - if(mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)){ - WmsWarehouseMaterial wmsWarehouseMaterial = new WmsWarehouseMaterial(); - wmsWarehouseMaterial.setStorageId(mesBaseBarcodeInfo.getMaterialId()); - R isExistWarehouseMaterial = remoteWmsService.isExistWarehouseMaterial(wmsWarehouseMaterial, SecurityConstants.INNER); - if (!isExistWarehouseMaterial.getData()) { - throw new ServiceException("此物料还没有配置仓库信息"); - } - } - - - String userName = SecurityUtils.getUsername(); - Date currentDate = new Date(); - mesBaseBarcodeInfo.setPalletInfoCode(palletInfoCode); - mesBaseBarcodeInfo.setUpdateBy(userName); - mesBaseBarcodeInfo.setUpdateTime(currentDate); - mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo); mesBasePalletInfo.setMaterialBarcode(materialBarcode); mesBasePalletInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId()); - mesBasePalletInfo.setMaterialCode(mesBasePalletInfo.getMaterialCode()); + mesBasePalletInfo.setMaterialCode(mesBaseBarcodeInfo.getMaterialCode()); mesBasePalletInfo.setMaterialName(mesBaseBarcodeInfo.getMaterialName()); mesBasePalletInfo.setUpdateBy(userName); mesBasePalletInfo.setUpdateTime(currentDate); @@ -209,24 +228,34 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService { */ @Override public int printPalletInfoCodes(String[] palletInfoCodes) { - StringBuilder buffer = new StringBuilder(); + com.alibaba.fastjson.JSONArray printInfoJsonArr = new com.alibaba.fastjson.JSONArray(); + com.alibaba.fastjson.JSONObject printContentJson = new com.alibaba.fastjson.JSONObject(); for (String palletInfoCode : palletInfoCodes) { if (StringUtils.isNotEmpty(palletInfoCode)) { - try { - HashMap params = new HashMap<>(); - params.put("text", palletInfoCode); - params.put("qrCode", palletInfoCode); - //调用的打印接口 - remotePrinterService.printLocationLabel(params, SecurityConstants.INNER); - } catch (Exception e) { - buffer.append("打印托盘RFID编码报错——[编码内容:").append(palletInfoCode).append("]").append(e.getMessage()); + com.alibaba.fastjson.JSONObject printInfoObject = new com.alibaba.fastjson.JSONObject(); + if (StringUtils.isNotEmpty(palletInfoCode)) { + printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_TEXT, palletInfoCode); + printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_QRCODE, palletInfoCode); + printInfoJsonArr.add(printInfoObject); + } else { + throw new ServiceException("请选择有设备编号的设备进行打印"); } } } - if (buffer.length() == 0) { - return 1; - } else { - throw new ServiceException(buffer.toString()); + String printTemplate = PrintConstants.PRINT_TEMPLATE_SMALL; + printContentJson.put("template", printTemplate); + printContentJson.put("printContent", printInfoJsonArr.toString()); + + try { + String hostIp = IpUtils.getIpAddr(); + String printKey = "print_" + hostIp; + redisTemplate.opsForList().rightPush(printKey, printContentJson.toString()); + redisTemplate.expire(printKey, 1, TimeUnit.DAYS); +// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString()); + } catch (Exception e) { + throw new ServiceException("打印失败:" + e.getMessage()); } + + return 1; } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseStationInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseStationInfoServiceImpl.java index b04aa16..5fb554a 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseStationInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseStationInfoServiceImpl.java @@ -101,7 +101,6 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService */ @Override public MesBaseStationInfo getLoginStationInfo() { - //TODO:正式时需要修改回来 String ipAddress = SecurityUtils.getLoginUser().getIpaddr(); // ipAddress = "192.168.2.25"; diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java index 3f0cbff..94d198d 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java @@ -386,7 +386,7 @@ public class MesImportImpl implements IMesImportService { } Cell amountCell = rowC.getCell(5); Cell brandCell = rowC.getCell(6); - if (StringUtils.isNotEmpty(materialCode)) { + if (StringUtils.isNotEmpty(materialCode) && !materialCode.equals("物料编码")) { MesBaseMaterialInfo materialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(materialCode); if (StringUtils.isNotNull(materialInfo)) { MesRaiseCapitalBom materialBom = new MesRaiseCapitalBom(); diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesOrderBindServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesOrderBindServiceImpl.java index 328d4e6..aef2623 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesOrderBindServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesOrderBindServiceImpl.java @@ -104,4 +104,17 @@ public class MesOrderBindServiceImpl implements IMesOrderBindService { ? mesOrderBind.getSpecificationParameter().replaceAll("\\s+", "") : ""); return mesOrderBindMapper.selectMesOrderBindJoinList(mesOrderBind); } + + + + /** + * 查询采购销售订单绑定信息列表,Join product + * + * @param mesOrderBind 采购销售订单绑定信息 + * @return 采购销售订单绑定信息 + */ + @Override + public List selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind) { + return mesOrderBindMapper.selectMesOrderBindJoinList(mesOrderBind); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java index cd3d843..181feb3 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java @@ -22,6 +22,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -52,6 +53,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer @Autowired private MesProductOrderMapper mesProductOrderMapper; + @Autowired + private MesStatusChangeInfoMapper mesStatusChangeInfoMapper; + + @Autowired + private MesProduceStatisticsDetailMapper mesProduceStatisticsDetailMapper; + @Autowired private MesConfig mesConfig; @@ -365,7 +372,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer } - //如果是五楼拆分,校验是否有配对条码 if (StringUtils.isNotEmpty(mesProductPlanDetail.getProcessType()) && mesProductPlanDetail.getProcessType().equals(MesConstants.MES_PROCESS_TYPE_FIFTH_SPLIT)) { @@ -528,7 +534,8 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer @Override @Transactional(rollbackFor = Exception.class) public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail, String startType) { - //根据planId获取最新一条的生产计划明细 + //根据planId和userId获取最新一条的生产计划明细 + mesProductPlanDetail.setUserId(SecurityUtils.getUserId()); MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail); //如果此计划有最新的计划明细 @@ -665,14 +672,14 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer } - if (StringUtils.isNotEmpty(bindBarcodeInfo.getTransferredPlanDetailCode())) { - throw new ServiceException("此条码已经扫描使用过,不能再次使用"); - } +// if (StringUtils.isNotEmpty(bindBarcodeInfo.getTransferredPlanDetailCode())) { +// throw new ServiceException("此条码已经扫描使用过,不能再次使用"); +// } MesProductPlan barcodeProductPlan; if (bindBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {//如果是成品码,则是4楼绑定的,需要找到5楼生成的原材料条码 - //四楼到5楼的装配开始时有可能柜体还没运输上来,还未生成原材料条码,组装出库再判断 + //四楼到5楼的装配开始时有可能柜体还没运输上来,还未生成原材料条码,组装出库再判断 // MesBaseBindBarcode mesBaseBindBarcode = mesBaseBindBarcodeMapper.selectMesBaseBindBarcodeByBindBarcode(mesBaseBarcodeInfo.getBindBarcode()); // if (mesBaseBindBarcode ==null) { // throw new ServiceException("未按成品条码生成原材料条码"); @@ -693,8 +700,16 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer if (!barcodeProductPlan.getDispatchCode().equals(dispatchCode)) { throw new ServiceException("此条码的派工单号为:" + barcodeProductPlan.getDispatchCode() + ",与此派工单号不符"); } - } + MesProductPlanDetail queryProductPlanDetail = new MesProductPlanDetail(); + queryProductPlanDetail.setMaterialBarcode(materialBarcode); + queryProductPlanDetail.setUserId(SecurityUtils.getUserId()); + List mesProductPlanDetails = mesProductPlanDetailMapper.selectMesProductPlanDetailList(queryProductPlanDetail); + if(mesProductPlanDetails!=null && !mesProductPlanDetails.isEmpty()){ + throw new ServiceException("您已经扫描此条码开始过,请勿重复扫描"); + } + + } bindBarcodeInfo.setTransferredPlanDetailCode(planDetailCode); @@ -754,7 +769,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer } - /** * 生产计划明细暂停 * @@ -763,13 +777,13 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer */ @Override public int productPlanDetailPause(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) { - MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()) ; + MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()); String planDetailStatus = mesProductPlanDetail.getPlanDetailStatus(); // 明细状态:1-未开始;2-已开始;3-已完成;4-暂停,9-异常完成(校验物料信息不完整) //已开始的可以改为暂停 - if(!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)){ + if (!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)) { String planDetailStatusPrompt = MesConstants.PLAN_DETAIL_STATUS_PROMPT_MAP.get(planDetailStatus); throw new ServiceException(String.format("此生产计划明细已经%s,不能暂停!", planDetailStatusPrompt)); } @@ -781,7 +795,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer } - /** * 生产计划明细继续 * @@ -790,13 +803,13 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer */ @Override public int productPlanDetailContinue(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) { - MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()) ; + MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()); String planDetailStatus = mesProductPlanDetail.getPlanDetailStatus(); // 明细状态:1-未开始;2-已开始;3-已完成;4-暂停,9-异常完成(校验物料信息不完整) //已开始的可以改为暂停 - if(!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)){ + if (!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)) { String planDetailStatusPrompt = MesConstants.PLAN_DETAIL_STATUS_PROMPT_MAP.get(planDetailStatus); throw new ServiceException(String.format("此生产计划明细已经%s,不能继续!", planDetailStatusPrompt)); } @@ -807,4 +820,86 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail); } + + /** + * 生成生产计划明细统计表 + * @param time + */ + @Override + public void generateProduceStatisticsDetail(String time) { + MesProductPlanDetail queryProductPlandetail = new MesProductPlanDetail(); + queryProductPlandetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH); + queryProductPlandetail.setStatisticsFlag("1"); + List mesProductPlanDetailList = mesProductPlanDetailMapper.selectMesProductPlanDetailList4Statistics(queryProductPlandetail); + + for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList) { + MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanId(mesProductPlanDetail.getPlanId()); + + //易耗品标识,分摊到各个生产计划明细中 + + + //计算工时 + Date realBeginTime = mesProductPlanDetail.getRealBeginTime(); + Date realEndTime = mesProductPlanDetail.getRealEndTime(); + Long produceTime = realEndTime.getTime()-realBeginTime.getTime(); + + MesStatusChangeInfo queryStatusChangeInfo = new MesStatusChangeInfo(); + queryStatusChangeInfo.setProductOrderId(mesProductPlan.getProductOrderId()); + queryStatusChangeInfo.setPlanDetailId(mesProductPlanDetail.getPlanDetailId()); + List mesStatusChangeInfoList = mesStatusChangeInfoMapper.selectMesStatusChangeInfoListByProduce(queryStatusChangeInfo); + +// Optional result = mesStatusChangeInfoList.stream() +// .filter(msci -> (StringUtils.isEmpty(msci.getOldStatus()) && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)) +// || StringUtils.isNotEmpty(msci.getOldStatus()) && msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED) +// && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)) +// .findFirst(); +// if(result.isPresent()){ +// MesStatusChangeInfo startStatus = result.get(); +// } + + List pause2StartOrFinishChangeInfoList = mesStatusChangeInfoList.stream() + .filter(msci -> StringUtils.isNotEmpty(msci.getOldStatus()) && ((msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE) + && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)) + || (msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE) + && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)))).collect(Collectors.toList()); + + List start2PauseChangeInfoList = mesStatusChangeInfoList.stream() + .filter(msci -> StringUtils.isNotEmpty(msci.getOldStatus()) && (msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED) + && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE))).collect(Collectors.toList()); + + if (pause2StartOrFinishChangeInfoList.size() == start2PauseChangeInfoList.size()) { + for (int i = 0; i < pause2StartOrFinishChangeInfoList.size(); i++) { + MesStatusChangeInfo pause2StartOrFinishChangeInfo = pause2StartOrFinishChangeInfoList.get(i); + MesStatusChangeInfo start2PauseChangeInfo = start2PauseChangeInfoList.get(i); + Long startOrFinshChangeTimeL = pause2StartOrFinishChangeInfo.getChangeTime().getTime(); + Long pauseChangeTimeL = start2PauseChangeInfo.getChangeTime().getTime(); + produceTime = produceTime -(startOrFinshChangeTimeL-pauseChangeTimeL); + } + } + + + MesProduceStatisticsDetail mesProduceStatisticsDetail = new MesProduceStatisticsDetail(); + mesProduceStatisticsDetail.setProductOrderId(mesProductPlan.getProductOrderId()); + mesProduceStatisticsDetail.setSaleOrderId(mesProductPlan.getSaleOrderId()); + mesProduceStatisticsDetail.setSaleorderCode(mesProductPlan.getSaleorderCode()); + mesProduceStatisticsDetail.setPlanId(mesProductPlanDetail.getPlanId()); + mesProduceStatisticsDetail.setPlanCode(mesProductPlan.getPlanCode()); + mesProduceStatisticsDetail.setPlanDetailId(mesProductPlanDetail.getPlanDetailId()); + mesProduceStatisticsDetail.setPlanDetailCode(mesProductPlanDetail.getPlanDetailCode()); + mesProduceStatisticsDetail.setProductId(mesProductPlan.getMaterialId()); + mesProduceStatisticsDetail.setUserId(mesProductPlanDetail.getUserId()); + mesProduceStatisticsDetail.setNickName(mesProductPlanDetail.getNickName()); + mesProduceStatisticsDetail.setProcessId(mesProductPlan.getProcessId()); + mesProduceStatisticsDetail.setProcessName(mesProductPlan.getProcessName()); + mesProduceStatisticsDetail.setPlanBeginTime(mesProductPlan.getPlanBeginTime()); + mesProduceStatisticsDetail.setPlanEndTime(mesProductPlan.getRealEndTime()); + mesProduceStatisticsDetail.setRealBeginTime(realBeginTime); + mesProduceStatisticsDetail.setRealEndTime(realEndTime); + mesProduceStatisticsDetail.setProduceTime(produceTime); + mesProduceStatisticsDetail.setCreateTime(new Date()); + + mesProduceStatisticsDetailMapper.insertMesProduceStatisticsDetail(mesProduceStatisticsDetail); + + } + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java index b2f004d..6366011 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java @@ -585,4 +585,16 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService { public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId) { return mesPurchaseOrderMapper.selectPurchaseOrderJoinSupplierProjectByOrderId(purchaseOrderId); } + + + /** + * 查询采购订单信息,join material + * + * @param purchaseOrderId 采购订单信息主键 + * @return 采购订单信息 + */ + @Override + public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId) { + return mesPurchaseOrderMapper.selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(purchaseOrderId); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java index 1a406dd..ebc515c 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.mes.service.impl; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -11,7 +12,9 @@ import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesSaleOrderRelate; import com.hw.mes.api.domain.vo.MesBaseBarcodeInfoTransferVo; import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo; +import com.hw.mes.domain.MesMaterialBom; import com.hw.mes.mapper.MesBaseBarcodeInfoMapper; +import com.hw.mes.mapper.MesMaterialBomMapper; import com.hw.mes.mapper.MesSaleOrderRelateMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -37,6 +40,9 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { @Autowired private MesSaleOrderRelateMapper mesSaleOrderRelateMapper; + @Autowired + private MesMaterialBomMapper mesMaterialBomMapper; + /** * 查询销售订单信息 * @@ -116,7 +122,36 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { public List selectMesSaleOrderJoinMaterialList(MesSaleOrder mesSaleOrder) { mesSaleOrder.setMaterialSpec(StringUtils.isNotEmpty(mesSaleOrder.getMaterialSpec()) ? mesSaleOrder.getMaterialSpec().replaceAll("\\s+", "") : ""); - return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder); + if (mesSaleOrder.getMaterialId() != null) { + MesMaterialBom queryMaterialBom = new MesMaterialBom(); + queryMaterialBom.setMaterialId(mesSaleOrder.getMaterialId()); + List mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom); + if (mesMaterialBoms != null && !mesMaterialBoms.isEmpty()) { + StringBuilder parentIdsBuilder = new StringBuilder(); + for (MesMaterialBom mesMaterialBom : mesMaterialBoms) { + String ancestors = mesMaterialBom.getAncestors(); + int commaIndex = ancestors.indexOf(","); + if (commaIndex >= 0) { + String ancestorPostfix = ancestors.substring(commaIndex + 1); + commaIndex = ancestorPostfix.indexOf(","); + if (commaIndex >= 0) { + ancestorPostfix = ancestorPostfix.substring(commaIndex + 1); + } + parentIdsBuilder.append(",").append(ancestorPostfix); + } + + } + + String parentIds = parentIdsBuilder.toString().replaceFirst(",", ""); + mesSaleOrder.setParentIds(parentIds); + return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder); + } else { + return new ArrayList<>(); + } + + } else { + return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder); + } } @@ -173,11 +208,12 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { /** * 根据relatesaleorderId查询关联的成品信息 + * * @param saleOrderId * @return */ @Override - public List getRelateProductsBySaleOrderId(Long saleOrderId){ + public List getRelateProductsBySaleOrderId(Long saleOrderId) { MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate(); querySaleOrderRelate.setSaleOrderId(saleOrderId); return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinProductList(querySaleOrderRelate); @@ -185,16 +221,25 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { /** * 根据relatesaleorderId查询关联的原材料信息 + * * @param saleOrderId * @return */ @Override - public List selectMesSaleOrderRelateJoinList(Long saleOrderId){ + public List selectMesSaleOrderRelateJoinList(Long saleOrderId) { MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate(); querySaleOrderRelate.setSaleOrderId(saleOrderId); return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinList(querySaleOrderRelate); } - + /** + * 获取销售订单关联信息表,join product + * @param mesSaleOrderRelate + * @return + */ + @Override + public List selectMesSaleOrderRelateJoinProductList(MesSaleOrderRelate mesSaleOrderRelate){ + return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinProductList(mesSaleOrderRelate); + } } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml index 88e7762..f723d8a 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml @@ -103,13 +103,15 @@ and bbi.print_time = #{printTime} + and bbi.purchase_order_id = #{purchaseOrderId} and bbi.print_person = #{printPerson} and bbi.print_flag = #{printFlag} and bbi.batch_flag = #{batchFlag} and bbi.barcode_type in (${barcodeTypeStr}) and bbi.barcode_type = #{barcodeType} and bbi.single_flag = #{singleFlag} - and bbi.barcode_info = #{barcodeInfo} + and bbi.barcode_info like concat('%', #{barcodeInfo}, + '%') and bbi.batch_code = #{batchCode} and bbi.pallet_info_code = #{palletInfoCode} and bbi.bind_barcode = #{bindBarcode} @@ -136,8 +138,10 @@ and bbi.production_date = #{productionDate} and bbi.accepted_date = #{acceptedDate} and bbi.last_outstock_date = #{lastOutstockDate} - and bbi.plan_code = #{planCode} - and bbi.plan_detail_code = #{planDetailCode} + and bbi.plan_code like concat('%', #{planCode}, + '%') + and bbi.plan_detail_code like concat('%', #{planDetailCode}, + '%') and bbi.sale_order_id = #{saleOrderId} and bbi.saleorder_code like concat('%', #{saleorderCode}, '%') @@ -154,6 +158,11 @@ or exists (select 1 from mes_base_barcode_info mbbi where mbbi.plan_detail_code =#{planDetailCode} and bbi.bind_barcode=mbbi.barcode_info) + + and exists + (select 1 from mes_prd_barcode_info mpbi where mpbi.prd_barcode_info like concat('%', #{prdBarcodeInfo}, '%') + and mpbi.mes_barcode_info=bbi.barcode_info) + order by bbi.barcode_id desc @@ -437,6 +446,8 @@ and wlb.location_code = #{locationCode}) and bmi.material_code like concat('%', #{materialCode},'%') and bmi.material_name like concat('%', #{materialName},'%') + and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec}, + '%') and bbi.barcode_info like concat('%', #{barcodeInfo},'%') @@ -455,6 +466,8 @@ and wlb.location_code = #{locationCode} and bmi.material_code like concat('%', #{materialCode},'%') and bmi.material_name like concat('%', #{materialName},'%') + and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec}, + '%') and wlb.barcode_info like concat('%', #{barcodeInfo},'%') diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml index b88163a..263c7f3 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml @@ -311,6 +311,8 @@ and material_name like concat('%', #{materialName}, '%') + and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec}, + '%') and material_categories = #{materialCategories} @@ -322,7 +324,6 @@ and material_unit_id = #{materialUnitId} and material_unit = #{materialUnit} and material_matkl = #{materialMatkl} - and material_spec = #{materialSpec} and net_weight = #{netWeight} and gross_weight = #{grossWeight} and factory_id = #{factoryId} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml index 8b4482a..8325705 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml @@ -169,4 +169,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by mob.order_bind_id desc + + + + + + \ No newline at end of file diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPrdBarcodeInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPrdBarcodeInfoMapper.xml new file mode 100644 index 0000000..8d7a03c --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPrdBarcodeInfoMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + select prd_barcode_id, prd_barcode_info, print_flag, mes_barcode_info, pallet_info_code, creat_time, print_time, bind_time from mes_prd_barcode_info + + + + + + + + insert into mes_prd_barcode_info + + prd_barcode_info, + print_flag, + mes_barcode_info, + pallet_info_code, + creat_time, + print_time, + bind_time, + + + #{prdBarcodeInfo}, + #{printFlag}, + #{mesBarcodeInfo}, + #{palletInfoCode}, + #{creatTime}, + #{printTime}, + #{bindTime}, + + + + + update mes_prd_barcode_info + + prd_barcode_info = #{prdBarcodeInfo}, + print_flag = #{printFlag}, + mes_barcode_info = #{mesBarcodeInfo}, + pallet_info_code = #{palletInfoCode}, + creat_time = #{creatTime}, + print_time = #{printTime}, + bind_time = #{bindTime}, + + where prd_barcode_id = #{prdBarcodeId} + + + + delete from mes_prd_barcode_info where prd_barcode_id = #{prdBarcodeId} + + + + delete from mes_prd_barcode_info where prd_barcode_id in + + #{prdBarcodeId} + + + \ No newline at end of file diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProduceStatisticsDetailMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProduceStatisticsDetailMapper.xml new file mode 100644 index 0000000..f2b2960 --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProduceStatisticsDetailMapper.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select statistics_detail_id, product_order_id, sale_order_id, saleorder_code, plan_id, plan_code, plan_detail_id, plan_detail_code, product_id, product_code, product_name, product_spec, user_id, nick_name, process_id, process_name, plan_begin_time, plan_end_time, real_begin_time, real_end_time, produce_time, create_time from mes_produce_statistics_detail + + + + + + + + insert into mes_produce_statistics_detail + + product_order_id, + sale_order_id, + saleorder_code, + plan_id, + plan_code, + plan_detail_id, + plan_detail_code, + product_id, + product_code, + product_name, + product_spec, + user_id, + nick_name, + process_id, + process_name, + plan_begin_time, + plan_end_time, + real_begin_time, + real_end_time, + produce_time, + create_time, + + + #{productOrderId}, + #{saleOrderId}, + #{saleorderCode}, + #{planId}, + #{planCode}, + #{planDetailId}, + #{planDetailCode}, + #{productId}, + #{productCode}, + #{productName}, + #{productSpec}, + #{userId}, + #{nickName}, + #{processId}, + #{processName}, + #{planBeginTime}, + #{planEndTime}, + #{realBeginTime}, + #{realEndTime}, + #{produceTime}, + #{createTime}, + + + + + update mes_produce_statistics_detail + + product_order_id = #{productOrderId}, + sale_order_id = #{saleOrderId}, + saleorder_code = #{saleorderCode}, + plan_id = #{planId}, + plan_code = #{planCode}, + plan_detail_id = #{planDetailId}, + plan_detail_code = #{planDetailCode}, + product_id = #{productId}, + product_code = #{productCode}, + product_name = #{productName}, + product_spec = #{productSpec}, + user_id = #{userId}, + nick_name = #{nickName}, + process_id = #{processId}, + process_name = #{processName}, + plan_begin_time = #{planBeginTime}, + plan_end_time = #{planEndTime}, + real_begin_time = #{realBeginTime}, + real_end_time = #{realEndTime}, + produce_time = #{produceTime}, + create_time = #{createTime}, + + where statistics_detail_id = #{statisticsDetailId} + + + + delete from mes_produce_statistics_detail where statistics_detail_id = #{statisticsDetailId} + + + + delete from mes_produce_statistics_detail where statistics_detail_id in + + #{statisticsDetailId} + + + + + delete from mes_produce_statistics_detail_material where statistics_detail_id in + + #{statisticsDetailId} + + + + + delete from mes_produce_statistics_detail_material where statistics_detail_id = #{statisticsDetailId} + + + + insert into mes_produce_statistics_detail_material( statistics_detail_material_id, statistics_detail_id, material_id, material_code, material_name, material_spec, used_amount) values + + ( #{item.statisticsDetailMaterialId}, #{item.statisticsDetailId}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.usedAmount}) + + + \ No newline at end of file diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml index c5e8f73..a668ada 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml @@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -43,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and real_end_time = #{realEndTime} and plan_detail_status = #{planDetailStatus} and is_flag = #{isFlag} + and material_barcode = #{materialBarcode} order by plan_detail_status asc,plan_detail_id desc @@ -138,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" real_begin_time, real_end_time, plan_detail_status from mes_product_plan_detail mppd + and user_id = #{userId} and plan_id = #{planId} and exists (select 1 from mes_product_plan mpp where mppd.plan_id=mpp.plan_id and mpp.station_id=#{stationId}) @@ -166,4 +169,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where material_barcode = #{materialBarcode} + + + + + + + + + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml index bd093e2..6822feb 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml @@ -43,6 +43,7 @@ + @@ -350,7 +351,7 @@ mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time, mpp.real_begin_time, mpp.real_end_time, mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mpo.sale_type,mpo.cabinet_channel,mpo.material_id as product_id, - mbmi.material_code,mbmi.material_name,mbmi.material_spec + mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.material_classfication from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id @@ -546,4 +547,42 @@ + + + + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml index dde12f3..4faf53c 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml @@ -299,7 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mpo.specification_parameter like concat('%', #{specificationParameter}, '%') and mbmi.material_spec like concat('%', #{materialSpec}, '%') and mbmi.always_flag = #{alwaysFlag} - + and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mpo.material_id and mmb.ancestors like concat('0,', #{materialBomId}, '%') ) order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name @@ -474,7 +474,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and replace(pbmi.material_spec,' ','') like concat('%', #{productSpec}, '%') - order by mpo.po_no + order by mpo.create_time desc @@ -498,4 +498,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where a.purchase_order_id = #{purchaseOrderId} + + + + + + + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml index eeed4a6..ac50833 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml @@ -270,7 +270,7 @@ and mso.sale_order_classfication = #{saleOrderClassfication} and exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id and msor.sale_order_id=#{virtualSaleOrderId}) and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id) - + and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds})) order by mso.erp_modify_date desc diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml index d0790d3..39add43 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and barcode_info = #{barcodeInfo} + and bind_barcode = #{bindBarcode} and sale_order_id = #{saleOrderId} and relate_sale_order_id = #{relateSaleOrderId} and purchase_order_id = #{purchaseOrderId} @@ -144,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and relate_sale_order_id = #{relateSaleOrderId} and purchase_order_id = #{purchaseOrderId} and relate_sale_order_amount = #{relateSaleOrderAmount} + and virtual_material_id = #{virtualMaterialId} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesStatusChangeInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesStatusChangeInfoMapper.xml new file mode 100644 index 0000000..7c1a54c --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesStatusChangeInfoMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + select status_change_info_id, change_type, change_id, old_status, new_status, change_by, change_time from mes_status_change_info + + + + + + + + insert into mes_status_change_info + + change_type, + change_id, + old_status, + new_status, + change_by, + change_time, + + + #{changeType}, + #{changeId}, + #{oldStatus}, + #{newStatus}, + #{changeBy}, + #{changeTime}, + + + + + update mes_status_change_info + + change_type = #{changeType}, + change_id = #{changeId}, + old_status = #{oldStatus}, + new_status = #{newStatus}, + change_by = #{changeBy}, + change_time = #{changeTime}, + + where status_change_info_id = #{statusChangeInfoId} + + + + delete from mes_status_change_info where status_change_info_id = #{statusChangeInfoId} + + + + delete from mes_status_change_info where status_change_info_id in + + #{statusChangeInfoId} + + + + + + + \ No newline at end of file diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/WfProcessActivityServiceImpl.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/WfProcessActivityServiceImpl.java index 57b744b..74d2522 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/WfProcessActivityServiceImpl.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/WfProcessActivityServiceImpl.java @@ -67,6 +67,8 @@ public class WfProcessActivityServiceImpl implements IWfProcessActivityService wfProcessFor.setTimeLimitDays(days); wfProcessFor.setTimeLimitHours(hours/(60*60l)); } + + } return wfProcessActivities; } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMove.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMove.java index a3bef50..88a0209 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMove.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMove.java @@ -91,7 +91,7 @@ public class WmsMove extends BaseEntity private String applyBy; /** 申请时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") private Date applyDate; @@ -100,22 +100,22 @@ public class WmsMove extends BaseEntity private String auditBy; /** 审核时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd") private Date auditDate; /** 最后更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd") private Date updateDate; /** 开始时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") private Date beginTime; /** 结束时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") private Date endTime; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawReturn.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawReturn.java index b576ca4..cae3335 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawReturn.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawReturn.java @@ -139,6 +139,9 @@ public class WmsRawReturn extends BaseEntity private String productName; + private String executeStatusStr; + + /** 原材料退库记录明细信息 */ private List wmsRawReturnDetailList; @@ -437,6 +440,14 @@ public class WmsRawReturn extends BaseEntity this.productName = productName; } + public String getExecuteStatusStr() { + return executeStatusStr; + } + + public void setExecuteStatusStr(String executeStatusStr) { + this.executeStatusStr = executeStatusStr; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java index 688492d..857ebdd 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java @@ -3,6 +3,7 @@ package com.hw.wms.domain.vo; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * @Description: 原材料出库审核VO @@ -14,10 +15,14 @@ import javax.validation.constraints.NotBlank; @Data public class WmsProductOutstockAuditVo { - //审核状态 - @NotBlank(message = "任务编号必须输入") + //任务编号 private String taskCode; + + //成品出库记录ID + @NotNull(message = "成品出库记录ID必须输入") + private Long productOutstockId; + //审核状态 @NotBlank(message = "审核状态必须输入") private String auditStatus; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java index 6e075de..be6defe 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java @@ -2,15 +2,14 @@ package com.hw.wms.service.impl; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; -import com.hw.common.core.constant.SecurityConstants; +import com.hw.common.core.constant.PrintConstants; import com.hw.common.core.constant.WmsConstants; import com.hw.common.core.enums.WmsLocationStatus; import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.StringUtils; +import com.hw.common.core.utils.ip.IpUtils; import com.hw.common.security.utils.SecurityUtils; -//import com.hw.printer.api.RemotePrinterService; -import com.hw.printer.api.RemotePrinterService; import com.hw.wms.domain.WmsBaseLocation; import com.hw.wms.domain.WmsBaseWarehouse; import com.hw.wms.domain.WmsLocationBarcode; @@ -19,10 +18,11 @@ import com.hw.wms.mapper.WmsBaseWarehouseMapper; import com.hw.wms.mapper.WmsLocationBarcodeMapper; import com.hw.wms.service.IWmsBaseLocationService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import java.util.*; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** @@ -42,8 +42,8 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { @Autowired private WmsLocationBarcodeMapper wmsLocationBarcodeMapper; - @Resource - private RemotePrinterService remotePrinterService; + @Autowired + private StringRedisTemplate redisTemplate; /** * 查询库位 @@ -220,8 +220,11 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { */ @Override public int printLabels(Long[] locationIds, int type) { + com.alibaba.fastjson.JSONArray printInfoJsonArr = new com.alibaba.fastjson.JSONArray(); + com.alibaba.fastjson.JSONObject printContentJson = new com.alibaba.fastjson.JSONObject(); StringBuilder buffer = new StringBuilder(); for (Long locationId : locationIds) { + com.alibaba.fastjson.JSONObject printInfoObject = new com.alibaba.fastjson.JSONObject(); WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationId(locationId); String qrCode = ""; if (type == 1) { @@ -230,20 +233,28 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { qrCode = baseLocation.getContainerCode(); } if (StringUtils.isNotEmpty(qrCode)) { - try { - HashMap params = new HashMap<>(); - params.put("text", qrCode); - params.put("qrCode", qrCode); - //调用的打印接口 - remotePrinterService.printLocationLabel(params, SecurityConstants.INNER); - } catch (Exception e) { - buffer.append("打印料箱条码报错——[条码内容:").append(qrCode).append("]").append(e.getMessage()); - } + printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_TEXT, qrCode); + printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_QRCODE, qrCode); + printInfoJsonArr.add(printInfoObject); } else { buffer.append("打印料箱条码为空——[库位条码:").append(baseLocation.getLocationCode()).append("]"); } } if (buffer.length() == 0) { + String printTemplate = PrintConstants.PRINT_TEMPLATE_SMALL; + printContentJson.put("template", printTemplate); + printContentJson.put("printContent", printInfoJsonArr.toString()); + + try { + String hostIp = IpUtils.getIpAddr(); + String printKey = "print_" + hostIp; + redisTemplate.opsForList().rightPush(printKey, printContentJson.toString()); + redisTemplate.expire(printKey,1, TimeUnit.DAYS); +// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString()); + } catch (Exception e) { + throw new ServiceException("打印失败:" + e.getMessage()); + } + return 1; } else { throw new ServiceException(buffer.toString()); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java index cb39a05..d00fabc 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java @@ -201,7 +201,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { throw new RuntimeException("没有绑定的成品条码信息!"); } - for(MesBaseBindBarcode baseBindBarcode:baseBindBarcodeList){ + for (MesBaseBindBarcode baseBindBarcode : baseBindBarcodeList) { this.saveWmsProductInstock(baseLocation.getWarehouseId(), locationCode, baseBarcodeInfo.getPlanCode(), baseBarcodeInfo.getPlanDetailCode(), null, baseBindBarcode.getProductId(), userName, currentDate); @@ -417,14 +417,32 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { * @return */ public int produceInstock(MesBaseBarcodeInfo baseBarcodeInfo, Long warehouseId, String productType, String operationType, String executeStatus, Long warehouseFloor) { - //半成品入库按原材料入库的柜体原料码进行入库 if (productType.equals(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_SEMI)) { if (!baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) { throw new ServiceException("请按原材料柜体条码入库"); } - } else {//其他按成品条码入库 - if (!baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) { + } else {//其他按成品条码入库(四楼对内生产的可以按配对码入库) + String barcodeType = baseBarcodeInfo.getBarcodeType(); + //判断条码信息如果是配对码,则需要通过配对码找成品条码入库 + if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_BIND)) { + String productBarcode = baseBarcodeInfo.getBindBarcode(); + R productBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER); + if (productBarcodeInfoR == null) { + throw new ServiceException("没找到成品条码"); + } + MesBaseBarcodeInfo productBarcodeInfo = productBarcodeInfoR.getData(); + if (productBarcodeInfo == null) { + throw new ServiceException("没找到成品条码!"); + } + baseBarcodeInfo.setBarcodeInfo(productBarcodeInfo.getBarcodeInfo()); + baseBarcodeInfo.setPlanCode(productBarcodeInfo.getPlanCode()); + baseBarcodeInfo.setPlanDetailCode(productBarcodeInfo.getPlanDetailCode()); + baseBarcodeInfo.setBatchCode(productBarcodeInfo.getBatchCode()); + + } else if (barcodeType.equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) { + + } else { throw new ServiceException("请按成品条码入库"); } } @@ -433,19 +451,19 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { throw new ServiceException("此条码还未打印"); } - //如果执行状态不是已完成,是agv入库,则需要判断是否有入库记录,避免重复提交;如果执行状态是已完成(人工入库),则判断是否有此成品条码库存即可 - if (!executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) { - WmsProductInstock queryProductInstock = new WmsProductInstock(); - queryProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());//productbatch是索引,查出来再过滤性能更快 - List wmsProductInstocks = wmsProductInstockMapper.selectWmsProductInstockList(queryProductInstock); - if (wmsProductInstocks != null && !wmsProductInstocks.isEmpty()) { - List incompleteProductInstocks = wmsProductInstocks.stream().filter( - wmsProductInstock -> !wmsProductInstock.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)).collect(Collectors.toList()); - if (incompleteProductInstocks != null && !incompleteProductInstocks.isEmpty()) { - throw new ServiceException("已经有此成品入库记录"); - } - } + //判断是否已经入过库,不能重复入库 +// if (!executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) { + WmsProductInstock queryProductInstock = new WmsProductInstock(); + queryProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());//productbatch是索引,查出来再过滤性能更快 + List wmsProductInstocks = wmsProductInstockMapper.selectWmsProductInstockList(queryProductInstock); + if (wmsProductInstocks != null && !wmsProductInstocks.isEmpty()) { +// List incompleteProductInstocks = wmsProductInstocks.stream().filter( +// wmsProductInstock -> !wmsProductInstock.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)).collect(Collectors.toList()); +// if (incompleteProductInstocks != null && !incompleteProductInstocks.isEmpty()) { + throw new ServiceException("已经有此成品入库记录"); +// } } +// } String userName = SecurityUtils.getUsername(); Date currentDate = new Date(); @@ -477,7 +495,6 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { } - /** * 查询成品入库记录;成品入库记录列表,join material * diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java index 68600c9..75b936e 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java @@ -272,8 +272,8 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService } List unConfirmedProductOutstockDetailList = wmsProductOutstockDetailList.stream(). - filter(wpod ->!wpod.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_CONFIRM)).collect(Collectors.toList()); - if(unConfirmedProductOutstockDetailList==null || unConfirmedProductOutstockDetailList.isEmpty()){ + filter(wpod -> !wpod.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_CONFIRM)).collect(Collectors.toList()); + if (unConfirmedProductOutstockDetailList == null || unConfirmedProductOutstockDetailList.isEmpty()) { throw new ServiceException("没有待确认成品出库信息"); } @@ -317,13 +317,6 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService Long warehouseId = wmsProduceInstockVo.getWarehouseId(); String materialBarcode = wmsProduceInstockVo.getMaterialBarcode(); - WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode); - BigDecimal availableAmount = getAvailableAmount(productStock); //可申请数量 - - if (availableAmount.compareTo(BigDecimal.ONE) < 0) { - throw new ServiceException("没有库存信息"); - } - R mesBaseBarcodeInfoData = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); if (mesBaseBarcodeInfoData == null) { throw new ServiceException("物料条码有误"); @@ -332,6 +325,37 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService if (mesBaseBarcodeInfo == null) { throw new ServiceException("物料条码有误!"); } + + String barcodeType = mesBaseBarcodeInfo.getBarcodeType(); + //判断条码信息如果是配对码,则需要通过配对码找成品条码入库 + if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_BIND)) { + String productBarcode = mesBaseBarcodeInfo.getBindBarcode(); + R productBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER); + if (productBarcodeInfoR == null) { + throw new ServiceException("没找到成品条码"); + } + MesBaseBarcodeInfo productBarcodeInfo = productBarcodeInfoR.getData(); + if (productBarcodeInfo == null) { + throw new ServiceException("没找到成品条码!"); + } + mesBaseBarcodeInfo.setBarcodeInfo(productBarcodeInfo.getBarcodeInfo()); + mesBaseBarcodeInfo.setBatchCode(productBarcodeInfo.getBatchCode()); + mesBaseBarcodeInfo.setPlanCode(productBarcodeInfo.getPlanCode()); + mesBaseBarcodeInfo.setPlanDetailCode(productBarcodeInfo.getPlanDetailCode()); + + } else if (barcodeType.equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) { + + } else { + throw new ServiceException("请按成品条码入库"); + } + + WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(mesBaseBarcodeInfo.getBarcodeInfo()); + BigDecimal availableAmount = getAvailableAmount(productStock); //可申请数量 + + if (availableAmount.compareTo(BigDecimal.ONE) < 0) { + throw new ServiceException("没有库存信息"); + } + Long materialId = mesBaseBarcodeInfo.getMaterialId(); Long saleOrderId = mesBaseBarcodeInfo.getSaleOrderId(); String saleorderCode = mesBaseBarcodeInfo.getSaleorderCode(); @@ -343,7 +367,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService String userName = SecurityUtils.getUsername(); Date currentDate = new Date(); - Long productOutstockId=null; + Long productOutstockId = null; //如果是直接出库 if (outRequirement.equals(WmsConstants.WMS_WAREHOUSE_OUT_REQUIREMENT_DIRECT)) { WmsProductOutstock wmsProductOutstock = new WmsProductOutstock(); @@ -392,7 +416,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService } List auditPassProductOutstocks = saleProductOutstocks.stream().filter(wmsProductOutstock -> - wmsProductOutstock.getAuditStatus().equals(WmsConstants.WMS_AUDIT_STATUS_PASS) + wmsProductOutstock.getAuditStatus().equals(WmsConstants.WMS_AUDIT_STATUS_PASS) ).collect(Collectors.toList()); if (auditPassProductOutstocks == null || auditPassProductOutstocks.isEmpty()) { throw new ServiceException("此销售订单[" + saleorderCode + "]的成品出库申请未审核通过"); @@ -410,7 +434,6 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService } - //更新出库记录 if (applyQty.compareTo(currentOutstockQty) == 0) { productOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); @@ -425,6 +448,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService } productOutstock.setUpdateDate(currentDate); productOutstock.setUpdateBy(userName); + productOutstock.setProductBatch(materialBarcode); wmsProductOutstockMapper.updateWmsProductOutstock(productOutstock); wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId()); @@ -492,32 +516,52 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService public int auditProductOutstock(WmsProductOutstockAuditVo wmsProductOutstockAuditVo) { String auditStatus = wmsProductOutstockAuditVo.getAuditStatus(); String auditReason = wmsProductOutstockAuditVo.getAuditReason(); - String taskCode = wmsProductOutstockAuditVo.getTaskCode(); + Long productOutstockId = wmsProductOutstockAuditVo.getProductOutstockId(); Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); - WmsProductOutstock queryProductOutstock = new WmsProductOutstock(); - queryProductOutstock.setTaskCode(taskCode); - queryProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT); - List wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock); - if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) { - throw new ServiceException("无待审核成品出库记录"); - } +// WmsProductOutstock queryProductOutstock = new WmsProductOutstock(); +// queryProductOutstock.setTaskCode(taskCode); +// queryProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT); +// List wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock); +// if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) { +// throw new ServiceException("无待审核成品出库记录"); +// } + + WmsProductOutstock wmsProductOutstock = wmsProductOutstockMapper.selectWmsProductOutstockByProductOutstockId(productOutstockId); //审核不通过,需要有审核意见 if (auditStatus.equalsIgnoreCase(WmsConstants.WMS_AUDIT_STATUS_FAIL)) { if (StringUtils.isEmpty(auditReason)) { throw new ServiceException("请输入审核意见"); } + + WmsStockTotal queryStockTotal = new WmsStockTotal(); + queryStockTotal.setWarehouseId(wmsProductOutstock.getWarehouseId()); + queryStockTotal.setMaterialId(wmsProductOutstock.getProductId()); + queryStockTotal.setSaleOrderId(wmsProductOutstock.getSaleOrderId()); + List wmsStockTotals = wmsStockTotalMapper.selectOnlyWmsStockTotalList(queryStockTotal); + if (wmsStockTotals == null || wmsStockTotals.isEmpty()) { + throw new ServiceException("没有库存"); + } + WmsStockTotal wmsStockTotal = wmsStockTotals.get(0); + wmsStockTotal.setOccupyAmount(wmsStockTotal.getOccupyAmount().subtract(wmsProductOutstock.getApplyQty())); + wmsStockTotal.setUpdateBy(userName); + wmsStockTotal.setUpdateDate(currentDate); + + wmsStockTotalMapper.updateWmsStockTotal(wmsStockTotal); + + wmsProductOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); + } - WmsProductOutstock wmsProductOutstock = new WmsProductOutstock(); + wmsProductOutstock.setAuditStatus(auditStatus); wmsProductOutstock.setAuditReason(auditReason); wmsProductOutstock.setAuditBy(userName); wmsProductOutstock.setAuditDate(currentDate); - wmsProductOutstock.setTaskCode(taskCode); - return wmsProductOutstockMapper.auditWmsProductOutstockByTaskCode(wmsProductOutstock); + + return wmsProductOutstockMapper.updateWmsProductOutstock(wmsProductOutstock); } private static BigDecimal getAvailableAmount(WmsProductStock productStock) { diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java index 68141bc..8af42df 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java @@ -545,8 +545,6 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { : wmsRawOutstock.getTaskType(); String warehouseType = baseWarehouse.getWarehouseType(); - - //TODO 判断质检状态,还是在实际出库时判断质检状态 String queryQualityStatus = WmsConstants.WMS_QUALITY_STATUS_PASS; List toInsertedRawOutstocks = new ArrayList<>(); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java index 404d053..e2714f5 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java @@ -309,6 +309,9 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { // throw new ServiceException("输入数量需为1"); // } // } + if (!wmsRawReturn.getMaterialId().equals(mesBaseBarcodeInfo.getMaterialId())) { + throw new ServiceException("退库物料不匹配"); + } WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode); @@ -485,6 +488,16 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { String taskCode = Seq.getId(Seq.rawReturnSeqType, Seq.rawReturnCode); for (WmsRawReturn rawReturn : wmsRawReturns) { + if (baseWarehouse.getWarehouseFloor().equals(5L)) { + WmsRawReturn queryRawReturn = new WmsRawReturn(); + queryRawReturn.setEndStationCode(rawReturn.getEndStationCode()); + queryRawReturn.setExecuteStatusStr(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE + "," + WmsConstants.WMS_EXECUTE_STATUS_EXECUTING); + List wmsRawReturnList = wmsRawReturnMapper.selectWmsRawReturnList(queryRawReturn); + if (wmsRawReturnList != null && !wmsRawReturnList.isEmpty()) { + throw new ServiceException("此工位还有未完成的退库物料"); + } + } + BigDecimal planAmount = rawReturn.getPlanAmount(); if (planAmount.compareTo(BigDecimal.ZERO) <= 0) { throw new ServiceException("数量需大于0"); @@ -505,7 +518,6 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { } - // /** // * 申请退库 // * @@ -653,6 +665,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { /** * 查询原材料退库记录 * 审核按钮查询 + * * @param taskCode 原材料退库记录任务编号 * @return 原材料退库记录审核返回VO对象 */ @@ -662,7 +675,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { WmsRawReturn queryRawReturn = new WmsRawReturn(); queryRawReturn.setTaskCode(taskCode); List wmsRawReturnList = wmsRawReturnMapper.selectGetRawReturnByTaskCode(queryRawReturn); - if (wmsRawReturnList.size() > 0){ + if (wmsRawReturnList.size() > 0) { WmsRawReturn wmsRawReturn = wmsRawReturnList.get(0); wmsRawReturnAuditReturnVo.setWmsRawReturn(wmsRawReturn); wmsRawReturnAuditReturnVo.setWmsRawReturnDetailList(wmsRawReturnList); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsTransferServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsTransferServiceImpl.java index cb9501e..a1df380 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsTransferServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsTransferServiceImpl.java @@ -226,6 +226,12 @@ public class WmsTransferServiceImpl implements IWmsTransferService { throw new ServiceException("库位不存在"); } + WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(oriLocation.getWarehouseId()); + if(!baseWarehouse.getWarehouseInstockType().equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_SEMI)){ + throw new ServiceException("请从半成品库出库"); + } + + //删除成品库存 WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode); if (productStock == null) { @@ -307,6 +313,11 @@ public class WmsTransferServiceImpl implements IWmsTransferService { throw new ServiceException("库位不存在"); } + WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(targetLocation.getWarehouseId()); + if(!baseWarehouse.getWarehouseInstockType().equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_PRODUCT)){ + throw new ServiceException("请入成品库"); + } + WmsProductStock queryProductStock = new WmsProductStock(); queryProductStock.setLocationCode(targetLocationCode); List productStocks = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java index d12b91f..8c8eb5e 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java @@ -113,6 +113,8 @@ public class WmsWarehouseMaterialServiceImpl implements IWmsWarehouseMaterialSer */ @Override public List selectWmsWarehouseMaterialJoinList(WmsWarehouseMaterial wmsWarehouseMaterial) { + wmsWarehouseMaterial.setMaterialSpec(StringUtils.isNotEmpty(wmsWarehouseMaterial.getMaterialSpec()) + ? wmsWarehouseMaterial.getMaterialSpec().replaceAll("\\s+", "") : ""); return wmsWarehouseMaterialMapper.selectWmsWarehouseMaterialJoinList(wmsWarehouseMaterial); } diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml index 637a106..bfa9bd0 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml @@ -74,7 +74,7 @@ and wps.location_code = #{locationCode} and wps.stock_type = #{stockType} and wps.stock_type in ('2','3') - and wps.product_batch = #{productBatch} + and wps.product_batch like concat('%', #{productBatch}, '%') and wps.quality_status = #{qualityStatus} and wps.product_id = #{productId} and wps.plan_code = #{planCode} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawReturnMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawReturnMapper.xml index eb88af8..0ba066c 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawReturnMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawReturnMapper.xml @@ -88,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and audit_reason = #{auditReason} and audit_status = #{auditStatus} and execute_status = #{executeStatus} + and execute_status in (${executeStatusStr}) + and end_station_code = #{endStationCode} and apply_by = #{applyBy} and apply_date = #{applyDate} and audit_by = #{auditBy} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml index a60e62e..e50a1e4 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml @@ -334,7 +334,8 @@ '%') and mso.saleorder_code like concat('%', #{saleorderCode}, '%') - and wrs.instock_batch = #{instockBatch} + and wrs.instock_batch like concat('%', #{instockBatch}, + '%') and wrs.instock_date = #{instockDate} and wrs.last_outstock_time = #{lastOutstockTime} and wrs.quality_status = #{qualityStatus} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml index 905e685..69fa502 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml @@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -84,10 +85,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/hw-ui/src/api/dms/ledger.js b/hw-ui/src/api/dms/ledger.js index 04ce59e..5c78700 100644 --- a/hw-ui/src/api/dms/ledger.js +++ b/hw-ui/src/api/dms/ledger.js @@ -51,3 +51,21 @@ export function getDeviceLedgerList(query) { params: query }) } + +// 查询设备台账信息列表 +export function listAllLedger(query) { + return request({ + url: '/dms/ledger/listAll', + method: 'get', + params: query + }) +} + + +// 打印设备编码 +export function printDeviceLabels(deviceId) { + return request({ + url: '/dms/ledger/printDeviceLabels/'+deviceId, + method: 'get', + }) +} diff --git a/hw-ui/src/api/mes/barcode.js b/hw-ui/src/api/mes/barcode.js index 7923635..b46a4b4 100644 --- a/hw-ui/src/api/mes/barcode.js +++ b/hw-ui/src/api/mes/barcode.js @@ -187,3 +187,13 @@ export function mergeUpdateBarcode(data) { data: data }) } + + +// 查询小包条码信息列表 +export function listPrdBarcode(query) { + return request({ + url: '/mes/barcode/listPrdBarcode', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/mes/purchaseOrder.js b/hw-ui/src/api/mes/purchaseOrder.js index 0d33d5c..0cdd799 100644 --- a/hw-ui/src/api/mes/purchaseOrder.js +++ b/hw-ui/src/api/mes/purchaseOrder.js @@ -138,3 +138,23 @@ export function getPurchaseOrdersWithBind(query) { params: query }) } + + +// 获取生产bom List +export function getMaterialBoms(query) { + return request({ + url: '/mes/purchaseOrder/getMaterialBoms', + method: 'get', + params: query + }) +} + + +// 查询采购订单信息列表 +export function getOrderBinds(query) { + return request({ + url: '/mes/purchaseOrder/getOrderBinds', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/mes/saleOrder.js b/hw-ui/src/api/mes/saleOrder.js index 2c724d4..0dbac69 100644 --- a/hw-ui/src/api/mes/saleOrder.js +++ b/hw-ui/src/api/mes/saleOrder.js @@ -52,3 +52,14 @@ export function listOrderBinds(query) { params: query }) } + + + +// 查询销售订单关联信息列表 +export function selectSaleOrderRelates(query) { + return request({ + url: '/mes/api/selectSaleOrderRelates', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/views/board/barcode/workshopBarcode.vue b/hw-ui/src/views/board/barcode/workshopBarcode.vue index 3a06609..dead8b2 100644 --- a/hw-ui/src/views/board/barcode/workshopBarcode.vue +++ b/hw-ui/src/views/board/barcode/workshopBarcode.vue @@ -125,7 +125,6 @@ - - - + + @@ -290,10 +289,13 @@ import { checkSemiOutstock, reprintBarcodes } from "@/api/board/barcode"; +import {monitorSerialData} from "@/utils/serial" +import {noticeData} from "@/utils/notice"; export default { name: "Barcode", dicts: ['bind_status', 'active_flag', 'barcode_type', 'mes_print_flag'], + mixins: [monitorSerialData], data() { return { // 遮罩层 @@ -511,7 +513,7 @@ export default { planDetailCode: this.defineData.planDetailCode, singleFlag: this.defineData.singleFlag, saleOrderId: this.defineData.saleOrderId, - productId:this.defineData.productId, + productId: this.defineData.productId, batchFlag: '0', bindBarcode: bindBarcode, barcodeType: "", @@ -524,7 +526,7 @@ export default { planId: this.defineData.planId, planCode: this.defineData.planCode, planDetailCode: this.defineData.planDetailCode, - productId : this.defineData.productId, + productId: this.defineData.productId, saleOrderId: this.defineData.saleOrderId, saleorderCode: this.defineData.saleorderCode, materialBomId: this.defineData.materialBomId, @@ -535,6 +537,26 @@ export default { this.queryParams.planDetailCode = this.defineData.planDetailCode; this.queryParams.singleFlag = this.SINGLE_FLAG.INTERNAL; this.queryParams.barcodeType = this.BARCODE_TYPE.RAW; + + // if (!this.checkSerialConnected()) { + // this.$confirm('请连接条码枪', '提示', { + // confirmButtonText: '连接', + // showClose: true, + // // beforeClose:async(action,instance,done)=>{ + // // if(action==='confirm'){ + // // }else{ + // // this.connectSerialPort(); + // // } + // // + // // }, + // showCancelButton: true, + // type: 'warning' + // }).then(() => { + // this.connectSerial(this.setSerialData); + // }).catch(() => { + // }); + // } + } }, @@ -718,6 +740,7 @@ export default { printBindBarcodes(barcodeIds, printNumber).then(response => { this.$modal.msgSuccess("打印条码成功"); this.getList(); + this.closePopover(); }).catch(() => { }); }, @@ -917,6 +940,19 @@ export default { }, + setSerialData() { + + if (this.internalForm.productBarcode && this.internalForm.productBarcode !== '') { + this.internalForm.productBarcode = "," + this.serialData; + } else { + this.internalForm.productBarcode = this.serialData; + } + + + // console.log(this.serialData) + }, + + } }; diff --git a/hw-ui/src/views/board/common/applyRawReturn.vue b/hw-ui/src/views/board/common/applyRawReturn.vue index 16a8c5f..ba7fd3a 100644 --- a/hw-ui/src/views/board/common/applyRawReturn.vue +++ b/hw-ui/src/views/board/common/applyRawReturn.vue @@ -27,9 +27,10 @@ - 物料信息 + 物料信息 - + 新增 @@ -40,6 +41,7 @@ :header-cell-style="{textAlign:'center'}" max-height="19.13vw" style="width: 100%;" + v-if="materialVisible" > { if (valid) { - if (this.wmsRawReturnList.length <= 0) { - this.$modal.msgWarning("请选择要退库的物料"); - return; - } - - for (const wmsRawReturn of this.wmsRawReturnList) { - if(wmsRawReturn.planAmount <=0){ - this.$modal.msgWarning("退库数量需大于0"); + if (this.form.warehouseFloor === 5) { + this.form.planAmount = 1; + this.wmsRawReturnList.push(this.form); + } else { + if (this.wmsRawReturnList.length <= 0) { + this.$modal.msgWarning("请选择要退库的物料"); return; } - wmsRawReturn.applyReason = this.form.applyReason; - wmsRawReturn.taskType = this.form.taskType; + + for (const wmsRawReturn of this.wmsRawReturnList) { + if (wmsRawReturn.planAmount <= 0) { + this.$modal.msgWarning("退库数量需大于0"); + return; + } + wmsRawReturn.applyReason = this.form.applyReason; + wmsRawReturn.taskType = this.form.taskType; + } } this.submitloading = true; @@ -358,7 +369,6 @@ export default { }, - } }; diff --git a/hw-ui/src/views/board/common/saleOrderRelates.vue b/hw-ui/src/views/board/common/saleOrderRelates.vue new file mode 100644 index 0000000..dc1a40c --- /dev/null +++ b/hw-ui/src/views/board/common/saleOrderRelates.vue @@ -0,0 +1,92 @@ + + + + diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index a2b4074..e2960f3 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -41,10 +41,10 @@ :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="completeCollectMaterials()">完成领料 - 扫描 - + + + + 退料 @@ -221,6 +221,13 @@ width="120" > diff --git a/hw-ui/src/views/dms/maintDetail/index.vue b/hw-ui/src/views/dms/maintDetail/index.vue index 20645df..a8f73b0 100644 --- a/hw-ui/src/views/dms/maintDetail/index.vue +++ b/hw-ui/src/views/dms/maintDetail/index.vue @@ -298,16 +298,16 @@ - - - - - - + + + + + + + + + + diff --git a/hw-ui/src/views/dms/shutType/index.vue b/hw-ui/src/views/dms/shutType/index.vue index ab11a3e..eeb5b70 100644 --- a/hw-ui/src/views/dms/shutType/index.vue +++ b/hw-ui/src/views/dms/shutType/index.vue @@ -33,38 +33,38 @@ - - 新增 - - - 修改 - - - 删除 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,30 +78,30 @@ - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -268,8 +278,15 @@ placeholder="请输入计量设备位置" /> - - + + + {{ dict.label }} + + @@ -597,7 +614,6 @@ export default { /** 查询计量设备信息列表 */ getList() { this.loading = true; - this.queryParams.monitorType = 2; listShuiMeasurement(this.queryParams).then((response) => { this.list = response.data; // response.data.forEach(m=>{ @@ -616,7 +632,6 @@ export default { "parentId" ); - console.log("this.expandrowid", this.expandrowid); this.loading = false; }); }, @@ -757,7 +772,6 @@ export default { submitForm() { this.$refs["form"].validate((valid) => { if (valid) { - this.form.monitorType = 2; this.form.buildId = this.getBuildAllCheckedKeys(); // this.form.subentryId = this.getSubentryAllCheckedKeys(); // this.form.businessId = this.getBusinessAllCheckedKeys(); @@ -861,7 +875,6 @@ export default { /** 查询计量设备信息下拉树结构 */ getTreeselect() { - this.queryParams.monitorType = 2; listShuiMeasurement(this.queryParams).then((response) => { this.ShuiMeasurementOptions = []; const data = { objid: 0, monitorName: "顶级节点", children: [] }; diff --git a/hw-ui/src/views/mes/barcode/endProductIndex.vue b/hw-ui/src/views/mes/barcode/endProductIndex.vue index 0bbe937..e35b413 100644 --- a/hw-ui/src/views/mes/barcode/endProductIndex.vue +++ b/hw-ui/src/views/mes/barcode/endProductIndex.vue @@ -1,11 +1,88 @@