Compare commits
2 Commits
b4397ec7e3
...
ff686e6cbd
Author | SHA1 | Date |
---|---|---|
|
ff686e6cbd | |
|
40c6ed3ae1 |
|
@ -0,0 +1,64 @@
|
||||||
|
package com.hzya.frame.plugin.yut.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.u8c.gnsale.service.IGnSaleService;
|
||||||
|
import com.hzya.frame.u8c.hwsale.service.IHwSaleService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息管理日志(SysMessageManageLog)表服务接口
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-03-08 10:22:00
|
||||||
|
*/
|
||||||
|
public class YutGnSaleOrderPluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(YutGnSaleOrderPluginInitializer.class);
|
||||||
|
@Autowired
|
||||||
|
public IGnSaleService gnSaleService;
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginId() {
|
||||||
|
return "YutGnSaleOrderPluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "抓取慧经营发货明细数据插件";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "抓取慧经营发货明细数据插件";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getPluginType() {
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
logger.info("开始执行"+getPluginName()+requestJson.toString());
|
||||||
|
try {
|
||||||
|
gnSaleService.getGNSaleOrder(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.hzya.frame.plugin.yut.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.u8c.gnsale.service.IGnSaleService;
|
||||||
|
import com.hzya.frame.u8c.hwsale.service.IHwSaleService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息管理日志(SysMessageManageLog)表服务接口
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-03-08 10:22:00
|
||||||
|
*/
|
||||||
|
public class YutGnSaleSHRecPluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(YutGnSaleSHRecPluginInitializer.class);
|
||||||
|
@Autowired
|
||||||
|
public IGnSaleService gnSaleService;
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginId() {
|
||||||
|
return "YutGnSaleSHRecPluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "抓取慧经营售后退货数据插件";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "抓取慧经营售后退货数据插件";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getPluginType() {
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
logger.info("开始执行"+getPluginName()+requestJson.toString());
|
||||||
|
try {
|
||||||
|
gnSaleService.getGnSaleSHRec(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.hzya.frame.plugin.yut.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.u8c.gnsale.service.IGnSaleService;
|
||||||
|
import com.hzya.frame.u8c.hwsale.service.IHwSaleService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息管理日志(SysMessageManageLog)表服务接口
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-03-08 10:22:00
|
||||||
|
*/
|
||||||
|
public class YutGnSaleSZRecPluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(YutGnSaleSZRecPluginInitializer.class);
|
||||||
|
@Autowired
|
||||||
|
public IGnSaleService gnSaleService;
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginId() {
|
||||||
|
return "YutGnSaleSZRecPluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "抓取慧经营售中退货数据插件";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "抓取慧经营售中退货数据插件";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getPluginType() {
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
logger.info("开始执行"+getPluginName()+requestJson.toString());
|
||||||
|
try {
|
||||||
|
gnSaleService.getGnSaleSZRec(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.hzya.frame.plugin.yut.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.u8c.gnsale.service.IGnSaleService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息管理日志(SysMessageManageLog)表服务接口
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-03-08 10:22:00
|
||||||
|
*/
|
||||||
|
public class YutGnU8CSaleOrderCreatePluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(YutGnU8CSaleOrderCreatePluginInitializer.class);
|
||||||
|
@Autowired
|
||||||
|
public IGnSaleService gnSaleService;
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginId() {
|
||||||
|
return "YutGnU8CSaleOrderCreatePluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "慧经营发货明细生成蓝字销售订单数据插件";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "慧经营发货明细生成蓝字销售订单数据插件";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getPluginType() {
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
logger.info("开始执行"+getPluginName()+requestJson.toString());
|
||||||
|
try {
|
||||||
|
gnSaleService.sendSaleOrderToU8c(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.hzya.frame.plugin.yut.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.u8c.gnsale.service.IGnSaleService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息管理日志(SysMessageManageLog)表服务接口
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-03-08 10:22:00
|
||||||
|
*/
|
||||||
|
public class YutGnU8CSaleRecCreatePluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(YutGnU8CSaleRecCreatePluginInitializer.class);
|
||||||
|
@Autowired
|
||||||
|
public IGnSaleService gnSaleService;
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginId() {
|
||||||
|
return "YutGnU8CSaleRecCreatePluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "慧经营销售退货数据插件";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "慧经营销售退货数据插件";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getPluginType() {
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
logger.info("开始执行"+getPluginName()+requestJson.toString());
|
||||||
|
try {
|
||||||
|
gnSaleService.sendSaleRecToU8c(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.hzya.frame.plugin.yut.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.u8c.hwsale.service.IHwSaleService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息管理日志(SysMessageManageLog)表服务接口
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-03-08 10:22:00
|
||||||
|
*/
|
||||||
|
public class YutHwSaleOrderToU8cPluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(YutHwSaleOrderToU8cPluginInitializer.class);
|
||||||
|
@Autowired
|
||||||
|
public IHwSaleService hwSaleService;
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginId() {
|
||||||
|
return "YutHwSaleOrderToU8cPluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "海外销售订单同步U8C数据插件";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "海外销售订单同步U8C数据插件";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getPluginType() {
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
logger.info("开始执行"+getPluginName()+requestJson.toString());
|
||||||
|
try {
|
||||||
|
hwSaleService.getHwSaleOrderToU8c(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.hzya.frame.plugin.yut.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.u8c.hwsale.service.IHwSaleService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息管理日志(SysMessageManageLog)表服务接口
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-03-08 10:22:00
|
||||||
|
*/
|
||||||
|
public class YutHwSaleRrcToU8cPluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(YutHwSaleRrcToU8cPluginInitializer.class);
|
||||||
|
@Autowired
|
||||||
|
public IHwSaleService hwSaleService;
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginId() {
|
||||||
|
return "YutHwSaleRrcToU8cPluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "抓取海外销售退货同步U8C数据插件";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "抓取海外销售退货同步U8C数据插件";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getPluginType() {
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
logger.info("开始执行"+getPluginName()+requestJson.toString());
|
||||||
|
try {
|
||||||
|
hwSaleService.getHwSaleRecToU8c(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
server:
|
server:
|
||||||
port: 9990
|
port: 9999
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /kangarooDataCenterV3
|
context-path: /kangarooDataCenterV3
|
||||||
localIP: 127.0.0.1
|
localIP: 127.0.0.1
|
||||||
|
|
|
@ -3,4 +3,11 @@
|
||||||
<beans default-autowire="byName">
|
<beans default-autowire="byName">
|
||||||
<bean name="YutHwSaleOrderPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutHwSaleOrderPluginInitializer" />
|
<bean name="YutHwSaleOrderPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutHwSaleOrderPluginInitializer" />
|
||||||
<bean name="YutHwSaleRrcPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutHwSaleRrcPluginInitializer" />
|
<bean name="YutHwSaleRrcPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutHwSaleRrcPluginInitializer" />
|
||||||
|
<bean name="YutHwSaleOrderToU8cPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutHwSaleOrderToU8cPluginInitializer" />
|
||||||
|
<bean name="YutHwSaleRrcToU8cPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutHwSaleRrcToU8cPluginInitializer" />
|
||||||
|
<bean name="YutGnSaleSZRecPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutGnSaleSZRecPluginInitializer" />
|
||||||
|
<bean name="YutGnSaleSHRecPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutGnSaleSHRecPluginInitializer" />
|
||||||
|
<bean name="YutGnSaleOrderPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutGnSaleOrderPluginInitializer" />
|
||||||
|
<bean name="YutGnU8CSaleOrderCreatePluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutGnU8CSaleOrderCreatePluginInitializer" />
|
||||||
|
<bean name="YutGnU8CSaleRecCreatePluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutGnU8CSaleRecCreatePluginInitializer" />
|
||||||
</beans>
|
</beans>
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
package com.hzya.frame;
|
package com.hzya.frame;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
|
||||||
|
import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl;
|
||||||
|
import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
|
||||||
import com.hzya.frame.util.AESUtil;
|
import com.hzya.frame.util.AESUtil;
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
import org.apache.http.client.config.RequestConfig;
|
import org.apache.http.client.config.RequestConfig;
|
||||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
@ -15,6 +21,7 @@ import org.apache.http.impl.client.HttpClients;
|
||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
@ -23,6 +30,7 @@ import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName dsasas
|
* @ClassName dsasas
|
||||||
|
@ -30,10 +38,13 @@ import java.util.Map;
|
||||||
* @Author llg
|
* @Author llg
|
||||||
* Date 2023/7/16 8:18 上午
|
* Date 2023/7/16 8:18 上午
|
||||||
*/
|
*/
|
||||||
//@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
//@SpringBootTest(classes = {WebappApplication.class})
|
@SpringBootTest(classes = {WebappApplication.class})
|
||||||
public class temButtom {
|
public class temButtom {
|
||||||
|
@Autowired
|
||||||
|
private ComparisonServiceImpl comparisonServiceimpl;
|
||||||
|
@Autowired
|
||||||
|
private MasterDataDaoImpl masterDataDaoImpl;
|
||||||
@Test
|
@Test
|
||||||
public void test01() {
|
public void test01() {
|
||||||
String a = AESUtil.encrypt("hzya@1314");
|
String a = AESUtil.encrypt("hzya@1314");
|
||||||
|
@ -142,5 +153,73 @@ public class temButtom {
|
||||||
return body.toString();
|
return body.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test03() {
|
||||||
|
MdmModuleSourceEntity entity = new MdmModuleSourceEntity();
|
||||||
|
entity.setDataSourceCode("ZT");
|
||||||
|
String sqlStr = "select a.project_code as data_id,a.* from imp_temp a";
|
||||||
|
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(sqlStr,entity);
|
||||||
|
List<JSONObject> list = new ArrayList<>();
|
||||||
|
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||||
|
int i = 0;
|
||||||
|
for (HashMap<String, Object> hashMap : hashMaps) {
|
||||||
|
|
||||||
|
JSONObject main = new JSONObject();
|
||||||
|
JSONObject mdm_cost_project = new JSONObject();
|
||||||
|
if(null != hashMap){
|
||||||
|
for(String key:hashMap.keySet()) {
|
||||||
|
mdm_cost_project.put(key, hashMap.get(key));
|
||||||
|
}
|
||||||
|
main.put("mdm_cost_project",mdm_cost_project);
|
||||||
|
list.add(main);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(JSONObject item : list){
|
||||||
|
JSONObject jsonStr = new JSONObject();
|
||||||
|
item.put("appName","数智中台");
|
||||||
|
item.put("appCode","800004");
|
||||||
|
item.put("mdmCode", "10009");
|
||||||
|
item.put("optionName", "数智中台");
|
||||||
|
item.put("data_id",item.getString("project_code"));
|
||||||
|
jsonStr.put("jsonStr", item);
|
||||||
|
Object result = comparisonServiceimpl.saveEntity(jsonStr);
|
||||||
|
System.out.println("结果为:"+JSON.toJSONString(result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test04() {
|
||||||
|
MdmModuleSourceEntity entity = new MdmModuleSourceEntity();
|
||||||
|
entity.setDataSourceCode("ZT");
|
||||||
|
String sqlStr = "select a.org_name as data_id,a.* from imp_tempa a";
|
||||||
|
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(sqlStr,entity);
|
||||||
|
List<JSONObject> list = new ArrayList<>();
|
||||||
|
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||||
|
int i = 0;
|
||||||
|
for (HashMap<String, Object> hashMap : hashMaps) {
|
||||||
|
|
||||||
|
JSONObject main = new JSONObject();
|
||||||
|
JSONObject mdm_cost_project = new JSONObject();
|
||||||
|
if(null != hashMap){
|
||||||
|
for(String key:hashMap.keySet()) {
|
||||||
|
mdm_cost_project.put(key, hashMap.get(key));
|
||||||
|
}
|
||||||
|
main.put("mdm_orgs",mdm_cost_project);
|
||||||
|
list.add(main);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(JSONObject item : list){
|
||||||
|
JSONObject jsonStr = new JSONObject();
|
||||||
|
item.put("appName","数智中台");
|
||||||
|
item.put("appCode","800004");
|
||||||
|
item.put("mdmCode", "10010");
|
||||||
|
item.put("optionName", "数智中台");
|
||||||
|
|
||||||
|
jsonStr.put("jsonStr", item);
|
||||||
|
Object result = comparisonServiceimpl.saveEntity(jsonStr);
|
||||||
|
System.out.println("结果为:"+JSON.toJSONString(result));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hzya.frame.execsql.service;
|
package com.hzya.frame.execsql.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.hzya.frame.datasource.DataSourceUtil;
|
import com.hzya.frame.datasource.DataSourceUtil;
|
||||||
import com.hzya.frame.execsql.entity.ExecSqlEntity;
|
import com.hzya.frame.execsql.entity.ExecSqlEntity;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
@ -80,14 +81,14 @@ public class ExecSqlServiceImpl implements IExecSqlService {
|
||||||
@Override
|
@Override
|
||||||
public int execUpdateSql(String sql, String data_source_code) throws Exception {
|
public int execUpdateSql(String sql, String data_source_code) throws Exception {
|
||||||
logger.info("=============进入execUpdateSql方法============");
|
logger.info("=============进入execUpdateSql方法============");
|
||||||
if (ObjectUtils.isEmpty(sql)) {
|
if (StrUtil.isNotEmpty(sql)) {
|
||||||
if (sql.contains("where") || sql.contains("WHERE")) {
|
if (sql.contains("where") || sql.contains("WHERE")) {
|
||||||
// SqlSession sqlSession = getSqlSession(data_source_code);
|
// SqlSession sqlSession = getSqlSession(data_source_code);
|
||||||
// SqlSession sqlSession = new DataSourceUtil().getDefaultSqlSession();
|
// SqlSession sqlSession = new DataSourceUtil().getDefaultSqlSession();
|
||||||
logger.info("=============execUpdateSql方法要执行的sql:============" + sql);
|
logger.info("=============execUpdateSql方法要执行的sql:============" + sql);
|
||||||
ExecSqlEntity entity = new ExecSqlEntity();
|
ExecSqlEntity entity = new ExecSqlEntity();
|
||||||
entity.setSql(sql);
|
entity.setSql(sql);
|
||||||
int result = sqlSession.update("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
|
int result = sqlSession.update("com.hzya.frame.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
|
||||||
logger.info("update受影响行数:" + result);
|
logger.info("update受影响行数:" + result);
|
||||||
//sqlSession.close();
|
//sqlSession.close();
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -11,5 +11,54 @@ import com.hzya.frame.web.entity.BaseEntity;
|
||||||
* @since 2023-08-25 11:21:44
|
* @since 2023-08-25 11:21:44
|
||||||
*/
|
*/
|
||||||
public interface IGnSaleService extends IBaseService<BaseEntity, String> {
|
public interface IGnSaleService extends IBaseService<BaseEntity, String> {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 获取慧经营发货明细
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-08-28 9:07
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
void getGNSaleOrder(JSONObject requestJson);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 获取慧经营售后数据
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-08-28 10:42
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
void getGnSaleSHRec(JSONObject requestJson);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 获取慧经营售中数据
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-08-28 10:42
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void getGnSaleSZRec(JSONObject requestJson);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 发送发货明细数据到U8C
|
||||||
|
* so08一推到底
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-09-03 9:04
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
void sendSaleOrderToU8c(JSONObject requestJson);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 销售退货生成U8C数据
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-09-04 16:50
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
void sendSaleRecToU8c(JSONObject requestJson);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,34 @@
|
||||||
package com.hzya.frame.u8c.gnsale.service.impl;
|
package com.hzya.frame.u8c.gnsale.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||||
import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
|
import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
|
||||||
import com.hzya.frame.u8c.gnsale.service.IGnSaleService;
|
import com.hzya.frame.u8c.gnsale.service.IGnSaleService;
|
||||||
|
import com.hzya.frame.u8c.gnsale.util.HjyUtil;
|
||||||
|
import com.hzya.frame.u8c.hwsale.dao.IHwsaleDao;
|
||||||
|
import com.hzya.frame.u8c.util.U8cHttpUtil;
|
||||||
import com.hzya.frame.web.entity.BaseEntity;
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
import com.qimencloud.api.DefaultQimenCloudClient;
|
||||||
|
import com.qimencloud.api.QimenCloudRequest;
|
||||||
|
import com.qimencloud.api.QimenCloudResponse;
|
||||||
|
import com.taobao.api.ApiException;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.io.IOException;
|
||||||
import java.util.TreeMap;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import static com.hzya.frame.u8c.gnsale.util.HjyUtil.sign;
|
||||||
|
import static com.hzya.frame.u8c.hwsale.util.HwUtil.sid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (BdInvmandoc)表服务实现类
|
* (BdInvmandoc)表服务实现类
|
||||||
|
@ -23,15 +40,17 @@ import java.util.TreeMap;
|
||||||
public class GnSaleServiceImpl extends BaseService<BaseEntity, String> implements IGnSaleService {
|
public class GnSaleServiceImpl extends BaseService<BaseEntity, String> implements IGnSaleService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ComparisonServiceImpl comparisonServiceimpl;
|
private ComparisonServiceImpl comparisonServiceimpl;
|
||||||
|
@Autowired
|
||||||
|
private IHwsaleDao hwsaleDao;
|
||||||
|
|
||||||
|
|
||||||
private JSONObject bdGnDispatch(Object item) {
|
private JSONObject bdGnDispatch(Object item) {
|
||||||
JSONObject data = (JSONObject) item;
|
JSONObject data = (JSONObject) item;
|
||||||
//组装表头参数
|
//组装表头参数
|
||||||
JSONArray orders = data.getJSONArray("orders");
|
// JSONArray orders = data.getJSONArray("orders");
|
||||||
JSONObject jsonObjectUser = new JSONObject();
|
JSONObject jsonObjectUser = new JSONObject();
|
||||||
JSONObject jsonStr = new JSONObject();
|
JSONObject jsonStr = new JSONObject();
|
||||||
jsonObjectUser.put("data_id", data.get("data_id"));
|
jsonObjectUser.put("data_id", data.get("detailId"));
|
||||||
jsonObjectUser.put("mdmCode", "10001");
|
jsonObjectUser.put("mdmCode", "10001");
|
||||||
jsonStr.put("jsonStr", jsonObjectUser);
|
jsonStr.put("jsonStr", jsonObjectUser);
|
||||||
//先查询编码和名称查询是否存在
|
//先查询编码和名称查询是否存在
|
||||||
|
@ -50,42 +69,30 @@ public class GnSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
gn_dispatch.put ("shop_no", data.getString ("shopNo"));// 店铺编码
|
gn_dispatch.put ("shop_no", data.getString ("shopNo"));// 店铺编码
|
||||||
gn_dispatch.put ("shop_name", data.getString ("shopName"));// 店铺名称
|
gn_dispatch.put ("shop_name", data.getString ("shopName"));// 店铺名称
|
||||||
gn_dispatch.put ("spec_no", data.getString ("specNo"));// 商品编码
|
gn_dispatch.put ("spec_no", data.getString ("specNo"));// 商品编码
|
||||||
gn_dispatch.put("reco_status", data.getString("recoStatus"));//对账状态(对账成功/对账失败)
|
|
||||||
gn_dispatch.put ("warehouse_no", data.getString ("warehouseNo"));// 仓库编码
|
gn_dispatch.put ("warehouse_no", data.getString ("warehouseNo"));// 仓库编码
|
||||||
gn_dispatch.put ("warehouse_name", data.getString ("warehouseName"));// 仓库名称
|
gn_dispatch.put ("warehouse_name", data.getString ("warehouseName"));// 仓库名称
|
||||||
gn_dispatch.put ("business_time", data.getString ("businessTime"));// 业务日期,发货口径对账则为发货日期,收货口径对账则为完成日期
|
gn_dispatch.put ("business_time", data.getString ("businessTime"));// 业务日期,发货口径对账则为发货日期,收货口径对账则为完成日期
|
||||||
gn_dispatch.put("period_start_date", data.getString("periodStartDate"));//账期开始日期
|
|
||||||
gn_dispatch.put("period_end_date", data.getString("periodEndDate"));//账期结束日期
|
|
||||||
gn_dispatch.put ("summary_no", data.getString ("summaryNo"));// 汇总单号
|
gn_dispatch.put ("summary_no", data.getString ("summaryNo"));// 汇总单号
|
||||||
gn_dispatch.put ("plat_order_no", data.getString ("platOrderNo"));// 平台订单号
|
gn_dispatch.put ("plat_order_no", data.getString ("platOrderNo"));// 平台订单号
|
||||||
gn_dispatch.put ("plat_sub_no", data.getString ("platSubNo"));// 平台子订单号
|
gn_dispatch.put ("plat_sub_no", data.getString ("platSubNo"));// 平台子订单号
|
||||||
gn_dispatch.put("sys_order_no", data.getString("sysOrderNo"));//系统订单号
|
gn_dispatch.put ("oms_order_no", data.getString ("omsOrderNo"));// 系统订单号
|
||||||
gn_dispatch.put("oms_stockout_no", data.getString("omsStockoutNo"));//销售出库单号
|
gn_dispatch.put ("oms_stockout_no", data.getString ("omsStockoutNo"));// 出库单号
|
||||||
gn_dispatch.put("oms_refund_no", data.getString("omsRefundNo"));//退单号
|
gn_dispatch.put ("original_order_no", data.getString ("originalOrderNo"));// 平台订单号 [未处理],手工订单 / 退单默认截取单号后缀(如 7198371239874-1 展示原单号)
|
||||||
gn_dispatch.put("original_order_no", data.getString("originalOrderNo"));//平台订单号[未处理](对于手工订单/退单,慧经营会默认截取单号后缀,如7198371239874-1,截取后订单号为7198371239874,此列展示7198371239874-1)
|
gn_dispatch.put ("author_name", data.getString ("authorName"));// 达人名称
|
||||||
gn_dispatch.put("reco_time", data.getString("recoTime"));//对账时间,对账执行时间
|
|
||||||
gn_dispatch.put ("salesman_name", data.getString ("salesmanName"));// 业务员名称
|
gn_dispatch.put ("salesman_name", data.getString ("salesmanName"));// 业务员名称
|
||||||
gn_dispatch.put ("fenxiao_nick", data.getString ("fenxiaoNick"));// 分销商昵称
|
gn_dispatch.put ("fenxiao_nick", data.getString ("fenxiaoNick"));// 分销商昵称
|
||||||
|
gn_dispatch.put ("trade_label", data.getString ("tradeLabel"));// 订单标签
|
||||||
|
gn_dispatch.put ("cs_remark", data.getString ("csRemark"));// 客服备注
|
||||||
gn_dispatch.put ("goods_no", data.getString ("goodsNo"));// 货品编码
|
gn_dispatch.put ("goods_no", data.getString ("goodsNo"));// 货品编码
|
||||||
gn_dispatch.put ("goods_name", data.getString ("goodsName"));// 货品名称
|
gn_dispatch.put ("goods_name", data.getString ("goodsName"));// 货品名称
|
||||||
gn_dispatch.put ("goods_batch_no", data.getString ("goodsBatchNo"));// 货品批次号
|
gn_dispatch.put ("goods_batch_no", data.getString ("goodsBatchNo"));// 货品批次号
|
||||||
gn_dispatch.put("gift_type", data.getString("giftType"));//赠品(是/否)
|
gn_dispatch.put ("gift_type", data.getString ("giftType"));// 赠品
|
||||||
gn_dispatch.put("erp_order_type", data.getString("erpOrderType"));//订单类型(网店销售、线下零售、售后换货、批发业务、保修换新、保修完成、订单补发、供销补发、自定义类型1-6、自定义属性7-8等)
|
gn_dispatch.put ("erp_order_type", data.getString ("erpOrderType"));// 订单类型,可选值:网店销售、线下零售、售后换货、批发业务、保修换新、保修完成、订单补发、供销补发、自定义类型 1-6、自定义属性 7-8
|
||||||
gn_dispatch.put ("delivery_amount", data.getString ("deliveryAmount"));// 发货金额
|
gn_dispatch.put ("delivery_amount", data.getString ("deliveryAmount"));// 发货金额
|
||||||
gn_dispatch.put("sqt_amount", data.getString("sqtAmount"));//售前退款金额,发货前退款金额
|
gn_dispatch.put ("share_post_amount", data.getString ("sharePostAmount"));// 邮费
|
||||||
gn_dispatch.put("szt_amount", data.getString("sztAmount"));//售中退款金额,发货后确认收货前退款金额
|
gn_dispatch.put ("commission", data.getString ("commission"));// 佣金
|
||||||
gn_dispatch.put("sz_refund_only_amount", data.getString("szRefundOnlyAmount"));//售中仅退款金额
|
gn_dispatch.put ("cost_price", data.getString ("costPrice"));// 总成本
|
||||||
gn_dispatch.put("sz_refund_return_amount", data.getString("szRefundReturnAmount"));//售中退货退款金额
|
|
||||||
gn_dispatch.put("adjust_amount", data.getString("adjustAmount"));//调整单金额
|
|
||||||
gn_dispatch.put("collection_amount", data.getString("collectionAmount"));//收款金额,最终账单实际收款金额
|
|
||||||
gn_dispatch.put("diff_amount", data.getString("diffAmount"));//差异金额,计算公式:发货金额-售中退款金额+调整单金额-收款金额
|
|
||||||
gn_dispatch.put ("delivery_qty", data.getString ("deliveryQty"));// 发货数量
|
gn_dispatch.put ("delivery_qty", data.getString ("deliveryQty"));// 发货数量
|
||||||
gn_dispatch.put("refund_qty", data.getString("refundQty"));//售中预计退款数量
|
|
||||||
gn_dispatch.put("return_qty", data.getString("returnQty"));//售中退货入库数量
|
|
||||||
gn_dispatch.put("expect_qty", data.getString("expectQty"));//实际数量,计算公式:发货数量-售中退货入库数量
|
|
||||||
gn_dispatch.put("share_post_amount", data.getString("sharePostAmount"));//邮费收入
|
|
||||||
gn_dispatch.put("author_name", data.getString("authorName"));//达人名称
|
|
||||||
gn_dispatch.put("sign_status", data.getString("signStatus"));//签收状态(已签收等)
|
|
||||||
|
|
||||||
mainObject.put("gn_dispatch",gn_dispatch);
|
mainObject.put("gn_dispatch",gn_dispatch);
|
||||||
jsonStr.put("jsonStr",mainObject);
|
jsonStr.put("jsonStr",mainObject);
|
||||||
|
@ -100,7 +107,7 @@ public class GnSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
JSONArray orders = data.getJSONArray("orders");
|
JSONArray orders = data.getJSONArray("orders");
|
||||||
JSONObject jsonObjectUser = new JSONObject();
|
JSONObject jsonObjectUser = new JSONObject();
|
||||||
JSONObject jsonStr = new JSONObject();
|
JSONObject jsonStr = new JSONObject();
|
||||||
jsonObjectUser.put("data_id", data.get("data_id"));
|
jsonObjectUser.put("data_id", data.get("summaryNo"));
|
||||||
jsonObjectUser.put("mdmCode", "10001");
|
jsonObjectUser.put("mdmCode", "10001");
|
||||||
jsonStr.put("jsonStr", jsonObjectUser);
|
jsonStr.put("jsonStr", jsonObjectUser);
|
||||||
//先查询编码和名称查询是否存在
|
//先查询编码和名称查询是否存在
|
||||||
|
@ -140,7 +147,7 @@ public class GnSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
JSONArray orders = data.getJSONArray("orders");
|
JSONArray orders = data.getJSONArray("orders");
|
||||||
JSONObject jsonObjectUser = new JSONObject();
|
JSONObject jsonObjectUser = new JSONObject();
|
||||||
JSONObject jsonStr = new JSONObject();
|
JSONObject jsonStr = new JSONObject();
|
||||||
jsonObjectUser.put("data_id", data.get("data_id"));
|
jsonObjectUser.put("data_id", data.get("summaryNo"));
|
||||||
jsonObjectUser.put("mdmCode", "10001");
|
jsonObjectUser.put("mdmCode", "10001");
|
||||||
jsonStr.put("jsonStr", jsonObjectUser);
|
jsonStr.put("jsonStr", jsonObjectUser);
|
||||||
//先查询编码和名称查询是否存在
|
//先查询编码和名称查询是否存在
|
||||||
|
@ -154,6 +161,7 @@ public class GnSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
mainObject.put("mdmCode", "10005");
|
mainObject.put("mdmCode", "10005");
|
||||||
mainObject.put("optionName", "数智中台");
|
mainObject.put("optionName", "数智中台");
|
||||||
JSONObject gn_zdfy = new JSONObject();
|
JSONObject gn_zdfy = new JSONObject();
|
||||||
|
gn_zdfy.put("data_id", data.getString("summaryNo"));//
|
||||||
gn_zdfy.put("plat_name", data.getString("platName"));//平台名称(示例:淘宝)
|
gn_zdfy.put("plat_name", data.getString("platName"));//平台名称(示例:淘宝)
|
||||||
gn_zdfy.put("shop_no", data.getString("shopNo"));//店铺编码(示例:Db001)
|
gn_zdfy.put("shop_no", data.getString("shopNo"));//店铺编码(示例:Db001)
|
||||||
gn_zdfy.put("shop_name", data.getString("shopName"));//店铺名称(示例:第一个店铺)
|
gn_zdfy.put("shop_name", data.getString("shopName"));//店铺名称(示例:第一个店铺)
|
||||||
|
@ -180,4 +188,830 @@ public class GnSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private JSONObject bdGnReceipt(Object item,String type) {
|
||||||
|
JSONObject data = (JSONObject) item;
|
||||||
|
//组装表头参数
|
||||||
|
JSONArray orders = data.getJSONArray("orders");
|
||||||
|
JSONObject jsonObjectUser = new JSONObject();
|
||||||
|
JSONObject jsonStr = new JSONObject();
|
||||||
|
jsonObjectUser.put("data_id", data.get("detailId"));
|
||||||
|
jsonObjectUser.put("mdmCode", "10003");
|
||||||
|
jsonStr.put("jsonStr", jsonObjectUser);
|
||||||
|
//先查询编码和名称查询是否存在
|
||||||
|
Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr);
|
||||||
|
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
|
||||||
|
JSONArray jsonArrayList = jsonObjectAttribute.getJSONObject("pageInfo").getJSONArray("list");
|
||||||
|
if (jsonArrayList == null || jsonArrayList.size() == 0) {
|
||||||
|
JSONObject mainObject = new JSONObject();
|
||||||
|
mainObject.put("appName","数智中台");
|
||||||
|
mainObject.put("appCode","800004");
|
||||||
|
mainObject.put("mdmCode", "10003");
|
||||||
|
mainObject.put("optionName", "数智中台");
|
||||||
|
JSONObject gn_receipt = new JSONObject();
|
||||||
|
gn_receipt.put("data_id", data.getString("detailId"));//明细唯一id
|
||||||
|
gn_receipt.put("detail_id", data.getString("detailId"));//明细唯一id
|
||||||
|
gn_receipt.put("shop_no", data.getString("shopNo"));//店铺编码
|
||||||
|
gn_receipt.put("shop_name", data.getString("shopName"));//店铺名称
|
||||||
|
gn_receipt.put("spec_no", data.getString("specNo"));//商品编码
|
||||||
|
gn_receipt.put("warehouse_no", data.getString("warehouseNo"));//仓库编码
|
||||||
|
gn_receipt.put("warehouse_name", data.getString("warehouseName"));//仓库名称
|
||||||
|
gn_receipt.put("business_time", data.getString("businessTime"));//业务日期,退款完成时间
|
||||||
|
gn_receipt.put("delivery_time", data.getString("deliveryTime"));//发货时间
|
||||||
|
gn_receipt.put("summary_no", data.getString("summaryNo"));//汇总单号
|
||||||
|
gn_receipt.put("plat_order_no", data.getString("platOrderNo"));//平台订单号
|
||||||
|
gn_receipt.put("plat_sub_no", data.getString("platSubNo"));//平台子订单号
|
||||||
|
gn_receipt.put("original_order_no", data.getString("originalOrderNo"));//平台订单号[未处理](对于手工订单/退单,慧经营会默认截取单号后缀,如7198371239874-1,截取之后的订单号为7198371239874,此列展示7198371239874-1)
|
||||||
|
gn_receipt.put("sys_order_no", data.getString("sysOrderNo"));//系统订单号,拉取平台退单即为平台退单号,拉取系统退单则为系统退单号
|
||||||
|
gn_receipt.put("refund_type", data.getString("refundType"));//退款类型(退款不退货、退货退款)
|
||||||
|
gn_receipt.put("defect_type", data.getString("defectType"));//是否残次品(是/否)
|
||||||
|
gn_receipt.put("salesman_name", data.getString("salesmanName"));//业务员名称
|
||||||
|
gn_receipt.put("fenxiao_nick", data.getString("fenxiaoNick"));//分销商昵称
|
||||||
|
gn_receipt.put("goods_no", data.getString("goodsNo"));//货品编码
|
||||||
|
gn_receipt.put("goods_name", data.getString("goodsName"));//货品名称
|
||||||
|
gn_receipt.put("goods_batch_no", data.getString("goodsBatchNo"));//货品批次号
|
||||||
|
gn_receipt.put("gift_type", data.getString("giftType"));//赠品(是/否)
|
||||||
|
gn_receipt.put("erp_order_type", data.getString("erpOrderType"));//订单类型(网店销售、线下零售、售后换货、批发业务、保修换新、保修完成、订单补发、供销补发、自定义类型1-6、自定义属性7-8等)
|
||||||
|
gn_receipt.put("refundable_amount", data.getString("refundableAmount"));//应退款金额,退款订单退款金额
|
||||||
|
gn_receipt.put("return_qty", data.getString("returnQty"));//退货入库数量,实际退货入库数量
|
||||||
|
gn_receipt.put("cost_price", data.getString("costPrice"));//总成本
|
||||||
|
gn_receipt.put("refund_qty", data.getString("refundQty"));//退款数量,申请退款数量
|
||||||
|
gn_receipt.put ("rec_type", type);// 退货类型
|
||||||
|
mainObject.put("gn_receipt",gn_receipt);
|
||||||
|
jsonStr.put("jsonStr",mainObject);
|
||||||
|
Object result = comparisonServiceimpl.saveEntity(jsonStr);
|
||||||
|
logger.info("新增结果为:{}", JSON.toJSONString(result));
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 获取慧经营发货明细
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-08-28 9:08
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getGNSaleOrder(JSONObject requestJson) {
|
||||||
|
String startDate = U8cHttpUtil.formatStartDate();
|
||||||
|
String endDate = U8cHttpUtil.formatEndDate();
|
||||||
|
|
||||||
|
JSONArray dataArr = new JSONArray();
|
||||||
|
String nextRequestId = "";
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
QimenCloudRequest request = new QimenCloudRequest();
|
||||||
|
map.put("appId", HjyUtil.appId);
|
||||||
|
map.put("sid", HjyUtil.sid);
|
||||||
|
request.setApiMethodName(HjyUtil.deliveryApiName);
|
||||||
|
request.setTargetAppKey(HjyUtil.targetAppkey);
|
||||||
|
request.addQueryParam("appId", HjyUtil.appId);
|
||||||
|
request.addQueryParam("sid", HjyUtil.sid);
|
||||||
|
|
||||||
|
while (true){
|
||||||
|
map.put("startBusinessTime", startDate);
|
||||||
|
map.put("endBusinessTime", endDate);
|
||||||
|
if(StrUtil.isNotEmpty(nextRequestId)){
|
||||||
|
map.put("nextRequestId", nextRequestId);
|
||||||
|
}
|
||||||
|
String sign = "";
|
||||||
|
try {
|
||||||
|
sign = sign(map, HjyUtil.hjyAppKey);
|
||||||
|
boolean flag = HjyUtil.checkSign(map, HjyUtil.hjyAppKey, sign);
|
||||||
|
if (!flag) {
|
||||||
|
System.out.println("error");
|
||||||
|
} else {
|
||||||
|
System.out.println("ok");
|
||||||
|
}
|
||||||
|
request.addQueryParam("hjySign", sign);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
DefaultQimenCloudClient client = new DefaultQimenCloudClient(HjyUtil.baseUrl, HjyUtil.appKey, HjyUtil.appSecret, HjyUtil.format);
|
||||||
|
|
||||||
|
request.addQueryParam("startBusinessTime", startDate);
|
||||||
|
request.addQueryParam("endBusinessTime", endDate);
|
||||||
|
if(StrUtil.isNotEmpty(nextRequestId)){
|
||||||
|
request.addQueryParam("nextRequestId",nextRequestId);
|
||||||
|
}
|
||||||
|
QimenCloudResponse response = null;
|
||||||
|
try {
|
||||||
|
logger.info("发货明细请求参数"+JSON.toJSONString(request));
|
||||||
|
response = client.execute(request);
|
||||||
|
// logger.info("发货明细返回数据数量"+JSON.toJSONString(response.getBody().length()));
|
||||||
|
//
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
|
||||||
|
JSONObject responseObj = jsonObject.getJSONObject("response");
|
||||||
|
String resultCode = responseObj.getString("resultCode");
|
||||||
|
if("200".equals(resultCode)){
|
||||||
|
dataArr.addAll(responseObj.getJSONArray("data"));
|
||||||
|
nextRequestId = responseObj.getString("nextRequestId");
|
||||||
|
if("false".equals(nextRequestId)){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
logger.info("发货明细查询失败");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (ApiException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
||||||
|
// if(dataArr.size() >0){
|
||||||
|
// dataArr.forEach(item -> {
|
||||||
|
// JSONObject dataItem = bdGnDispatch(item);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
||||||
|
if(dataArr.size() >0){
|
||||||
|
// dataArr.forEach(item -> {
|
||||||
|
// JSONObject dataItem = bdHwSaleParm(item);
|
||||||
|
// });
|
||||||
|
if(dataArr.size()>500){
|
||||||
|
// 拆分为每批500条
|
||||||
|
List<JSONArray> batches = U8cHttpUtil.splitIntoBatches(dataArr, 500);
|
||||||
|
|
||||||
|
// 创建线程池,核心线程数根据CPU核心数设定,这里使用Runtime.getRuntime().availableProcessors()
|
||||||
|
// 也可以根据实际情况调整,比如设置为固定数量如10
|
||||||
|
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||||
|
|
||||||
|
// 提交所有批次任务到线程池
|
||||||
|
batches.forEach(batch -> {
|
||||||
|
executor.submit(() -> {
|
||||||
|
// 每个批次在单独的线程中处理
|
||||||
|
batch.forEach(item -> {
|
||||||
|
JSONObject dataItem = bdGnDispatch(item);
|
||||||
|
// 这里可以添加对dataItem的后续处理逻辑
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 关闭线程池,不再接受新任务
|
||||||
|
executor.shutdown();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 等待所有任务完成,设置超时时间防止无限等待
|
||||||
|
if (!executor.awaitTermination(60, TimeUnit.MINUTES)) {
|
||||||
|
// 超时后强制关闭
|
||||||
|
executor.shutdownNow();
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
executor.shutdownNow();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
dataArr.forEach(item -> {
|
||||||
|
JSONObject dataItem = bdGnDispatch(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 售后
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-08-28 10:43
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getGnSaleSHRec(JSONObject requestJson) {
|
||||||
|
String startDate = U8cHttpUtil.formatStartDate();
|
||||||
|
String endDate = U8cHttpUtil.formatEndDate();
|
||||||
|
|
||||||
|
JSONArray dataArr = new JSONArray();
|
||||||
|
String nextRequestId = "";
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
QimenCloudRequest request = new QimenCloudRequest();
|
||||||
|
map.put("appId", HjyUtil.appId);
|
||||||
|
map.put("sid", HjyUtil.sid);
|
||||||
|
request.setApiMethodName(HjyUtil.shthApiName);
|
||||||
|
request.setTargetAppKey(HjyUtil.targetAppkey);
|
||||||
|
request.addQueryParam("appId", HjyUtil.appId);
|
||||||
|
request.addQueryParam("sid", HjyUtil.sid);
|
||||||
|
|
||||||
|
while (true){
|
||||||
|
map.put("startBusinessTime", startDate);
|
||||||
|
map.put("endBusinessTime", endDate);
|
||||||
|
if(StrUtil.isNotEmpty(nextRequestId)){
|
||||||
|
map.put("nextRequestId", nextRequestId);
|
||||||
|
}
|
||||||
|
String sign = "";
|
||||||
|
try {
|
||||||
|
sign = sign(map, HjyUtil.hjyAppKey);
|
||||||
|
boolean flag = HjyUtil.checkSign(map, HjyUtil.hjyAppKey, sign);
|
||||||
|
if (!flag) {
|
||||||
|
System.out.println("error");
|
||||||
|
} else {
|
||||||
|
System.out.println("ok");
|
||||||
|
}
|
||||||
|
request.addQueryParam("hjySign", sign);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
DefaultQimenCloudClient client = new DefaultQimenCloudClient(HjyUtil.baseUrl, HjyUtil.appKey, HjyUtil.appSecret, HjyUtil.format);
|
||||||
|
|
||||||
|
request.addQueryParam("startBusinessTime", startDate);
|
||||||
|
request.addQueryParam("endBusinessTime", endDate);
|
||||||
|
if(StrUtil.isNotEmpty(nextRequestId)){
|
||||||
|
request.addQueryParam("nextRequestId",nextRequestId);
|
||||||
|
}
|
||||||
|
QimenCloudResponse response = null;
|
||||||
|
try {
|
||||||
|
logger.info("售后退货请求"+JSON.toJSONString(request));
|
||||||
|
response = client.execute(request);
|
||||||
|
// logger.info("发货明细返回数据数量"+JSON.toJSONString(response.getBody().length()));
|
||||||
|
//
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
|
||||||
|
JSONObject responseObj = jsonObject.getJSONObject("response");
|
||||||
|
String resultCode = responseObj.getString("resultCode");
|
||||||
|
if("200".equals(resultCode)){
|
||||||
|
dataArr.addAll(responseObj.getJSONArray("data"));
|
||||||
|
nextRequestId = responseObj.getString("nextRequestId");
|
||||||
|
if("false".equals(nextRequestId)){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
logger.info("售后查询失败");
|
||||||
|
}
|
||||||
|
} catch (ApiException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// //如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
||||||
|
// if(dataArr.size() >0){
|
||||||
|
// dataArr.forEach(item -> {
|
||||||
|
// JSONObject dataItem = bdGnReceipt(item,"售后");
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
||||||
|
if(dataArr.size() >0){
|
||||||
|
// dataArr.forEach(item -> {
|
||||||
|
// JSONObject dataItem = bdHwSaleParm(item);
|
||||||
|
// });
|
||||||
|
if(dataArr.size()>500){
|
||||||
|
|
||||||
|
// 拆分为每批500条
|
||||||
|
List<JSONArray> batches = U8cHttpUtil.splitIntoBatches(dataArr, 500);
|
||||||
|
|
||||||
|
// 创建线程池,核心线程数根据CPU核心数设定,这里使用Runtime.getRuntime().availableProcessors()
|
||||||
|
// 也可以根据实际情况调整,比如设置为固定数量如10
|
||||||
|
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||||
|
|
||||||
|
// 提交所有批次任务到线程池
|
||||||
|
batches.forEach(batch -> {
|
||||||
|
executor.submit(() -> {
|
||||||
|
// 每个批次在单独的线程中处理
|
||||||
|
batch.forEach(item -> {
|
||||||
|
JSONObject dataItem = bdGnReceipt(item,"售后");
|
||||||
|
// 这里可以添加对dataItem的后续处理逻辑
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 关闭线程池,不再接受新任务
|
||||||
|
executor.shutdown();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 等待所有任务完成,设置超时时间防止无限等待
|
||||||
|
if (!executor.awaitTermination(60, TimeUnit.MINUTES)) {
|
||||||
|
// 超时后强制关闭
|
||||||
|
executor.shutdownNow();
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
executor.shutdownNow();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
dataArr.forEach(item -> {
|
||||||
|
JSONObject dataItem =bdGnReceipt(item,"售后");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 售中
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-08-28 10:43
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getGnSaleSZRec(JSONObject requestJson) {
|
||||||
|
String startDate = U8cHttpUtil.formatStartDate();
|
||||||
|
String endDate = U8cHttpUtil.formatEndDate();
|
||||||
|
|
||||||
|
JSONArray dataArr = new JSONArray();
|
||||||
|
String nextRequestId = "";
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
QimenCloudRequest request = new QimenCloudRequest();
|
||||||
|
map.put("appId", HjyUtil.appId);
|
||||||
|
map.put("sid", HjyUtil.sid);
|
||||||
|
request.setApiMethodName(HjyUtil.szthApiName);
|
||||||
|
request.setTargetAppKey(HjyUtil.targetAppkey);
|
||||||
|
request.addQueryParam("appId", HjyUtil.appId);
|
||||||
|
request.addQueryParam("sid", HjyUtil.sid);
|
||||||
|
|
||||||
|
while (true){
|
||||||
|
map.put("startBusinessTime", startDate);
|
||||||
|
map.put("endBusinessTime", endDate);
|
||||||
|
if(StrUtil.isNotEmpty(nextRequestId)){
|
||||||
|
map.put("nextRequestId", nextRequestId);
|
||||||
|
}
|
||||||
|
String sign = "";
|
||||||
|
try {
|
||||||
|
sign = sign(map, HjyUtil.hjyAppKey);
|
||||||
|
boolean flag = HjyUtil.checkSign(map, HjyUtil.hjyAppKey, sign);
|
||||||
|
if (!flag) {
|
||||||
|
System.out.println("error");
|
||||||
|
} else {
|
||||||
|
System.out.println("ok");
|
||||||
|
}
|
||||||
|
request.addQueryParam("hjySign", sign);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
DefaultQimenCloudClient client = new DefaultQimenCloudClient(HjyUtil.baseUrl, HjyUtil.appKey, HjyUtil.appSecret, HjyUtil.format);
|
||||||
|
|
||||||
|
request.addQueryParam("startBusinessTime", startDate);
|
||||||
|
request.addQueryParam("endBusinessTime", endDate);
|
||||||
|
if(StrUtil.isNotEmpty(nextRequestId)){
|
||||||
|
request.addQueryParam("nextRequestId",nextRequestId);
|
||||||
|
}
|
||||||
|
QimenCloudResponse response = null;
|
||||||
|
try {
|
||||||
|
logger.info("售中请求参数"+JSON.toJSONString(request));
|
||||||
|
response = client.execute(request);
|
||||||
|
// logger.info("发货明细返回数据数量"+JSON.toJSONString(response.getBody().length()));
|
||||||
|
//
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
|
||||||
|
JSONObject responseObj = jsonObject.getJSONObject("response");
|
||||||
|
String resultCode = responseObj.getString("resultCode");
|
||||||
|
if("200".equals(resultCode)){
|
||||||
|
dataArr.addAll(responseObj.getJSONArray("data"));
|
||||||
|
nextRequestId = responseObj.getString("nextRequestId");
|
||||||
|
if("false".equals(nextRequestId)){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
logger.info("售中查询失败");
|
||||||
|
}
|
||||||
|
} catch (ApiException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// //如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
||||||
|
// if(dataArr.size() >0){
|
||||||
|
// dataArr.forEach(item -> {
|
||||||
|
// JSONObject dataItem = bdGnReceipt(item,"售中");
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
||||||
|
if(dataArr.size() >0){
|
||||||
|
// dataArr.forEach(item -> {
|
||||||
|
// JSONObject dataItem = bdHwSaleParm(item);
|
||||||
|
// });
|
||||||
|
if(dataArr.size()>500){
|
||||||
|
|
||||||
|
// 拆分为每批500条
|
||||||
|
List<JSONArray> batches = U8cHttpUtil.splitIntoBatches(dataArr, 500);
|
||||||
|
|
||||||
|
// 创建线程池,核心线程数根据CPU核心数设定,这里使用Runtime.getRuntime().availableProcessors()
|
||||||
|
// 也可以根据实际情况调整,比如设置为固定数量如10
|
||||||
|
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||||
|
|
||||||
|
// 提交所有批次任务到线程池
|
||||||
|
batches.forEach(batch -> {
|
||||||
|
executor.submit(() -> {
|
||||||
|
// 每个批次在单独的线程中处理
|
||||||
|
batch.forEach(item -> {
|
||||||
|
JSONObject dataItem = bdGnReceipt(item,"售中");
|
||||||
|
// 这里可以添加对dataItem的后续处理逻辑
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 关闭线程池,不再接受新任务
|
||||||
|
executor.shutdown();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 等待所有任务完成,设置超时时间防止无限等待
|
||||||
|
if (!executor.awaitTermination(60, TimeUnit.MINUTES)) {
|
||||||
|
// 超时后强制关闭
|
||||||
|
executor.shutdownNow();
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
executor.shutdownNow();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
dataArr.forEach(item -> {
|
||||||
|
JSONObject dataItem =bdGnReceipt(item,"售中");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendSaleOrderToU8c(JSONObject requestJson) {
|
||||||
|
BaseEntity entity = new BaseEntity();
|
||||||
|
// entity.setDataSourceCode("ZT");
|
||||||
|
StringBuffer mainSql = new StringBuffer();
|
||||||
|
mainSql.append("select c.ntaxrate,a.erp_order_type,a.shop_no, a.shop_name, warehouse_no, ");
|
||||||
|
mainSql.append("b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.po_org_code,b.po_org_name ");
|
||||||
|
mainSql.append("from gn_dispatch a ");
|
||||||
|
mainSql.append("left join mdm_cost_project b on a.shop_no = b.shop_no ");
|
||||||
|
mainSql.append("left join mdm_orgs c on b.org_name = c.org_name ");
|
||||||
|
mainSql.append("where 1=1 and a.send_state is null and b.org_code is not null and erp_order_type in ('1','22','32') ");
|
||||||
|
mainSql.append("and b.project_code is not null and a.shop_no is not null and warehouse_no is not null and b.po_org_name is not null ");
|
||||||
|
// mainSql.append("and b.org_code = 'SH010002' ");
|
||||||
|
mainSql.append("group by a.shop_no, a.shop_name,c.ntaxrate,a.erp_order_type,warehouse_no,b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.po_org_code,b.po_org_name ");
|
||||||
|
mainSql.append("limit 1 ");
|
||||||
|
try {
|
||||||
|
List<HashMap<String, Object>> hashMaps = hwsaleDao.execSelectSql(mainSql.toString(),entity);
|
||||||
|
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||||
|
|
||||||
|
for (HashMap<String, Object> item : hashMaps) {
|
||||||
|
// item.put("org_code", "SH010002");
|
||||||
|
//通过订单类型、店铺编码、仓库编码、项目编码、品牌编码、平台编码、销售主体编码、采购主体编码查询需要汇总的明细信息
|
||||||
|
StringBuffer detailSql = new StringBuffer();
|
||||||
|
detailSql.append("select * from ( ");
|
||||||
|
detailSql.append("select c.ntaxrate,a.erp_order_type,sum(a.delivery_amount) as delivery_amount,a.shop_no, a.shop_name, a.spec_no, a.goods_no, a.goods_name, sum(a.delivery_qty) as delivery_qty,warehouse_no, ");
|
||||||
|
detailSql.append("b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no as shop_no_new,b.shop_name as shop_name_new,b.po_org_code,b.po_org_name ");
|
||||||
|
detailSql.append("from gn_dispatch a ");
|
||||||
|
detailSql.append("left join mdm_cost_project b on a.shop_no = b.shop_no ");
|
||||||
|
detailSql.append("left join mdm_orgs c on b.org_name = c.org_name ");
|
||||||
|
detailSql.append("where 1=1 and a.send_state is null and b.org_code is not null ");
|
||||||
|
detailSql.append("group by c.ntaxrate,a.erp_order_type,a.shop_no, a.shop_name, a.spec_no, a.goods_no, a.goods_name, ");
|
||||||
|
detailSql.append("warehouse_no,b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no,b.shop_name,b.po_org_code,b.po_org_name ");
|
||||||
|
detailSql.append(")m1 ");
|
||||||
|
detailSql.append("where shop_no = '"+item.get("shop_no")+"' ");
|
||||||
|
detailSql.append("and erp_order_type = '"+item.get("erp_order_type")+"' ");
|
||||||
|
detailSql.append("and warehouse_no = '"+item.get("warehouse_no")+"' ");
|
||||||
|
detailSql.append("and project_code = '"+item.get("project_code")+"' ");
|
||||||
|
if(StrUtil.isNotEmpty(String.valueOf(item.get("brand_code")))){
|
||||||
|
detailSql.append("and brand_code = '"+item.get("brand_code")+"' ");
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotEmpty(String.valueOf(item.get("platform_code")))) {
|
||||||
|
detailSql.append("and platform_code = '"+item.get("platform_code")+"' ");
|
||||||
|
}
|
||||||
|
detailSql.append("and org_code = '"+item.get("org_code")+"' ");
|
||||||
|
detailSql.append("and po_org_code = '"+item.get("po_org_code")+"' ");
|
||||||
|
List<HashMap<String, Object>> detailsHashMaps = hwsaleDao.execSelectSql(detailSql.toString(),entity);
|
||||||
|
//map转json
|
||||||
|
JSONObject jsonObject = new JSONObject(item);
|
||||||
|
if(CollectionUtils.isNotEmpty(detailsHashMaps)){
|
||||||
|
jsonObject.put("orders",detailsHashMaps);
|
||||||
|
}else{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
jsonObject.put("org_code", "SH010002");
|
||||||
|
//根据订单类型走不同的业务逻辑
|
||||||
|
String erpOrderType = String.valueOf(item.get("erp_order_type"));
|
||||||
|
|
||||||
|
|
||||||
|
StringBuffer errorMsg = new StringBuffer();
|
||||||
|
//猜测 1是正常订单2是补发订单3是换货订单
|
||||||
|
boolean flag = true;
|
||||||
|
String billNo = "";
|
||||||
|
switch (erpOrderType){
|
||||||
|
case "1":
|
||||||
|
billNo = saleOrder(jsonObject);
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
billNo = reissueOrder(jsonObject);
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
billNo = exchangeOrder(jsonObject);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
String sendState = "";
|
||||||
|
if(StrUtil.isNotEmpty(billNo)){
|
||||||
|
sendState = "Y";
|
||||||
|
}else{
|
||||||
|
sendState = "N";
|
||||||
|
}
|
||||||
|
String updateSql = "update gn_dispatch set send_state = '"+sendState+"' ,u8c_bill_no = '"+billNo+"'"+
|
||||||
|
"where shop_no = '"+item.get("shop_no")+"' " +
|
||||||
|
"and erp_order_type = '"+item.get("erp_order_type")+"' " +
|
||||||
|
"and warehouse_no = '"+item.get("warehouse_no")+"' " ;
|
||||||
|
// "and spec_no = '"+item.get("spec_no")+"' " ;
|
||||||
|
try {
|
||||||
|
hwsaleDao.execUpdateSql(updateSql,new BaseEntity());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendSaleRecToU8c(JSONObject requestJson) {
|
||||||
|
BaseEntity entity = new BaseEntity();
|
||||||
|
// entity.setDataSourceCode("ZT");
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
stringBuffer.append("select a.shop_no,a.shop_name,a.warehouse_no,a.warehouse_name,a.refund_type,a.erp_order_type,sum(a.refundable_amount)as refundable_amount,sum(a.refund_qty)as refund_qty , ");
|
||||||
|
stringBuffer.append("b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no as shop_no_new,b.shop_name as shop_name_new,b.po_org_code,b.po_org_name ");
|
||||||
|
stringBuffer.append("from gn_receipt a ");
|
||||||
|
stringBuffer.append("left join mdm_cost_project b on a.shop_no = b.shop_no ");
|
||||||
|
stringBuffer.append("left join mdm_orgs c on b.org_name = c.org_name ");
|
||||||
|
stringBuffer.append("where a.erp_order_type ='1' and b.org_code is not null and a.send_state is null ");
|
||||||
|
stringBuffer.append("and refund_type = '退货退款' ");
|
||||||
|
stringBuffer.append("GROUP BY a.shop_no,a.shop_name,a.warehouse_no,a.warehouse_name,a.refund_type,a.erp_order_type, ");
|
||||||
|
stringBuffer.append("b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no ,b.shop_name ,b.po_org_code,b.po_org_name ");
|
||||||
|
stringBuffer.append("limit 1 ");
|
||||||
|
try {
|
||||||
|
List<HashMap<String, Object>> hashMaps = hwsaleDao.execSelectSql(stringBuffer.toString(),entity);
|
||||||
|
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||||
|
|
||||||
|
for (HashMap<String, Object> item : hashMaps) {
|
||||||
|
//
|
||||||
|
//通过订单类型、店铺编码、仓库编码、项目编码、品牌编码、平台编码、销售主体编码、采购主体编码查询需要汇总的明细信息
|
||||||
|
StringBuffer detailSql = new StringBuffer();
|
||||||
|
detailSql.append("select * from ( ");
|
||||||
|
detailSql.append("select a.shop_no,a.shop_name,a.spec_no,a.warehouse_no,a.warehouse_name,a.refund_type,a.goods_no,a.goods_name,a.erp_order_type,sum(a.refundable_amount)as delivery_amount,sum(a.refund_qty)as delivery_qty , ");
|
||||||
|
detailSql.append("b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no as shop_no_new,b.shop_name as shop_name_new,b.po_org_code,b.po_org_name ");
|
||||||
|
detailSql.append("from gn_receipt a ");
|
||||||
|
detailSql.append("left join mdm_cost_project b on a.shop_no = b.shop_no ");
|
||||||
|
detailSql.append("left join mdm_orgs c on b.org_name = c.org_name ");
|
||||||
|
detailSql.append("where a.erp_order_type ='1' and b.org_code is not null and a.send_state is null ");
|
||||||
|
detailSql.append("GROUP BY a.shop_no,a.shop_name,a.spec_no,a.warehouse_no,a.warehouse_name,a.refund_type,a.goods_no,a.goods_name,a.erp_order_type, ");
|
||||||
|
detailSql.append("b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no ,b.shop_name ,b.po_org_code,b.po_org_name ");
|
||||||
|
detailSql.append(")m1 ");
|
||||||
|
detailSql.append("where shop_no = '"+item.get("shop_no")+"' ");
|
||||||
|
detailSql.append("and erp_order_type = '"+item.get("erp_order_type")+"' ");
|
||||||
|
detailSql.append("and warehouse_no = '"+item.get("warehouse_no")+"' ");
|
||||||
|
detailSql.append("and project_code = '"+item.get("project_code")+"' ");
|
||||||
|
if(StrUtil.isNotEmpty(String.valueOf(item.get("brand_code")))){
|
||||||
|
detailSql.append("and brand_code = '"+item.get("brand_code")+"' ");
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotEmpty(String.valueOf(item.get("platform_code")))) {
|
||||||
|
detailSql.append("and platform_code = '"+item.get("platform_code")+"' ");
|
||||||
|
}
|
||||||
|
detailSql.append("and org_code = '"+item.get("org_code")+"' ");
|
||||||
|
detailSql.append("and po_org_code = '"+item.get("po_org_code")+"' ");
|
||||||
|
detailSql.append("and refund_type = '"+item.get("refund_type")+"' ");
|
||||||
|
List<HashMap<String, Object>> detailsHashMaps = hwsaleDao.execSelectSql(detailSql.toString(),entity);
|
||||||
|
//map转json
|
||||||
|
JSONObject jsonObject = new JSONObject(item);
|
||||||
|
if(CollectionUtils.isNotEmpty(detailsHashMaps)){
|
||||||
|
jsonObject.put("orders",detailsHashMaps);
|
||||||
|
}else{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
item.put("org_code", "SH010002");
|
||||||
|
//根据退款类型走不同的业务逻辑
|
||||||
|
String refund_type = String.valueOf(item.get("refund_type"));
|
||||||
|
|
||||||
|
|
||||||
|
StringBuffer errorMsg = new StringBuffer();
|
||||||
|
//退货退款 先走红字收款 再走红字订单
|
||||||
|
boolean flag = true;
|
||||||
|
String billNo = "";
|
||||||
|
billNo = refund(item,refund_type);
|
||||||
|
String sendState = "";
|
||||||
|
if(StrUtil.isNotEmpty(billNo)){
|
||||||
|
sendState = "Y";
|
||||||
|
}else{
|
||||||
|
sendState = "N";
|
||||||
|
}
|
||||||
|
String updateSql = "update gn_receipt set send_state = '"+sendState+"' ,u8c_bill_no = '"+billNo+"'"+
|
||||||
|
"where shop_no = '"+item.get("shop_no")+"' " +
|
||||||
|
"and erp_order_type = '"+item.get("erp_order_type")+"' " +
|
||||||
|
"and warehouse_no = '"+item.get("warehouse_no")+"' " +
|
||||||
|
"and refund_type = '"+item.get("refund_type")+"' " ;
|
||||||
|
try {
|
||||||
|
hwsaleDao.execUpdateSql(updateSql,new BaseEntity());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String refund(HashMap<String, Object> item,String recTpye) {
|
||||||
|
String billNo = "";
|
||||||
|
boolean flag = true;
|
||||||
|
String refundable_amount = String.valueOf(item.get("refundable_amount"));
|
||||||
|
String refund_qty = String.valueOf(item.get("refund_qty"));
|
||||||
|
BigDecimal delivery_amount_bd = new BigDecimal(refundable_amount).divide(new BigDecimal(refund_qty),2, BigDecimal.ROUND_HALF_UP);
|
||||||
|
item.put("delivery_amount_bd",delivery_amount_bd);
|
||||||
|
item.put("delivery_qty",refund_qty);
|
||||||
|
JSONObject jsonObject = new JSONObject(item);
|
||||||
|
JSONObject resultSaleTc = bdU8cSaleRecParm(jsonObject,"8000050001","2");
|
||||||
|
String status = resultSaleTc.getString("status");
|
||||||
|
if("success".equals(status)){
|
||||||
|
JSONArray dataArr = resultSaleTc.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo = parentvo.getString("djbh");
|
||||||
|
//判断,如果是退货退款 在生产红字收款单的同时 在生成红字销售单
|
||||||
|
if("退货退款".equals(recTpye)){
|
||||||
|
JSONObject resultSaleTb = U8cHttpUtil.bdU8cBlueSaleOrderParm(jsonObject,"8000050000","1","1","1");
|
||||||
|
status = resultSaleTb.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArra = resultSaleTb.getJSONArray("data");
|
||||||
|
JSONObject dataa = dataArra.getJSONObject(0);
|
||||||
|
JSONObject parentvoa = dataa.getJSONObject("parentvo");
|
||||||
|
billNo += parentvoa.getString("vreceiptcode");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return billNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content单据类型 1蓝字 2红字
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-09-05 13:59
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
private JSONObject bdU8cSaleRecParm(JSONObject jsonObject, String apiCode, String billType) {
|
||||||
|
JSONObject main = new JSONObject();
|
||||||
|
JSONObject billvo = new JSONObject();
|
||||||
|
JSONObject parentvo = new JSONObject();
|
||||||
|
JSONArray childrenvo = new JSONArray();
|
||||||
|
|
||||||
|
parentvo.put("djrq", DateUtil.format(new Date(),"yyyy-MM-dd"));//单据日期
|
||||||
|
parentvo.put("dwbm",jsonObject.get("org_code"));//单位编码
|
||||||
|
parentvo.put("hbbm",jsonObject.get("project_code"));//客商
|
||||||
|
parentvo.put("lrr","17633965916");//录入人
|
||||||
|
parentvo.put("shr","17633965916");//审核人
|
||||||
|
parentvo.put("shrq",DateUtil.format(new Date(),"yyyy-MM-dd"));//审核日期
|
||||||
|
JSONArray orders = jsonObject.getJSONArray("orders");
|
||||||
|
for(Object order : orders) {
|
||||||
|
String dataStr = JSON.toJSONString(order);
|
||||||
|
JSONObject data = JSONObject.parseObject(dataStr);
|
||||||
|
JSONObject item = new JSONObject();
|
||||||
|
if("2".equals(billType)){
|
||||||
|
item.put("dfybje",data.getBigDecimal("delivery_amount").subtract(data.getBigDecimal("delivery_amount").add(data.getBigDecimal("delivery_amount"))));//原币金额
|
||||||
|
}
|
||||||
|
|
||||||
|
item.put("wldx","0");//往来对象标识(0 客户 1供应商 2部门 3业务员 )
|
||||||
|
childrenvo.add( item);
|
||||||
|
}
|
||||||
|
|
||||||
|
billvo.put("children",childrenvo);
|
||||||
|
billvo.put("parentvo",parentvo);
|
||||||
|
main.put("billvo",billvo);
|
||||||
|
logger.info("开始执行收款单请求参数"+main.toJSONString());
|
||||||
|
return U8cHttpUtil.sendDataTOU8CEsb(main.toJSONString(),apiCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String exchangeOrder(JSONObject item) {
|
||||||
|
//todo 售后换货需要先生成红字销售订单在生成蓝字销售订单
|
||||||
|
//先生成红字销售订单
|
||||||
|
String billNo = "";
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
JSONObject resultSaleTc = U8cHttpUtil.bdU8cBlueSaleOrderParm(item,"8000050000","1","4","1");
|
||||||
|
String status = resultSaleTc.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultSaleTc.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo = parentvo.getString("vreceiptcode");
|
||||||
|
|
||||||
|
}
|
||||||
|
//在生成蓝字销售订单
|
||||||
|
if(flag) {
|
||||||
|
JSONObject resultSaleTb = U8cHttpUtil.bdU8cBlueSaleOrderParm(item,"8000050000","1","1","1");
|
||||||
|
status = resultSaleTb.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultSaleTb.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vreceiptcode");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return billNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String reissueOrder(JSONObject item) {
|
||||||
|
//补发订单生成赠品销售订单
|
||||||
|
String billNo = "";
|
||||||
|
boolean flag = true;
|
||||||
|
JSONObject resultSaleTc = U8cHttpUtil.bdU8cBlueSaleOrderParm(item,"8000050000","1","2","1");
|
||||||
|
String status = resultSaleTc.getString("status");
|
||||||
|
if("success".equals(status)){
|
||||||
|
JSONArray dataArr = resultSaleTc.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo = parentvo.getString("vreceiptcode");
|
||||||
|
}
|
||||||
|
|
||||||
|
//在生成销售公司向库存公司的采购订单
|
||||||
|
if(flag){
|
||||||
|
JSONObject resultPoTb = U8cHttpUtil.bdU8cBluePoOrderParm(item,"8000050004","2");
|
||||||
|
status = resultPoTb.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultPoTb.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vordercode");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//在生成库存公司向销售公司的销售订单
|
||||||
|
if(flag) {
|
||||||
|
JSONObject resultSaleTb = U8cHttpUtil.bdU8cBlueSaleOrderParm(item,"8000050000","3","1","");
|
||||||
|
status = resultSaleTb.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultSaleTb.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vreceiptcode");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return billNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String saleOrder(JSONObject item) {
|
||||||
|
//todo 因为涉及到公司内部交易,需要生成不同的单据 销售公司的销售订单,销售公司向生产公司的采购订单、生成公司向销售公司的销售订单
|
||||||
|
//先生成销售公司的销售订单
|
||||||
|
String billNo = "";
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
JSONObject resultSaleTc = U8cHttpUtil.bdU8cBlueSaleOrderParm(item,"8000050000","1","1","");
|
||||||
|
String status = resultSaleTc.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultSaleTc.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vreceiptcode");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//在生成销售公司向库存公司的采购订单
|
||||||
|
if(flag){
|
||||||
|
JSONObject resultPoTb = U8cHttpUtil.bdU8cBluePoOrderParm(item,"8000050004","2");
|
||||||
|
status = resultPoTb.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultPoTb.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vordercode");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//在生成库存公司向销售公司的销售订单
|
||||||
|
if(flag) {
|
||||||
|
JSONObject resultSaleTb = U8cHttpUtil.bdU8cBlueSaleOrderParm(item,"8000050000","3","1","");
|
||||||
|
status = resultSaleTb.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultSaleTb.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vreceiptcode");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return billNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,11 @@ package com.hzya.frame.u8c.gnsale.util;
|
||||||
|
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,35 +17,86 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class HjyUtil {
|
public class HjyUtil {
|
||||||
public static final String baseUrl = "https://openapi.qizhishangke.com";
|
public static final String baseUrl = "http://332wh0cyoi.api.taobao.com/router/qm";
|
||||||
public static final String appkey = "2aa6ce6a155fdceebec72edec9c7abf8";
|
public static String slipt = ":";
|
||||||
/**
|
public static String link = "&";
|
||||||
*
|
public static String appKey = "34176866";
|
||||||
* @content 参数加密
|
public static String hjyAppKey = "5eff199a9de8e25b4968c7219e6c13b5bc558d2b";
|
||||||
* @className: Administrator
|
public static String appSecret = "c44b90d3ba99d6d88df095f231d45fbe";
|
||||||
* @author laborer
|
public static String appId = "04c6d000efc84a10bf442236fdec291f";
|
||||||
* @date 2025-08-14 13:25
|
public static String sid = "jss3";
|
||||||
*
|
public static String targetAppkey = "21363512";
|
||||||
*/
|
public static String format = "JSON";
|
||||||
|
//发货明细接口
|
||||||
|
public static String deliveryApiName = "wdt.hjy.recon.delivery.detail.query";
|
||||||
|
//售中
|
||||||
|
public static String szthApiName = "wdt.hjy.recon.sztdetail.query";
|
||||||
|
//售后
|
||||||
|
public static String shthApiName = "wdt.hjy.recon.shtdetail.query";
|
||||||
|
|
||||||
public static String linkParams(Map<String, String> map, String secret) {
|
/**
|
||||||
StringBuilder sb = new StringBuilder();
|
* 获取签名-慧经营开发平台
|
||||||
sb.append(secret);
|
*
|
||||||
for (Map.Entry<String, String> item : map.entrySet())
|
* @param params
|
||||||
{
|
* @param appKey
|
||||||
if (item.getKey().equals("sign"))
|
* @return
|
||||||
continue;
|
* @throws IOException
|
||||||
sb.append(item.getKey());
|
*/
|
||||||
sb.append(item.getValue());
|
public static String sign(Map<String, Object> params, String appKey) throws IOException {
|
||||||
|
StringBuilder sb = new StringBuilder(getParamStrFromMap(params));
|
||||||
|
sb.append(appKey);
|
||||||
|
String sbStr = sb.toString().replace("\"", "");
|
||||||
|
sbStr = sbStr.replace(" ", "");
|
||||||
|
String md5 = md5Hex(sbStr);
|
||||||
|
System.out.println("带验签的参数 sbT:"+sbStr);
|
||||||
|
return md5.toLowerCase();
|
||||||
}
|
}
|
||||||
sb.append(secret);
|
private static String getParamStrFromMap(Map<String, Object> params) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
if (params != null && !params.isEmpty()) {
|
||||||
|
String[] keys = params.keySet().toArray(new String[0]);
|
||||||
|
Arrays.sort(keys);
|
||||||
|
for (int i = 0; i < keys.length; ++i) {
|
||||||
|
String name = keys[i];
|
||||||
|
sb.append(name);
|
||||||
|
sb.append(slipt);
|
||||||
|
sb.append(params.get(name));
|
||||||
|
sb.append(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String substring = sb.substring(0, sb.length() - 1);
|
||||||
|
return substring;
|
||||||
|
}
|
||||||
|
public static String md5Hex(String message) {
|
||||||
|
try {
|
||||||
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
|
return hex(md.digest(message.getBytes("UTF-8")));
|
||||||
|
} catch (NoSuchAlgorithmException var2) {
|
||||||
|
} catch (UnsupportedEncodingException var3) {
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public static String hex(byte[] array) {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
for (int i = 0; i < array.length; ++i) {
|
||||||
|
sb.append(Integer.toHexString(array[i] & 255 | 256).substring(1, 3));
|
||||||
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
public static String doPost(String parm,String url){
|
public static boolean checkSign(Map<String, Object> params, String appKey, String remoteSign) {
|
||||||
String result = HttpRequest.post(url)
|
try {
|
||||||
.body(parm)//表单内容
|
params.remove("sign");
|
||||||
.timeout(20000)//超时,毫秒
|
params.remove("hjySign");
|
||||||
.execute().body();
|
String localSign = sign(params, appKey);
|
||||||
return result;
|
System.out.println("根据远程调用的请求参数生成的签名:"+localSign);
|
||||||
|
if (localSign.equals(remoteSign)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.hzya.frame.u8c.hwsale.dao;
|
||||||
|
|
||||||
|
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 销售发票
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2024-10-18 9:27
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IHwsaleDao extends IBaseDao<BaseEntity,String> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 通用获取OA数据接口
|
||||||
|
* @author laborer
|
||||||
|
* @date 2024/7/10 0010 16:06
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
List<HashMap<String, Object>> execSelectSql(String str , BaseEntity entity)throws Exception;
|
||||||
|
int execUpdateSql(String str , BaseEntity entity)throws Exception;
|
||||||
|
int execInsertSql(String str , BaseEntity entity)throws Exception;
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.hzya.frame.u8c.hwsale.dao.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
|
import com.hzya.frame.execsql.service.IExecSqlService;
|
||||||
|
import com.hzya.frame.u8c.hwsale.dao.IHwsaleDao;
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 销售发票
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2024-10-18 9:27
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Repository(value = "SaleInvDaoImpl")
|
||||||
|
public class HwsaleDaoImpl extends MybatisGenericDao<BaseEntity,String> implements IHwsaleDao {
|
||||||
|
@Autowired
|
||||||
|
private IExecSqlService execSqlService;
|
||||||
|
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<HashMap<String, Object>> execSelectSql(String str, BaseEntity entity)throws Exception {
|
||||||
|
return execSqlService.execSelectSql(str, entity.getDataSourceCode());
|
||||||
|
}
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public int execUpdateSql(String str, BaseEntity entity) throws Exception {
|
||||||
|
return execSqlService.execUpdateSql(str, entity.getDataSourceCode());
|
||||||
|
}
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public int execInsertSql(String str, BaseEntity entity) throws Exception {
|
||||||
|
return execSqlService.execInsertSql(str, entity.getDataSourceCode());
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,9 +2,13 @@ package com.hzya.frame.u8c.hwsale.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.basedao.service.IBaseService;
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
|
||||||
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
|
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
|
||||||
import com.hzya.frame.web.entity.BaseEntity;
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (BdInvmandoc)表服务接口
|
* (BdInvmandoc)表服务接口
|
||||||
*
|
*
|
||||||
|
@ -26,4 +30,23 @@ public interface IHwSaleService extends IBaseService<BaseEntity, String> {
|
||||||
* @return 实例对象
|
* @return 实例对象
|
||||||
*/
|
*/
|
||||||
void getHwSaleRec(JSONObject requestJson);
|
void getHwSaleRec(JSONObject requestJson);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 抓取海外订单数据推送U8C
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-08-26 11:17
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
void getHwSaleOrderToU8c(JSONObject requestJson);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 抓取海外销售退货数据推送U8C
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-08-26 11:17
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void getHwSaleRecToU8c(JSONObject requestJson)throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,37 @@
|
||||||
package com.hzya.frame.u8c.hwsale.service.impl;
|
package com.hzya.frame.u8c.hwsale.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.UUID;
|
import cn.hutool.core.lang.UUID;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||||
|
import com.hzya.frame.execsql.entity.ExecSqlEntity;
|
||||||
|
import com.hzya.frame.execsql.service.IExecSqlService;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
|
||||||
import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
|
import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
|
||||||
import com.hzya.frame.u8c.Invmandoc.dao.IBdInvmandocDao;
|
import com.hzya.frame.u8c.Invmandoc.dao.IBdInvmandocDao;
|
||||||
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
|
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
|
||||||
import com.hzya.frame.u8c.Invmandoc.service.IBdInvmandocService;
|
import com.hzya.frame.u8c.Invmandoc.service.IBdInvmandocService;
|
||||||
|
import com.hzya.frame.u8c.hwsale.dao.IHwsaleDao;
|
||||||
import com.hzya.frame.u8c.hwsale.service.IHwSaleService;
|
import com.hzya.frame.u8c.hwsale.service.IHwSaleService;
|
||||||
import com.hzya.frame.u8c.hwsale.util.HwUtil;
|
import com.hzya.frame.u8c.hwsale.util.HwUtil;
|
||||||
|
import com.hzya.frame.u8c.util.U8cHttpUtil;
|
||||||
import com.hzya.frame.web.entity.BaseEntity;
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.time.LocalDate;
|
||||||
import java.util.TreeMap;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (BdInvmandoc)表服务实现类
|
* (BdInvmandoc)表服务实现类
|
||||||
|
@ -31,6 +43,9 @@ import java.util.TreeMap;
|
||||||
public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implements IHwSaleService {
|
public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implements IHwSaleService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ComparisonServiceImpl comparisonServiceimpl;
|
private ComparisonServiceImpl comparisonServiceimpl;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IHwsaleDao hwsaleDao ;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @content 获取电商海外数据
|
* @content 获取电商海外数据
|
||||||
|
@ -42,17 +57,21 @@ public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getHwSaleOrder(JSONObject requestJson) {
|
public void getHwSaleOrder(JSONObject requestJson) {
|
||||||
|
String startDate = U8cHttpUtil.formatStartDateHW();
|
||||||
|
String endDate = U8cHttpUtil.formatEndDateHW();
|
||||||
|
|
||||||
|
|
||||||
JSONArray dataArr = new JSONArray();
|
JSONArray dataArr = new JSONArray();
|
||||||
StringBuffer url = new StringBuffer();
|
StringBuffer url = new StringBuffer();
|
||||||
url.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesTradeList");
|
url.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesTradeList");
|
||||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
Map<String, String> map = new TreeMap<>();
|
Map<String, String> map = new TreeMap<>();
|
||||||
map.put("sid", "sales");
|
map.put("sid", HwUtil.sid);
|
||||||
map.put("appName", "sales");
|
map.put("appName", HwUtil.appName);
|
||||||
map.put("timestamp",timestamp );
|
map.put("timestamp",timestamp );
|
||||||
JSONObject parmetersMap = new JSONObject();
|
JSONObject parmetersMap = new JSONObject();
|
||||||
parmetersMap.put("createTimeBegin", "2025-05-10 00:00:00");
|
parmetersMap.put("createTimeBegin", startDate);
|
||||||
parmetersMap.put("createTimeEnd", "2025-08-01 15:00:00");
|
parmetersMap.put("createTimeEnd", endDate);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (true){
|
while (true){
|
||||||
i++;
|
i++;
|
||||||
|
@ -61,8 +80,9 @@ public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
map.put("body",parmetersMap.toJSONString());
|
map.put("body",parmetersMap.toJSONString());
|
||||||
String sign = SecureUtil.md5(HwUtil.linkParams(map,HwUtil.appkey));
|
String sign = SecureUtil.md5(HwUtil.linkParams(map,HwUtil.appkey));
|
||||||
logger.info("获取跨境电商销售订单数据,请求参数"+parmetersMap.toJSONString());
|
logger.info("获取跨境电商销售订单数据,请求参数"+parmetersMap.toJSONString());
|
||||||
url.append("?sid=sales&appName=sales×tamp="+timestamp+"&sign="+sign);
|
url.append("?sid="+HwUtil.sid+"&appName="+HwUtil.appName+"×tamp="+timestamp+"&sign="+sign);
|
||||||
String result = HwUtil.doPost(parmetersMap.toString(),url.toString());
|
String result = HwUtil.doPost(parmetersMap.toString(),url.toString());
|
||||||
|
logger.info("获取跨境电商销售订单数据,返回参数"+result);
|
||||||
if(StrUtil.isEmpty(result)){
|
if(StrUtil.isEmpty(result)){
|
||||||
throw new RuntimeException("获取跨境电商销售订单数据失败");
|
throw new RuntimeException("获取跨境电商销售订单数据失败");
|
||||||
}
|
}
|
||||||
|
@ -75,22 +95,84 @@ public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
JSONArray datas = dataObj.getJSONArray("data");
|
JSONArray datas = dataObj.getJSONArray("data");
|
||||||
//获取订单明细数据,如果有数据递归向下查,反之跳出循环
|
//获取订单明细数据,如果有数据递归向下查,反之跳出循环
|
||||||
if(datas.size() >0){
|
if(datas.size() >0){
|
||||||
datas.forEach(item -> {
|
JSONArray dataArrs = new JSONArray();
|
||||||
JSONObject data = getOrders(timestamp, item);
|
for(Object item :datas){
|
||||||
|
JSONObject data = (JSONObject) item;
|
||||||
|
dataArrs.add( data.getString("tradeId"));
|
||||||
|
}
|
||||||
|
//这是所有的明细数据
|
||||||
|
JSONArray reList = getOrders(timestamp,dataArrs);
|
||||||
|
//循环数组 将明细放到各自的主表下面
|
||||||
|
for(Object main :datas){
|
||||||
|
JSONObject data = (JSONObject) main;
|
||||||
|
JSONArray detailsArr = new JSONArray();
|
||||||
|
String tradeId = data.getString("tradeId");
|
||||||
|
for(Object item :reList){
|
||||||
|
JSONObject body = (JSONObject) item;
|
||||||
|
String tradeIds = body.getString("tradeId");
|
||||||
|
if(tradeId.equals(tradeIds)){
|
||||||
|
detailsArr.add( body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.put("orders",detailsArr);
|
||||||
dataArr.add(data);
|
dataArr.add(data);
|
||||||
});
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
//如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
||||||
if(dataArr.size() >0){
|
if(dataArr.size() >0){
|
||||||
|
// dataArr.forEach(item -> {
|
||||||
|
// JSONObject dataItem = bdHwSaleParm(item);
|
||||||
|
// });
|
||||||
|
if(dataArr.size()>500){
|
||||||
|
|
||||||
|
// 拆分为每批500条
|
||||||
|
List<JSONArray> batches = U8cHttpUtil.splitIntoBatches(dataArr, 500);
|
||||||
|
|
||||||
|
// 创建线程池,核心线程数根据CPU核心数设定,这里使用Runtime.getRuntime().availableProcessors()
|
||||||
|
// 也可以根据实际情况调整,比如设置为固定数量如10
|
||||||
|
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||||
|
|
||||||
|
// 提交所有批次任务到线程池
|
||||||
|
batches.forEach(batch -> {
|
||||||
|
executor.submit(() -> {
|
||||||
|
// 每个批次在单独的线程中处理
|
||||||
|
batch.forEach(item -> {
|
||||||
|
JSONObject dataItem = bdHwSaleParm(item);
|
||||||
|
// 这里可以添加对dataItem的后续处理逻辑
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 关闭线程池,不再接受新任务
|
||||||
|
executor.shutdown();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 等待所有任务完成,设置超时时间防止无限等待
|
||||||
|
if (!executor.awaitTermination(60, TimeUnit.MINUTES)) {
|
||||||
|
// 超时后强制关闭
|
||||||
|
executor.shutdownNow();
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
executor.shutdownNow();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
dataArr.forEach(item -> {
|
dataArr.forEach(item -> {
|
||||||
JSONObject dataItem = bdHwSaleParm(item);
|
JSONObject dataItem = bdHwSaleParm(item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取电商海外退货数据
|
* 获取电商海外退货数据
|
||||||
*
|
*
|
||||||
|
@ -99,19 +181,21 @@ public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void getHwSaleRec(JSONObject requestJson) {
|
public void getHwSaleRec(JSONObject requestJson) {
|
||||||
|
|
||||||
JSONArray dataArr = new JSONArray();
|
JSONArray dataArr = new JSONArray();
|
||||||
StringBuffer url = new StringBuffer();
|
StringBuffer url = new StringBuffer();
|
||||||
url.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesRefundList");
|
url.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesRefundList");
|
||||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||||
Map<String, String> map = new TreeMap<>();
|
Map<String, String> map = new TreeMap<>();
|
||||||
map.put("sid", "sales");
|
map.put("sid", HwUtil.sid);
|
||||||
map.put("appName", "sales");
|
map.put("appName", HwUtil.appName);
|
||||||
|
map.put("timestamp",timestamp );
|
||||||
map.put("timestamp",timestamp );
|
map.put("timestamp",timestamp );
|
||||||
JSONObject parmetersMap = new JSONObject();
|
JSONObject parmetersMap = new JSONObject();
|
||||||
parmetersMap.put("createTimeBegin", "2025-05-10 00:00:00");
|
parmetersMap.put("createTimeBegin", "2025-08-27 00:00:00");
|
||||||
parmetersMap.put("createTimeEnd", "2025-08-01 15:00:00");
|
parmetersMap.put("createTimeEnd", "2025-09-09 23:59:59");
|
||||||
String []typeArr = new String[]{"1","2","3","4","5"};
|
String []typeArr = new String[]{"1","2","3","4","5"};
|
||||||
parmetersMap.put("typeList",typeArr);
|
// parmetersMap.put("typeList",typeArr);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (true){
|
while (true){
|
||||||
i++;
|
i++;
|
||||||
|
@ -120,7 +204,7 @@ public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
map.put("body",parmetersMap.toJSONString());
|
map.put("body",parmetersMap.toJSONString());
|
||||||
String sign = SecureUtil.md5(HwUtil.linkParams(map,HwUtil.appkey));
|
String sign = SecureUtil.md5(HwUtil.linkParams(map,HwUtil.appkey));
|
||||||
logger.info("获取跨境电商销售退货数据,请求参数"+parmetersMap.toJSONString());
|
logger.info("获取跨境电商销售退货数据,请求参数"+parmetersMap.toJSONString());
|
||||||
url.append("?sid=sales&appName=sales×tamp="+timestamp+"&sign="+sign);
|
url.append("?sid="+HwUtil.sid+"&appName="+HwUtil.appName+"×tamp="+timestamp+"&sign="+sign);
|
||||||
String result = HwUtil.doPost(parmetersMap.toString(),url.toString());
|
String result = HwUtil.doPost(parmetersMap.toString(),url.toString());
|
||||||
if(StrUtil.isEmpty(result)){
|
if(StrUtil.isEmpty(result)){
|
||||||
throw new RuntimeException("获取跨境电商销售退货数据失败");
|
throw new RuntimeException("获取跨境电商销售退货数据失败");
|
||||||
|
@ -139,21 +223,206 @@ public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
//如果数组不为空,将数据写入中台业务中心,先查询在写入,如果数据已经存在则直接跳过,反正写入中台业务中心
|
||||||
if(dataArr.size() >0){
|
if(dataArr.size() >0){
|
||||||
|
// dataArr.forEach(item -> {
|
||||||
|
// JSONObject dataItem = bdHwSaleParm(item);
|
||||||
|
// });
|
||||||
|
if(dataArr.size()>500){
|
||||||
|
// 拆分为每批500条
|
||||||
|
List<JSONArray> batches = U8cHttpUtil.splitIntoBatches(dataArr, 500);
|
||||||
|
batches.forEach(batch -> {
|
||||||
|
// 批量处理每个批次
|
||||||
|
batch.forEach(item -> {
|
||||||
|
JSONObject dataItem = bdHwSaleRecParm(item);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
System.out.println(batches);
|
||||||
|
}else{
|
||||||
dataArr.forEach(item -> {
|
dataArr.forEach(item -> {
|
||||||
JSONObject dataItem = bdHwSaleRecParm(item);
|
JSONObject dataItem = bdHwSaleRecParm(item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getHwSaleOrderToU8c(JSONObject requestJson) {
|
||||||
|
BaseEntity entity = new BaseEntity();
|
||||||
|
// entity.setDataSourceCode("ZT");
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
stringBuffer.append("select c.ntaxrate,sum(aa.sku_amount) as delivery_amount,b.shop_no as shop_no, a.shop_text, sum(aa.num) as delivery_qty,warehouse_no, ");
|
||||||
|
stringBuffer.append("b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no as shop_no_new,b.shop_name as shop_name_new,b.po_org_code,b.po_org_name \n ");
|
||||||
|
stringBuffer.append("from hw_sale_order a ");
|
||||||
|
stringBuffer.append("left join hw_sale_orders aa on a.trade_id = aa.trade_id ");
|
||||||
|
stringBuffer.append("left join mdm_cost_project b on a.shop_text = b.project_name ");
|
||||||
|
stringBuffer.append("left join mdm_orgs c on b.org_name = c.org_name ");
|
||||||
|
stringBuffer.append("where 1=1 and a.send_state is null and b.org_code is not null and a.refund_status = '0' ");
|
||||||
|
stringBuffer.append("group by c.ntaxrate,a.shop_no, a.shop_text, ");
|
||||||
|
stringBuffer.append("warehouse_no,b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no,b.shop_name,b.po_org_code,b.po_org_name ");
|
||||||
|
stringBuffer.append("limit 1 ");
|
||||||
|
try {
|
||||||
|
List<HashMap<String, Object>> hashMaps = hwsaleDao.execSelectSql(stringBuffer.toString(),entity);
|
||||||
|
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||||
|
|
||||||
|
for (HashMap<String, Object> item : hashMaps) {
|
||||||
|
//通过订单类型、店铺编码、仓库编码、项目编码、品牌编码、平台编码、销售主体编码、采购主体编码查询需要汇总的明细信息
|
||||||
|
StringBuffer detailSql = new StringBuffer();
|
||||||
|
detailSql.append("select * from ( ");
|
||||||
|
detailSql.append("select c.ntaxrate,sum(aa.sku_amount) as delivery_amount,b.shop_no as shop_no, a.shop_text, aa.sku_no as spec_no, aa.spu_no as goods_no, aa.spu_name as goods_name, sum(aa.num) as delivery_qty,warehouse_no, ");
|
||||||
|
detailSql.append("b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no as shop_no_new,b.shop_name as shop_name_new,b.po_org_code,b.po_org_name ");
|
||||||
|
detailSql.append("from hw_sale_order a ");
|
||||||
|
detailSql.append("left join hw_sale_orders aa on a.trade_id = aa.trade_id ");
|
||||||
|
detailSql.append("left join mdm_cost_project b on a.shop_text = b.project_name ");
|
||||||
|
detailSql.append("left join mdm_orgs c on b.org_name = c.org_name ");
|
||||||
|
detailSql.append("where 1=1 and a.send_state is null and b.org_code is not null and a.refund_status = '0' ");
|
||||||
|
detailSql.append("group by c.ntaxrate,a.shop_no, a.shop_text, aa.sku_no, aa.spu_no, aa.spu_name, ");
|
||||||
|
detailSql.append("warehouse_no,b.project_code,b.project_name,b.project_type,b.project_acc,b.brand_code,b.brand_name,b.platform_code,b.platform_name,b.org_code,b.org_name,b.shop_no,b.shop_name,b.po_org_code,b.po_org_name ");
|
||||||
|
|
||||||
|
detailSql.append(")m1 ");
|
||||||
|
detailSql.append("where shop_no = '"+item.get("shop_no")+"' ");
|
||||||
|
detailSql.append("and warehouse_no = '"+item.get("warehouse_no")+"' ");
|
||||||
|
detailSql.append("and project_code = '"+item.get("project_code")+"' ");
|
||||||
|
if(StrUtil.isNotEmpty(String.valueOf(item.get("brand_code")))){
|
||||||
|
detailSql.append("and brand_code = '"+item.get("brand_code")+"' ");
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotEmpty(String.valueOf(item.get("platform_code")))) {
|
||||||
|
detailSql.append("and platform_code = '"+item.get("platform_code")+"' ");
|
||||||
|
}
|
||||||
|
detailSql.append("and org_code = '"+item.get("org_code")+"' ");
|
||||||
|
detailSql.append("and po_org_code = '"+item.get("po_org_code")+"' ");
|
||||||
|
// detailSql.append("and a.refund_type = '"+item.get("refund_type")+"' ");
|
||||||
|
List<HashMap<String, Object>> detailsHashMaps = hwsaleDao.execSelectSql(detailSql.toString(),entity);
|
||||||
|
//map转json
|
||||||
|
JSONObject jsonObject = new JSONObject(item);
|
||||||
|
if(CollectionUtils.isNotEmpty(detailsHashMaps)){
|
||||||
|
jsonObject.put("orders",detailsHashMaps);
|
||||||
|
}else{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
jsonObject.put("org_code", "SH010002");
|
||||||
|
boolean flag = true;
|
||||||
|
String billNo = "";
|
||||||
|
billNo = saleOrder(jsonObject);
|
||||||
|
|
||||||
|
String sendState = "";
|
||||||
|
if(StrUtil.isNotEmpty(billNo)){
|
||||||
|
sendState = "Y";
|
||||||
|
}else{
|
||||||
|
sendState = "N";
|
||||||
|
}
|
||||||
|
String updateSql = "update hw_sale_order set send_state = '"+sendState+"' ,u8c_bill_no = '"+billNo+"'"+
|
||||||
|
"where shop_text = '"+item.get("shop_text")+"' " +
|
||||||
|
"and warehouse_no = '"+item.get("warehouse_no")+"' ";
|
||||||
|
try {
|
||||||
|
hwsaleDao.execUpdateSql(updateSql,new BaseEntity());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String saleOrder(JSONObject item) {
|
||||||
|
//todo 因为涉及到公司内部交易,需要生成不同的单据 销售公司的销售订单,销售公司向生产公司的采购订单、生成公司向销售公司的销售订单
|
||||||
|
//先生成销售公司的销售订单
|
||||||
|
String billNo = "";
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
JSONObject resultSaleTc = U8cHttpUtil.bdU8cBlueSaleOrderParm(item,"8000050000","1","1","");
|
||||||
|
String status = resultSaleTc.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultSaleTc.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vreceiptcode");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//在生成销售公司向库存公司的采购订单
|
||||||
|
if(flag){
|
||||||
|
JSONObject resultPoTb = U8cHttpUtil.bdU8cBluePoOrderParm(item,"8000050004","2");
|
||||||
|
status = resultPoTb.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultPoTb.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vordercode");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//在生成库存公司向销售公司的销售订单
|
||||||
|
if(flag) {
|
||||||
|
JSONObject resultSaleTb = U8cHttpUtil.bdU8cBlueSaleOrderParm(item,"8000050000","3","1","");
|
||||||
|
status = resultSaleTb.getString("status");
|
||||||
|
if(!"success".equals(status)){
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
JSONArray dataArr = resultSaleTb.getJSONArray("data");
|
||||||
|
JSONObject data = dataArr.getJSONObject(0);
|
||||||
|
JSONObject parentvo = data.getJSONObject("parentvo");
|
||||||
|
billNo += parentvo.getString("vreceiptcode");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return billNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject bdU8SaleParm(HashMap<String, Object> item) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
JSONObject saleorder = new JSONObject();
|
||||||
|
JSONObject data = JSON.parseObject(JSON.toJSONString(item));
|
||||||
|
JSONObject parentvo = new JSONObject();
|
||||||
|
JSONArray childrenvo = new JSONArray();
|
||||||
|
// 组装表头信息 (parentvo)
|
||||||
|
parentvo.put("cbiztype", "so08"); // 业务流程
|
||||||
|
parentvo.put("ccalbodyid", "SH010002"); // 库存组织
|
||||||
|
parentvo.put("ccustomerid", "SH02011565"); // 客户
|
||||||
|
parentvo.put("cdeptid", "8888"); // 部门
|
||||||
|
parentvo.put("coperatorid", "17633965916"); // 操作人
|
||||||
|
parentvo.put("csalecorpid", "SH010002"); // 销售公司
|
||||||
|
parentvo.put("cwarehouseid", "test0715"); // 仓库
|
||||||
|
parentvo.put("pk_corp", "SH010002"); // 公司
|
||||||
|
// 组装表体信息 (childrenvo)
|
||||||
|
JSONArray orders = data.getJSONArray("orders");
|
||||||
|
if (orders != null && !orders.isEmpty()) {
|
||||||
|
for (int i = 0; i < orders.size(); i++) {
|
||||||
|
JSONObject order = orders.getJSONObject(i);
|
||||||
|
JSONObject child = new JSONObject();
|
||||||
|
child.put("cinventoryid", order.getString("sku_no")); // 存货ID(SKU编码)
|
||||||
|
child.put("nnumber", order.getString("num")); // 数量
|
||||||
|
child.put("noriginalcurprice", order.getString("price")); // 原币单价
|
||||||
|
childrenvo.add(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
saleorder.put("parentvo",parentvo);
|
||||||
|
saleorder.put("childrenvo",childrenvo);
|
||||||
|
jsonObject.put("saleorder",saleorder);
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getHwSaleRecToU8c(JSONObject requestJson) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private JSONObject bdHwSaleRecParm(Object item) {
|
private JSONObject bdHwSaleRecParm(Object item) {
|
||||||
JSONObject data = (JSONObject) item;
|
JSONObject data = (JSONObject) item;
|
||||||
//组装表头参数
|
//组装表头参数
|
||||||
JSONArray orders = data.getJSONArray("skuSpuInfoList");
|
JSONArray orders = data.getJSONArray("skuSpuInfoList");
|
||||||
JSONObject jsonObjectUser = new JSONObject();
|
JSONObject jsonObjectUser = new JSONObject();
|
||||||
JSONObject jsonStr = new JSONObject();
|
JSONObject jsonStr = new JSONObject();
|
||||||
jsonObjectUser.put("data_id", data.get("data_id"));
|
jsonObjectUser.put("data_id", data.get("returnNo"));
|
||||||
jsonObjectUser.put("mdmCode", "10001");
|
jsonObjectUser.put("mdmCode", "10001");
|
||||||
jsonStr.put("jsonStr", jsonObjectUser);
|
jsonStr.put("jsonStr", jsonObjectUser);
|
||||||
//先查询编码和名称查询是否存在
|
//先查询编码和名称查询是否存在
|
||||||
|
@ -227,7 +496,7 @@ public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
JSONArray orders = data.getJSONArray("orders");
|
JSONArray orders = data.getJSONArray("orders");
|
||||||
JSONObject jsonObjectUser = new JSONObject();
|
JSONObject jsonObjectUser = new JSONObject();
|
||||||
JSONObject jsonStr = new JSONObject();
|
JSONObject jsonStr = new JSONObject();
|
||||||
jsonObjectUser.put("data_id", data.get("data_id"));
|
jsonObjectUser.put("data_id", data.get("tradeId"));
|
||||||
jsonObjectUser.put("mdmCode", "10001");
|
jsonObjectUser.put("mdmCode", "10001");
|
||||||
jsonStr.put("jsonStr", jsonObjectUser);
|
jsonStr.put("jsonStr", jsonObjectUser);
|
||||||
//先查询编码和名称查询是否存在
|
//先查询编码和名称查询是否存在
|
||||||
|
@ -356,33 +625,35 @@ public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implement
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private JSONObject getOrders(String timestamp, Object item) {
|
private JSONArray getOrders(String timestamp, JSONArray tradeIds) {
|
||||||
JSONObject data = (JSONObject) item;
|
// JSONObject data = (JSONObject) item;
|
||||||
//获取订单明细数据
|
//获取订单明细数据
|
||||||
JSONArray tradeIds = new JSONArray();
|
// JSONArray tradeIds = new JSONArray();
|
||||||
tradeIds.add(data.getString("tradeId"));
|
// tradeIds.add(data.getString("tradeId"));
|
||||||
StringBuffer bUrl = new StringBuffer();
|
StringBuffer bUrl = new StringBuffer();
|
||||||
bUrl.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesTradeOrderList");
|
bUrl.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesTradeOrderList");
|
||||||
Map<String, String> bMap = new TreeMap<>();
|
Map<String, String> bMap = new TreeMap<>();
|
||||||
bMap.put("sid", "sales");
|
bMap.put("sid", HwUtil.sid);
|
||||||
bMap.put("appName", "sales");
|
bMap.put("appName", HwUtil.appName);
|
||||||
bMap.put("timestamp", timestamp);
|
bMap.put("timestamp", timestamp);
|
||||||
JSONObject bParmetersMap = new JSONObject();
|
JSONObject bParmetersMap = new JSONObject();
|
||||||
bParmetersMap.put("tradeIds",tradeIds);
|
bParmetersMap.put("tradeIds",tradeIds);
|
||||||
bMap.put("body",bParmetersMap.toJSONString());
|
bMap.put("body",bParmetersMap.toJSONString());
|
||||||
String bSign = SecureUtil.md5(HwUtil.linkParams(bMap,HwUtil.appkey));
|
String bSign = SecureUtil.md5(HwUtil.linkParams(bMap,HwUtil.appkey));
|
||||||
bUrl.append("?sid=sales&appName=sales×tamp="+ timestamp +"&sign="+bSign);
|
bUrl.append("?sid="+HwUtil.sid+"&appName="+HwUtil.appName+"×tamp="+ timestamp +"&sign="+bSign);
|
||||||
String bResult = HwUtil.doPost(bParmetersMap.toString(),bUrl.toString());
|
String bResult = HwUtil.doPost(bParmetersMap.toString(),bUrl.toString());
|
||||||
if(StrUtil.isEmpty(bResult)){
|
if(StrUtil.isEmpty(bResult)){
|
||||||
throw new RuntimeException("获取跨境电商销售订单数据失败");
|
throw new RuntimeException("获取跨境电商销售订单数据失败");
|
||||||
}
|
}
|
||||||
JSONObject bResultObj = JSONObject.parseObject(bResult);
|
JSONObject bResultObj = JSONObject.parseObject(bResult);
|
||||||
|
logger.info("获取跨境电商销售订单数据结果为:{}", JSON.toJSONString(bResultObj));
|
||||||
boolean bOk = bResultObj.getBoolean("ok");
|
boolean bOk = bResultObj.getBoolean("ok");
|
||||||
if(!bOk){
|
if(!bOk){
|
||||||
logger.info("获取跨境电商销售订单明细数据失败");
|
logger.info("获取跨境电商销售订单明细数据失败");
|
||||||
}
|
}
|
||||||
JSONArray bDataarr = bResultObj.getJSONArray("data");
|
JSONArray bDataarr = bResultObj.getJSONArray("data");
|
||||||
data.put("orders",bDataarr);
|
// data.put("orders",bDataarr);
|
||||||
return data;
|
return bDataarr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
package com.hzya.frame.u8c.hwsale.util;
|
package com.hzya.frame.u8c.hwsale.util;
|
||||||
|
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,7 +17,9 @@ import java.util.Map;
|
||||||
|
|
||||||
public class HwUtil {
|
public class HwUtil {
|
||||||
public static final String baseUrl = "https://openapi.qizhishangke.com";
|
public static final String baseUrl = "https://openapi.qizhishangke.com";
|
||||||
public static final String appkey = "2aa6ce6a155fdceebec72edec9c7abf8";
|
public static final String appkey = "d754a2f4a3c7fcbf92c77cbb17cb330c";
|
||||||
|
public static final String sid = "jss3";
|
||||||
|
public static final String appName = "jss3";
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @content 参数加密
|
* @content 参数加密
|
||||||
|
@ -43,4 +49,6 @@ public class HwUtil {
|
||||||
.execute().body();
|
.execute().body();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,16 @@ package com.hzya.frame.u8c.util;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* com.hzya.frame.u8c.util
|
* com.hzya.frame.u8c.util
|
||||||
|
@ -13,15 +22,16 @@ import com.alibaba.fastjson.JSONObject;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class U8cHttpUtil {
|
public class U8cHttpUtil {
|
||||||
|
protected Logger logger = LogManager.getLogger(super.getClass());
|
||||||
public static String baseUrl = "127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
|
public static String baseUrl = "127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
|
||||||
public static JSONObject sendOATOU8CEsb(String parm, String apiCode){
|
public static JSONObject sendDataTOU8CEsb(String parm, String apiCode){
|
||||||
|
|
||||||
String result = HttpRequest.post(baseUrl)
|
String result = HttpRequest.post(baseUrl)
|
||||||
.header("usercode", "admin")//头信息,多个头信息多次调用此方法即可
|
.header("usercode", "U8CLOUD")//头信息,多个头信息多次调用此方法即可
|
||||||
// .header("needStackTrace", "Y")//头信息,多个头信息多次调用此方法即可
|
// .header("needStackTrace", "Y")//头信息,多个头信息多次调用此方法即可
|
||||||
.header("password", "eddea5c9f7fab1a9d18410cda784c224")//头信息,多个头信息多次调用此方法即可
|
.header("password", "f37aa888e10dbf1046421f5d09df7646")//头信息,多个头信息多次调用此方法即可
|
||||||
.header("trantype", "PK")//头信息,多个头信息多次调用此方法即可
|
.header("trantype", "code")//头信息,多个头信息多次调用此方法即可
|
||||||
.header("system", "sowow")//头信息,多个头信息多次调用此方法即可
|
.header("system", "U8CLOUD")//头信息,多个头信息多次调用此方法即可
|
||||||
.header("appId", "800005")//头信息,多个头信息多次调用此方法即可
|
.header("appId", "800005")//头信息,多个头信息多次调用此方法即可
|
||||||
.header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可
|
.header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可
|
||||||
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可
|
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可
|
||||||
|
@ -42,6 +52,257 @@ public class U8cHttpUtil {
|
||||||
JSONObject attributeObj = JSON.parseObject(attribute);
|
JSONObject attributeObj = JSON.parseObject(attribute);
|
||||||
return attributeObj;
|
return attributeObj;
|
||||||
}
|
}
|
||||||
|
if("500".equals(status)){
|
||||||
|
String attribute = main.getString("attribute");
|
||||||
|
JSONObject attributeObj = JSON.parseObject(attribute);
|
||||||
|
return attributeObj;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将大型JSONArray拆分为固定大小的批次
|
||||||
|
* @param largeJsonArray 原始大型JSONArray
|
||||||
|
* @param batchSize 每批的大小(如500)
|
||||||
|
* @return 包含多个子JSONArray的列表
|
||||||
|
*/
|
||||||
|
public static List<JSONArray> splitIntoBatches(JSONArray largeJsonArray, int batchSize) {
|
||||||
|
List<JSONArray> batches = new ArrayList<>();
|
||||||
|
int totalSize = largeJsonArray.size();
|
||||||
|
|
||||||
|
// 计算总批次(向上取整,避免遗漏最后不足一批的数据)
|
||||||
|
int totalBatches = (totalSize + batchSize - 1) / batchSize;
|
||||||
|
|
||||||
|
for (int i = 0; i < totalBatches; i++) {
|
||||||
|
// 计算当前批次的起始索引和结束索引
|
||||||
|
int startIndex = i * batchSize;
|
||||||
|
int endIndex = Math.min(startIndex + batchSize, totalSize);
|
||||||
|
|
||||||
|
// 创建子JSONArray并添加当前批次的数据
|
||||||
|
JSONArray batch = new JSONArray();
|
||||||
|
for (int j = startIndex; j < endIndex; j++) {
|
||||||
|
JSONObject item = largeJsonArray.getJSONObject(j);
|
||||||
|
batch.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
batches.add(batch);
|
||||||
|
}
|
||||||
|
|
||||||
|
return batches;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content billType类型
|
||||||
|
* 1正常销售一推到底so08
|
||||||
|
* 2内部交易采购ZDCG
|
||||||
|
* 3内部交易销售ZDXS
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-09-03 10:37
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static JSONObject bdU8cBlueSaleOrderParm(JSONObject jsonObject,String apiCode,String billType,String orderType,String type) {
|
||||||
|
JSONObject main = new JSONObject();
|
||||||
|
JSONObject saleorder = new JSONObject();
|
||||||
|
JSONObject parentvo = new JSONObject();
|
||||||
|
JSONArray childrenvo = new JSONArray();
|
||||||
|
//根据不同的接口判断业务流程
|
||||||
|
String cbiztype = "";
|
||||||
|
switch (billType){
|
||||||
|
case "1":
|
||||||
|
cbiztype = "so08";
|
||||||
|
parentvo.put("ccustomerid",jsonObject.get("project_code"));//客户
|
||||||
|
parentvo.put("pk_corp",jsonObject.get("org_code"));//所属公司
|
||||||
|
parentvo.put("csalecorpid",jsonObject.get("org_code"));//销售组织
|
||||||
|
parentvo.put("ccalbodyid",jsonObject.get("org_code"));//库存组织 后面调整先默认
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
cbiztype = "ZDXS";
|
||||||
|
parentvo.put("ccustomerid",jsonObject.get("org_code"));//客户
|
||||||
|
parentvo.put("pk_corp",jsonObject.get("po_org_code"));//所属公司
|
||||||
|
parentvo.put("csalecorpid",jsonObject.get("po_org_code"));//销售组织
|
||||||
|
parentvo.put("ccalbodyid",jsonObject.get("po_org_code"));//库存组织 后面调整先默认
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
parentvo.put("cbiztype",cbiztype);//业务流程 默认so08一推到底
|
||||||
|
parentvo.put("cdeptid","8888");//部门
|
||||||
|
parentvo.put("coperatorid","17633965916");//制单人
|
||||||
|
parentvo.put("cwarehouseid",jsonObject.get("warehouse_no"));//仓库
|
||||||
|
JSONArray orders = jsonObject.getJSONArray("orders");
|
||||||
|
for(Object order : orders){
|
||||||
|
String dataStr = JSON.toJSONString(order);
|
||||||
|
JSONObject data = JSONObject.parseObject(dataStr);
|
||||||
|
BigDecimal delivery_amount = data.getBigDecimal("delivery_amount");
|
||||||
|
BigDecimal delivery_qty = data.getBigDecimal("delivery_qty");
|
||||||
|
BigDecimal delivery_amount_bd = delivery_amount.divide(delivery_qty,2, BigDecimal.ROUND_HALF_UP);
|
||||||
|
// item.put("delivery_amount_bd",delivery_amount_bd);
|
||||||
|
JSONObject item = new JSONObject();
|
||||||
|
item.put("cinventoryid",data.get("spec_no"));//商品编码
|
||||||
|
item.put("nnumber",data.get("delivery_qty"));//数量
|
||||||
|
item.put("noriginalcurprice",delivery_amount_bd);//无税单价
|
||||||
|
item.put("pk_defdoc16",data.get("brand_code"));//品牌
|
||||||
|
item.put("pk_defdoc17",data.get("shop_no"));//店铺
|
||||||
|
item.put("pk_defdoc18",data.get("platform_code"));//平台
|
||||||
|
item.put("cprojectid",data.get("project_code"));//平台
|
||||||
|
item.put("ntaxrate,",data.get("ntaxrate"));//数量
|
||||||
|
//如果订单类型是2 需要生成赠品订单
|
||||||
|
// if("1".equals(type)){
|
||||||
|
boolean isZero1 = delivery_amount_bd.compareTo(BigDecimal.ZERO) == 0;
|
||||||
|
if(isZero1){
|
||||||
|
item.put("blargessflag",true);//是否赠品
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
//如果订单类型是4 需要生成红字订单
|
||||||
|
if("4".equals(orderType)){
|
||||||
|
parentvo.put("bretinvflag",'Y');//退货标记(Y / N)
|
||||||
|
// 处理数量(nnumber):转为负数
|
||||||
|
// BigDecimal qtyObj = data.getBigDecimal("delivery_qty");
|
||||||
|
item.put("nnumber", data.getBigDecimal("delivery_qty").subtract(data.getBigDecimal("delivery_qty").add(data.getBigDecimal("delivery_qty"))));
|
||||||
|
}
|
||||||
|
childrenvo.add( item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
saleorder.put("parentvo",parentvo);
|
||||||
|
saleorder.put("childrenvo",childrenvo);
|
||||||
|
main.put("saleorder",saleorder);
|
||||||
|
System.out.println(main.toJSONString());
|
||||||
|
return U8cHttpUtil.sendDataTOU8CEsb(main.toJSONString(),apiCode);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content billType类型
|
||||||
|
* 1正常销售一推到底so08
|
||||||
|
* 2内部交易采购ZDCG
|
||||||
|
* 3内部交易销售ZDXS
|
||||||
|
* @className: Administrator
|
||||||
|
* @author laborer
|
||||||
|
* @date 2025-09-03 10:37
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static JSONObject bdU8cBluePoOrderParm(JSONObject jsonObject, String apiCode, String billType) {
|
||||||
|
JSONObject main = new JSONObject();
|
||||||
|
JSONObject puordervo = new JSONObject();
|
||||||
|
JSONObject parentvo = new JSONObject();
|
||||||
|
JSONArray childrenvo = new JSONArray();
|
||||||
|
//根据不同的接口判断业务流程
|
||||||
|
String cbiztype = "";
|
||||||
|
switch (billType){
|
||||||
|
case "2":
|
||||||
|
cbiztype = "ZDCG";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
parentvo.put("cbiztype",cbiztype);//业务流程
|
||||||
|
parentvo.put("cdeptid","9999");//采购部门
|
||||||
|
parentvo.put("coperator","17633965916");//制单人
|
||||||
|
parentvo.put("cpurorganization",jsonObject.get("org_code"));//采购组织
|
||||||
|
parentvo.put("cvendormangid",jsonObject.get("po_org_code"));//供应商、默认库存组织
|
||||||
|
parentvo.put("pk_corp",jsonObject.get("org_code"));//采购组织
|
||||||
|
JSONArray orders = jsonObject.getJSONArray("orders");
|
||||||
|
for(Object order:orders){
|
||||||
|
String dataStr = JSON.toJSONString(order);
|
||||||
|
JSONObject forson = JSONObject.parseObject(dataStr);
|
||||||
|
JSONObject item = new JSONObject();
|
||||||
|
item.put("cmangid",forson.get("spec_no"));//商品编码
|
||||||
|
item.put("cwarehouseid",forson.get("warehouse_no"));//仓库
|
||||||
|
item.put("nordernum",forson.get("delivery_qty"));//数量
|
||||||
|
item.put("ntaxrate,",forson.get("ntaxrate"));//数量
|
||||||
|
BigDecimal delivery_amount = forson.getBigDecimal("delivery_amount");
|
||||||
|
BigDecimal delivery_qty = forson.getBigDecimal("delivery_qty");
|
||||||
|
BigDecimal delivery_amount_bd = delivery_amount.divide(delivery_qty,2, BigDecimal.ROUND_HALF_UP);
|
||||||
|
|
||||||
|
item.put("noriginalcurprice",delivery_amount_bd);//无税单价
|
||||||
|
boolean isZero1 = delivery_amount_bd.compareTo(BigDecimal.ZERO) == 0;
|
||||||
|
if(isZero1){
|
||||||
|
item.put("blargess",true);//是否赠品
|
||||||
|
}
|
||||||
|
childrenvo.add( item);
|
||||||
|
}
|
||||||
|
|
||||||
|
puordervo.put("childrenvo",childrenvo);
|
||||||
|
puordervo.put("parentvo",parentvo);
|
||||||
|
main.put("puordervo",puordervo);
|
||||||
|
// logger.info("U8C接口参数:{}",main.toJSONString());
|
||||||
|
return U8cHttpUtil.sendDataTOU8CEsb(main.toJSONString(),apiCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
//格式化开始日期日期
|
||||||
|
public static String formatStartDateHW() {
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
||||||
|
// 2. 向前偏移2天,然后设置时分秒为23:59:00
|
||||||
|
LocalDateTime result = now
|
||||||
|
.minusDays(2) // 日期减2天
|
||||||
|
.withHour(23) // 设置小时为23
|
||||||
|
.withMinute(59) // 设置分钟为59
|
||||||
|
.withSecond(0) // 设置秒为0
|
||||||
|
.withNano(0); // 清除纳秒(可选)
|
||||||
|
return result.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//格式化结束日期日期
|
||||||
|
public static String formatEndDateHW() {
|
||||||
|
// 1. 获取当前日期,并设置时间为00:02:00
|
||||||
|
LocalDateTime todayEarlyMorning = LocalDateTime.now()
|
||||||
|
.withHour(0) // 小时设为0点
|
||||||
|
.withMinute(2) // 分钟设为2分
|
||||||
|
.withSecond(0) // 秒设为0
|
||||||
|
.withNano(0); // 纳秒设为0(可选)
|
||||||
|
|
||||||
|
// 2. 定义日期时间格式化器(根据需要调整格式)
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// 3. 格式化并输出
|
||||||
|
return todayEarlyMorning.format(formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//格式化开始日期日期
|
||||||
|
public static String formatStartDate() {
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
||||||
|
// 2. 向前偏移2天,然后设置时分秒为23:59:00
|
||||||
|
LocalDateTime result = now
|
||||||
|
.minusDays(2) // 日期减1天
|
||||||
|
.withHour(0) // 设置小时为23
|
||||||
|
.withMinute(0) // 设置分钟为59
|
||||||
|
.withSecond(0) // 设置秒为0
|
||||||
|
.withNano(0); // 清除纳秒(可选)
|
||||||
|
return result.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//格式化结束日期日期
|
||||||
|
public static String formatEndDate() {
|
||||||
|
// 1. 获取当前日期,并设置时间为00:02:00
|
||||||
|
LocalDateTime todayLastMoment = LocalDateTime.now()
|
||||||
|
.minusDays(2) // 日期减1天
|
||||||
|
.withHour(23) // 小时设为23点
|
||||||
|
.withMinute(59) // 分钟设为59分
|
||||||
|
.withSecond(59) // 秒设为59秒
|
||||||
|
.withNano(0); // 纳秒设为999,000,000(对应999毫秒)
|
||||||
|
|
||||||
|
// 2. 定义日期时间格式化器(根据需要调整格式)
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// 3. 格式化并输出
|
||||||
|
return todayLastMoment.format(formatter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
54
pom.xml
54
pom.xml
|
@ -471,33 +471,33 @@
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<webResources>
|
<webResources>
|
||||||
<resource>
|
<!-- <resource>-->
|
||||||
<directory>${basedir}/../base-service/src/main/webapp/WEB-INF/lib</directory>
|
<!-- <directory>${basedir}/../base-service/src/main/webapp/WEB-INF/lib</directory>-->
|
||||||
<targetPath>WEB-INF/lib/</targetPath>
|
<!-- <targetPath>WEB-INF/lib/</targetPath>-->
|
||||||
<filtering>false</filtering>
|
<!-- <filtering>false</filtering>-->
|
||||||
<includes>
|
<!-- <includes>-->
|
||||||
<!-- 匹配所有jar包 -->
|
<!-- <!– 匹配所有jar包 –>-->
|
||||||
<include>**/*.jar</include>
|
<!-- <include>**/*.jar</include>-->
|
||||||
</includes>
|
<!-- </includes>-->
|
||||||
</resource>
|
<!-- </resource>-->
|
||||||
<resource>
|
<!-- <resource>-->
|
||||||
<directory>${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib</directory>
|
<!-- <directory>${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib</directory>-->
|
||||||
<targetPath>WEB-INF/lib/</targetPath>
|
<!-- <targetPath>WEB-INF/lib/</targetPath>-->
|
||||||
<filtering>false</filtering>
|
<!-- <filtering>false</filtering>-->
|
||||||
<includes>
|
<!-- <includes>-->
|
||||||
<!-- 匹配所有jar包 -->
|
<!-- <!– 匹配所有jar包 –>-->
|
||||||
<include>**/*.jar</include>
|
<!-- <include>**/*.jar</include>-->
|
||||||
</includes>
|
<!-- </includes>-->
|
||||||
</resource>
|
<!-- </resource>-->
|
||||||
<resource>
|
<!-- <resource>-->
|
||||||
<directory>${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib</directory>
|
<!-- <directory>${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib</directory>-->
|
||||||
<targetPath>WEB-INF/lib/</targetPath>
|
<!-- <targetPath>WEB-INF/lib/</targetPath>-->
|
||||||
<filtering>false</filtering>
|
<!-- <filtering>false</filtering>-->
|
||||||
<includes>
|
<!-- <includes>-->
|
||||||
<!-- 匹配所有jar包 -->
|
<!-- <!– 匹配所有jar包 –>-->
|
||||||
<include>**/*.jar</include>
|
<!-- <include>**/*.jar</include>-->
|
||||||
</includes>
|
<!-- </includes>-->
|
||||||
</resource>
|
<!-- </resource>-->
|
||||||
</webResources>
|
</webResources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
Loading…
Reference in New Issue