diff --git a/zbf-admin/src/main/resources/application-druid.yml b/zbf-admin/src/main/resources/application-druid.yml index f0d278d..6d3e52c 100644 --- a/zbf-admin/src/main/resources/application-druid.yml +++ b/zbf-admin/src/main/resources/application-druid.yml @@ -17,7 +17,7 @@ spring: # password: Tony123 url: jdbc:mysql://localhost:3306/leader_wms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true username: root - password: 123456 + password: root # # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/zbf-admin/src/main/resources/application.yml b/zbf-admin/src/main/resources/application.yml index e90fc7f..ae6f025 100644 --- a/zbf-admin/src/main/resources/application.yml +++ b/zbf-admin/src/main/resources/application.yml @@ -33,7 +33,7 @@ server: logging: level: - com.zbf: debug + com.zbf: info org.springframework: warn org.quartz: warn diff --git a/zbf-common/src/main/java/com/zbf/common/enums/custom/InboundNoticeTabStatus.java b/zbf-common/src/main/java/com/zbf/common/enums/custom/InboundNoticeTabStatus.java new file mode 100644 index 0000000..c74ac86 --- /dev/null +++ b/zbf-common/src/main/java/com/zbf/common/enums/custom/InboundNoticeTabStatus.java @@ -0,0 +1,29 @@ +package com.zbf.common.enums.custom; + +/** + * 入库通知单明细启停状态 + */ +public enum InboundNoticeTabStatus +{ + ENABLED("0", "启用"), + DISABLED("1", "停用"); + + private final String code; + private final String description; + + InboundNoticeTabStatus(String code, String description) + { + this.code = code; + this.description = description; + } + + public String getCode() + { + return code; + } + + public String getDescription() + { + return description; + } +} diff --git a/zbf-system/src/main/java/com/zbf/system/config/D_Service.java b/zbf-system/src/main/java/com/zbf/system/config/D_Service.java index ee4bf9c..b43a03c 100644 --- a/zbf-system/src/main/java/com/zbf/system/config/D_Service.java +++ b/zbf-system/src/main/java/com/zbf/system/config/D_Service.java @@ -36,7 +36,6 @@ import org.springframework.stereotype.Component; import shade.com.alibaba.fastjson2.JSONArray; import shade.com.alibaba.fastjson2.JSONObject; -import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.util.*; import java.util.concurrent.TimeUnit; @@ -93,7 +92,7 @@ public class D_Service { * @param*/ - @PostConstruct + // @PostConstruct public void initToken() { try { oauth2Client = createOauth2Client(); diff --git a/zbf-system/src/main/java/com/zbf/system/domain/TRkWareNoticeTabUpdate.java b/zbf-system/src/main/java/com/zbf/system/domain/TRkWareNoticeTabUpdate.java index 7999774..fc558b6 100644 --- a/zbf-system/src/main/java/com/zbf/system/domain/TRkWareNoticeTabUpdate.java +++ b/zbf-system/src/main/java/com/zbf/system/domain/TRkWareNoticeTabUpdate.java @@ -1,14 +1,14 @@ package com.zbf.system.domain; - import java.util.HashMap; +import java.util.HashMap; import java.util.List; import java.util.Map; - import com.fasterxml.jackson.annotation.JsonProperty; - import com.zbf.common.core.domain.BaseEntity; - import lombok.Data; - import lombok.Getter; - import lombok.Setter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.zbf.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; /** * 入库通知单明细更新参数 @@ -22,71 +22,113 @@ import java.util.Map; public class TRkWareNoticeTabUpdate extends BaseEntity { private static final long serialVersionUID = 1L; - /** 通知单主键ID */ + /** + * 通知单主键ID + */ private String id; - /** 通知单ID */ + /** + * 通知单ID + */ private String noticeId; - /**来源单号 */ + /** + * 来源单号 + */ private String deliveryId; - /** 仓库ID */ + /** + * 仓库ID + */ private String storageId; - /** 仓库ID */ + /** + * 仓库ID + */ private String storageShortName; - /** 库位 */ + /** + * 库位 + */ private String storageLocation; - /** 库区 */ + /** + * 库区 + */ private String storageAreaId; - /** 入库类型 */ + /** + * 入库类型 + */ private String storageMode; - /** 用户账号 */ + /** + * 用户账号 + */ private String userName; private Map extras = new HashMap<>(); - /** 手持用字段 */ + /** + * 手持用字段 + */ private String recordPerson; - /** 托盘号 */ + /** + * 托盘号 + */ private String ctlNo; - /** 部门ID */ + /** + * 部门ID + */ private Long deptId; - /**物料编码 */ + /** + * 物料编码 + */ private String goodsId; - /**物料名称 */ + /** + * 物料名称 + */ private String goodsName; - /**打印条码数量 */ - private int printNum; + /** + * 打印条码数量 + */ + private int printNum; - /**收货数量 */ + /** + * 收货数量 + */ private int receiveNum; - /**子需求编号 */ + /** + * 子需求编号 + */ private String salesOrderNumber; - /**虚拟收货 */ + /** + * 虚拟收货 + */ private String fictitious; - /**规格型号 */ + /** + * 规格型号 + */ private String specification; - /** 通知单明细 */ + /** + * 通知单明细 + */ private List trkWareNoticeTabList; - /** 入库任务明细 */ + /** + * 入库任务明细 + */ private List tOngoodsshelfList; - private String rkMxId; + private String rkMxId; private String locationId; diff --git a/zbf-system/src/main/java/com/zbf/system/service/impl/TRkWareNoticeServiceImpl.java b/zbf-system/src/main/java/com/zbf/system/service/impl/TRkWareNoticeServiceImpl.java index 43b7d0f..5359619 100644 --- a/zbf-system/src/main/java/com/zbf/system/service/impl/TRkWareNoticeServiceImpl.java +++ b/zbf-system/src/main/java/com/zbf/system/service/impl/TRkWareNoticeServiceImpl.java @@ -12,9 +12,11 @@ import com.zbf.common.enums.custom.InboundLevelType; import com.zbf.common.enums.custom.InboundNoticeReceivingStatus; import com.zbf.common.enums.custom.InboundNoticeTabInStatus; import com.zbf.common.enums.custom.InboundNoticeTabReceivingStatus; +import com.zbf.common.enums.custom.InboundNoticeTabStatus; import com.zbf.common.enums.custom.InboundOngoodsshelfInStatus; import com.zbf.common.enums.custom.InboundResourceLockStatus; import com.zbf.common.enums.custom.InboundResourceOccupancyStatus; +import com.zbf.common.enums.custom.InboundStorageMode; import com.zbf.common.enums.custom.InboundTaskStatus; import com.zbf.common.enums.custom.InboundTaskType; import com.zbf.common.exception.ServiceException; @@ -1710,8 +1712,9 @@ public class TRkWareNoticeServiceImpl extends ServiceImpl importedNoticeTabs, boolean isUpdateSupport, String operName) { - if (StringUtils.isNull(importedNoticeTabs) || importedNoticeTabs.size() == 0) { + if (StringUtils.isNull(importedNoticeTabs) || importedNoticeTabs.isEmpty()) { throw new ServiceException("导入入库通知单数据不能为空!"); } int successCount = 0; @@ -1721,18 +1724,12 @@ public class TRkWareNoticeServiceImpl extends ServiceImpl duplicateNotices = tRkWareNoticeMapper.selectTRkWareNoticeList(importedNotice); - if (duplicateNotices.size() == 0) { + if (duplicateNotices.isEmpty()) { setTrkNotice(importedNotice, firstImportedNoticeTab, operName); - importedNotice.setReceivingStatus("0"); - importedNotice.setStorageMode("1"); + importedNotice.setReceivingStatus(InboundNoticeReceivingStatus.CREATED.getCode()); + importedNotice.setStorageMode(InboundStorageMode.STANDARD.getCode()); tRkWareNoticeMapper.insertTRkWareNotice(importedNotice); } else if (isUpdateSupport) { @@ -1752,20 +1749,19 @@ public class TRkWareNoticeServiceImpl extends ServiceImpl duplicateNoticeTabs = tRkWareNoticeTabMapper.selectTRkWareNoticeTabList(noticeTabQuery); - if (duplicateNoticeTabs.size() == 0) { + if (duplicateNoticeTabs.isEmpty()) { initializeNoticeTabForInsert(importedNoticeTab, importedNotice.getId(), operName); importedNoticeTab.setDeliveryId(firstImportedNoticeTab.getDeliveryId()); importedNoticeTab.setSourceNum(firstImportedNoticeTab.getDeliveryId()); @@ -1814,8 +1810,9 @@ public class TRkWareNoticeServiceImpl extends ServiceImpl importedExcelNoticeTabs, boolean isUpdateSupport, String operName) { - if (StringUtils.isNull(importedExcelNoticeTabs) || importedExcelNoticeTabs.size() == 0) { + if (StringUtils.isNull(importedExcelNoticeTabs) || importedExcelNoticeTabs.isEmpty()) { throw new ServiceException("导入入库通知单数据不能为空!"); } int successCount = 0; @@ -1825,54 +1822,44 @@ public class TRkWareNoticeServiceImpl extends ServiceImpl duplicateNotices = tRkWareNoticeMapper.selectTRkWareNoticeList(importedNotice); - if (duplicateNotices.size() == 0) { + if (duplicateNotices.isEmpty()) { setExcelTrkNotice(importedNotice, firstImportedNoticeTab, operName); - importedNotice.setReceivingStatus("0"); - importedNotice.setStorageMode("1"); + importedNotice.setReceivingStatus(InboundNoticeReceivingStatus.CREATED.getCode()); + importedNotice.setStorageMode(InboundStorageMode.STANDARD.getCode()); tRkWareNoticeMapper.insertTRkWareNotice(importedNotice); -// TRkWareNotice notice2 = new TRkWareNotice(); -// notice2.setId(tRkWareNotice.getId()); -// notice2.setCreateBy(operName); -// tRkWareNoticeMapper.updateTRkWareNotice(notice2); - } else if (isUpdateSupport) { List noticeIdsToDelete = duplicateNotices.stream().map(TRkWareNotice::getId).collect(Collectors.toList()); tRkWareNoticeMapper.deleteTRkWareNoticeByIds(noticeIdsToDelete.toArray(new String[noticeIdsToDelete.size()])); setExcelTrkNotice(importedNotice, firstImportedNoticeTab, operName); - importedNotice.setReceivingStatus("0"); - importedNotice.setStorageMode("1"); + importedNotice.setReceivingStatus(InboundNoticeReceivingStatus.CREATED.getCode()); + importedNotice.setStorageMode(InboundStorageMode.STANDARD.getCode()); tRkWareNoticeMapper.insertTRkWareNotice(importedNotice); } else { throw new ServiceException("来源单号 " + firstImportedNoticeTab.getDeliveryId() + " 重复导入异常!"); } - for (int importIndex = 0; importIndex < importedExcelNoticeTabs.size(); importIndex++) { + for (TRkWareNoticeTabExcel importedExcelNoticeTab : importedExcelNoticeTabs) { try { - //校验必输字段 - TRkWareNoticeTabExcel importedExcelNoticeTab = importedExcelNoticeTabs.get(importIndex); + // 校验必输字段 // validateImportedNoticeTab(importIndex, importedExcelNoticeTab); // 验证是否存在该明细 - importedExcelNoticeTab.setDeliveryId(importedExcelNoticeTab.getPurchaseId()); + TRkWareNoticeTab noticeTabQuery = new TRkWareNoticeTab(); noticeTabQuery.setSalesOrderNumber(importedExcelNoticeTab.getSalesOrderNumber()); noticeTabQuery.setGoodsId(importedExcelNoticeTab.getGoodsId()); - noticeTabQuery.setReceivingStatus("0"); - noticeTabQuery.setInStatus("0"); - noticeTabQuery.setDataSource("一级库"); + noticeTabQuery.setReceivingStatus(InboundNoticeTabReceivingStatus.PENDING.getCode()); + noticeTabQuery.setInStatus(InboundNoticeTabInStatus.INITIAL.getCode()); + noticeTabQuery.setDataSource(InboundLevelType.LEVEL_ONE.getDescription()); - importedExcelNoticeTab.setDataSource("一级库"); - importedExcelNoticeTab.setLevelType("1"); + importedExcelNoticeTab.setDataSource(InboundLevelType.LEVEL_ONE.getDescription()); + importedExcelNoticeTab.setLevelType(InboundLevelType.LEVEL_ONE.getCode()); + importedExcelNoticeTab.setDeliveryId(importedExcelNoticeTab.getPurchaseId()); SimpleDateFormat originalFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US); SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -1887,27 +1874,19 @@ public class TRkWareNoticeServiceImpl extends ServiceImpl duplicateNoticeTabs = tRkWareNoticeTabMapper.selectTRkWareNoticeTabList(noticeTabQuery); noticeTabToInsert.setDeliveryId(firstImportedNoticeTab.getDeliveryId()); noticeTabToInsert.setSourceNum(firstImportedNoticeTab.getDeliveryId()); - if (duplicateNoticeTabs.size() == 0) { + List duplicateNoticeTabs = tRkWareNoticeTabMapper.selectTRkWareNoticeTabList(noticeTabQuery); + if (duplicateNoticeTabs.isEmpty()) { logger.info("createBy:{}", noticeTabToInsert.getCreateBy()); initializeNoticeTabForInsert(noticeTabToInsert, importedNotice.getId(), operName); noticeTabToInsert.setReceivingNum(importedExcelNoticeTab.getArraMount()); - logger.info("createBy:{}", noticeTabToInsert.getCreateBy()); tRkWareNoticeTabMapper.insertTRkWareNoticeTab(noticeTabToInsert); -// TRkWareNoticeTab noticeTabToUpdate = new TRkWareNoticeTab(); -// noticeTabToUpdate.setId(noticeTabToInsert.getId()); -// noticeTabToUpdate.setCreateBy(operName); -// tRkWareNoticeTabMapper.updateTRkWareNoticeTab(noticeTabToUpdate); -// logger.info("createBy:{}", noticeTabToInsert.getCreateBy()); successCount++; successMessage.append("
" + successCount + "、物料编号 " + importedExcelNoticeTab.getGoodsId() + " 导入成功"); } else if (isUpdateSupport) { @@ -1943,8 +1922,8 @@ public class TRkWareNoticeServiceImpl extends ServiceImpl