From b24828951a8fad13b23c4a249a59060f76597b43 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Wed, 16 Jul 2025 09:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=90=89=E5=AE=A2=E4=BA=91?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kjs/listener/GenericEventSubscribe.java | 2 +- ...eckYunGoodsdocInToU8PluginInitializer.java | 45 +- ...ckYunGoodsdocOutToU8PluginInitializer.java | 161 +++++ .../U8DeliveryAutoOutPluginInitializer.java | 109 ++++ .../impl/DeliveryOrderPluginServiceImpl.java | 16 +- .../service/impl/MdmServiceImpl.java | 4 +- .../src/main/resources/application-kjs.yml | 32 +- .../src/main/resources/application.yml | 15 +- .../kjs/spring/spring-buildpackage-plugin.xml | 1 + .../contrast/currency/dao/ICurrencyDao.java | 14 + .../currency/dao/impl/CurrencyDaoImpl.java | 17 + .../currency/entity/CurrencyEntity.java | 65 ++ .../currency/entity/CurrencyEntity.xml | 159 +++++ .../currency/service/ICurrencyService.java | 14 + .../service/impl/CurrencyServiceImpl.java | 18 + .../contrast/customer/dao/ICustomerDao.java | 19 + .../customer/dao/impl/CustomerDaoImpl.java | 33 + .../customer/entity/CustomerEntity.java | 77 +++ .../customer/entity/CustomerEntity.xml | 44 ++ .../customer/service/ICustomerService.java | 14 + .../service/impl/CustomerServiceImpl.java | 18 + .../contrast/inventory/dao/IInventoryDao.java | 19 + .../inventory/dao/impl/InventoryDaoImpl.java | 32 + .../inventory/entity/InventoryEntity.java | 77 +++ .../inventory/entity/InventoryEntity.xml | 184 ++++++ .../inventory/entity/InventoryUnitEntity.java | 54 ++ .../inventory/service/IInventoryService.java | 14 + .../service/impl/InventoryServiceImpl.java | 17 + .../contrast/warehouse/dao/IWarehouseDao.java | 17 + .../warehouse/dao/impl/WarehouseDaoImpl.java | 25 + .../warehouse/entity/WarehouseEntity.java | 65 ++ .../warehouse/entity/WarehouseEntity.xml | 38 ++ .../warehouse/service/IWarehouseService.java | 15 + .../service/impl/WarehouseServiceImpl.java | 17 + .../dao/impl/GoodsdocInLogisticDaoImpl.java | 2 +- .../entity/GoodsdocInDetailEntity.java | 40 +- .../entity/GoodsdocInDetailEntity.xml | 39 +- .../goodsdocin/entity/GoodsdocInEntity.java | 18 + .../goodsdocin/entity/GoodsdocInEntity.xml | 44 +- .../entity/GoodsdocInLogisticEntity.xml | 2 +- .../service/impl/GoodsdocInServiceImpl.java | 95 ++- .../goodsdocout/dao/IGoodsdocOutDao.java | 9 + .../dao/IGoodsdocOutDetailDao.java | 4 + .../dao/impl/GoodsdocOutDaoImpl.java | 22 + .../dao/impl/GoodsdocOutDetailDaoImpl.java | 6 + .../entity/GoodsdocOutDetailEntity.java | 41 ++ .../entity/GoodsdocOutDetailEntity.xml | 37 ++ .../goodsdocout/entity/GoodsdocOutEntity.java | 38 ++ .../goodsdocout/entity/GoodsdocOutEntity.xml | 63 +- .../service/IGoodsdocOutService.java | 10 + .../service/impl/GoodsdocOutServiceImpl.java | 226 ++++++- .../Jackyun/util/JackyunOpenHttpUtils.java | 85 ++- .../hzya/frame/barcode/dao/IBarcodeDao.java | 20 + .../barcode/dao/impl/BarcodeDaoImpl.java | 33 + .../frame/barcode/entity/BarcodeEntity.java | 134 ++++ .../frame/barcode/entity/BarcodeEntity.xml | 34 ++ .../barcode/service/IBarcodeService.java | 17 + .../service/impl/BarcodeServiceImpl.java | 37 ++ .../dd/robot/service/IDingRobotService.java | 16 + .../service/impl/DingRobotServiceImpl.java | 154 +++++ .../u8/delivery/dao/IDeliveryOrderDao.java | 3 + .../dao/impl/DeliveryOrderDaoImpl.java | 6 + .../delivery/entity/DeliveryOrderEntity.java | 9 + .../delivery/entity/DeliveryOrderEntity.xml | 12 +- .../service/IDeliveryOrderService.java | 37 ++ .../impl/DeliveryOrderServiceImpl.java | 574 ++++++++++++++++-- .../frame/u8/otherin/entity/OtherInEntity.xml | 3 +- .../u8/otherout/entity/OtherOutEntity.xml | 3 +- .../service/impl/OtherReceiptServiceImpl.java | 4 +- .../service/impl/ProductionInServicempl.java | 14 +- .../service/impl/ReceiptServiceImpl.java | 4 +- .../service/impl/SaleOutServiceImpl.java | 44 +- .../java/com/hzya/frame/u8/util/U8Util.java | 20 +- .../basemdm/service/IBaseMdmService.java | 2 + .../service/impl/BaseMdmServiceImpl.java | 6 + 75 files changed, 3222 insertions(+), 196 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/JeckYunGoodsdocOutToU8PluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/U8DeliveryAutoOutPluginInitializer.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/dao/ICurrencyDao.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/dao/impl/CurrencyDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/entity/CurrencyEntity.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/entity/CurrencyEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/service/ICurrencyService.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/service/impl/CurrencyServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/dao/ICustomerDao.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/dao/impl/CustomerDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/entity/CustomerEntity.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/entity/CustomerEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/service/ICustomerService.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/service/impl/CustomerServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/dao/IInventoryDao.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/dao/impl/InventoryDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryEntity.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryUnitEntity.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/service/IInventoryService.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/service/impl/InventoryServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/dao/IWarehouseDao.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/dao/impl/WarehouseDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/entity/WarehouseEntity.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/entity/WarehouseEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/service/IWarehouseService.java create mode 100644 service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/service/impl/WarehouseServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/barcode/dao/IBarcodeDao.java create mode 100644 service/src/main/java/com/hzya/frame/barcode/dao/impl/BarcodeDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/barcode/entity/BarcodeEntity.java create mode 100644 service/src/main/java/com/hzya/frame/barcode/entity/BarcodeEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/barcode/service/IBarcodeService.java create mode 100644 service/src/main/java/com/hzya/frame/barcode/service/impl/BarcodeServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/dd/robot/service/IDingRobotService.java create mode 100644 service/src/main/java/com/hzya/frame/dd/robot/service/impl/DingRobotServiceImpl.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/listener/GenericEventSubscribe.java b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/listener/GenericEventSubscribe.java index 02941291..df3d6b9b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/listener/GenericEventSubscribe.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/listener/GenericEventSubscribe.java @@ -26,7 +26,7 @@ import javax.annotation.Resource; * @Author xiangerlin * @Date 2024/8/27 14:43 **/ -@Component +//@Component public class GenericEventSubscribe { Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/JeckYunGoodsdocInToU8PluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/JeckYunGoodsdocInToU8PluginInitializer.java index f7131eb3..1625cd12 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/JeckYunGoodsdocInToU8PluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/JeckYunGoodsdocInToU8PluginInitializer.java @@ -1,5 +1,6 @@ package com.hzya.frame.plugin.kjs.plugin; +import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.Jackyun.goodsdocin.service.IGoodsdocInService; import com.hzya.frame.base.PluginBaseEntity; @@ -9,6 +10,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import java.time.DayOfWeek; +import java.time.LocalDate; +import java.util.Date; + /** * @Description * @Author xiangerlin @@ -95,8 +100,44 @@ public class JeckYunGoodsdocInToU8PluginInitializer extends PluginBaseEntity { **/ @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { - logger.info("开始执行"+getPluginName()+requestJson.toString()); - goodsdocInService.getJeckGoodsdocInToU8(requestJson); + logger.info("开始执行入库单推送U8单据"); + String minDate = ""; + String maxDate = ""; + Date now = new Date(); + //判断今天是否是周一,周一在前 + // 获取当前日期 + LocalDate today = LocalDate.now(); + // 获取星期几(返回 DayOfWeek 枚举) + DayOfWeek dayOfWeek = today.getDayOfWeek(); + if (dayOfWeek.getValue() == 1) {//判断是否为周一,如果为周一开始执行逻辑//todo dayOfWeek.getValue() == 1 + logger.info("今天是周一"); + Date fiveDaysAgo = DateUtil.offsetDay(now, -7); + Date fiveDaysAgoMax = DateUtil.offsetDay(now, -1); + minDate = DateUtil.format(fiveDaysAgo, "yyyy-MM-dd"); + maxDate = DateUtil.format(fiveDaysAgoMax, "yyyy-MM-dd"); + logger.info(minDate + " 00:00:00"); + logger.info(maxDate + " 23:59:59"); + requestJson.put("minDate", minDate+ " 00:00:00"); + requestJson.put("maxDate", maxDate+ " 23:59:59"); + logger.info("开始执行" + getPluginName() + requestJson.toString()); + logger.info("开始执行今天是周一"); + goodsdocInService.getJeckGoodsdocInToU8(requestJson); + } + //判断是否月底执行 + boolean isLastDay = DateUtil.isSameDay(now, DateUtil.endOfMonth(now)); + if (isLastDay) { + Date firstDayOfMonth = DateUtil.beginOfMonth(now); + minDate = DateUtil.format(firstDayOfMonth, "yyyy-MM-dd"); + Date fiveDaysAgoMax = DateUtil.offsetDay(now, -1); + maxDate = DateUtil.format(fiveDaysAgoMax, "yyyy-MM-dd"); + logger.info(minDate + " 00:00:00"); + logger.info(maxDate + " 23:59:59"); + logger.info("今天是本月最后一天"); + requestJson.put("minDate", minDate+ " 00:00:00"); + requestJson.put("maxDate", maxDate+ " 23:59:59"); + logger.info("开始执行" + getPluginName() + requestJson.toString()); + goodsdocInService.getJeckGoodsdocInToU8(requestJson); + } return BaseResult.getSuccessMessageEntity("操作成功"); } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/JeckYunGoodsdocOutToU8PluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/JeckYunGoodsdocOutToU8PluginInitializer.java new file mode 100644 index 00000000..25a3dc3f --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/JeckYunGoodsdocOutToU8PluginInitializer.java @@ -0,0 +1,161 @@ +package com.hzya.frame.plugin.kjs.plugin; + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.Jackyun.goodsdocin.service.IGoodsdocInService; +import com.hzya.frame.Jackyun.goodsdocout.service.IGoodsdocOutService; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.time.LocalDate; +import java.util.Date; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/8/22 16:39 + **/ +public class JeckYunGoodsdocOutToU8PluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private IGoodsdocOutService goodsdocOutService; + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "JeckYunGoodsdocOutToU8PluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "吉客云入库单同步WMS插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "吉客云入库单同步WMS插件"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + boolean flag = false; + String minDate = ""; + String maxDate = ""; +// Date now = new Date(); + Date now = DateUtil.parse("2025-07-06 05:10:11"); + boolean isLastDay = DateUtil.isSameDay(now, DateUtil.endOfMonth(now)); +// isLastDay = true; + if (isLastDay) { + flag = true; + // 获取当月第一天 + Date firstDayOfMonth = DateUtil.beginOfMonth(now); + // 获取上月最后一天 +// Date lastDayOfPreviousMonth = DateUtil.endOfMonth(DateUtil.offsetMonth(now, -1)); + +// Date firstDayOfMonth = DateUtil.beginOfMonth(now); +// minDate = DateUtil.format(lastDayOfPreviousMonth, "yyyy-MM-dd"); + Date fiveDaysAgoMax = DateUtil.offsetDay(now, -1); + maxDate = DateUtil.format(fiveDaysAgoMax, "yyyy-MM-dd"); + minDate = DateUtil.format(now, "yyyy-MM"+"-26 "); +// requestJson.put("outDate", outDate+"-26 "+ "00:00:00"); + logger.info(minDate + " 00:00:00"); + logger.info(maxDate + " 23:59:59"); + logger.info("今天是本月最后一天"); + } else { + LocalDate today = LocalDate.now(); + int dayOfMonth = today.getDayOfMonth(); + dayOfMonth = 6; + boolean isTargetDate = (dayOfMonth == 6 || dayOfMonth == 11 || + dayOfMonth == 16 || dayOfMonth == 21 || + dayOfMonth == 26); + if(isTargetDate){ + logger.info("今天是{}号",dayOfMonth); + flag = true; + Date fiveDaysAgo = null; + if(dayOfMonth == 6){ + fiveDaysAgo = DateUtil.offsetDay(now, -6); + }else{ + fiveDaysAgo = DateUtil.offsetDay(now, -5); + } + + Date fiveDaysAgoMax = DateUtil.offsetDay(now, -1); + minDate = DateUtil.format(fiveDaysAgo, "yyyy-MM-dd"); + maxDate = DateUtil.format(fiveDaysAgoMax, "yyyy-MM-dd"); + logger.info(minDate + " 00:00:00"); + logger.info(maxDate + " 23:59:59"); + } + } +// requestJson.put("minDate", minDate+ " 00:00:00"); + requestJson.put("minDate", "2025-07-01 00:00:00"); + requestJson.put("maxDate", maxDate+ " 23:59:59"); + if(flag){ + logger.info("开始执行"+getPluginName()+requestJson.toString()); + goodsdocOutService.getJeckGoodsdocOutToU8(requestJson); + }else{ + logger.info("出库单今天不是指定日期"); + } + return BaseResult.getSuccessMessageEntity("操作成功"); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/U8DeliveryAutoOutPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/U8DeliveryAutoOutPluginInitializer.java new file mode 100644 index 00000000..66bf9b49 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/U8DeliveryAutoOutPluginInitializer.java @@ -0,0 +1,109 @@ +package com.hzya.frame.plugin.kjs.plugin; + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.Jackyun.goodsdocin.service.IGoodsdocInService; +import com.hzya.frame.Jackyun.goodsdocout.service.IGoodsdocOutService; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.u8.delivery.service.IDeliveryOrderService; +import com.hzya.frame.u8.util.U8ResultEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.time.LocalDate; +import java.util.Date; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/8/22 16:39 + **/ +public class U8DeliveryAutoOutPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private IDeliveryOrderService deliveryOrderService; + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "U8DeliveryAutoOutPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "U8发货单自动出库"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "U8发货单自动出库"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + logger.info("开始执行"+getPluginName()+requestJson.toString()); + U8ResultEntity res = deliveryOrderService.u8DeliveryAutoOut(requestJson); + return BaseResult.getSuccessMessageEntity("操作成功"); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/service/impl/DeliveryOrderPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/service/impl/DeliveryOrderPluginServiceImpl.java index 31b4517a..677ab3ef 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/service/impl/DeliveryOrderPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/service/impl/DeliveryOrderPluginServiceImpl.java @@ -5,10 +5,12 @@ import cn.hutool.core.map.MapBuilder; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.plugin.kjs.service.IDeliveryOrderPluginService; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.u8.delivery.dao.IDeliveryOrderDao; import com.hzya.frame.u8.delivery.dto.DeliveryDetailDTO; import com.hzya.frame.u8.delivery.dto.DeliveryOrderDTO; import com.hzya.frame.u8.delivery.entity.DeliveryDetailEntity; @@ -38,6 +40,8 @@ public class DeliveryOrderPluginServiceImpl extends KjsPluginBaseService impleme private IDeliveryOrderService deliveryOrderService; @Autowired private IDeliveryDetaiService deliveryDetaiService; + @Autowired + private IDeliveryOrderDao deliveryOrderDao; @Resource private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @@ -97,7 +101,17 @@ public class DeliveryOrderPluginServiceImpl extends KjsPluginBaseService impleme String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(reqParams).timeout(60000).execute().body(); //保存自定义项 标记推送状态 order.setDataSourceCode(datasourceCode); - //deliveryOrderService.saveExtradefine(order); + logger.info("发货单返回结果{}",body); + JSONObject responseJson = JSONObject.parseObject(body); + boolean responseFlag = responseJson.getBoolean("flag"); + if(responseFlag){ + order.setSync_flag("Y"); + }else{ + order.setSync_flag("N"); + } + order.setSync_flag("Y"); + logger.info("开始修改发货单更新后状态{}", JSONArray.toJSONString(order)); + deliveryOrderDao.updateSengStatus(order); if (StrUtil.isNotEmpty(body)){ JSONObject jsonObject = JSONObject.parseObject(body); Boolean flag = jsonObject.getBoolean("flag"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/service/impl/MdmServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/service/impl/MdmServiceImpl.java index e1016019..aeabe416 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/service/impl/MdmServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/service/impl/MdmServiceImpl.java @@ -13,9 +13,9 @@ import com.hzya.frame.basedao.service.impl.BaseService; * @since 2024-06-21 13:52:35 */ public class MdmServiceImpl extends BaseService implements IMdmService { - + private IMdmDao mdmCustomerDao; - + @Autowired public void setMdmCustomerDao(IMdmDao dao) { this.mdmCustomerDao = dao; diff --git a/buildpackage/src/main/resources/application-kjs.yml b/buildpackage/src/main/resources/application-kjs.yml index d98d986e..a90e6395 100644 --- a/buildpackage/src/main/resources/application-kjs.yml +++ b/buildpackage/src/main/resources/application-kjs.yml @@ -1,34 +1,40 @@ -#######################本地环境####################### +#######################dev环境####################### logging: #日志级别 指定目录级别 level: - root: info + root: INFO encodings: UTF-8 file: -# 日志保存路径 - path: /Users/xiangerlin/work/app/logs/yuecheng + # 日志保存路径 + path: D:\yongansystem\log spring: datasource: dynamic: datasource: master: - url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter_kjs?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + url: jdbc:mysql://192.168.2.58:3306/businesscenter_test?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=120000&autoReconnectForPools=true username: root password: 62e4295b615a30dbf3b8ee96f41c820b driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: - # 文件保存路径 - path: /Users/xiangerlin/work/app/logs/yuecheng + # 文件保存路径 + path: D:\yongansystem\file cbs8: - appId: 1Prpz - appSecret: 24bbe3a5abf39e1bea9cd3a + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a url: https://cbs8-openapi-reprd.csuat.cmburl.cn # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 - ya_private_key: 31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 # 这个私钥到时候上传到cbs,和下面到是同一对 #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 - ya_public_key: 044fa399d2223760f17b81b864c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde - cbs_public_key: 0469146F06BF3B01236E84632441E826F30836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc_oa +zt: + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface dingtalk: appKey: dingq3vbsswvyujiuwa7 - appSecret: m4IRNcKQn-W9QBLERHWt0iW2hSirvxPS684xiNw-4QFMNg2gsBCur9T4QMvvAR4I \ No newline at end of file + appSecret: m4IRNcKQn-W9QBLERHWt0iW2hSirvxPS684xiNw-4QFMNg2gsBCur9T4QMvvAR4I diff --git a/buildpackage/src/main/resources/application.yml b/buildpackage/src/main/resources/application.yml index aef79e6c..30cf99c4 100644 --- a/buildpackage/src/main/resources/application.yml +++ b/buildpackage/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 9999 + port: 9990 servlet: context-path: /kangarooDataCenterV3 localIP: 127.0.0.1 @@ -57,22 +57,23 @@ spring: maxWait: 60000 # 获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并发效率会有所下降,如果需要可以通过配置 timeBetweenEvictionRunsMillis: 60000 # 关闭空闲连接的检测时间间隔.Destroy线程会检测连接的间隔时间,如果连接空闲时间大于等于minEvictableIdleTimeMillis则关闭物理连接。 minEvictableIdleTimeMillis: 300000 # 连接的最小生存时间.连接保持空闲而不被驱逐的最小时间 + max-evictable-idle-time-millis: 900000 # 添加最大空闲时间控制(15分钟) validationQuery: SELECT 1 FROM DUAL # 验证数据库服务可用性的sql.用来检测连接是否有效的sql 因数据库方言而差, 例如 oracle 应该写成 SELECT 1 FROM DUAL testWhileIdle: true # 申请连接时检测空闲时间,根据空闲时间再检测连接是否有效.建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRun testOnBorrow: false # 申请连接时直接检测连接是否有效.申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 testOnReturn: false # 归还连接时检测连接是否有效.归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 poolPreparedStatements: true # 开启PSCache - maxPoolPreparedStatementPerConnectionSize: 20 #设置PSCache值 - connectionErrorRetryAttempts: 3 # 连接出错后再尝试连接三次 + maxPoolPreparedStatementPerConnectionSize: 50 #设置PSCache值 + connectionErrorRetryAttempts: 5 # 连接出错后再尝试连接三次 breakAfterAcquireFailure: true # 数据库服务宕机自动重连机制 - timeBetweenConnectErrorMillis: 300000 # 连接出错后重试时间间隔 + timeBetweenConnectErrorMillis: 10000 # 连接出错后重试时间间隔 asyncInit: true # 异步初始化策略 remove-abandoned: true # 是否自动回收超时连接 - remove-abandoned-timeout: 1800 # 超时时间(以秒数为单位) - transaction-query-timeout: 6000 # 事务超时时间 + remove-abandoned-timeout: 180 # 超时时间(以秒数为单位) + transaction-query-timeout: 600 # 事务超时时间 filters: stat,wall,log4j2 useGlobalDataSourceStat: true #合并多个DruidDataSource的监控数据 - connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 #通过connectProperties属性来打开mergeSql功能;慢SQL记录 + connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=2000 #通过connectProperties属性来打开mergeSql功能;慢SQL记录 batch: job: enabled: false diff --git a/buildpackage/src/main/resources/cfgHome/plugin/kjs/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/kjs/spring/spring-buildpackage-plugin.xml index 9112d6e6..bef7c171 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/kjs/spring/spring-buildpackage-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/kjs/spring/spring-buildpackage-plugin.xml @@ -17,5 +17,6 @@ + diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/dao/ICurrencyDao.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/dao/ICurrencyDao.java new file mode 100644 index 00000000..ed99a35d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/dao/ICurrencyDao.java @@ -0,0 +1,14 @@ +package com.hzya.frame.Jackyun.contrast.currency.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.Jackyun.contrast.currency.entity.CurrencyEntity; +/** + * @description: 币种档案对照表 dao + * @tableName: contrast_currency + * @entityName: CurrencyEntity + * @author: gjh + * @history: 1.0 + */ +public interface ICurrencyDao extends IBaseDao{ + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/dao/impl/CurrencyDaoImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/dao/impl/CurrencyDaoImpl.java new file mode 100644 index 00000000..18e5ac3b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/dao/impl/CurrencyDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.Jackyun.contrast.currency.dao.impl; +import com.hzya.frame.Jackyun.contrast.currency.entity.CurrencyEntity; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.Jackyun.contrast.currency.dao.ICurrencyDao; + +/** + * @description: 币种档案对照表 dao + * @tableName: contrast_currency + * @entityName: CurrencyEntity + * @author: gjh + * @history:1.0 + */ +@Repository("contrast_currencydao") +public class CurrencyDaoImpl extends MybatisGenericDao implements ICurrencyDao{ + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/entity/CurrencyEntity.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/entity/CurrencyEntity.java new file mode 100644 index 00000000..6a63d3fe --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/entity/CurrencyEntity.java @@ -0,0 +1,65 @@ +package com.hzya.frame.Jackyun.contrast.currency.entity; +import java.util.Date; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @description: 币种档案对照表 + * @tableName: contrast_currency + * @entityName: CurrencyEntity + * @author: gjh + * @history: 1.0 + */ +public class CurrencyEntity extends BaseEntity { + +/** 无备注 */ +private String jeck_code; +/** 无备注 */ +private String jeck_name; +/** 无备注 */ +private String u8_code; +/** 无备注 */ +private String u8_name; + + +/** 无备注 */ +public void setJeck_code(String jeck_code) { + this.jeck_code = jeck_code; + } +/** 无备注 */ +public String getJeck_code() { + return jeck_code; + } + + +/** 无备注 */ +public void setJeck_name(String jeck_name) { + this.jeck_name = jeck_name; + } +/** 无备注 */ +public String getJeck_name() { + return jeck_name; + } + + +/** 无备注 */ +public void setU8_code(String u8_code) { + this.u8_code = u8_code; + } +/** 无备注 */ +public String getU8_code() { + return u8_code; + } + + +/** 无备注 */ +public void setU8_name(String u8_name) { + this.u8_name = u8_name; + } +/** 无备注 */ +public String getU8_name() { + return u8_name; + } + + + } diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/entity/CurrencyEntity.xml b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/entity/CurrencyEntity.xml new file mode 100644 index 00000000..d8e2f642 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/entity/CurrencyEntity.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + jeck_code, + jeck_name, + u8_code, + u8_name + + + + + + + + + + + + + + + + + + + insert into contrast_currency( + + jeck_code, + jeck_name, + u8_code, + u8_name, + create_time, + modify_time, + sts + + )values + ( + + #{jeck_code}, + #{jeck_name}, + #{u8_code}, + #{u8_name}, + #{create_time} , + now(), + #{modify_time}, + now(), + 'Y' + + ) + + select + last_insert_id() as id + + + + + + update contrast_currency set + + jeck_code = #{jeck_code}, + jeck_name = #{jeck_name}, + u8_code = #{u8_code}, + u8_name = #{u8_name}, + modify_time =#{modify_time} + modify_time = now() + + where id = #{id} + + + + + update contrast_currency set + sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where + id = #{id} + + + + + update contrast_currency set + sts='N',modify_time = now(),modify_user_id = #{modify_user_id} + + jeck_code = #{jeck_code} + and jeck_name = #{jeck_name} + and u8_code = #{u8_code} + and u8_name = #{u8_name} + + + + + + delete from contrast_currency where id =#{id} + + diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/service/ICurrencyService.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/service/ICurrencyService.java new file mode 100644 index 00000000..9f4db03b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/service/ICurrencyService.java @@ -0,0 +1,14 @@ +package com.hzya.frame.Jackyun.contrast.currency.service; +import com.hzya.frame.Jackyun.contrast.currency.entity.CurrencyEntity; +import com.hzya.frame.basedao.service.IBaseService; + +/** + * @description: 币种档案对照表 service + * @tableName: contrast_currency + * @entityName: CurrencyEntity + * @author: gjh + * @history: 1.0 + */ +public interface ICurrencyService extends IBaseService { + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/service/impl/CurrencyServiceImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/service/impl/CurrencyServiceImpl.java new file mode 100644 index 00000000..3db7bd8a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/currency/service/impl/CurrencyServiceImpl.java @@ -0,0 +1,18 @@ +package com.hzya.frame.Jackyun.contrast.currency.service.impl; +import com.hzya.frame.basedao.service.impl.BaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.Jackyun.contrast.currency.entity.CurrencyEntity; +import com.hzya.frame.Jackyun.contrast.currency.service.ICurrencyService; +import com.hzya.frame.Jackyun.contrast.currency.dao.ICurrencyDao; +/** + * @description: 币种档案对照表 service + * @tableName: contrast_currency + * @entityName: CurrencyEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="contrast_currencyService") +public class CurrencyServiceImpl extends BaseService< CurrencyEntity,Long> implements ICurrencyService{ + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/dao/ICustomerDao.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/dao/ICustomerDao.java new file mode 100644 index 00000000..867e8326 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/dao/ICustomerDao.java @@ -0,0 +1,19 @@ +package com.hzya.frame.Jackyun.contrast.customer.dao; +import com.hzya.frame.Jackyun.contrast.customer.entity.CustomerEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; + +/** + * @description: 客户账套对照表 dao + * @tableName: contrast_customer + * @entityName: CustomerEntity + * @author: gjh + * @history: 1.0 + */ +public interface ICustomerDao extends IBaseDao { + + List queryListByJeckYun(CustomerEntity cust); + + List quertInvTest(String code); +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/dao/impl/CustomerDaoImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/dao/impl/CustomerDaoImpl.java new file mode 100644 index 00000000..b05efb58 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/dao/impl/CustomerDaoImpl.java @@ -0,0 +1,33 @@ +package com.hzya.frame.Jackyun.contrast.customer.dao.impl; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.Jackyun.contrast.customer.entity.CustomerEntity; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.Jackyun.contrast.customer.dao.ICustomerDao; + +import java.util.List; + +/** + * @description: 客户账套对照表 dao + * @tableName: contrast_customer + * @entityName: CustomerEntity + * @author: gjh + * @history:1.0 + */ +@Repository("contrast_customerdao") +public class CustomerDaoImpl extends MybatisGenericDao implements ICustomerDao{ + + @DS("jeckYun") + @Override + public List queryListByJeckYun(CustomerEntity cust) { + return (List) selectList("com.hzya.frame.Jackyun.contrast.customer.entity.CustomerEntity.CustomerEntity_list_base",cust); + } + + @DS("YONYOUU8") + @Override + public List quertInvTest(String code) { + CustomerEntity cust = new CustomerEntity(); + cust.setU8_code(code); + return (List) selectList("com.hzya.frame.Jackyun.contrast.customer.entity.CustomerEntity.CustomerEntity_list_test",cust); + } +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/entity/CustomerEntity.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/entity/CustomerEntity.java new file mode 100644 index 00000000..6d5ad665 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/entity/CustomerEntity.java @@ -0,0 +1,77 @@ +package com.hzya.frame.Jackyun.contrast.customer.entity; +import java.util.Date; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @description: 客户账套对照表 + * @tableName: contrast_customer + * @entityName: CustomerEntity + * @author: gjh + * @history: 1.0 + */ +public class CustomerEntity extends BaseEntity { + +/** 无备注 */ +private String jeck_code; +/** 无备注 */ +private String jeck_name; +/** 无备注 */ +private String u8_code; +/** 无备注 */ +private String u8_name; +/** 无备注 */ +private String u8_accid; + + +/** 无备注 */ +public void setJeck_code(String jeck_code) { + this.jeck_code = jeck_code; + } +/** 无备注 */ +public String getJeck_code() { + return jeck_code; + } + + +/** 无备注 */ +public void setJeck_name(String jeck_name) { + this.jeck_name = jeck_name; + } +/** 无备注 */ +public String getJeck_name() { + return jeck_name; + } + + +/** 无备注 */ +public void setU8_code(String u8_code) { + this.u8_code = u8_code; + } +/** 无备注 */ +public String getU8_code() { + return u8_code; + } + + +/** 无备注 */ +public void setU8_name(String u8_name) { + this.u8_name = u8_name; + } +/** 无备注 */ +public String getU8_name() { + return u8_name; + } + + +/** 无备注 */ +public void setU8_accid(String u8_accid) { + this.u8_accid = u8_accid; + } +/** 无备注 */ +public String getU8_accid() { + return u8_accid; + } + + + } diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/entity/CustomerEntity.xml b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/entity/CustomerEntity.xml new file mode 100644 index 00000000..b7008743 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/entity/CustomerEntity.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + jeck_code, + jeck_name, + u8_code, + u8_name, + u8_accid + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/service/ICustomerService.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/service/ICustomerService.java new file mode 100644 index 00000000..f38c73b1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/service/ICustomerService.java @@ -0,0 +1,14 @@ +package com.hzya.frame.Jackyun.contrast.customer.service; +import com.hzya.frame.Jackyun.contrast.customer.entity.CustomerEntity; +import com.hzya.frame.basedao.service.IBaseService; + +/** + * @description: 客户账套对照表 service + * @tableName: contrast_customer + * @entityName: CustomerEntity + * @author: gjh + * @history: 1.0 + */ +public interface ICustomerService extends IBaseService { + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/service/impl/CustomerServiceImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/service/impl/CustomerServiceImpl.java new file mode 100644 index 00000000..2186fa36 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/customer/service/impl/CustomerServiceImpl.java @@ -0,0 +1,18 @@ +package com.hzya.frame.Jackyun.contrast.customer.service.impl; +import com.hzya.frame.basedao.service.impl.BaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.Jackyun.contrast.customer.entity.CustomerEntity; +import com.hzya.frame.Jackyun.contrast.customer.service.ICustomerService; +import com.hzya.frame.Jackyun.contrast.customer.dao.ICustomerDao; +/** + * @description: 客户账套对照表 service + * @tableName: contrast_customer + * @entityName: CustomerEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="contrast_customerService") +public class CustomerServiceImpl extends BaseService< CustomerEntity,Long> implements ICustomerService{ + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/dao/IInventoryDao.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/dao/IInventoryDao.java new file mode 100644 index 00000000..34d76901 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/dao/IInventoryDao.java @@ -0,0 +1,19 @@ +package com.hzya.frame.Jackyun.contrast.inventory.dao; +import com.hzya.frame.Jackyun.contrast.inventory.entity.InventoryEntity; +import com.hzya.frame.Jackyun.contrast.inventory.entity.InventoryUnitEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; + +/** + * @description: 存货档案对照表 dao + * @tableName: contrast_inventory + * @entityName: InventoryEntity + * @author: gjh + * @history: 1.0 + */ +public interface IInventoryDao extends IBaseDao { + List getInventoryUnitEntity(String code); + + List getInventoryEntity(String code); +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/dao/impl/InventoryDaoImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/dao/impl/InventoryDaoImpl.java new file mode 100644 index 00000000..39f3c5f3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/dao/impl/InventoryDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.Jackyun.contrast.inventory.dao.impl; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.Jackyun.contrast.inventory.entity.InventoryEntity; +import com.hzya.frame.Jackyun.contrast.inventory.entity.InventoryUnitEntity; +import com.hzya.frame.Jackyun.goodsdocout.entity.GoodsdocOutEntity; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.Jackyun.contrast.inventory.dao.IInventoryDao; + +import java.util.List; + +/** + * @description: 存货档案对照表 dao + * @tableName: contrast_inventory + * @entityName: InventoryEntity + * @author: gjh + * @history:1.0 + */ +@Repository("contrast_inventorydao") +public class InventoryDaoImpl extends MybatisGenericDao implements IInventoryDao{ + @DS("YONYOUU8") + @Override + public List getInventoryUnitEntity(String code) { + return (List) super.selectList("com.hzya.frame.Jackyun.contrast.inventory.entity.InventoryEntity.InventoryUnitEntity_get",code); + } + + @DS("jeckYun") + @Override + public List getInventoryEntity(String code) { + return (List) super.selectList("com.hzya.frame.Jackyun.contrast.inventory.entity.InventoryEntity.InventoryEntity_get",code); + } +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryEntity.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryEntity.java new file mode 100644 index 00000000..c7e87601 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryEntity.java @@ -0,0 +1,77 @@ +package com.hzya.frame.Jackyun.contrast.inventory.entity; +import java.util.Date; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @description: 存货档案对照表 + * @tableName: contrast_inventory + * @entityName: InventoryEntity + * @author: gjh + * @history: 1.0 + */ +public class InventoryEntity extends BaseEntity { + +/** 无备注 */ +private String jeck_code; +/** 无备注 */ +private String spec; +/** 配比 */ +private Integer propor; +/** 无备注 */ +private String u8_code; +/** 无备注 */ +private String sale_spec; + + +/** 无备注 */ +public void setJeck_code(String jeck_code) { + this.jeck_code = jeck_code; + } +/** 无备注 */ +public String getJeck_code() { + return jeck_code; + } + + +/** 无备注 */ +public void setSpec(String spec) { + this.spec = spec; + } +/** 无备注 */ +public String getSpec() { + return spec; + } + + +/** 配比 */ +public void setPropor(Integer propor) { + this.propor = propor; + } +/** 配比 */ +public Integer getPropor() { + return propor; + } + + +/** 无备注 */ +public void setU8_code(String u8_code) { + this.u8_code = u8_code; + } +/** 无备注 */ +public String getU8_code() { + return u8_code; + } + + +/** 无备注 */ +public void setSale_spec(String sale_spec) { + this.sale_spec = sale_spec; + } +/** 无备注 */ +public String getSale_spec() { + return sale_spec; + } + + + } diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryEntity.xml b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryEntity.xml new file mode 100644 index 00000000..4b163463 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryEntity.xml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + jeck_code, + spec, + propor, + u8_code, + sale_spec + + + + + + + + + + + + + + + + + + + + + insert into contrast_inventory( + + jeck_code, + spec, + propor, + u8_code, + sale_spec, + create_time, + modify_time, + sts + + )values + ( + + #{jeck_code}, + #{spec}, + #{propor}, + #{u8_code}, + #{sale_spec}, + #{create_time} , + now(), + #{modify_time}, + now(), + 'Y' + + ) + + select + last_insert_id() as id + + + + + + update contrast_inventory set + + jeck_code = #{jeck_code}, + spec = #{spec}, + propor = #{propor}, + u8_code = #{u8_code}, + sale_spec = #{sale_spec}, + modify_time =#{modify_time} + modify_time = now() + + where id = #{id} + + + + + update contrast_inventory set + sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where + id = #{id} + + + + + update contrast_inventory set + sts='N',modify_time = now(),modify_user_id = #{modify_user_id} + + jeck_code = #{jeck_code} + and spec = #{spec} + and propor = #{propor} + and u8_code = #{u8_code} + and sale_spec = #{sale_spec} + + + + + + delete from contrast_inventory where id =#{id} + + diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryUnitEntity.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryUnitEntity.java new file mode 100644 index 00000000..8f215a8d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/entity/InventoryUnitEntity.java @@ -0,0 +1,54 @@ +package com.hzya.frame.Jackyun.contrast.inventory.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @description: 存货档案对照表 + * @tableName: contrast_inventory + * @entityName: InventoryEntity + * @author: gjh + * @history: 1.0 + */ +public class InventoryUnitEntity extends BaseEntity { + + /** 无备注 */ + private String cinvcode; + /** 无备注 */ + private String ccomcode; + /** 配比 */ + private String unitid; + /** 无备注 */ + private String rate; + + public String getCinvcode() { + return cinvcode; + } + + public void setCinvcode(String cinvcode) { + this.cinvcode = cinvcode; + } + + public String getCcomcode() { + return ccomcode; + } + + public void setCcomcode(String ccomcode) { + this.ccomcode = ccomcode; + } + + public String getUnitid() { + return unitid; + } + + public void setUnitid(String unitid) { + this.unitid = unitid; + } + + public String getRate() { + return rate; + } + + public void setRate(String rate) { + this.rate = rate; + } +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/service/IInventoryService.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/service/IInventoryService.java new file mode 100644 index 00000000..b3046bd3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/service/IInventoryService.java @@ -0,0 +1,14 @@ +package com.hzya.frame.Jackyun.contrast.inventory.service; +import com.hzya.frame.Jackyun.contrast.inventory.entity.InventoryEntity; +import com.hzya.frame.basedao.service.IBaseService; + +/** + * @description: 存货档案对照表 service + * @tableName: contrast_inventory + * @entityName: InventoryEntity + * @author: gjh + * @history: 1.0 + */ +public interface IInventoryService extends IBaseService { + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/service/impl/InventoryServiceImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/service/impl/InventoryServiceImpl.java new file mode 100644 index 00000000..148201cd --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/inventory/service/impl/InventoryServiceImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.Jackyun.contrast.inventory.service.impl; +import com.hzya.frame.basedao.service.impl.BaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.Jackyun.contrast.inventory.entity.InventoryEntity; +import com.hzya.frame.Jackyun.contrast.inventory.service.IInventoryService; +/** + * @description: 存货档案对照表 service + * @tableName: contrast_inventory + * @entityName: InventoryEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="contrast_inventoryService") +public class InventoryServiceImpl extends BaseService< InventoryEntity,Long> implements IInventoryService{ + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/dao/IWarehouseDao.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/dao/IWarehouseDao.java new file mode 100644 index 00000000..0c337e61 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/dao/IWarehouseDao.java @@ -0,0 +1,17 @@ +package com.hzya.frame.Jackyun.contrast.warehouse.dao; +import com.hzya.frame.Jackyun.contrast.warehouse.entity.WarehouseEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; + +/** + * @description: 仓库档案对照表 dao + * @tableName: contrast_warehouse + * @entityName: WarehouseEntity + * @author: gjh + * @history: 1.0 + */ +public interface IWarehouseDao extends IBaseDao { + + List queryListByJeckYun(WarehouseEntity ware); +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/dao/impl/WarehouseDaoImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/dao/impl/WarehouseDaoImpl.java new file mode 100644 index 00000000..05149021 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/dao/impl/WarehouseDaoImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.Jackyun.contrast.warehouse.dao.impl; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.Jackyun.contrast.warehouse.entity.WarehouseEntity; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.Jackyun.contrast.warehouse.dao.IWarehouseDao; + +import java.util.List; + +/** + * @description: 仓库档案对照表 dao + * @tableName: contrast_warehouse + * @entityName: WarehouseEntity + * @author: gjh + * @history:1.0 + */ +@Repository("contrast_warehousedao") +public class WarehouseDaoImpl extends MybatisGenericDao implements IWarehouseDao{ + + @DS("jeckYun") + @Override + public List queryListByJeckYun(WarehouseEntity ware) { + return (List) super.selectList("com.hzya.frame.Jackyun.contrast.warehouse.entity.WarehouseEntity.WarehouseEntity_list_base", ware); + } +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/entity/WarehouseEntity.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/entity/WarehouseEntity.java new file mode 100644 index 00000000..3b78b355 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/entity/WarehouseEntity.java @@ -0,0 +1,65 @@ +package com.hzya.frame.Jackyun.contrast.warehouse.entity; +import java.util.Date; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @description: 仓库档案对照表 + * @tableName: contrast_warehouse + * @entityName: WarehouseEntity + * @author: gjh + * @history: 1.0 + */ +public class WarehouseEntity extends BaseEntity { + +/** 无备注 */ +private String jeck_code; +/** 无备注 */ +private String jeck_name; +/** 无备注 */ +private String u8_code; +/** 无备注 */ +private String u8_name; + + +/** 无备注 */ +public void setJeck_code(String jeck_code) { + this.jeck_code = jeck_code; + } +/** 无备注 */ +public String getJeck_code() { + return jeck_code; + } + + +/** 无备注 */ +public void setJeck_name(String jeck_name) { + this.jeck_name = jeck_name; + } +/** 无备注 */ +public String getJeck_name() { + return jeck_name; + } + + +/** 无备注 */ +public void setU8_code(String u8_code) { + this.u8_code = u8_code; + } +/** 无备注 */ +public String getU8_code() { + return u8_code; + } + + +/** 无备注 */ +public void setU8_name(String u8_name) { + this.u8_name = u8_name; + } +/** 无备注 */ +public String getU8_name() { + return u8_name; + } + + + } diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/entity/WarehouseEntity.xml b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/entity/WarehouseEntity.xml new file mode 100644 index 00000000..ea8fd72e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/entity/WarehouseEntity.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + jeck_code, + jeck_name, + u8_code, + u8_name + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/service/IWarehouseService.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/service/IWarehouseService.java new file mode 100644 index 00000000..f78fe7b1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/service/IWarehouseService.java @@ -0,0 +1,15 @@ +package com.hzya.frame.Jackyun.contrast.warehouse.service; + +import com.hzya.frame.Jackyun.contrast.warehouse.entity.WarehouseEntity; +import com.hzya.frame.basedao.service.IBaseService; + +/** + * @description: 仓库档案对照表 service + * @tableName: contrast_warehouse + * @entityName: WarehouseEntity + * @author: gjh + * @history: 1.0 + */ +public interface IWarehouseService extends IBaseService { + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/service/impl/WarehouseServiceImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/service/impl/WarehouseServiceImpl.java new file mode 100644 index 00000000..edde613b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/Jackyun/contrast/warehouse/service/impl/WarehouseServiceImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.Jackyun.contrast.warehouse.service.impl; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.Jackyun.contrast.warehouse.entity.WarehouseEntity; +import com.hzya.frame.Jackyun.contrast.warehouse.service.IWarehouseService; +import org.springframework.stereotype.Service; + +/** + * @description: 仓库档案对照表 service + * @tableName: contrast_warehouse + * @entityName: WarehouseEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="contrast_warehouseService") +public class WarehouseServiceImpl extends BaseService< WarehouseEntity,Long> implements IWarehouseService{ + +} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/dao/impl/GoodsdocInLogisticDaoImpl.java b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/dao/impl/GoodsdocInLogisticDaoImpl.java index db9e7641..c3192c42 100644 --- a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/dao/impl/GoodsdocInLogisticDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/dao/impl/GoodsdocInLogisticDaoImpl.java @@ -38,6 +38,6 @@ public class GoodsdocInLogisticDaoImpl extends MybatisGenericDaogoodsdocInEntityList; public List getGoodsdocInEntityList() { @@ -123,15 +151,13 @@ public class GoodsdocInDetailEntity extends BaseEntity { this.mainId = mainId; } - /** 入库单明细ID */ - public void setRecId(Integer recId) { - this.recId = recId; - } - /** 入库单明细ID */ - public Integer getRecId() { + public String getRecId() { return recId; } + public void setRecId(String recId) { + this.recId = recId; + } /** 货品ID */ public void setGoodsId(String goodsId) { diff --git a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInDetailEntity.xml b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInDetailEntity.xml index fb61e51c..9457b49c 100644 --- a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInDetailEntity.xml @@ -143,18 +143,32 @@ @@ -208,6 +222,7 @@ and orderNum = #{orderNum} and serialSourceId = #{serialSourceId} and mainId = #{mainId} + and goodsNo like '5%' diff --git a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInEntity.java b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInEntity.java index 9cb64b15..28eb3918 100644 --- a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInEntity.java +++ b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInEntity.java @@ -120,6 +120,24 @@ public class GoodsdocInEntity extends BaseEntity { private String state; private String u8BillCode; private String accId; + private String minDate; + private String maxDate; + + public String getMinDate() { + return minDate; + } + + public void setMinDate(String minDate) { + this.minDate = minDate; + } + + public String getMaxDate() { + return maxDate; + } + + public void setMaxDate(String maxDate) { + this.maxDate = maxDate; + } public String getU8BillCode() { return u8BillCode; diff --git a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInEntity.xml b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInEntity.xml index ea01b60f..3cf046c8 100644 --- a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInEntity.xml +++ b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocin/entity/GoodsdocInEntity.xml @@ -105,6 +105,8 @@ + + @@ -164,19 +166,17 @@ @@ -198,14 +198,14 @@ top 100 * from jeck_goodsdocin where state is null and inouttype = '105' - + order by inOutDate asc select @@ -149,10 +151,45 @@ and goodsId = #{goodsId} and goodsNo = #{goodsNo} and mainId = #{mainId} +and goodsNo like '5%' + + insert into jeck_goodsdocout_details( diff --git a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/entity/GoodsdocOutEntity.java b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/entity/GoodsdocOutEntity.java index 99b4f7ab..8af02df0 100644 --- a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/entity/GoodsdocOutEntity.java +++ b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/entity/GoodsdocOutEntity.java @@ -1,5 +1,6 @@ package com.hzya.frame.Jackyun.goodsdocout.entity; +import com.hzya.frame.Jackyun.goodsdocin.entity.GoodsdocInEntity; import com.hzya.frame.web.entity.BaseEntity; import java.util.List; @@ -66,6 +67,42 @@ public class GoodsdocOutEntity extends BaseEntity { private String state; private String u8BillCode; private String accId; + private String custCode; + private String minDate; + private String maxDate; + + public String getMinDate() { + return minDate; + } + + public void setMinDate(String minDate) { + this.minDate = minDate; + } + + public String getMaxDate() { + return maxDate; + } + + public void setMaxDate(String maxDate) { + this.maxDate = maxDate; + } + public String getCustCode() { + return custCode; + } + + public void setCustCode(String custCode) { + this.custCode = custCode; + } + + private List groupList; + + public List getGroupList() { + return groupList; + } + + public void setGroupList(List groupList) { + this.groupList = groupList; + } public String getU8BillCode() { return u8BillCode; @@ -494,4 +531,5 @@ public class GoodsdocOutEntity extends BaseEntity { public void setOutBillNo(String outBillNo) { this.outBillNo = outBillNo; } + } diff --git a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/entity/GoodsdocOutEntity.xml b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/entity/GoodsdocOutEntity.xml index 17284d35..67ea0cba 100644 --- a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/entity/GoodsdocOutEntity.xml +++ b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/entity/GoodsdocOutEntity.xml @@ -97,6 +97,9 @@ + + + @@ -108,11 +111,48 @@ + + + + + + + + + @@ -332,7 +372,24 @@ ); - + + + update a set + + state= #{state} , + u8BillCode=#{u8BillCode} + + from jeck_goodsdocout a + inner join contrast_customer b on a.channelCode=b.jeck_code + inner join contrast_warehouse c on a.warehouseCode=c.jeck_code + where inouttype = '201' + and c.u8_code = #{warehouseCode} + and b.u8_code = #{channelCode} + and CAST(GETDATE() AS DATE)>inoutdate + and inoutdate >= #{minDate} + and inoutdate <= #{maxDate} + and state is null + delete from jeck_goodsdocout where recId =#{recId} diff --git a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/service/IGoodsdocOutService.java b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/service/IGoodsdocOutService.java index 774acd42..2a0ab7e3 100644 --- a/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/service/IGoodsdocOutService.java +++ b/service/src/main/java/com/hzya/frame/Jackyun/goodsdocout/service/IGoodsdocOutService.java @@ -33,4 +33,14 @@ public interface IGoodsdocOutService extends IBaseService0){ +// // 修复编码 +// String fixedJson = JackyunOpenHttpUtils.fixJsonEncoding(dataArr.toString()); +// // 解析JSON +// dataArr = JSONObject.parseArray(fixedJson); + logger.info("本次获取的吉客云数据"+dataArr.toString()); dataArr.forEach(item->{ GoodsdocOutEntity goodsdocOut = JSONObject.parseObject(JSON.toJSONString(item),GoodsdocOutEntity.class); //判断是否已经存在此单据,如果存在则跳过,如果不存在则新增写入 @@ -97,6 +130,7 @@ public class GoodsdocOutServiceImpl extends BaseService goodsdocOutEntityList = goodsdocOutDao.checkBill(checkEntity); if(goodsdocOutEntityList.size() == 0){ + logger.info("本次新增的数据"+JSON.toJSONString(goodsdocOut)); //新增出库单数据 GoodsdocOutEntity goodsdocOutEntity =goodsdocOutDao.saveGoodsdocOut(goodsdocOut); //判断是否有物流数据如果有则保存 @@ -128,9 +162,11 @@ public class GoodsdocOutServiceImpl extends BaseService goodsdocOutEntityList = goodsdocOutDao.getGoodsdocOutList(goodsdocOutEntity); if(CollectionUtils.isNotEmpty(goodsdocOutEntityList)){ goodsdocOutEntityList.forEach(item -> { + i.getAndIncrement(); String recId = item.getRecId(); if(StrUtil.isNotEmpty(recId)){ //查询出库单物流信息 @@ -165,4 +201,186 @@ public class GoodsdocOutServiceImpl extends BaseService goodsdocOutList = goodsdocOutDao.getGoodsdocOutListGroup(goodsdocOutEntity); + + if(CollectionUtils.isNotEmpty(goodsdocOutList)){ +// // 获取最大和最小时间 +// String minDate = null; +// String maxDate = null; +// // 获取最小时间 +// Optional minEntity = goodsdocOutList.stream() +// .min(Comparator.comparing(GoodsdocOutEntity::getInOutDate)); +// minDate = minEntity.isPresent() ? minEntity.get().getInOutDate() : null; +// +// // 获取最大时间 +// Optional maxEntity = goodsdocOutList.stream() +// .max(Comparator.comparing(GoodsdocOutEntity::getInOutDate)); +// maxDate = maxEntity.isPresent() ? maxEntity.get().getInOutDate() : null; +// String cmemo = minDate+"-"+maxDate; + + + //按照分组之后的效果重新或者当前分组下的recid用来获取所属的明细信息 + goodsdocOutList.forEach(item -> { + String minDateStr = goodsdocOutEntity.getMinDate() != null + ? DateUtil.format(DateUtil.parse(goodsdocOutEntity.getMinDate()), "yyyyMMdd") + : ""; + String maxDateStr = goodsdocOutEntity.getMaxDate() != null + ? DateUtil.format(DateUtil.parse(goodsdocOutEntity.getMaxDate()), "yyyyMMdd") + : ""; + String cmemo = minDateStr + "-" + maxDateStr; + item.setMemo(cmemo); + item.setMinDate(requestJson.getString("minDate")); + item.setMaxDate(requestJson.getString("maxDate")); + //查询明细数据 + List goodsdocOutDetailEntityList = goodsdocOutDetailDao.getGoodsdocOutDetailListGroup(item); + if (goodsdocOutDetailEntityList.size()==0){ + item.setState("Y"); + goodsdocOutDao.updateGoodsdocOut(item); + return; + } + List goodsdocOutDetailEntityListNew = new ArrayList<>(); +// goodsdocOutEntity = goodsdocOutList.get(0); + // todo 开始获取中间库获取转换数据 + //统一处理如果涉及大坛的情况下多添加一次大坛信息 + if(CollectionUtils.isNotEmpty(goodsdocOutDetailEntityList)){ + goodsdocOutDetailEntityList.forEach(details -> { + goodsdocOutDetailEntityListNew.add(details); + if("502060036".equals(details.getGoodsNo())){ + GoodsdocOutDetailEntity big = new GoodsdocOutDetailEntity(); + big.setGoodsNo("50090503"); + big.setGoodsName("黄酒大坛"); + big.setQuantity(details.getNum()); + big.setUnitName("坛"); + big.setTransHasTaxAmount("0"); + goodsdocOutDetailEntityListNew.add(big); + } + }); + } + + JSONObject jsonObject = bdingParm(item,goodsdocOutDetailEntityListNew,cmemo); +// if(1==1){ +// throw new RuntimeException(); +// } + //调用U8接口生成发货单 + U8ResultEntity u8ResultEntity = deliveryOrderService.addDelivery(jsonObject); + String state = ""; + if (!u8ResultEntity.issuccess()) { + item.setState("N"); + } + item.setU8BillCode(u8ResultEntity.getmessage()); + JSONObject saleOut = bdingParmOut(item, goodsdocOutDetailEntityListNew,cmemo); + U8ResultEntity u8ResultOut = saleOutService.addSaleOut(saleOut); + if (!u8ResultOut.issuccess()) { + item.setState("N"); + } else { + item.setState("Y"); + } + goodsdocOutDao.updateGoodsdocOut(item); + }); + } + } + /** + * + * @content 开始组装U8红字销售出库单数据 + * @className: Administrator + * @author laborer + * @date 2025-04-23 15:11 + * + */ + + private JSONObject bdingParmOut(GoodsdocOutEntity goodsdocOutEntity, List goodsdocOutDetailEntityList,String cmemo) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("AccId", goodsdocOutEntity.getAccId()); + jsonObject.put("billid", "123"); + JSONObject head = new JSONObject(); + head.put("cbuscode", goodsdocOutEntity.getU8BillCode());//发货单号 + head.put("cdepcode", "005");//todo 部门编码 + head.put("cmemo",cmemo);//TODO 这里填的是发货单的最早日期和最晚日期 + head.put("cmaker", "吉客云出库单自动生成");//创建人 + head.put("cbustype", "普通销售");//创建人 + head.put("crdcode", "203");//入库类别编码 + head.put("cwhcode", goodsdocOutEntity.getWarehouseCode());//仓库编码 todo 正式需要切换为04009 + head.put("ddate", DateUtil.format(new Date(),"yyyy-MM-dd"));//销售类型 + head.put("ccuscode", goodsdocOutEntity.getCustCode());//todo 正式需要切换未这个客户 + head.put("cDefine1", "多组织-采购订单");// +// head.put("ccuscode", "01010918");//客户 + head.put("csource","发货单"); + jsonObject.put("head",head); + JSONArray body = new JSONArray(); + int i = 0; + if(CollectionUtils.isNotEmpty(goodsdocOutDetailEntityList)){ + for(GoodsdocOutDetailEntity item : goodsdocOutDetailEntityList){ + i++; +// if("501010323".equals(item.getGoodsNo())){ +// continue; +// } + JSONObject details = new JSONObject(); + details.put("cbdlcode",goodsdocOutEntity.getU8BillCode());//发货单号 + details.put("cdblrowno", i);//行号 + details.put("cinvcode", item.getGoodsNo());//存货编码 + details.put("iquantity",item.getQuantity()); +// details.put("iquantity", item.getQuantity());//数量 + body.add(details); + } + } + jsonObject.put("body",body); + JSONObject result = new JSONObject(); + result.put("jsonStr", jsonObject); + return result; + } + + private JSONObject bdingParm(GoodsdocOutEntity goodsdocOutEntity, List goodsdocOutDetailEntityList,String cmemo) { + + JSONObject jsonObject = new JSONObject(); + jsonObject.put("AccId", goodsdocOutEntity.getAccId()); + jsonObject.put("billid", "123"); + + JSONObject head = new JSONObject(); + head.put("brdflag", "0");//发货0,退货1@ + head.put("breturnflag", "0");//发货0,退货1 + head.put("cbustype", "普通销售");// +// head.put("cbustype", "普通销售");// + head.put("cdepcode", "005");//销售部门 默认 + head.put("cmaker", "吉客云出库单自动生成");//创建人 + head.put("cmemo",cmemo);//TODO 这里填的是发货单的最早日期和最晚日期 +// head.put("cDefine1", "多组织-红字采购入库");// + head.put("ccuscode", goodsdocOutEntity.getChannelCode()); +// head.put("ccuscode", "01010918");//客户 + head.put("cstcode", "11");//销售类型 + head.put("ddate", DateUtil.format(new Date(), "yyyy-MM-dd"));//创建时间 + jsonObject.put("head", head); + JSONArray body = new JSONArray(); + if (CollectionUtils.isNotEmpty(goodsdocOutDetailEntityList)) { + goodsdocOutDetailEntityList.forEach(item -> { + JSONObject details = new JSONObject(); + details.put("cwhcode", goodsdocOutEntity.getWarehouseCode());//todo 正式需要切换为04009 + details.put("cinvcode", item.getGoodsNo()); + List inv = customerDao.quertInvTest(item.getGoodsNo()); + if (inv.size()>0){ + details.put("cunitid", inv.get(0).getU8_name()); + if (inv.get(0).getJeck_name() != null){ + details.put("inum", String.format("%.2f", + Double.parseDouble(item.getQuantity()) / + Double.parseDouble(inv.get(0).getJeck_name()))); + } + } + details.put("isum", item.getTransHasTaxAmount()); + details.put("iquantity", item.getQuantity()); + details.put("itaxrate", "13"); + body.add(details); + }); + } + jsonObject.put("body", body); + JSONObject result = new JSONObject(); + result.put("jsonStr", jsonObject); + return result; + } } diff --git a/service/src/main/java/com/hzya/frame/Jackyun/util/JackyunOpenHttpUtils.java b/service/src/main/java/com/hzya/frame/Jackyun/util/JackyunOpenHttpUtils.java index e29d34fa..be2ff50e 100644 --- a/service/src/main/java/com/hzya/frame/Jackyun/util/JackyunOpenHttpUtils.java +++ b/service/src/main/java/com/hzya/frame/Jackyun/util/JackyunOpenHttpUtils.java @@ -3,6 +3,7 @@ package com.hzya.frame.Jackyun.util; +import cn.hutool.http.HttpRequest; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.junit.Test; @@ -168,7 +169,7 @@ public void test01(){ * @return HTTP-Post返回结果 */ public static String postData(String url, String postData) throws IOException { - return postData(url, postData, "UTF-8", 300000); + return postDataNew(url, postData, "UTF-8", 300000); } /** @@ -252,6 +253,88 @@ public void test01(){ return resultBuffer.toString(); } + public static String postDataNew(String url, String postData, String encoding, int timeOut) throws IOException { + if (encoding == null || encoding.isEmpty()) { + encoding = "UTF-8"; + } + if (timeOut <= 0) { + timeOut = 300000; + } + PrintWriter printWriter = null; + BufferedReader bufferedReader = null; + StringBuffer resultBuffer = null; + URLConnection urlConnection = null; + String result = HttpRequest.post(url) + .header("accept", "application/json; charset=UTF-8")//头信息,多个头信息多次调用此方法即可 + .header("connection", "Keep-Alive")//头信息,多个头信息多次调用此方法即可 + .header("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)")//头信息,多个头信息多次调用此方法即可 + .header("Content-Type", "application/x-www-form-urlencoded")//头信息,多个头信息多次调用此方法即可 + .body(postData)//表单内容 + .timeout(120000)//超时,毫秒 + .execute().body(); +// +// +// // 发送Post请求 +// try { +// URL postMethodUrl = new URL(url); +// // 打开连接 +// urlConnection = postMethodUrl.openConnection(); +// // 设置通用的请求属性 +// urlConnection.setRequestProperty("Accept", "application/json; charset=UTF-8"); +// urlConnection.setRequestProperty("connection", "Keep-Alive"); +// +// urlConnection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); +// urlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); +// urlConnection.setConnectTimeout(timeOut); +// // 设置url连接可以用于输入输出 +// urlConnection.setDoOutput(true); +// urlConnection.setDoInput(true); +// // 获取URLConnection对象对应的输出流 +// printWriter = new PrintWriter(urlConnection.getOutputStream()); +// // 发送请求参数 +// printWriter.print(postData); +// // flush输出流的缓冲 +// printWriter.flush(); +// // 定义BufferedReader输入流来读取URL的响应 +// bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); +// resultBuffer = new StringBuffer(); +// String temp = ""; +// while ((temp = bufferedReader.readLine()) != null) { +// resultBuffer.append(temp); +// } +// } finally { +// if (bufferedReader != null) { +// try { +// bufferedReader.close(); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// +// if (printWriter != null) { +// try { +// printWriter.close(); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// } + return result; + } + /** + * 修复JSON编码(从ISO-8859-1转为UTF-8) + */ +// public static String fixJsonEncoding(String garbledJson) { +// try { +// // 先将乱码字符串按ISO-8859-1转为字节 +// byte[] bytes = garbledJson.getBytes("GBK"); +// +// // 再按UTF-8重新编码为字符串 +// return new String(bytes, "UTF-8"); +// } catch (Exception e) { +// throw new RuntimeException("编码修复失败", e); +// } +// } //endregion } diff --git a/service/src/main/java/com/hzya/frame/barcode/dao/IBarcodeDao.java b/service/src/main/java/com/hzya/frame/barcode/dao/IBarcodeDao.java new file mode 100644 index 00000000..30092dc5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/barcode/dao/IBarcodeDao.java @@ -0,0 +1,20 @@ +package com.hzya.frame.barcode.dao; + +import com.hzya.frame.barcode.entity.BarcodeEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; + +/** + * (attendance: table)表数据库访问层 + * + * @author makejava + * @since 2024-09-19 13:26:00 + */ +public interface IBarcodeDao extends IBaseDao { + + List getBarcodeList(BarcodeEntity entity); + + String getBarcodeListCount(BarcodeEntity entity); +} + diff --git a/service/src/main/java/com/hzya/frame/barcode/dao/impl/BarcodeDaoImpl.java b/service/src/main/java/com/hzya/frame/barcode/dao/impl/BarcodeDaoImpl.java new file mode 100644 index 00000000..c4068830 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/barcode/dao/impl/BarcodeDaoImpl.java @@ -0,0 +1,33 @@ +package com.hzya.frame.barcode.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.barcode.dao.IBarcodeDao; +import com.hzya.frame.barcode.entity.BarcodeEntity; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * (码包)表数据库访问层 + * + * @author makejava + * @since 2024-09-19 13:26:00 + */ +@Repository("BarcodeDaoImpl") +public class BarcodeDaoImpl extends MybatisGenericDao implements IBarcodeDao { + + @DS("barcode") + @Override + public List getBarcodeList(BarcodeEntity entity) { + return (List) super.selectList("com.hzya.frame.barcode.dao.impl.BarcodeDaoImpl.entity_list_base",entity); + } + + @DS("barcode") + @Override + public String getBarcodeListCount(BarcodeEntity entity) { + BarcodeEntity barcode = (BarcodeEntity) super.selectOne("com.hzya.frame.barcode.dao.impl.BarcodeDaoImpl.entity_list_count",entity); + return barcode.getId(); + } +} + diff --git a/service/src/main/java/com/hzya/frame/barcode/entity/BarcodeEntity.java b/service/src/main/java/com/hzya/frame/barcode/entity/BarcodeEntity.java new file mode 100644 index 00000000..c04a9e91 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/barcode/entity/BarcodeEntity.java @@ -0,0 +1,134 @@ +package com.hzya.frame.barcode.entity; + +import com.hzya.frame.web.entity.BaseEntity; +/** + * (Attendance)实体类 + * + * @author makejava + * @since 2024-09-19 13:26:00 + */ +public class BarcodeEntity extends BaseEntity { + + private String boxCode; + + private String productCode; + + private String companyId; + + private String productId; + + private String deleted; + + private String creator; + + private String createDate; + + private String modifier; + + private String modifyDate; + + private String dealStatus; + + private String activeStatus; + + private String bakCode; + + public String getBoxCode() { + return boxCode; + } + + public void setBoxCode(String boxCode) { + this.boxCode = boxCode; + } + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + @Override + public String getCompanyId() { + return companyId; + } + + @Override + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getModifier() { + return modifier; + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getModifyDate() { + return modifyDate; + } + + public void setModifyDate(String modifyDate) { + this.modifyDate = modifyDate; + } + + public String getDealStatus() { + return dealStatus; + } + + public void setDealStatus(String dealStatus) { + this.dealStatus = dealStatus; + } + + public String getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(String activeStatus) { + this.activeStatus = activeStatus; + } + + public String getBakCode() { + return bakCode; + } + + public void setBakCode(String bakCode) { + this.bakCode = bakCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/barcode/entity/BarcodeEntity.xml b/service/src/main/java/com/hzya/frame/barcode/entity/BarcodeEntity.xml new file mode 100644 index 00000000..abc17be7 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/barcode/entity/BarcodeEntity.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/barcode/service/IBarcodeService.java b/service/src/main/java/com/hzya/frame/barcode/service/IBarcodeService.java new file mode 100644 index 00000000..f1d0c42b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/barcode/service/IBarcodeService.java @@ -0,0 +1,17 @@ +package com.hzya.frame.barcode.service; + +import com.hzya.frame.barcode.entity.BarcodeEntity; +import java.util.List; + +/** + * (Attendance)表服务接口 + * + * @author makejava + * @since 2024-09-19 13:26:00 + */ +public interface IBarcodeService { + + List getBarcodeList(BarcodeEntity entity); + + String getBarcodeCount(BarcodeEntity entity); +} diff --git a/service/src/main/java/com/hzya/frame/barcode/service/impl/BarcodeServiceImpl.java b/service/src/main/java/com/hzya/frame/barcode/service/impl/BarcodeServiceImpl.java new file mode 100644 index 00000000..c0580c5d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/barcode/service/impl/BarcodeServiceImpl.java @@ -0,0 +1,37 @@ +package com.hzya.frame.barcode.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.barcode.dao.IBarcodeDao; +import com.hzya.frame.barcode.entity.BarcodeEntity; +import com.hzya.frame.barcode.service.IBarcodeService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * (码包)表服务实现类 + * + * @author makejava + * @since 2024-09-19 13:26:00 + */ +@Service("bacodeService") +public class BarcodeServiceImpl implements IBarcodeService { + private static final Logger logger = LoggerFactory.getLogger(BarcodeServiceImpl.class); + + @Autowired + private IBarcodeDao barcodeDao; + + @Override + public List getBarcodeList(BarcodeEntity entity){ + return barcodeDao.getBarcodeList(entity); + } + + @Override + public String getBarcodeCount(BarcodeEntity entity){ + return barcodeDao.getBarcodeListCount(entity); + } + +} diff --git a/service/src/main/java/com/hzya/frame/dd/robot/service/IDingRobotService.java b/service/src/main/java/com/hzya/frame/dd/robot/service/IDingRobotService.java new file mode 100644 index 00000000..5b1c2648 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/dd/robot/service/IDingRobotService.java @@ -0,0 +1,16 @@ +package com.hzya.frame.dd.robot.service; + +import com.hzya.frame.barcode.entity.BarcodeEntity; + +import java.util.List; + +/** + * (Attendance)表服务接口 + * + * @author makejava + * @since 2024-09-19 13:26:00 + */ +public interface IDingRobotService { + + String getBarcodeList(BarcodeEntity entity); +} diff --git a/service/src/main/java/com/hzya/frame/dd/robot/service/impl/DingRobotServiceImpl.java b/service/src/main/java/com/hzya/frame/dd/robot/service/impl/DingRobotServiceImpl.java new file mode 100644 index 00000000..6aebb66e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/dd/robot/service/impl/DingRobotServiceImpl.java @@ -0,0 +1,154 @@ +package com.hzya.frame.dd.robot.service.impl; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.barcode.entity.BarcodeEntity; +import com.hzya.frame.barcode.service.IBarcodeService; +import com.hzya.frame.dd.robot.service.IDingRobotService; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.UnsupportedEncodingException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import org.apache.commons.codec.binary.Base64; +import java.net.URLEncoder; +import java.util.concurrent.atomic.AtomicReference; + +/** + * (Attendance)表服务实现类 + * + * @author makejava + * @since 2024-09-19 13:26:00 + */ +@Service("dingRobotService") +public class DingRobotServiceImpl implements IDingRobotService { + private static final Logger logger = LoggerFactory.getLogger(DingRobotServiceImpl.class); + + private static String access_token = "f2f3bffeb0184589fb2038fe21196936e837096ea54f0a82d8f6c05804707e46"; + + @Autowired + private IBarcodeService barcodeService; + + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + @Override + public String getBarcodeList(BarcodeEntity entity){ + + String count = barcodeService.getBarcodeCount(entity); + List list = barcodeService.getBarcodeList(entity); + JSONObject main = bindingAdd(count,list); + long timestamp = System.currentTimeMillis(); + String sign = getSign(Long.toString(timestamp)); + String query = "access_token="+access_token+"&sign="+sign+"×tamp="+timestamp; + + if (count.equals("0")){ + return "0"; + }else { + String result = sendTORobotEsb(main.toString(), "8000050004", query); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(list)); + logDetails.setPluginId("kjsDingRobotPlugin"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getString("code").equals("200"); + if (flag) { + logDetails.setNewTransmitInfo("推送成功"); + } + try { + if (flag) { + //首推成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + } else { + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + } catch (Exception e) { + logger.error("保存日志失败" + e.getMessage()); + e.printStackTrace(); + } + return result; + } + } + + public String getSign(String timestamp){ + //Long timestamp = System.currentTimeMillis(); + String sign = ""; + try { + String secret = "SEC7d83e2c124953dedd9794577fccc34900ea5032c6c67629e8293282d832f6029"; + + String stringToSign = timestamp + "\n" + secret; + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); + sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException(e); + } catch (InvalidKeyException e) { + throw new RuntimeException(e); + } + return sign; + } + + public String sendTORobotEsb(String parm, String apiCode,String query){ + String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface?" + query; + System.out.println("推送参数"+parm); + String result = HttpRequest.post(baseUrl) + .header("appId", "800005")//头信息,多个头信息多次调用此方法即可 + .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYAju1ajInPjFRjPC/gO6XaNx4fDlaPBRNDe5XW/O8GWVVCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "ExwEKYQs1xV46u+UttuhaxlsGmbIz9uZE+XvD8loIUVzfoy6p67iMAwaelVG7fOOj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body(parm)//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("返回参数"+result); + if(StrUtil.isNotEmpty(result)){ + return analytic(result); + } + return null; + } + + public static String analytic(String parm){ + JSONObject main = JSON.parseObject(parm); + return main.getString("attribute"); + } + + private JSONObject bindingAdd(String count, List sale) { + JSONObject main = new JSONObject(); + main.put("msgtype","markdown"); + JSONObject markdown = new JSONObject(); + markdown.put("title","码包预警"); + AtomicReference tt = new AtomicReference<>("#### 当前异常数据总计" + count + "条。"); + if(CollectionUtils.isNotEmpty(sale)){ + String tt2 = "最新部分明细如下: \n" + + "|create_date|product_code|\n" + + "|---|---|\n"; + tt.set(tt + tt2); + sale.forEach(line -> { + String str = "|"+line.getCreateDate()+"|"+line.getProductCode()+"|\n"; + tt.set(tt + str); + }); + } + markdown.put("text",tt); + main.put("markdown",markdown); + return main; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/delivery/dao/IDeliveryOrderDao.java b/service/src/main/java/com/hzya/frame/u8/delivery/dao/IDeliveryOrderDao.java index 24a12085..36c24b4c 100644 --- a/service/src/main/java/com/hzya/frame/u8/delivery/dao/IDeliveryOrderDao.java +++ b/service/src/main/java/com/hzya/frame/u8/delivery/dao/IDeliveryOrderDao.java @@ -1,5 +1,6 @@ package com.hzya.frame.u8.delivery.dao; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.dao.IBaseDao; import com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity; @@ -19,4 +20,6 @@ public interface IDeliveryOrderDao extends IBaseDao */ int updateDeliveryState( DeliveryOrderEntity entity); + + int updateSengStatus(DeliveryOrderEntity entity); } diff --git a/service/src/main/java/com/hzya/frame/u8/delivery/dao/impl/DeliveryOrderDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/delivery/dao/impl/DeliveryOrderDaoImpl.java index a5ec36ac..0be97c92 100644 --- a/service/src/main/java/com/hzya/frame/u8/delivery/dao/impl/DeliveryOrderDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/delivery/dao/impl/DeliveryOrderDaoImpl.java @@ -18,4 +18,10 @@ public class DeliveryOrderDaoImpl extends MybatisGenericDao and ccusname = #{ccusname} and csocode = #{csocode} and bReturnFlag = #{bReturnFlag} - and lasttime >= #{startTime} - + and cVerifier is not null + and sync_flag is null order by dlid @@ -80,5 +81,12 @@ where cdlcode = #{cdlcode} + + + + UPDATE ${dbname}DispatchList set sync_flag =#{sync_flag} + where dlid = #{dlid} + + diff --git a/service/src/main/java/com/hzya/frame/u8/delivery/service/IDeliveryOrderService.java b/service/src/main/java/com/hzya/frame/u8/delivery/service/IDeliveryOrderService.java index 693a43cd..0a9b9e4b 100644 --- a/service/src/main/java/com/hzya/frame/u8/delivery/service/IDeliveryOrderService.java +++ b/service/src/main/java/com/hzya/frame/u8/delivery/service/IDeliveryOrderService.java @@ -56,6 +56,23 @@ public interface IDeliveryOrderService extends IBaseService255){ - jsonObject.put("cmemo", cmemo.substring(0,254)); - } +// String cmemo = jsonObject.getString("cmemo"); +// if(cmemo.length()>255){ +// jsonObject.put("cmemo", cmemo.substring(0,254)); +// } if(StrUtil.isEmpty(AccId)){ return BaseU8Result.getFailureMessageEntity("请传入正确的账套号"); } @@ -223,17 +227,18 @@ public class DeliveryOrderServiceImpl extends BaseService> hashMaps = saleInvDao.getU8BillData(cDLCodeIsExist,U8Obj); - if(CollectionUtils.isNotEmpty(hashMaps)){ - return BaseU8Result.getFailureMessageEntity("发货通知单号已存在!对应发货单号为:"+jHead.getString("cdefine10")); + if(StrUtil.isNotEmpty(jHead.getString("cdefine10"))){ + //校验发货单是否存在 CRM cdefine10是唯一的 + String cDLCodeIsExist = "select cDefine10,cDLCode from "+AccCode+".dbo.DispatchList where cDefine10 = '"+jHead.getString("cdefine10")+"'"; +// //查询银行账户列表 + SaleInvEntity U8Obj = new SaleInvEntity(); + U8Obj.setDataSourceCode("YONYOUU8NEW"); + List> hashMaps = saleInvDao.getU8BillData(cDLCodeIsExist,U8Obj); + if(CollectionUtils.isNotEmpty(hashMaps)){ + return BaseU8Result.getFailureMessageEntity("发货通知单号已存在!对应发货单号为:"+jHead.getString("cdefine10")); + } } - //todo 发货单表体 JSONArray body = new JSONArray(); JSONArray jBody = jsonObject.getJSONArray("body"); @@ -320,13 +325,28 @@ public class DeliveryOrderServiceImpl extends BaseService> U8BodyHashMaps = saleInvDao.getU8BillData(sqlUnit,U8Body); @@ -664,7 +687,7 @@ public class DeliveryOrderServiceImpl extends BaseService> dlMap = saleInvDao.getU8BillData(sqlIsAudit,erdt); + if(CollectionUtils.isEmpty(dlMap)){ + return BaseU8Result.getFailureMessageEntity("单据不存在::"+cdlcode); + } + JSONObject dt = new JSONObject(dlMap.get(0)); + String cVerifier = dt.getString("cVerifier"); + if(StrUtil.isEmpty(cVerifier)){ + return BaseU8Result.getFailureMessageEntity("未审核不允许关闭:"+cdlcode); + } + //验证出库数量 + String sqlSaleOutQty = "select cDLCode,ISNULL(iQuantity,0) as 'iQuantity',ISNULL(rs32.saleOutQty,0) as 'saleOutQty' " + + "from "+AccCode+".dbo.DispatchList dl " + + "left join "+AccCode+".dbo.DispatchLists dls on dls.DLID = dl.DLID " + + "left join ( select iDLsID,SUM(iQuantity) as 'saleOutQty' "+AccCode+".dbo.from rdrecords32 group by iDLsID )rs32 on rs32.iDLsID = dls.iDLsID " + + "where dl.cDLCode = '"+cdlcode+"'"; + List> saleOutQtyMap = saleInvDao.getU8BillData(sqlSaleOutQty,erdt); + if(CollectionUtils.isEmpty(saleOutQtyMap)){ + return BaseU8Result.getFailureMessageEntity("关闭失败,原因:校验发货单"+cdlcode+"出库数量失败:::"); + } + JSONObject dt1 = new JSONObject(saleOutQtyMap.get(0)); + if(dt1.getDouble("saleOutQty")>0){ + return BaseU8Result.getFailureMessageEntity("关闭失败,原因:发货单"+cdlcode+"已有部分出库,不能整单关闭!"); + } + String cdefine10 =dt.getString("cdefine10"); + //通过自定义10 将所有有关联的明细红蓝发货单协同关闭 + String deteilsSql = "select DLID,cVerifier,cdefine10,cdlcode from "+AccCode+".dbo.DispatchList where cdefine10 like '"+cdefine10+"%'"; + SaleInvEntity DetailsErdt = new SaleInvEntity(); + DetailsErdt.setDataSourceCode("YONYOUU8NEW"); + List> detailsDlMap = saleInvDao.getU8BillData(deteilsSql,erdt); + if(CollectionUtils.isNotEmpty(dlMap)){ + detailsDlMap.forEach(detailsDl -> { + try { + //循环关闭相关联的所有红蓝发货单 + JSONObject detailsDt = new JSONObject(detailsDl); + String updateMain = "update "+AccCode+".dbo.DispatchList set cCloser = '"+ccloser+"', bSettleAll = 1 where cDLCode = '"+detailsDt.getString("cdlcode")+"'"; + String updatebody = "update "+AccCode+".dbo.Dispatchlists set cSCloser = '"+ccloser+"',bSettleAll = 1 where DLID = '"+detailsDt.getString("DLID")+"'"; + saleInvDao.execUpdateSql(updateMain,erdt); + saleInvDao.execUpdateSql(updatebody,erdt); + } catch (Exception e) { + throw new RuntimeException("明细发货单关闭失败"+e); + } + }); + } + //关闭发货单 + String updateMain = "update "+AccCode+".dbo.DispatchList set cCloser = '"+ccloser+"', bSettleAll = 1 where cDLCode = '"+cdlcode+"'"; + String updatebody = "update "+AccCode+".dbo.Dispatchlists set cSCloser = '"+ccloser+"',bSettleAll = 1 where DLID = '"+dt.getString("DLID")+"'"; + saleInvDao.execUpdateSql(updateMain,erdt); + saleInvDao.execUpdateSql(updatebody,erdt); + } catch (Exception e) { + logger.info("关闭失败:"+e.getMessage()); + return BaseU8Result.getFailureMessageEntity("关闭失败"+e.getMessage()); + } + return null; + } + + @Override + public U8ResultEntity deleteDelivery(JSONObject parm) { + JSONObject jsonObject = parm.getJSONObject("jsonStr"); + logger.info("接收到的参数"+jsonObject.toString()); + String type = jsonObject.getString("type"); + String billCode = jsonObject.getString("billCode"); + String AccId = jsonObject.getString("AccId"); + if(StrUtil.isEmpty(AccId)){ + return BaseU8Result.getFailureMessageEntity("请传入正确的账套号"); + } + String AccCode = U8Util.accMap.get(AccId); + if("2".equals(type)){ + String dlSql = "select DLID from "+AccCode+".dbo.DispatchList where cDLCode = '"+billCode+"' "; + SaleInvEntity erdt = new SaleInvEntity(); + erdt.setDataSourceCode("YONYOUU8NEW"); + List> dlMap = null; + try { + dlMap = saleInvDao.getU8BillData(dlSql,erdt); + } catch (Exception e) { + throw new RuntimeException(e); + } + if(CollectionUtils.isEmpty(dlMap)){ + return BaseU8Result.getFailureMessageEntity("查询发货单主键失败::"+billCode); + } + String dlId = ""; + JSONObject dt3 = new JSONObject(dlMap.get(0)); + dlId = dt3.getString("DLID"); + JSONObject delete = new JSONObject(); + delete.put("billid", UUID.randomUUID()); + delete.put("AccId", AccId); + delete.put("cVoucherId", dlId); + //删除 + String resultDelete = U8Util.sengBillToU8(delete.toString(), "8000110017"); + } + return null; + } + @Override public U8ResultEntity ClosePartial(JSONObject parm) { String billCode = ""; @@ -1464,10 +1620,10 @@ public class DeliveryOrderServiceImpl extends BaseServicesuccessList = new ArrayList<>(); + U8ResultEntity u8ResultEntity = new U8ResultEntity(); + StringBuffer errorMsg = new StringBuffer(); + boolean flag = false; + String billCode = ""; + String dlId = ""; + String AccId = ""; + JSONArray resultArr = new JSONArray(); + try { + JSONObject jsonObject = parm.getJSONObject("jsonStr"); + logger.info("接收到的参数"+jsonObject.toString()); + StringBuffer resultStr = new StringBuffer();//回传json + String billid = jsonObject.getString("billid"); + if(StrUtil.isEmpty(billid)){ + return BaseU8Result.getFailureMessageEntity("请传入第三方唯一标识"); + } + AccId = jsonObject.getString("AccId"); + if(StrUtil.isEmpty(AccId)){ + return BaseU8Result.getFailureMessageEntity("请传入正确的账套号"); + } + String AccCode = U8Util.accMap.get(AccId); + if(StrUtil.isEmpty(AccCode)){ + return BaseU8Result.getFailureMessageEntity("请传入正确的账套号"); + } + JSONObject head = jsonObject.getJSONObject("head"); + JSONArray body = jsonObject.getJSONArray("body"); + if(CollectionUtils.isEmpty(body)){ + return BaseU8Result.getFailureMessageEntity("请传入发货单数据"); + } + int j = 1; + for(int i = 0 ; i < body.size() ; i++ ){ + JSONObject discountObj = body.getJSONObject(i); + JSONArray bodyArr = new JSONArray(); + bodyArr.add(discountObj); + //拼接发货单信息,按照明细行拆分 + //组装发货单数据 + JSONObject deliveryObjR = bdingParm(head,bodyArr,AccCode,"redd",j); + //调用U8接口生成发货单 + u8ResultEntity = addDelivery(jsonObject); + flag = u8ResultEntity.issuccess(); + if(flag){ + successList.add(u8ResultEntity.getmessage()); + }else{ + errorMsg.append(u8ResultEntity.getmessage()); + break; + } + //组装红字发货单数据 + JSONObject deliveryObjB= bdingParm(head,bodyArr,AccCode,"blue",j); + //调用U8接口生成发货单 + u8ResultEntity = addDelivery(jsonObject); + flag = u8ResultEntity.issuccess(); + if(flag){ + successList.add(u8ResultEntity.getmessage()); + JSONObject resultCode = new JSONObject(); + resultCode.put("cdlcode",u8ResultEntity.getmessage()); + resultCode.put("cdefine10",head.getString("cdefine10")); + resultArr.add(u8ResultEntity.getmessage()); + }else{ + errorMsg.append(u8ResultEntity.getmessage()); + break; + } + } + //组装明细汇总发货单数据 + JSONObject deliveryObjC = bdingParm(head,body,AccCode,"",0); + //调用U8接口生成发货单 + u8ResultEntity = addDelivery(deliveryObjC); + flag = u8ResultEntity.issuccess(); + JSONObject result = new JSONObject(); + if(flag){ + successList.add(u8ResultEntity.getmessage()); + result.put("cdlcode",u8ResultEntity.getmessage()); + }else{ + //回滚已经生成的发货单 + //因为U8底层没有发货单弃审接口,所以逆向暂时不处理 + return BaseU8Result.getFailureMessageEntity(errorMsg.toString()); + } + result.put("cdefine10",head.getString("cdefine10")); + result.put("body",resultArr); + //拼接回传json + BaseU8Result.getSuccessMessageEntity(result); + + } catch (Exception e) { + logger.info("查询失败:"+e.getMessage()); + return BaseU8Result.getFailureMessageEntity("查询失败,请联系U8管理员"); + } + return null; + } +/** + * + * @content U8发货单自动出库 + * 1、定时查询出库单,如果是汇总发货单出库的需要将相关联的拆分状态的发货单&红字发货单虚拟出库。 + * 2、 将虚拟出库的红字发货单和汇总发货单合并开票结0生成销售发票 + * @className: Administrator + * @author laborer + * @date 2025-07-15 13:45 + * + */ + + @Override + public U8ResultEntity u8DeliveryAutoOut(JSONObject parm) { + //循环账套信息,验证该账套下所有的数据 进行虚拟出库 + Map accMap = U8Util.accMap; + accMap.forEach((key,accCode)->{ + SaleInvEntity erdt = new SaleInvEntity(); + erdt.setDataSourceCode("YONYOUU8NEW"); + try { + String sqlSaleOutQty = "select m1.dlid,m1.cDLCode,m1.iQuantity,m1.saleOutQty,m1.cdefine10,m2.cDLCode as cDLCodeD,m2.dlidd from (\n" + + "select \n" + + "dl.cDLCode,\n" + + "dl.dlid,\n" + + "ISNULL(dls.iQuantity,0) as iQuantity,\n" + + "ISNULL(rs32.saleOutQty,0) as saleOutQty,\n" + + "dl.cdefine10\n" + + "from "+accCode+".dbo.DispatchList dl\n" + + "left join "+accCode+".dbo.DispatchLists dls on dls.DLID = dl.DLID \n" + + "left join ( select iDLsID,SUM(iQuantity) as saleOutQty from "+accCode+".dbo.rdrecords32 group by iDLsID )rs32 on rs32.iDLsID = dls.iDLsID \n" + + "\n" + + "where ISNULL(iQuantity,0) = ISNULL(rs32.saleOutQty,0)\n" + + "and ISNULL(iQuantity,0)>0\n" + + "and dl.cdefine10 is not null\n" + + " and cmaker = 'CRM合并发货汇总'\n" + + ")m1\n" + + "left join (\n" + + "select \n" + + "dl.cDLCode,\n" + + "dl.dlid,\n" + + "ISNULL(dls.iQuantity,0) as iQuantity,\n" + + "ISNULL(rs32.saleOutQty,0) as saleOutQty,\n" + + "SUBSTRING(dl.cdefine10, 1, LEN(dl.cdefine10) - 5)as cdefine10\n" + + "from "+accCode+".dbo.DispatchList dl\n" + + "left join "+accCode+".dbo.DispatchLists dls on dls.DLID = dl.DLID \n" + + "left join ( select iDLsID,SUM(iQuantity) as saleOutQty from "+accCode+".dbo.rdrecords32 group by iDLsID )rs32 on rs32.iDLsID = dls.iDLsID \n" + + "where ISNULL(rs32.saleOutQty,0) = 0\n" + + "and dl.cdefine10 is not null\n" + + "and LEN(dl.cdefine10)>5\n" + + " and cmaker in ('CRM合并发货明细red','CRM合并发货明细blue')\n" + + ")m2 on m1.cdefine10 = m2.cdefine10 \n" + + "where m2.cDLCode is not null\n"; + List> saleOutQtyMap = saleInvDao.getU8BillData(sqlSaleOutQty,erdt); + //如果该返回不为空则证明有需要自动出库的数据,执行自动出库逻辑 + //所有的发货单自动出库 + if(CollectionUtils.isNotEmpty(saleOutQtyMap)){ + //统计本次执行的所有汇总发货单用于后续自动开票 + List> cDLCodeList = removeDuplicates(saleOutQtyMap); + //自动出库 + for(HashMap selDis:saleOutQtyMap){ + String dlidd = String.valueOf(selDis.get("dlidd")); + String cdefine10 = String.valueOf(selDis.get("cdefine10")); + if(StrUtil.isNotEmpty(dlidd)){ + //获取该明细发货单的数据执行自动出库 + JSONObject saleOut = bdingSaleOut(accCode,dlidd,erdt); + U8ResultEntity u8ResultOut = saleOutService.addSaleOut(saleOut); + } + } + //将汇总的发货单和红字的发货单合并合票结0 + for(HashMap selDis:cDLCodeList){ + String cdefine10 = String.valueOf(selDis.get("cdefine10")); + //组装开票数据 + JSONObject saleInvoice = bdingSaleInvoice(accCode,cdefine10,erdt); + } + } + + + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + + return null; + } +/** + * + * @content 组装销售发票数据 + * @className: Administrator + * @author laborer + * @date 2025-07-15 16:18 + * + */ + + private JSONObject bdingSaleInvoice(String accCode, String cdefine10, SaleInvEntity erdt)throws Exception { + String dlSql = "select \n" + + "cdlcode \n" + + "from "+accCode+".dbo.DispatchList\n" + + "where cdefine10 like '"+cdefine10+"%'\n" + + "and cmaker in ('CRM合并发货汇总','CRM合并发货明细red')"; + //得到本次需要处理的发货单 + List> cDLCodeList = saleInvDao.getU8BillData(dlSql,erdt); + if(CollectionUtils.isNotEmpty(cDLCodeList)){ + cDLCodeList.forEach(map->{ + String cDLCode = String.valueOf(map.get("cdlcode")); + //通过发货单号分别查询出库信息 参照出库信息进行合并开票 + + }); + } + return null; + } + + public static List> removeDuplicates(List> list) { + return new ArrayList<>(list.stream() + .collect(Collectors.toMap( + // 组合键:cdefine10 + "|" + cDLCode + map -> map.get("cdefine10") + "|" + map.get("cDLCode"), + map -> map, + (existing, replacement) -> existing, // 保留首个元素 + LinkedHashMap::new // 保持插入顺序 + )) + .values()); + } + private JSONObject bdingSaleOut(String accCode, String dlidd,SaleInvEntity erdt)throws Exception { + //获取表头数据 + String sqlSaleHead = "select \n" + + "breturnflag as brdflag,\n" + + "breturnflag ,\n" + + "cbustype,\n" + + "cdepcode,\n" + + "cmaker,\n" + + "cmemo,\n" + + "ccuscode,\n" + + "cstcode,\n" + + "ddate\n" + + "from "+accCode+".dbo.DispatchList dl" + + " where dlid = "+dlidd+""; + List> sqlSaleHeadMap = saleInvDao.getU8BillData(sqlSaleHead,erdt); + JSONObject head = new JSONObject(sqlSaleHeadMap.get(0)); + //获取明细数据 + String sqlSaleBody = "select \n" + + "cwhcode,\n" + + "cinvcode ,\n" + + "cunitid,\n" + + "inum,\n" + + "isum,\n" + + "iquantity,\n" + + "itaxrate\n" + + "from "+accCode+".dbo.DispatchLists dl" + + " where dlid = "+dlidd+""; + List> sqlSaleBodyMap = saleInvDao.getU8BillData(sqlSaleBody,erdt); + //只会有一行数据 + JSONObject body = new JSONObject(sqlSaleBodyMap.get(0)); + JSONArray bodyArr = new JSONArray(); + bodyArr.add(body); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("AccId", accCode); + jsonObject.put("billid", "123"); + jsonObject.put("head", head); + jsonObject.put("body", body); + JSONObject result = new JSONObject(); + result.put("jsonStr", jsonObject); + return result; + } + + private JSONObject bdingParm(JSONObject headObj, JSONArray bodyArr, String AccId, String type, int j) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("AccId", AccId); + jsonObject.put("billid", "123"); + JSONObject head = new JSONObject(); + if("red".equals( type)){ + head.put("brdflag", "0");//发货0,退货1@ + head.put("breturnflag", "0");//发货0,退货1 + }else{ + head.put("brdflag", "1");//发货0,退货1@ + head.put("breturnflag", "1"); + } + head.put("cbustype", headObj.getString("cbustype"));//业务类型 + head.put("ddate", headObj.getString("ddate"));//业务类型 + head.put("cdepcode", headObj.getString("cdepcode"));//销售部门 + head.put("cstcode", headObj.getString("cstcode"));// + head.put("cpersoncode", headObj.getString("cpersoncode"));// + head.put("ccuscode", headObj.getString("ccuscode"));//客户 + head.put("csccode", headObj.getString("csccode"));//发运方式 + head.put("cshipaddress", headObj.getString("cshipaddress"));//发货地址 + head.put("cexch_name", headObj.getString("cexch_name"));//币种名称 + head.put("iexchrate", headObj.getString("iexchrate"));//汇率 + head.put("itaxrate", headObj.getString("itaxrate"));//税率 + if(j == 0){ + head.put("cmaker", "CRM合并发货汇总");//创建人 + head.put("cdefine10", headObj.getString("cdefine10"));//唯一字段、因为汇总发货单是我们拆分多行明细的 那么我们拼接各自的标识 + }else{ + head.put("cmaker", "CRM合并发货明细"+type);//创建人 + head.put("cdefine10", headObj.getString("cdefine10")+j+type);//唯一字段、因为汇总发货单是我们拆分多行明细的 那么我们拼接各自的标识 + } + + + head.put("cmemo",headObj.getString("cmemo")); + jsonObject.put("head", head); + JSONArray body = new JSONArray(); + if(CollectionUtils.isNotEmpty(bodyArr)){ + bodyArr.forEach(line -> { + JSONObject lineObj = JSON.parseObject(line.toString()); + JSONObject details = new JSONObject(); + String iquantity = lineObj.getString("isum"); + String isum = lineObj.getString("isum"); + String idiscount = lineObj.getString("isum"); + if("red".equals( type)){ + details.put("iquantity",new BigDecimal(iquantity).subtract(new BigDecimal(iquantity).add(new BigDecimal(iquantity)))); + details.put("isum",new BigDecimal(isum).subtract(new BigDecimal(isum).add(new BigDecimal(isum)))); + details.put("idiscount",new BigDecimal(idiscount).subtract(new BigDecimal(idiscount).add(new BigDecimal(idiscount)))); + }else{ + details.put("iquantity",iquantity); + details.put("isum",isum); + details.put("idiscount",idiscount); + } + details.put("cwhcode",lineObj.getString("cwhcode")); //仓库 + details.put("cdlcode",lineObj.getString("cdlcode")); //发货单号 + details.put("cinvcode",lineObj.getString("cinvcode")); //存货编码 + details.put("itaxrate",lineObj.getString("itaxrate")); //税率 + details.put("cdefine22",lineObj.getString("cdefine22")); //买赠类型 + details.put("cmemo",lineObj.getString("cmemo")); //备注 + body.add( details); + }); + } + jsonObject.put("body", body); + JSONObject result = new JSONObject(); + result.put("jsonStr", jsonObject); + return result; + } } diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml index 8016213b..bba84a77 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml @@ -21,8 +21,7 @@ diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml index 4d81c37a..fee18f39 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml @@ -19,8 +19,7 @@ diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptServiceImpl.java index 8a8b7f69..8c227100 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptServiceImpl.java @@ -127,9 +127,7 @@ public class OtherReceiptServiceImpl extends BaseService { try { diff --git a/service/src/main/java/com/hzya/frame/u8/productionin/service/impl/ProductionInServicempl.java b/service/src/main/java/com/hzya/frame/u8/productionin/service/impl/ProductionInServicempl.java index 49bc6959..9fb7d1e3 100644 --- a/service/src/main/java/com/hzya/frame/u8/productionin/service/impl/ProductionInServicempl.java +++ b/service/src/main/java/com/hzya/frame/u8/productionin/service/impl/ProductionInServicempl.java @@ -72,8 +72,6 @@ public class ProductionInServicempl extends BaseService> cdefine5Map = saleInvDao.getU8BillData(cdefine5Sql,U8Obj); - if(CollectionUtils.isNotEmpty(cdefine5Map) ){ - return BaseU8Result.getFailureMessageEntity("单号重复,请检查:"+cdefine5); - } - } //生产订单id if(StrUtil.isEmpty(jHead.getString("iproorderid"))){ - + U8Obj.setDataSourceCode("YONYOUU8NEW"); String sql = "select MoId from "+AccCode+".dbo.mom_order where MoCode = '"+jHead.getString("cmpocode")+"'"; List> momMap = saleInvDao.getU8BillData(sql,U8Obj); if(CollectionUtils.isEmpty(momMap) ){ diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java index 8a73bb0e..708de335 100644 --- a/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java @@ -104,9 +104,7 @@ public class ReceiptServiceImpl extends BaseService implem // 日志写入u8扩展库 try{ if (sale.getState().equals("Y")) { - if (sale.getOrderType().equals("修改")){ - saleOutDao.modifyState(sale); - } + saleOutDao.modifyState(sale); saleOutDao.insertLog(sale); } }catch (Exception e){ diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java index a540cfdf..4a4dc603 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java @@ -296,6 +296,21 @@ public class SaleOutServiceImpl extends BaseService implem return BaseU8Result.getFailureMessageEntity("获取账套号有误,请联系管理员"); } + String ccodeSql = "SELECT ISNULL(max(CONVERT(DECIMAL(20, 0), ccode))+1, CONVERT (VARCHAR (20),ddate,112) + '0001') as ccode " + + "FROM "+AccCode+".dbo.RdRecord32 " + + "WHERE cCode LIKE CONVERT (VARCHAR (20),'"+DateUtil.format(jHead.getDate("ddate"),"yyyyMMdd")+"',112) + '%'" + + "AND len(cCode) = 12 GROUP BY ddate"; + //查询账套中的发货单信息 +// SaleInvEntity U8Obj = new SaleInvEntity(); +// U8Obj.setDataSourceCode("YONYOUU8NEW"); + List> ccodeHashMaps = saleInvDao.getU8BillData(ccodeSql,U8Obj); + if(CollectionUtils.isNotEmpty(ccodeHashMaps)){ + HashMap ccodeObj= ccodeHashMaps.get(0); + jHead.put("ccode",ccodeObj.get("ccode")); + }else{ + jHead.put("ccode",DateUtil.format(jHead.getDate("ddate"),"yyyyMMdd")+"0001"); + } + //验证单号唯一 String cdefine5 = jsonObject.getString("cdefine5"); if(StrUtil.isNotEmpty(cdefine5)){ @@ -318,7 +333,7 @@ public class SaleOutServiceImpl extends BaseService implem if(CollectionUtils.isEmpty(selDisListMap) ){ return BaseU8Result.getFailureMessageEntity("发货单主表查询失败"+jHead.getString("cbuscode")); } - HashMap selDis= hashMaps.get(0); + HashMap selDis= selDisListMap.get(0); if(StrUtil.isEmpty(jHead.getString("dlid"))){ jHead.put("dlid",selDis.get("dlid")); } @@ -358,9 +373,11 @@ public class SaleOutServiceImpl extends BaseService implem if(StrUtil.isEmpty(jHead.getString("cmemo"))){ jHead.put("cmemo",selDis.get("cmemo")); } + //TODO 正式要放出来哦 + /* if(StrUtil.isEmpty(jHead.getString("cdefine1"))){ jHead.put("cdefine1",selDis.get("cdefine1")); - } + }*/ //表体 JSONArray body = new JSONArray(); JSONArray jBody = jsonObject.getJSONArray("body"); @@ -396,14 +413,14 @@ public class SaleOutServiceImpl extends BaseService implem if(CollectionUtils.isEmpty(selDisDetailsListMap) ){ return BaseU8Result.getFailureMessageEntity("发货单子表查询失败"+jHead.getString("cbuscode")+"发货单表体存货"+jBodyObj.getString("cinvcode")+"行号"+jBodyObj.getString("cdblrowno")+"不存在"); } - HashMap selDisDetails= hashMaps.get(0); + HashMap selDisDetails= selDisDetailsListMap.get(0); if(StrUtil.isEmpty(jBodyObj.getString("idlsid"))){ jBodyObj.put("idlsid",selDisDetails.get("idlsid")); } //获取辅计量单位 - String dtInvSql = "select cInvCode,cInvName,cInvStd,Inv.cComUnitCode,cInvCCode,iChangRate, cPUComUnitCode,cSAComUnitCode,cProductUnit,cSTComUnitCode " + + String dtInvSql = "select inv.bInvBatch,cInvCode,cInvName,cInvStd,Inv.cComUnitCode,cInvCCode,iChangRate, cPUComUnitCode,cSAComUnitCode,cProductUnit,cSTComUnitCode " + "from "+AccCode+".dbo.Inventory Inv " + "left join "+AccCode+".dbo.ComputationUnit Com On Inv.cComUnitCode = Com.cComUnitCode " + "where cInvCode='" + jBodyObj.getString("cinvcode") +"'"; @@ -413,7 +430,7 @@ public class SaleOutServiceImpl extends BaseService implem } HashMap dtInvObj= dtInv.get(0); //存在辅计量单位则 计算件数 =数量/换算率 - if(StrUtil.isNotEmpty(String.valueOf(dtInvObj.get("cSTComUnitCode")))){ + if(StrUtil.isNotEmpty(String.valueOf(dtInvObj.get("cSTComUnitCode"))) && !String.valueOf(dtInvObj.get("cSTComUnitCode")).equals("null")){ jBodyObj.put("cassunit",dtInvObj.get("cSTComUnitCode")); String sqlCassUnit = "select * from "+AccCode+".dbo.ComputationUnit where cComUnitCode='" +dtInvObj.get("cSTComUnitCode")+"'"; List> dtUnit = saleInvDao.getU8BillData(sqlCassUnit,U8Obj); @@ -423,10 +440,15 @@ public class SaleOutServiceImpl extends BaseService implem HashMap dtUnitObj= dtUnit.get(0); jBodyObj.put("iinvexchrate",dtUnitObj.get("iChangRate")); - jBodyObj.put("inum",jBodyObj.getBigDecimal("iquantity").divide(new BigDecimal(String.valueOf(dtUnitObj.get("iChangRate"))),6, RoundingMode.HALF_UP)); + jBodyObj.put("inum",jBodyObj.getBigDecimal("iquantity").divide(new BigDecimal(String.valueOf(dtUnitObj.get("iChangRate"))),2, RoundingMode.HALF_UP)); } jBodyObj.put("irowno",i+1); + + String bInvBatch = String.valueOf(dtInvObj.get("bInvBatch")); + if("true".equals(bInvBatch)){ + jBodyObj.put("cbatch",0); + } //默认字段 //是否需要开票 if(StrUtil.isEmpty(jBodyObj.getString("bneedbill"))){ @@ -436,7 +458,10 @@ public class SaleOutServiceImpl extends BaseService implem if(StrUtil.isEmpty(jBodyObj.getString("bIAcreatebill"))){ jBodyObj.put("bIAcreatebill",0); } + BigDecimal iquantity = jBodyObj.getBigDecimal("iquantity");;//数量 + jBodyObj.put("iquantity",iquantity.setScale(2, RoundingMode.HALF_UP));//本币含税金额 //是否销售出库开票 + /* if(StrUtil.isEmpty(jBodyObj.getString("bsaleoutcreatebill"))){ jBodyObj.put("bsaleoutcreatebill",0); } @@ -457,6 +482,7 @@ public class SaleOutServiceImpl extends BaseService implem } } } + */ body.add(jBodyObj); } JSONObject main = new JSONObject(); @@ -716,7 +742,7 @@ public class SaleOutServiceImpl extends BaseService implem }else { HashMap dtUnitObj= dtUnit.get(0); jBodyObj.put("iinvexchrate",dtUnitObj.get("iChangRate")); - jBodyObj.put("inum",jBodyObj.getBigDecimal("iquantity").divide(jBodyObj.getBigDecimal("iinvexchrate"),6, RoundingMode.HALF_UP)); + jBodyObj.put("inum",jBodyObj.getBigDecimal("iquantity").divide(jBodyObj.getBigDecimal("iinvexchrate"),2, RoundingMode.HALF_UP)); } @@ -755,6 +781,8 @@ public class SaleOutServiceImpl extends BaseService implem // } // } jBodyObj.put("cProBatch",0); + BigDecimal iquantity = jBodyObj.getBigDecimal("iquantity");;//数量 + jBodyObj.put("iquantity",iquantity.setScale(2, RoundingMode.HALF_UP));//本币含税金额 // jBodyObj.put("csource","发货单"); // jBodyObj.put("cbustype","普通销售"); jBodyObj.put("cProBatch",0); @@ -1055,7 +1083,7 @@ public class SaleOutServiceImpl extends BaseService implem HashMap dtUnitObj= dtUnit.get(0); jBodyObj.put("iinvexchrate",dtUnitObj.get("iChangRate")); - jBodyObj.put("inum",jBodyObj.getBigDecimal("iquantity").divide(new BigDecimal(String.valueOf(dtUnitObj.get("iChangRate"))),6, RoundingMode.HALF_UP)); + jBodyObj.put("inum",jBodyObj.getBigDecimal("iquantity").divide(new BigDecimal(String.valueOf(dtUnitObj.get("iChangRate"))),2, RoundingMode.HALF_UP)); } jBodyObj.put("irowno",i+1); diff --git a/service/src/main/java/com/hzya/frame/u8/util/U8Util.java b/service/src/main/java/com/hzya/frame/u8/util/U8Util.java index 93b29dcf..24bb45b9 100644 --- a/service/src/main/java/com/hzya/frame/u8/util/U8Util.java +++ b/service/src/main/java/com/hzya/frame/u8/util/U8Util.java @@ -23,8 +23,8 @@ public class U8Util { { put("001","UFDATA_001_2023"); put("002","UFDATA_002_2024"); - put("004","UFDATA_004_2023"); - put("005","UFDATA_005_2023"); + put("004","UFDATA_004_2024"); + put("005","UFDATA_005_2024"); put("201","UFDATA_201_2023"); } }; @@ -54,7 +54,7 @@ public class U8Util { .header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 .header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 .body(parm)//表单内容 - .timeout(20000)//超时,毫秒 + .timeout(120000)//超时,毫秒 .execute().body(); System.out.println("返回参数"+result); if(StrUtil.isNotEmpty(result)){ @@ -76,20 +76,20 @@ public class U8Util { ae.put("iPerTaxRate",iPerTaxRate); ae.put("iLenDecimal",iLenDecimal); - ae.put("TaxPrice",iSum.divide(iQuantity,6, RoundingMode.HALF_UP)); + ae.put("TaxPrice",iSum.divide(iQuantity,2, RoundingMode.HALF_UP)); ae.put("Money",iSum.divide(new BigDecimal(1).add(iPerTaxRate.multiply(new BigDecimal(0.01))),6)) ; ae.put("UnitPrice",ae.getBigDecimal("Money").divide(iQuantity,6, RoundingMode.HALF_UP)); ae.put("NatSum",iSum.multiply(nflat)); ae.put("NatUnitPrice",ae.getBigDecimal("UnitPrice").multiply(nflat)); ae.put("NatMoney",ae.getBigDecimal("Money").multiply(nflat)) ; ae.put("NatTaxPrice",ae.getBigDecimal("TaxPrice").multiply(nflat)); - ae.put("Sum",ae.getBigDecimal("iSum").setScale(6)) ; - ae.put("UnitPrice",ae.getBigDecimal("UnitPrice").setScale(iLenDecimal)); - ae.put("Money",ae.getBigDecimal("Money").setScale(6)); + ae.put("Sum",ae.getBigDecimal("iSum").setScale(2, RoundingMode.HALF_UP)) ; + ae.put("UnitPrice",ae.getBigDecimal("UnitPrice").setScale(iLenDecimal, RoundingMode.HALF_UP)); + ae.put("Money",ae.getBigDecimal("Money").setScale(2, RoundingMode.HALF_UP)); ae.put("NatTaxPrice",ae.getBigDecimal("NatTaxPrice").setScale(iLenDecimal)) ; - ae.put("NatSum",ae.getBigDecimal("NatSum").setScale(6)); - ae.put("NatUnitPrice",ae.getBigDecimal("NatUnitPrice").setScale(iLenDecimal)); - ae.put("NatMoney",ae.getBigDecimal("NatMoney").setScale(6)); + ae.put("NatSum",ae.getBigDecimal("NatSum").setScale(2, RoundingMode.HALF_UP)); + ae.put("NatUnitPrice",ae.getBigDecimal("NatUnitPrice").setScale(iLenDecimal, RoundingMode.HALF_UP)); + ae.put("NatMoney",ae.getBigDecimal("NatMoney").setScale(2, RoundingMode.HALF_UP)); ae.put("Tax",ae.getBigDecimal("Sum").subtract(ae.getBigDecimal("Money"))); ae.put("NatTax",ae.getBigDecimal("NatSum").subtract(ae.getBigDecimal("NatMoney"))); return ae; diff --git a/service/src/main/java/com/hzya/frame/wms_21/basemdm/service/IBaseMdmService.java b/service/src/main/java/com/hzya/frame/wms_21/basemdm/service/IBaseMdmService.java index ef1988be..e965d50c 100644 --- a/service/src/main/java/com/hzya/frame/wms_21/basemdm/service/IBaseMdmService.java +++ b/service/src/main/java/com/hzya/frame/wms_21/basemdm/service/IBaseMdmService.java @@ -11,4 +11,6 @@ public interface IBaseMdmService { JsonResultEntity CreateProduct(JSONObject requestData); JsonResultEntity CreateCustomer(JSONObject requestData); + + JsonResultEntity saveOaFlow(JSONObject requestData); } diff --git a/service/src/main/java/com/hzya/frame/wms_21/basemdm/service/impl/BaseMdmServiceImpl.java b/service/src/main/java/com/hzya/frame/wms_21/basemdm/service/impl/BaseMdmServiceImpl.java index 393357e4..04aec004 100644 --- a/service/src/main/java/com/hzya/frame/wms_21/basemdm/service/impl/BaseMdmServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/wms_21/basemdm/service/impl/BaseMdmServiceImpl.java @@ -65,4 +65,10 @@ public class BaseMdmServiceImpl implements IBaseMdmService { return new JsonResultEntity("插入成功:"+ JSON.toJSONString(customer),true); } + + @Override + public JsonResultEntity saveOaFlow(JSONObject requestData) { + + return new JsonResultEntity("接收成功",true); + } }