Compare commits

..

3 Commits
yut ... master

Author SHA1 Message Date
zhengyf 8fabbe8539 1、缓存类合并。
2、pom修改mysql为8.0.33版本.
3、删除日志查询mapper重复的id
2025-08-18 16:11:25 +08:00
zhengyf 47c91bb061 1、mdm_module新增字段。
2、数据建模新增导入功能。
2025-08-18 15:05:06 +08:00
zhengyf e1743ced68 1、mdm_module新增字段。
2、数据建模新增导入功能。
2025-08-18 15:04:58 +08:00
95 changed files with 1688 additions and 8159 deletions

View File

@ -33,13 +33,24 @@
<profile>
<id>yut</id> <!--吕磊钢-->
<id>llg</id> <!--吕磊钢-->
<properties>
<profile.active>yut</profile.active>
<profile.active>llg</profile.active>
</properties>
</profile>
<profile>
<id>xel</id> <!--xel-->
<properties>
<profile.active>xel</profile.active>
</properties>
</profile>
<profile>
<id>zqtlocal</id> <!--曾庆拓-->
<properties>
<profile.active>zqtlocal</profile.active>
</properties>
</profile>
</profiles>
<build>
<finalName>kangarooDataCenterV3</finalName>

View File

@ -1,64 +0,0 @@
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("执行成功");
}
}

View File

@ -1,64 +0,0 @@
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("执行成功");
}
}

View File

@ -1,64 +0,0 @@
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("执行成功");
}
}

View File

@ -1,63 +0,0 @@
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("执行成功");
}
}

View File

@ -1,63 +0,0 @@
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("执行成功");
}
}

View File

@ -1,63 +0,0 @@
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 YutHwSaleOrderPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(YutHwSaleOrderPluginInitializer.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 "YutHwSaleOrderPluginInitializer";
}
@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 {
hwSaleService.getHwSaleOrder(requestJson);
return BaseResult.getSuccessMessageEntity("执行成功");
}catch (Exception e){
e.printStackTrace();
}
return BaseResult.getSuccessMessageEntity("执行成功");
}
}

View File

@ -1,63 +0,0 @@
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("执行成功");
}
}

View File

@ -1,63 +0,0 @@
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 YutHwSaleRrcPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(YutHwSaleRrcPluginInitializer.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 "YutHwSaleRrcPluginInitializer";
}
@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 {
hwSaleService.getHwSaleRec(requestJson);
return BaseResult.getSuccessMessageEntity("执行成功");
}catch (Exception e){
e.printStackTrace();
}
return BaseResult.getSuccessMessageEntity("执行成功");
}
}

View File

@ -1,63 +0,0 @@
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("执行成功");
}
}

View File

@ -0,0 +1,23 @@
#######################澳星环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: GBK
file:
# 日志保存路径
path: E:\yongansystem\log
spring:
datasource:
dynamic:
datasource:
master:
url: jdbc:mysql://127.0.0.1:3306/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: E:\yongansystem\file
zt:
url: http://127.0.0.1:9081/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -0,0 +1,42 @@
#######################dev环境#######################
logging:
#日志级别 指定目录级别
level:
root: warn
encodings: UTF-8
file:
# 日志保存路径
path: /home/webservice/zt/log
spring:
datasource:
dynamic:
datasource:
master:
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: /home/webservice/zt/file
# path: D:\webservice\file
# pluginpath: D:\webservice\plugin
pluginpath: /home/webservice/zt/plugin
# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\
tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc_oa
zt:
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -0,0 +1,27 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: D:\yongansystem\kangarooDataCenter\v3\logs
spring:
datasource:
dynamic:
datasource:
master:
# url: jdbc:mysql://ufidahz.com.cn:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
# username: root
# password: bd993088e8a7c3dc5f44441617f9b4bf
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: D:\yongansystem\kangarooDataCenter\v3\logs
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -0,0 +1,82 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: /Users/apple/Desktop/log/local
spring:
data:
mongodb:
# host: 192.168.2.237
# port: 27017
# database: businesscenter
# auto-index-creation: true
# password: hzya1314
# username: hzya
flyway:
# 启动flyway migration, 默认为true
enabled: false
datasource:
dynamic:
druid:
filters: stat,log4j2
datasource:
master:
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
# username: hzyazt
# password: 62e4295b615a30dbf3b8ee96f41c820b
# driver-class-name: dm.jdbc.driver.DmDriver
# type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
# username: hzyazt
# password: 62e4295b615a30dbf3b8ee96f41c820b
# driver-class-name: dm.jdbc.driver.DmDriver
savefile:
# 文件保存路径
path: /Users/apple/Desktop/log/local
tomcatpath: /Users/apple/Desktop/log/local
pluginpath: /Users/apple/Desktop/log/local
zt:
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc_oa
server:
port: 10086
# mysqldump -d mylm -hhzya.ufyct.com -p9096 -uroot -phzya1314 >%dirName%\table_view.sql
database:
databaseName: businesscenter
host: 192.168.2.237
port: 3306
username: root
password: hzya@1314
filePase: /Users/apple/Desktop/log
fileName: data.sql
#sftp:
# host: 192.168.2.237
# port: 9091
# username: cs237
# password: hzya@1314
# filePase: /databaseBack

View File

@ -0,0 +1,23 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: /Users/apple/Desktop/log/local
spring:
datasource:
dynamic:
datasource:
master:
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: /Users/apple/Desktop/log/local
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -0,0 +1,23 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: /Users/xiangerlin/work/app/logs/dev
spring:
datasource:
dynamic:
datasource:
master:
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: bd993088e8a7c3dc5f44441617f9b4bf
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: /Users/xiangerlin/work/app/file/dev
pluginpath: /Users/xiangerlin/work/app/file/dev
tomcatpath: /Users/xiangerlin/work/app/file/dev

View File

@ -0,0 +1,90 @@
#logging:
# #日志级别 指定目录级别
# level:
# root: info
# encodings: UTF-8
# file:
# # 日志保存路径
# path: /zt/log
#spring:
# flyway:
# # 启动flyway migration, 默认为true
# enabled: false
# datasource:
# dynamic:
# druid:
# filters: stat,log4j2
# datasource:
# master:
# url: jdbc:dm://10.75.51.82:5238?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
# username: businesscenter
# password: 6842568689469adad597d144ee104063
# driver-class-name: dm.jdbc.driver.DmDriver
#savefile:
# # 文件保存路径
# path: /zt/file
#公司mysql
#ax:
# url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
#logging:
# #日志级别 指定目录级别warn
# level:
# root: info
# encodings: UTF-8
# file:
# # 日志保存路径
# path: /home/webservice/zt/log
#spring:
# datasource:
# dynamic:
# datasource:
# master:
# url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
# username: root
# password: 62e4295b615a30dbf3b8ee96f41c820b
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
#savefile:
# # 文件保存路径
# path: /home/webservice/zt/file
#公司服务器达梦
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: /zt/log
spring:
flyway:
# 启动flyway migration, 默认为true
enabled: false
datasource:
dynamic:
druid:
filters: stat,log4j2
datasource:
master:
url: jdbc:dm://ufidahz.com.cn:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
username: hzyazt
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: dm.jdbc.driver.DmDriver
savefile:
# 文件保存路径
path: /zt/file
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826
#电子回单下载临时存放位置
elec_path: /zt/elecfile
OA:
data_source_code: yc_oa

View File

@ -0,0 +1,21 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: /Users/xiangerlin/work/app/logs/ydc
spring:
datasource:
dynamic:
datasource:
master:
url: jdbc:mysql://ufidahz.com.cn:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: bd993088e8a7c3dc5f44441617f9b4bf
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: /Users/xiangerlin/work/app/logs/ydc

View File

@ -0,0 +1,31 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: /Users/xiangerlin/work/app/logs/yuecheng
spring:
datasource:
dynamic:
datasource:
master:
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: /Users/xiangerlin/work/app/logs/yuecheng
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185

View File

@ -12,7 +12,7 @@ spring:
dynamic:
datasource:
master:
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter_yut?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
url: jdbc:mysql://ufidahz.com.cn:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: bd993088e8a7c3dc5f44441617f9b4bf
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置

View File

@ -0,0 +1,39 @@
#######################zqtlocal环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: D:/local/logs/
spring:
datasource:
dynamic:
datasource:
master:
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: D:/local/upload/
pluginpath : D:/local/plugin/
tomcatpath: E:\apache-tomcat-9.0.27\webapps\kangarooDataCenterV3\WEB-INF\classes\
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc_oa
zt:
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -1,5 +1,5 @@
server:
port: 9999
port: 10086
servlet:
context-path: /kangarooDataCenterV3
localIP: 127.0.0.1
@ -93,7 +93,7 @@ mybatis-plus:
db-config:
id-type: auto # 主键策略
zt:
url: http://127.0.0.1:9990/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
#JimuReport[minidao配置]
minidao :
base-package: org.jeecg.modules.jmreport.desreport.dao*
@ -139,4 +139,4 @@ sftp:
port:
username:
password:
filePase:
filePase:

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>BackUpDatabasePlugin</id>
<name>BackUpDatabasePlugin插件</name>
<category>20241021</category>
</plugin>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<!--<bean name="mdmCustomerDao" class="com.hzya.frame.plugin.masterData.dao.impl.MdmDaoImpl" />-->
</beans>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean name="YutHwSaleOrderPluginInitializer" class="com.hzya.frame.plugin.yut.plugin.YutHwSaleOrderPluginInitializer" />
<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>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<!--<bean name="mdmCustomerService" class="com.hzya.frame.plugin.masterData.service.impl.MdmServiceImpl" />-->
</beans>

View File

@ -1,14 +1,8 @@
package com.hzya.frame;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
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.web.entity.BaseEntity;
import org.apache.commons.collections.CollectionUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
@ -21,7 +15,6 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@ -30,7 +23,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
/**
* @ClassName dsasas
@ -38,13 +30,10 @@ import java.util.logging.Logger;
* @Author llg
* Date 2023/7/16 8:18 上午
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {WebappApplication.class})
//@RunWith(SpringRunner.class)
//@SpringBootTest(classes = {WebappApplication.class})
public class temButtom {
@Autowired
private ComparisonServiceImpl comparisonServiceimpl;
@Autowired
private MasterDataDaoImpl masterDataDaoImpl;
@Test
public void test01() {
String a = AESUtil.encrypt("hzya@1314");
@ -153,73 +142,5 @@ public class temButtom {
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));
}
}
}

View File

@ -1,6 +1,5 @@
package com.hzya.frame.execsql.service;
import cn.hutool.core.util.StrUtil;
import com.hzya.frame.datasource.DataSourceUtil;
import com.hzya.frame.execsql.entity.ExecSqlEntity;
import org.apache.ibatis.session.SqlSession;
@ -81,14 +80,14 @@ public class ExecSqlServiceImpl implements IExecSqlService {
@Override
public int execUpdateSql(String sql, String data_source_code) throws Exception {
logger.info("=============进入execUpdateSql方法============");
if (StrUtil.isNotEmpty(sql)) {
if (ObjectUtils.isEmpty(sql)) {
if (sql.contains("where") || sql.contains("WHERE")) {
// SqlSession sqlSession = getSqlSession(data_source_code);
// SqlSession sqlSession = new DataSourceUtil().getDefaultSqlSession();
logger.info("=============execUpdateSql方法要执行的sql============" + sql);
ExecSqlEntity entity = new ExecSqlEntity();
entity.setSql(sql);
int result = sqlSession.update("com.hzya.frame.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
int result = sqlSession.update("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
logger.info("update受影响行数" + result);
//sqlSession.close();
return result;

View File

@ -5,6 +5,8 @@ import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import cn.hutool.crypto.symmetric.SymmetricCrypto;
import static cn.hutool.crypto.CipherMode.encrypt;
/**
* @Description AES加密解密
* @Author xiang2lin
@ -77,4 +79,9 @@ public class AESUtil {
return null;
}
public static void main(String[] args) {
String data = "U8C241231";
String encrypt1 = encrypt(data);
System.out.println(encrypt1);
}
}

View File

@ -7,7 +7,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.context.support.ApplicationObjectSupport;
/**
* @author 郭军辉
* <p>
@ -26,7 +25,7 @@ public class DefaultController extends ApplicationObjectSupport {
* @return
*/
public JsonResultEntity getFailureMessageEntity(String message) {
return new JsonResultEntity(message, false);
return new JsonResultEntity(message, false, "500");
}
/**
@ -35,8 +34,8 @@ public class DefaultController extends ApplicationObjectSupport {
* @param message 提示信息
* @return
*/
public JsonResultEntity getFailureMessageEntity(String message, Object mo) {
return new JsonResultEntity(message, false, mo);
public JsonResultEntity getFailureMessageEntity(String message, Object mo) {
return new JsonResultEntity(message, false, "500", mo);
}
/**
@ -46,8 +45,8 @@ public class DefaultController extends ApplicationObjectSupport {
* @param mo 返回对象
* @return
*/
public JsonResultEntity getSuccessMessageEntity(String message, Object mo) {
return new JsonResultEntity(message, true, mo);
public JsonResultEntity getSuccessMessageEntity(String message, Object mo) {
return new JsonResultEntity(message, true, "200", mo);
}
/**
@ -56,18 +55,11 @@ public class DefaultController extends ApplicationObjectSupport {
* @param message 提示消息
* @return
*/
public JsonResultEntity getSuccessMessageEntity(String message ) {
return new JsonResultEntity(message, true);
public JsonResultEntity getSuccessMessageEntity(String message) {
return new JsonResultEntity(message, true, "200");
}
/**
* //绑定org_id
*

View File

@ -0,0 +1,48 @@
package com.hzya.frame.mdm.mdmModule;
import com.alibaba.excel.EasyExcel;
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
import com.hzya.frame.mdm.mdmModule.vo.ExcelTemplateVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
public class WriteTest {
@Autowired
private IMdmModuleService mdmModuleService;
@Test
public void testGenerateExcelTemplate() throws IOException {
// 文件夹路径
String folderPath = "D:/test/";
// 完整文件路径文件夹 + 文件名
String localFilePath = folderPath + "表字段定义模版.xlsx";
File dir = new File(folderPath);
if (!dir.exists()) {
dir.mkdirs(); // 创建文件夹如果不存在
}
// 准备模板的示例数据
List<ExcelTemplateVO> demoData = new ArrayList<>();
// 生成Excel并保存到本地文件
try (OutputStream outputStream = new FileOutputStream(localFilePath)) {
EasyExcel.write(outputStream, ExcelTemplateVO.class)
.sheet("表字段定义模版")
.doWrite(demoData);
}
System.out.println("Excel模板已成功生成保存路径" + localFilePath);
}
}

View File

@ -0,0 +1,34 @@
package com.hzya.frame.mdm.mdmModule.config;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Arrays;
import java.util.List;
@Configuration
@EnableCaching
public class CacheConfig extends CachingConfigurerSupport {
@Override
@Bean
public ConcurrentMapCacheManager cacheManager() {
// 整合所有需要的缓存名称原有的mdm相关缓存 + 新的业务缓存
List<String> cacheNames = Arrays.asList(
// 原有缓存来自SimpleCacheManager的配置
"mdmModuleDb",
"mdmModuleDbFileds",
"mdmModule",
// 新添加的业务缓存来自之前的ConcurrentMapCacheManager配置
"sysApplicationPlugin",
"IntegrationTask",
"IntegrationTaskLiving"
);
ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager();
cacheManager.setCacheNames(cacheNames); // 注册所有缓存名称
return cacheManager;
}
}

View File

@ -0,0 +1,48 @@
package com.hzya.frame.mdm.mdmModule.controller;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import jline.internal.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/excel")
public class ImportExcelController {
@Autowired
private IMdmModuleService iMdmModuleService;
/**
* 导入模版
*/
@RequestMapping(value = "/importTemplateFile" ,method = RequestMethod.POST)
public JsonResultEntity importTemplateFile(@RequestParam("file") MultipartFile file,
@ModelAttribute ImportExcelVO importExcelVO){
List<MdmModuleDbFiledsEntity> entities = iMdmModuleService.importTemplateFile(file,importExcelVO);
// 新增字段
for (MdmModuleDbFiledsEntity entity : entities) {
// JSONObject object = (JSONObject) JSONObject.toJSON(entity);
String str = JSONObject.toJSONString(entity);
Map<String,String> jsonStr=new HashMap<>();
jsonStr.put("jsonStr",str);
String jsonS = JSON.toJSONString(jsonStr);
JSONObject jsonObject = JSONObject.parseObject(jsonS);
iMdmModuleService.saveMdmDbField(jsonObject);
}
return new JsonResultEntity("导入模版成功",true,200);
}
}

View File

@ -26,8 +26,45 @@ public class MdmModuleEntity extends BaseEntity {
private String createUser;
//修改人
private String modifyUser;
/** 0预制 1手工 */
private String tag;
private String u8cDbPk;
private String nccDbPk;
private String ysDbPk;
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getU8cDbPk() {
return u8cDbPk;
}
public void setU8cDbPk(String u8cDbPk) {
this.u8cDbPk = u8cDbPk;
}
public String getNccDbPk() {
return nccDbPk;
}
public void setNccDbPk(String nccDbPk) {
this.nccDbPk = nccDbPk;
}
public String getYsDbPk() {
return ysDbPk;
}
public void setYsDbPk(String ysDbPk) {
this.ysDbPk = ysDbPk;
}
public String getMdmName() {
return mdmName;
}

View File

@ -19,6 +19,10 @@
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="tag" column="tag" jdbcType="VARCHAR"/>
<result property="u8cDbPk" column="u8c_db_pk" jdbcType="VARCHAR"/>
<result property="nccDbPk" column="ncc_db_pk" jdbcType="VARCHAR"/>
<result property="ysDbPk" column="ys_db_pk" jdbcType="VARCHAR"/>
</resultMap>
@ -39,6 +43,10 @@
,sts
,org_id
,company_id
,tag
,u8c_db_pk
,ncc_db_pk
,ys_db_pk
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-MdmModuleEntity-result">
@ -67,6 +75,10 @@
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="tag != null and tag != ''">and tag = #{tag}</if>
<if test="u8cDbPk != null and u8cDbPk != ''">and u8c_db_pk = #{u8cDbPk}</if>
<if test="nccDbPk != null and nccDbPk != ''">and ncc_db_pk = #{nccDbPk}</if>
<if test="ysDbPk != null and ysDbPk != ''">and ys_db_pk = #{ysDbPk}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -91,6 +103,10 @@
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="tag != null and tag != ''">and tag = #{tag}</if>
<if test="u8cDbPk != null and u8cDbPk != ''">and u8c_db_pk = #{u8cDbPk}</if>
<if test="nccDbPk != null and nccDbPk != ''">and ncc_db_pk = #{nccDbPk}</if>
<if test="ysDbPk != null and ysDbPk != ''">and ys_db_pk = #{ysDbPk}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -122,6 +138,7 @@
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
<if test="tag != null and tag != ''">and tag like concat('%',#{tag},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -149,6 +166,7 @@
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
<if test="tag != null and tag != ''">or tag = #{tag}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -175,6 +193,10 @@
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="sts == null ">sts,</if>
<if test="tag == null ">tag ,</if>
<if test="u8cDbPk != null and u8cDbPk != ''">u8c_db_pk,</if>
<if test="nccDbPk != null and nccDbPk != ''">ncc_db_pk,</if>
<if test="ysDbPk != null and ysDbPk != ''">ys_db_pk,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
@ -194,6 +216,10 @@
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="sts == null ">'Y',</if>
<if test="tag == null ">'1',</if>
<if test="u8cDbPk != null and u8cDbPk != ''">#{u8cDbPk},</if>
<if test="nccDbPk != null and nccDbPk != ''">#{nccDbPk},</if>
<if test="ysDbPk != null and ysDbPk != ''">#{ysDbPk},</if>
</trim>
)
</insert>
@ -281,6 +307,9 @@ where id = #{id}
<select id="queryMdm" resultMap="get-MdmModuleEntity-result"
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
a.u8c_db_pk as u8c_db_pk,
a.ncc_db_pk as ncc_db_pk,
a.ys_db_pk as ys_db_pk,
a.id as id,
a.mdm_name as mdm_name,
a.mdm_logo as mdm_logo,
@ -974,10 +1003,10 @@ where id = #{id}
&lt; #{item.filedVaule}
</when>
<when test="item.compareType == '5'.toString() ">
like #{item.filedVaule}
like concat('%',#{item.filedVaule},'%')
</when>
<when test="item.compareType == '6'.toString() ">
not like #{item.filedVaule}
not like concat('%',#{item.filedVaule},'%')
</when>
</choose>

View File

@ -3,7 +3,14 @@ package com.hzya.frame.mdm.mdmModule.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* 主数据模版(MdmModule)表服务接口
@ -397,4 +404,16 @@ public interface IMdmModuleService extends IBaseService<MdmModuleEntity, String>
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmDistributeByMdmCode(JSONObject jsonObject);
/**
* 下载导入模版
* @return
*/
void generateExcelTemplate(HttpServletResponse response) throws IOException;
/**
* 导入模版
* @param file
*/
List<MdmModuleDbFiledsEntity> importTemplateFile(MultipartFile file, ImportExcelVO importExcelVO);
}

View File

@ -1,8 +1,17 @@
package com.hzya.frame.mdm.mdmModule.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.util.StringUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.beanutil.BeanUtil;
import com.hzya.frame.mdm.entity.MdmDbFiledVo;
import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmModuleViewVo;
@ -10,6 +19,8 @@ import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
import com.hzya.frame.mdm.mdmModule.vo.ExcelTemplateVO;
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
import com.hzya.frame.mdm.mdmModuleDb.dao.impl.MdmModuleDbDaoImpl;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
@ -50,17 +61,24 @@ import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.hzya.frame.basedao.service.impl.BaseService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.*;
/**
* 主数据模版(MdmModule)表服务实现类
@ -443,6 +461,22 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
if ("1".equals(mdmModuleDbEntities.get(i).getDbType()) || "2".equals(mdmModuleDbEntities.get(i).getDbType())) {
dbEntities.add(mdmModuleDbEntities.get(i));
//查询合并规则add by zyd 20250707
List<String> filedNames=new ArrayList<>();
if (mdmModuleDbEntities.get(i).getMergeRules() != null && !"".equals(mdmModuleDbEntities.get(i).getMergeRules())) {
String mergeRulesIds = mdmModuleDbEntities.get(i).getMergeRules();
String[] split = mergeRulesIds.split(",");
for (String filedId : split) {
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
mdmModuleDbFiledsEntity.setId(filedId);
List<MdmModuleDbFiledsEntity> fileds = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
if(fileds.size()!=0){
filedNames.add(fileds.get(0).getChName());
}
}
}
mdmModuleDbEntities.get(i).setMergeRulesStr(String.join(",",filedNames));
}
}
}
@ -1403,7 +1437,8 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
mdmModuleDbFiledsEntity.setSts("Y");
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity);
// List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity);
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) {
for (int i = 0; i < mdmModuleDbFiledsEntityList.size(); i++) {
if (entity.getDbId().equals(mdmModuleDbFiledsEntityList.get(i).getDbId()) && entity.getEnName().equals(mdmModuleDbFiledsEntityList.get(i).getEnName())) {
@ -1411,6 +1446,42 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
}
}
}
//新增时查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09
boolean isSysPk = false;
boolean isSysCode = false;
boolean isSysName = false;
boolean isSysDate = false;
for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if ("Y".equals(dbFiledsEntity.getIsSysPk())) {
isSysPk = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysCode())) {
isSysCode = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysName())) {
isSysName = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysDate())) {
isSysDate = true;
}
}
}
}
//判端该字段是不是sysPk,sysCode,sysName=true
if ("Y".equals(entity.getIsSysPk()) && isSysPk) {
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改");
}
if ("Y".equals(entity.getIsSysCode()) && isSysCode) {
return BaseResult.getFailureMessageEntity("系统code字段已存在请修改");
}
if ("Y".equals(entity.getIsSysName()) && isSysName) {
return BaseResult.getFailureMessageEntity("系统name字段已存在请修改");
}
if ("Y".equals(entity.getIsSysDate()) && isSysDate) {
return BaseResult.getFailureMessageEntity("系统date字段已存在请修改");
}
entity.setCreate();
if ("1".equals(entity.getDbType())) {
entity.setAddType("1");
@ -1488,6 +1559,49 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
} catch (Exception e) {
throw new BaseSystemException("表字段类型,修改失败,请联系管理员");
}
//更新时查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
mdmModuleDbFiledsEntity.setDbId(entity.getDbId());
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
mdmModuleDbFiledsEntity.setSts("Y");
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
boolean isSysPk = false;
boolean isSysCode = false;
boolean isSysName = false;
boolean isSysDate = false;
for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if ("Y".equals(dbFiledsEntity.getIsSysPk())) {
isSysPk = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysCode())) {
isSysCode = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysName())) {
isSysName = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysDate())) {
isSysDate = true;
}
}
}
}
//判端该字段是不是sysPk,sysCode,sysName=true
if ("Y".equals(entity.getIsSysPk()) && isSysPk) {
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改");
}
if ("Y".equals(entity.getIsSysCode()) && isSysCode) {
return BaseResult.getFailureMessageEntity("系统code字段已存在请修改");
}
if ("Y".equals(entity.getIsSysName()) && isSysName) {
return BaseResult.getFailureMessageEntity("系统name字段已存在请修改");
}
if ("Y".equals(entity.getIsSysDate()) && isSysDate) {
return BaseResult.getFailureMessageEntity("系统date字段已存在请修改");
}
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = new ArrayList<>();
mdmModuleDbFiledsEntities.add(entity);
mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities);
@ -1551,6 +1665,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
return BaseResult.getFailureMessageEntity("系统错误");
}
MdmModuleDbFiledsRuleEntity queryCount = new MdmModuleDbFiledsRuleEntity();
queryCount.setMdmId(entity.getMdmId());
queryCount.setDbId(entity.getDbId());
queryCount.setRuleCode("label");
queryCount.setRuleValue(entity.getEnName());
@ -2864,4 +2979,290 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
List<MdmModuleDistributeEntity> list = mdmModuleDistributeDao.queryBase(entity);
return BaseResult.getSuccessMessageEntity("获取分发设置成功", list);
}
/**
* 生成导入模版
*/
@Override
public void generateExcelTemplate(HttpServletResponse response) throws IOException {
// 设置响应内容类型
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
// 设置文件名注意中文需要URLEncoder编码
String fileName = URLEncoder.encode("表字段定义模版", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// 准备模板的示例数据
List<ExcelTemplateVO> demoData = new ArrayList<>(); //createTemplateDemoData()
// 使用EasyExcel直接写入响应输出流
EasyExcel.write(response.getOutputStream(), ExcelTemplateVO.class)
.sheet("表字段定义模版")
.doWrite(demoData);
}
/*private List<ExcelTemplateVO> createTemplateDemoData() {
List<ExcelTemplateVO> demoData = new ArrayList<>();
ExcelTemplateVO demo = new ExcelTemplateVO();
demo.setChName("用户ID");
demo.setEnName("userId");
demo.setFiledType("1"); // 对应BIGINT类型
demo.setFiledLength("20");
demo.setIsSysPk("Y");
demo.setIsSysCode("Y");
demo.setIsSysName("N");
demo.setIsSysDate("N");
demo.setTitle("用户ID");
demo.setRow("6");
demo.setWidth("100");
demo.setType("input");
demo.setRequired("true");
demo.setDisabled("true");
demoData.add(demo);
return demoData;
}
*/
/**
* 导入模版
*/
@Transactional
@Override
public List<MdmModuleDbFiledsEntity> importTemplateFile(MultipartFile file , ImportExcelVO importExcelVO) {
// 校验文件合法性
if (file == null || file.isEmpty()) {
throw new IllegalArgumentException("导入文件不能为空");
}
// 校验文件格式
String fileName = file.getOriginalFilename();
if (fileName == null || (!fileName.endsWith(".xlsx") && !fileName.endsWith(".xls"))) {
throw new IllegalArgumentException("请上传Excel格式文件");
}
// 表头数据
List<List<String>> headerList = new ArrayList<>();
// 用于存储内容数据
List<ExcelTemplateVO> dataList = new ArrayList<>();
List<MdmModuleDbFiledsEntity> resultEntities = new ArrayList<>();
try (InputStream inputStream = file.getInputStream()) {
// 使用EasyExcel读取文件
EasyExcel.read(inputStream)
.head(ExcelTemplateVO.class) // 指定映射的实体类
.sheet(0) // 指定第一个sheet页
.headRowNumber(1) // 表头行数从1开始
.autoTrim(true)
.registerReadListener(new AnalysisEventListener<ExcelTemplateVO>() {
/**
* 获取表头行数据
*/
@Override
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
// 1. 转换表头为有序列表
List<String> header = new ArrayList<>();
// 获取最大列索引确保顺序正确
int maxColIndex = headMap.keySet().stream().mapToInt(Integer::intValue).max().orElse(-1);
for (int i = 0; i <= maxColIndex; i++) {
header.add(headMap.getOrDefault(i, "")); // 无数据的列填空
}
headerList.add(header);
}
/**
* 每解析一行数据触发
*/
@Override
public void invoke(ExcelTemplateVO data, AnalysisContext context) {
// 空行直接跳过
if (isRowEmpty(data)) {
return;
}
// 数据校验
validateData(data, context.readRowHolder().getRowIndex() + 1);
dataList.add(data);
}
/**
* 所有数据解析完成后触发
*/
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
// 解析完成后的数据处理
List<MdmModuleDbFiledsEntity> entities = processImportData(headerList, dataList, importExcelVO);
if (entities != null) {
resultEntities.addAll(entities);
}
}
})
.doRead(); // 执行读取操作
} catch (IOException e) {
throw new RuntimeException("文件读取失败:" + e.getMessage(), e);
}
return resultEntities;
}
private boolean isRowEmpty(ExcelTemplateVO data) {
if(data == null) {
return true;
}
return StringUtils.isEmpty(data.getChName() ) &&
StringUtils.isEmpty(data.getFiledType()) &&
StringUtils.isEmpty(data.getEnName()) ;
}
/**
* 导入数据新增字段
* @param headerList
* @param dataList
*/
private List<MdmModuleDbFiledsEntity> processImportData(List<List<String>> headerList, List<ExcelTemplateVO> dataList,ImportExcelVO importExcelVO) {
// 获取表头列名
List<String> headers = headerList.get(0);
// 数据库字段数据
List<MdmModuleDbFiledsEntity> entities = new ArrayList<>();
for (ExcelTemplateVO data : dataList) {
MdmModuleDbFiledsEntity entity = new MdmModuleDbFiledsEntity();
BeanUtils.copyProperties(data, entity);
// 字段规则数据集合
List<MdmModuleDbFiledsRuleEntity> rules = new ArrayList<>();
for (String header : headers) {
// 字段规则数据
MdmModuleDbFiledsRuleEntity rule = new MdmModuleDbFiledsRuleEntity();
rule.setRuleType("2");
rule.setFormName("optionRuleForm");
switch (header) {
case "显示名":
rule.setRuleName("显示名");
rule.setRuleCode("title");
rule.setRuleValue(data.getChName());
break;
case "宽度":
rule.setRuleName("宽度");
rule.setRuleCode("row");
rule.setRuleValue(data.getRow());
break;
case "单元格宽度":
rule.setRuleName("单元格宽度");
rule.setRuleCode("width");
rule.setRuleValue(data.getWidth());
break;
case "数据类型":
rule.setRuleName("数据类型");
rule.setRuleCode("type");
rule.setRuleValue(data.getType());
break;
case "必填":
rule.setRuleName("必填");
rule.setRuleCode("required");
rule.setRuleValue(data.getRequired() != null ? "true" : "false");
break;
case "禁止修改":
rule.setRuleName("禁止修改");
rule.setRuleCode("disabled");
rule.setRuleValue(data.getDisabled() != null ? "true" : "false");
break;
default:
continue;
}
rules.add(rule);
}
entity.setMdmModuleDbFiledsRules(rules);
entity.setDbName(importExcelVO.getDbName());
entity.setDbId(importExcelVO.getDbId());
entity.setDbType(importExcelVO.getDbType());
entity.setMdmId(importExcelVO.getMdmId());
entities.add(entity);
}
return entities;
}
/**
* 数据校验方法验证Excel导入的数据合法性
* @param data 导入的Excel数据对象
* @param rowNum 行号
*/
private void validateData(ExcelTemplateVO data, int rowNum) {
List<String> errors = new ArrayList<>();
// 1. 校验中文名称必填
if (StringUtils.isBlank(data.getChName())) {
errors.add("" + rowNum + "行:中文名称不能为空");
}
// 2. 校验字段类型合法性
if (StringUtils.isBlank(data.getFiledType())) {
errors.add("" + rowNum + "行:字段类型不能为空");
} else {
Set<String> validTypes = new HashSet<>(Arrays.asList("1", "2", "3", "4"));
if (!validTypes.contains(data.getFiledType())) {
errors.add("" + rowNum + "字段类型无效允许值为1(BIGINT)、2(DECIMAL)、3(VARCHAR)、4(DATETIME)");
}
}
// 3. 校验长度数字类型且当字段类型为123时必填
if (StringUtils.isNotBlank(data.getFiledType()) &&
(data.getFiledType().equals("1") || data.getFiledType().equals("2") || data.getFiledType().equals("3"))) {
if (StringUtils.isBlank(data.getFiledLength())) {
errors.add("" + rowNum + "行:字段长度不能为空");
} else if (!StringUtils.isNumeric(data.getFiledLength())) {
errors.add("" + rowNum + "行:字段长度必须为数字");
} else {
int length = Integer.parseInt(data.getFiledLength());
if (length <= 0) {
errors.add("" + rowNum + "字段长度必须大于0");
}
}
}
// 4. 校验系统主键标识合法性
if (StringUtils.isNotBlank(data.getIsSysPk()) &&
!"Y".equals(data.getIsSysPk()) && !"N".equals(data.getIsSysPk())) {
errors.add("" + rowNum + "是否系统主键只能为Y或N");
}
// 5. 校验系统数据编码标识合法性
if (StringUtils.isNotBlank(data.getIsSysCode()) &&
!"Y".equals(data.getIsSysCode()) && !"N".equals(data.getIsSysCode())) {
errors.add("" + rowNum + "是否系统数据编码只能为Y或N");
}
// 6. 校验系统数据名称标识合法性
if (StringUtils.isNotBlank(data.getIsSysName()) &&
!"Y".equals(data.getIsSysName()) && !"N".equals(data.getIsSysName())) {
errors.add("" + rowNum + "是否系统数据名称只能为Y或N");
}
// 7. 校验系统日期标识合法性
if (StringUtils.isNotBlank(data.getIsSysDate()) &&
!"Y".equals(data.getIsSysDate()) && !"N".equals(data.getIsSysDate())) {
errors.add("" + rowNum + "是否系统日期只能为Y或N");
}
// 8. 校验是否必填标识合法性
if (data.getRequired() != null && !data.getRequired().trim().isEmpty()) {
String required = data.getRequired().trim();
if (!"TRUE".equalsIgnoreCase(required) && !"FALSE".equalsIgnoreCase(required)) {
errors.add("" + rowNum + "是否必填只能为true或false");
}
}
// 9. 校验禁止修改标识合法性
if (data.getDisabled() != null && !data.getDisabled().trim().isEmpty()) {
String disabled = data.getDisabled().trim();
if (!"TRUE".equalsIgnoreCase(disabled) && !"FALSE".equalsIgnoreCase(disabled)) {
errors.add("" + rowNum + "禁止修改只能为true或false");
}
}
// 如果有错误抛出异常中断导入
if (!errors.isEmpty()) {
throw new ExcelDataValidateException(String.join("", errors));
}
}
// 自定义异常类
public class ExcelDataValidateException extends RuntimeException {
public ExcelDataValidateException(String message) {
super(message);
}
}
}

View File

@ -0,0 +1,56 @@
package com.hzya.frame.mdm.mdmModule.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ExcelTemplateVO {
@ExcelProperty(value = "中文名称", index = 0)
private String chName;
@ExcelProperty(value = "英文名称", index = 1)
private String enName;
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
@ExcelProperty(value = "字段类型", index = 2)
private String filedType;
@ExcelProperty(value = "长度", index = 3)
private String filedLength;
@ExcelProperty(value = "是否系统主键", index = 4)
private String isSysPk;// Y N
@ExcelProperty(value = "系统数据编码", index = 5)
private String isSysCode;// Y N
@ExcelProperty(value = "系统数据名称", index = 6)
private String isSysName;// Y N
@ExcelProperty(value = "系统日期", index = 7)
private String isSysDate; // Y N
@ExcelProperty(value = "显示名", index = 8)
private String title;
@ExcelProperty(value = "宽度", index = 9)
private String row;
@ExcelProperty(value = "单元格宽度", index = 10)
private String width;
@ExcelProperty(value = "数据类型",index = 11)
private String type;
@ExcelProperty(value= "必填",index = 12)
private String required; // true false
@ExcelProperty(value= "禁止修改",index = 13)
private String disabled; // true false
}

View File

@ -0,0 +1,23 @@
package com.hzya.frame.mdm.mdmModule.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.checkerframework.checker.units.qual.A;
import org.springframework.web.multipart.MultipartFile;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImportExcelVO {
/** 主数据模版ID */
private String dbName;
/** 主数据模版ID */
private String mdmId;
/** 模版数据库id */
private String dbId;
/** 类型 1、主表 2、明细 3、操作日志 4、下发日志 */
private String dbType;
// MultipartFile file;
}

View File

@ -27,7 +27,25 @@ public class MdmModuleDbEntity extends BaseEntity {
/** 数据类型 1、新增 2、修改 */
private String dataType;
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
/** 合并规则字段id使用逗号隔开 */
private String mergeRules;
private String mergeRulesStr;
public String getMergeRules() {
return mergeRules;
}
public void setMergeRules(String mergeRules) {
this.mergeRules = mergeRules;
}
public String getMergeRulesStr() {
return mergeRulesStr;
}
public void setMergeRulesStr(String mergeRulesStr) {
this.mergeRulesStr = mergeRulesStr;
}
public String getMdmId() {
return mdmId;

View File

@ -16,6 +16,7 @@
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="mergeRules" column="merge_rules" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="MdmModuleDbEntity_Base_Column_List">
@ -32,6 +33,7 @@
,sts
,org_id
,company_id
,merge_rules
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbEntity-result"
@ -53,6 +55,7 @@
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -77,6 +80,7 @@
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -107,6 +111,7 @@
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
<if test="mergeRules != null and mergeRules != ''">and merge_rules like concat('%',#{mergeRules},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -133,6 +138,7 @@
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
<if test="mergeRules != null and mergeRules != ''">or merge_rules = #{mergeRules}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -156,6 +162,7 @@
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="mergeRules != null and mergeRules != ''">merge_rules ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -173,6 +180,7 @@
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="mergeRules != null and mergeRules != ''">#{mergeRules} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
@ -180,10 +188,10 @@
<!-- 批量新增 -->
<insert id="entityInsertBatch">
insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id,
modify_time, sts, org_id, company_id, sts)
modify_time, sts, org_id, company_id, merge_rules, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.mergeRules},
'Y')
</foreach>
</insert>
@ -223,6 +231,7 @@
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
<if test="mergeRules != null and mergeRules != ''">merge_rules = #{mergeRules},</if>
</trim>
where id = #{id}
</update>
@ -244,6 +253,7 @@ where id = #{id}
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
and sts='Y'
</trim>
</update>

View File

@ -1,7 +1,10 @@
package com.hzya.frame.mdm.mdmModuleDbFileds.entity;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.excel.annotation.ExcelProperty;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.web.entity.BaseEntity;
@ -20,11 +23,14 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
/** 模版数据库id */
private String dbId;
/** 中文名 */
@ExcelProperty(value = "中文名称", index = 0)
private String chName;
/** 英文名 */
private String enName;
@ExcelProperty(value = "英文名称", index = 1)
private String enName;
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
private String filedType;
@ExcelProperty(value = "字段类型", index = 2)
private String filedType;
/** 显示类型:新增 */
private String addType;
/** 显示类型:修改 */
@ -33,12 +39,14 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
private String showType;
/** 显示类型:查询 */
private String queryType;
/** 显示类型:列表 */
private String listType;
/** 显示类型:显示 */
private String viewType;
/** 长度 */
private String filedLength;
@ExcelProperty(value = "长度", index = 3)
private String filedLength;
/** 公司id */
private String companyId;
/** 数据类型 1、新增 2、修改 */
@ -53,10 +61,30 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
* roletype
*/
private String roleValue;
private List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules;
private List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules;
//1查询2列表3新增4修改 5查看
private String fieldType;
/**
* 是否sys主键 系统主键三方系统主键同步中台之后该字段作为主键Y/N
*/
@ExcelProperty(value = "是否系统主键", index = 4)
private String isSysPk;
/**
* 是否sys编码 系统code三方系统code同步中台之后该字段作为codeY/N
*/
@ExcelProperty(value = "是否系统数据编码", index = 5)
private String isSysCode;
/**
* 是否sys名称 系统name三方系统name同步中台之后该字段作为nameY/N
*/
@ExcelProperty(value = "是否系统数据名称", index = 6)
private String isSysName;
/**
* 是否sys日期 系统date三方系统name同步中台之后该字段作为nameY/N
*/
@ExcelProperty(value = "是否系统日期", index = 7)
private String isSysDate;
public String getMdmId() {
return mdmId;
}
@ -216,5 +244,67 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
public void setDbType(String dbType) {
this.dbType = dbType;
}
public String getIsSysPk() {
return isSysPk;
}
public void setIsSysPk(String isSysPk) {
this.isSysPk = isSysPk;
}
public String getIsSysCode() {
return isSysCode;
}
public void setIsSysCode(String isSysCode) {
this.isSysCode = isSysCode;
}
public String getIsSysName() {
return isSysName;
}
public void setIsSysName(String isSysName) {
this.isSysName = isSysName;
}
public String getIsSysDate() {
return isSysDate;
}
public void setIsSysDate(String isSysDate) {
this.isSysDate = isSysDate;
}
/**
* 关联的表
*/
private MdmModuleDbEntity mdmModuleDbEntity;
public MdmModuleDbEntity getMdmModuleDbEntity() {
return mdmModuleDbEntity;
}
public void setMdmModuleDbEntity(MdmModuleDbEntity mdmModuleDbEntity) {
this.mdmModuleDbEntity = mdmModuleDbEntity;
}
/**
* 关联字段
*/
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
public List<MdmModuleDbFiledsEntity> getSublistMdmModuleDbFileds() {
return sublistMdmModuleDbFileds;
}
public void setSublistMdmModuleDbFileds(List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds) {
this.sublistMdmModuleDbFileds = sublistMdmModuleDbFileds;
}
}

View File

@ -2,33 +2,38 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.mdm.mdmModuleDbFileds.dao.impl.MdmModuleDbFiledsDaoImpl">
<resultMap id="get-MdmModuleDbFiledsEntity-result" type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
<result property="chName" column="ch_name" jdbcType="VARCHAR"/>
<result property="enName" column="en_name" jdbcType="VARCHAR"/>
<result property="filedType" column="filed_type" jdbcType="VARCHAR"/>
<result property="addType" column="add_type" jdbcType="VARCHAR"/>
<result property="updateType" column="update_type" jdbcType="VARCHAR"/>
<result property="showType" column="show_type" jdbcType="VARCHAR"/>
<result property="queryType" column="query_type" jdbcType="VARCHAR"/>
<result property="listType" column="list_type" jdbcType="VARCHAR"/>
<result property="viewType" column="view_type" jdbcType="VARCHAR"/>
<result property="filedLength" column="filed_length" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="get-MdmModuleDbFiledsEntity-result"
type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
<result property="chName" column="ch_name" jdbcType="VARCHAR"/>
<result property="enName" column="en_name" jdbcType="VARCHAR"/>
<result property="filedType" column="filed_type" jdbcType="VARCHAR"/>
<result property="addType" column="add_type" jdbcType="VARCHAR"/>
<result property="updateType" column="update_type" jdbcType="VARCHAR"/>
<result property="showType" column="show_type" jdbcType="VARCHAR"/>
<result property="queryType" column="query_type" jdbcType="VARCHAR"/>
<result property="listType" column="list_type" jdbcType="VARCHAR"/>
<result property="viewType" column="view_type" jdbcType="VARCHAR"/>
<result property="filedLength" column="filed_length" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="isSysPk" column="sys_pk" jdbcType="VARCHAR"/>
<result property="isSysCode" column="sys_code" jdbcType="VARCHAR"/>
<result property="isSysName" column="sys_name" jdbcType="VARCHAR"/>
<result property="isSysDate" column="sys_date" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "MdmModuleDbFiledsEntity_Base_Column_List">
<sql id="MdmModuleDbFiledsEntity_Base_Column_List">
id
,mdm_id
,mdm_id
,db_id
,ch_name
,en_name
@ -48,295 +53,357 @@
,sts
,org_id
,company_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
,sys_pk
,sys_code
,sys_name
,sys_date
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="isSysPk != null and isSysPk != ''">and sys_pk = #{isSysPk}</if>
<if test="isSysCode != null and isSysCode != ''">and sys_code = #{isSysCode}</if>
<if test="isSysName != null and isSysName != ''">and sys_name = #{isSysName}</if>
<if test="isSysDate != null and isSysDate != ''">and sys_date = #{isSysDate}</if>
<if test="roletype != null and roletype != ''">
and id in (
select
filed_id
from mdm_module_db_fileds_rule
where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue}
where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue}
)
</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select count(1) from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select count(1) from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="isSysPk != null and isSysPk != ''">and sys_pk = #{isSysPk}</if>
<if test="isSysCode != null and isSysCode != ''">and sys_code = #{isSysCode}</if>
<if test="isSysName != null and isSysName != ''">and sys_name = #{isSysName}</if>
<if test="isSysDate != null and isSysDate != ''">and sys_date = #{isSysDate}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
<if test="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </if>
<if test="chName != null and chName != ''"> and ch_name like concat('%',#{chName},'%') </if>
<if test="enName != null and enName != ''"> and en_name like concat('%',#{enName},'%') </if>
<if test="filedType != null and filedType != ''"> and filed_type like concat('%',#{filedType},'%') </if>
<if test="addType != null and addType != ''"> and add_type like concat('%',#{addType},'%') </if>
<if test="updateType != null and updateType != ''"> and update_type like concat('%',#{updateType},'%') </if>
<if test="showType != null and showType != ''"> and show_type like concat('%',#{showType},'%') </if>
<if test="queryType != null and queryType != ''"> and query_type like concat('%',#{queryType},'%') </if>
<if test="listType != null and listType != ''"> and list_type like concat('%',#{listType},'%') </if>
<if test="viewType != null and viewType != ''"> and view_type like concat('%',#{viewType},'%') </if>
<if test="filedLength != null and filedLength != ''"> and filed_length like concat('%',#{filedLength},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
<if test="dbId != null and dbId != ''">and db_id like concat('%',#{dbId},'%')</if>
<if test="chName != null and chName != ''">and ch_name like concat('%',#{chName},'%')</if>
<if test="enName != null and enName != ''">and en_name like concat('%',#{enName},'%')</if>
<if test="filedType != null and filedType != ''">and filed_type like concat('%',#{filedType},'%')</if>
<if test="addType != null and addType != ''">and add_type like concat('%',#{addType},'%')</if>
<if test="updateType != null and updateType != ''">and update_type like concat('%',#{updateType},'%')</if>
<if test="showType != null and showType != ''">and show_type like concat('%',#{showType},'%')</if>
<if test="queryType != null and queryType != ''">and query_type like concat('%',#{queryType},'%')</if>
<if test="listType != null and listType != ''">and list_type like concat('%',#{listType},'%')</if>
<if test="viewType != null and viewType != ''">and view_type like concat('%',#{viewType},'%')</if>
<if test="filedLength != null and filedLength != ''">and filed_length like concat('%',#{filedLength},'%')
</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
<if test="dbId != null and dbId != ''"> or db_id = #{dbId} </if>
<if test="chName != null and chName != ''"> or ch_name = #{chName} </if>
<if test="enName != null and enName != ''"> or en_name = #{enName} </if>
<if test="filedType != null and filedType != ''"> or filed_type = #{filedType} </if>
<if test="addType != null and addType != ''"> or add_type = #{addType} </if>
<if test="updateType != null and updateType != ''"> or update_type = #{updateType} </if>
<if test="showType != null and showType != ''"> or show_type = #{showType} </if>
<if test="queryType != null and queryType != ''"> or query_type = #{queryType} </if>
<if test="listType != null and listType != ''"> or list_type = #{listType} </if>
<if test="viewType != null and viewType != ''"> or view_type = #{viewType} </if>
<if test="filedLength != null and filedLength != ''"> or filed_length = #{filedLength} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
<if test="isSysPk != null and isSysPk != ''">and sys_pk like concat('%',#{isSysPk},'%')</if>
<if test="isSysCode != null and isSysCode != ''">and sys_code like concat('%',#{isSysCode},'%')</if>
<if test="isSysName != null and isSysName != ''">and sys_name like concat('%',#{isSysName},'%')</if>
<if test="isSysDate != null and isSysDate != ''">and sys_date like concat('%',#{isSysDate},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">or db_id = #{dbId}</if>
<if test="chName != null and chName != ''">or ch_name = #{chName}</if>
<if test="enName != null and enName != ''">or en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">or filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">or add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">or update_type = #{updateType}</if>
<if test="showType != null and showType != ''">or show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">or query_type = #{queryType}</if>
<if test="listType != null and listType != ''">or list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">or view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">or filed_length = #{filedLength}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
<if test="isSysPk != null and isSysPk != ''">or sys_pk = #{isSysPk}</if>
<if test="isSysCode != null and isSysCode != ''">or sys_code = #{isSysCode}</if>
<if test="isSysName != null and isSysName != ''">or sys_name = #{isSysName}</if>
<if test="isSysDate != null and isSysDate != ''">or sys_date = #{isSysDate}</if>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
insert into mdm_module_db_fileds(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
<if test="dbId != null and dbId != ''"> db_id , </if>
<if test="chName != null and chName != ''"> ch_name , </if>
<if test="enName != null and enName != ''"> en_name , </if>
<if test="filedType != null and filedType != ''"> filed_type , </if>
<if test="addType != null and addType != ''"> add_type , </if>
<if test="updateType != null and updateType != ''"> update_type , </if>
<if test="showType != null and showType != ''"> show_type , </if>
<if test="queryType != null and queryType != ''"> query_type , </if>
<if test="listType != null and listType != ''"> list_type , </if>
<if test="viewType != null and viewType != ''"> view_type , </if>
<if test="filedLength != null and filedLength != ''"> filed_length , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="companyId != null and companyId != ''"> company_id , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
<if test="dbId != null and dbId != ''"> #{dbId} ,</if>
<if test="chName != null and chName != ''"> #{chName} ,</if>
<if test="enName != null and enName != ''"> #{enName} ,</if>
<if test="filedType != null and filedType != ''"> #{filedType} ,</if>
<if test="addType != null and addType != ''"> #{addType} ,</if>
<if test="updateType != null and updateType != ''"> #{updateType} ,</if>
<if test="showType != null and showType != ''"> #{showType} ,</if>
<if test="queryType != null and queryType != ''"> #{queryType} ,</if>
<if test="listType != null and listType != ''"> #{listType} ,</if>
<if test="viewType != null and viewType != ''"> #{viewType} ,</if>
<if test="filedLength != null and filedLength != ''"> #{filedLength} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
db_id = values(db_id),
ch_name = values(ch_name),
en_name = values(en_name),
filed_type = values(filed_type),
add_type = values(add_type),
update_type = values(update_type),
show_type = values(show_type),
query_type = values(query_type),
list_type = values(list_type),
view_type = values(view_type),
filed_length = values(filed_length),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
update mdm_module_db_fileds set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</if>
<if test="chName != null and chName != ''"> ch_name = #{chName},</if>
<if test="enName != null and enName != ''"> en_name = #{enName},</if>
<if test="filedType != null and filedType != ''"> filed_type = #{filedType},</if>
<if test="addType != null and addType != ''"> add_type = #{addType},</if>
<if test="updateType != null and updateType != ''"> update_type = #{updateType},</if>
<if test="showType != null and showType != ''"> show_type = #{showType},</if>
<if test="queryType != null and queryType != ''"> query_type = #{queryType},</if>
<if test="listType != null and listType != ''"> list_type = #{listType},</if>
<if test="viewType != null and viewType != ''"> view_type = #{viewType},</if>
filed_length = #{filedLength},
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from mdm_module_db_fileds where id = #{id}
</delete>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
insert into mdm_module_db_fileds(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
<if test="dbId != null and dbId != ''">db_id ,</if>
<if test="chName != null and chName != ''">ch_name ,</if>
<if test="enName != null and enName != ''">en_name ,</if>
<if test="filedType != null and filedType != ''">filed_type ,</if>
<if test="addType != null and addType != ''">add_type ,</if>
<if test="updateType != null and updateType != ''">update_type ,</if>
<if test="showType != null and showType != ''">show_type ,</if>
<if test="queryType != null and queryType != ''">query_type ,</if>
<if test="listType != null and listType != ''">list_type ,</if>
<if test="viewType != null and viewType != ''">view_type ,</if>
<if test="filedLength != null and filedLength != ''">filed_length ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="isSysPk != null and isSysPk != ''">sys_pk ,</if>
<if test="isSysCode != null and isSysCode != ''">sys_code ,</if>
<if test="isSysName != null and isSysName != ''">sys_name ,</if>
<if test="isSysDate != null and isSysDate != ''">sys_date ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
<if test="dbId != null and dbId != ''">#{dbId} ,</if>
<if test="chName != null and chName != ''">#{chName} ,</if>
<if test="enName != null and enName != ''">#{enName} ,</if>
<if test="filedType != null and filedType != ''">#{filedType} ,</if>
<if test="addType != null and addType != ''">#{addType} ,</if>
<if test="updateType != null and updateType != ''">#{updateType} ,</if>
<if test="showType != null and showType != ''">#{showType} ,</if>
<if test="queryType != null and queryType != ''">#{queryType} ,</if>
<if test="listType != null and listType != ''">#{listType} ,</if>
<if test="viewType != null and viewType != ''">#{viewType} ,</if>
<if test="filedLength != null and filedLength != ''">#{filedLength} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="isSysPk != null and isSysPk != ''">#{isSysPk} ,</if>
<if test="isSysCode != null and isSysCode != ''">#{isSysCode} ,</if>
<if test="isSysName != null and isSysName != ''">#{isSysName} ,</if>
<if test="isSysDate != null and isSysDate != ''">#{isSysDate} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch">
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type,
query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts,
org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch">
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type,
query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts,
org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
db_id = values(db_id),
ch_name = values(ch_name),
en_name = values(en_name),
filed_type = values(filed_type),
add_type = values(add_type),
update_type = values(update_type),
show_type = values(show_type),
query_type = values(query_type),
list_type = values(list_type),
view_type = values(view_type),
filed_length = values(filed_length),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
update mdm_module_db_fileds set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
<if test="dbId != null and dbId != ''">db_id = #{dbId},</if>
<if test="chName != null and chName != ''">ch_name = #{chName},</if>
<if test="enName != null and enName != ''">en_name = #{enName},</if>
<if test="filedType != null and filedType != ''">filed_type = #{filedType},</if>
<if test="addType != null and addType != ''">add_type = #{addType},</if>
<if test="updateType != null and updateType != ''">update_type = #{updateType},</if>
<if test="showType != null and showType != ''">show_type = #{showType},</if>
<if test="queryType != null and queryType != ''">query_type = #{queryType},</if>
<if test="listType != null and listType != ''">list_type = #{listType},</if>
<if test="viewType != null and viewType != ''">view_type = #{viewType},</if>
filed_length = #{filedLength},
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
<if test="isSysPk != null and isSysPk != ''">sys_pk = #{isSysPk},</if>
<if test="isSysPk == null ">sys_pk = null,</if>
<if test="isSysCode != null and isSysCode != ''">sys_code = #{isSysCode},</if>
<if test="isSysCode == null ">sys_code = null,</if>
<if test="isSysName != null and isSysName != ''">sys_name = #{isSysName},</if>
<if test="isSysName == null ">sys_name = null,</if>
<if test="isSysDate != null and isSysDate != ''">sys_date = #{isSysDate},</if>
<if test="isSysDate == null ">sys_date = null,</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
update mdm_module_db_fileds
set sts= 'N',
modify_time = #{modify_time},
modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from mdm_module_db_fileds
where id = #{id}
</delete>
<!--通过mdmCode删除-->
<delete id="deleteMdmModuleDbFileds" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
delete from mdm_module_db_fileds where mdm_id = #{mdmId}
</delete>
delete
from mdm_module_db_fileds
where mdm_id = #{mdmId}
</delete>
</mapper>

View File

@ -3,7 +3,8 @@ package com.hzya.frame.mdm.mdmModuleDbFileds.service.impl;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
import com.hzya.frame.mdm.mdmModuleDbFileds.service.IMdmModuleDbFiledsService;
import org.springframework.stereotype.Service;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;

View File

@ -310,7 +310,12 @@
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
select count(1) from mdm_module_db_fileds_rule
<trim prefix="where" prefixOverrides="and">
<if test="mdmId != null and mdmId != ''">and mdm_id != #{mdmId}</if>
<!-- <if test="mdmId != null and mdmId != ''">and mdm_id != #{mdmId}</if>-->
<!-- <if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>-->
<!-- <if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>-->
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
and sts='Y'

View File

@ -30,13 +30,13 @@ import java.util.zip.ZipInputStream;
public class FileDownloadServiceImpl extends BaseService< FileDownloadEntity,Long> implements IFileDownloadService{
protected IFileDownloadDao filedownloadDao;
@Value("${savefile.path:}")
@Value("${savefile.path}")
public String DSK;
@Value("${savefile.pluginpath:}")
@Value("${savefile.pluginpath}")
public String PLUGINPATH;
@Value("${savefile.tomcatpath:}")
@Value("${savefile.tomcatpath}")
public String TOMCATPATH;
@Autowired
public void setFileDownloadDao(IFileDownloadDao dao) {

View File

@ -40,10 +40,10 @@ import java.util.zip.ZipFile;
*/
@Service(value = "sys_fileUploadService")
public class FileUploadServiceImpl extends BaseService<FileUploadEntity, Long> implements IFileUploadService {
@Value("${savefile.path:}")
@Value("${savefile.path}")
public String DSK;
@Value("${savefile.pluginpath:}")
@Value("${savefile.pluginpath}")
public String PLUGINPATH;
protected IFileUploadDao fileUploadDao;

View File

@ -178,11 +178,6 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
.flatMap(e1 -> e1.getValue().keySet().stream()
.map(dbname -> new AbstractMap.SimpleEntry<>(e1.getKey(), dbname)))
.collect(Collectors.toList());
// 按value升序排序
// List<Map.Entry<String, String>> sortedByValue = keyPairs.stream()
// .sorted(Map.Entry.comparingByValue())
// .collect(Collectors.toList());
// keyPairs 得值为键值对键是表名称值是类型避免多个子表得键一样比如mdm_customer:1,mdm_customer_bank:2,mdm_customer_option_log:2
for (Map.Entry<String, String> keyPair : keyPairs) {
//如果是1就是主表根据查询出来得主表是否是传输传递得主表

View File

@ -73,11 +73,11 @@
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-IntegrationTaskLivingDetailsEntity-result">
select
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List" />
from integration_task_living_details where id = #{ id } and sts='Y'
</select>
<!-- <select id="entity_get" resultMap="get-IntegrationTaskLivingDetailsEntity-result">-->
<!-- select-->
<!-- <include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List" />-->
<!-- from integration_task_living_details where id = #{ id } and sts='Y'-->
<!-- </select>-->
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-IntegrationTaskLivingDetailsEntity-result" parameterType = "com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">

View File

@ -65,11 +65,11 @@
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-u8c</artifactId>
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-u8c</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->

View File

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>kangarooDataCenterV3</artifactId>
<groupId>com.hzya.frame</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fw-u8c</artifactId>
<packaging>jar</packaging>
<version>${revision}</version>
<dependencies>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>base-service</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法为了解决Unable to find main class的问题 -->
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
<skip>true</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,19 +0,0 @@
package com.hzya.frame.u8c.Encapsulation.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity;
import java.util.List;
/**
* (bd_corp: table)表数据库访问层
*
* @author makejava
* @since 2023-09-06 14:47:17
*/
public interface IEncapsulationDao extends IBaseDao<EncapsulationEntity, String> {
List<EncapsulationEntity> queryCgrkddh(EncapsulationEntity encapsulationEntity);
}

View File

@ -1,30 +0,0 @@
package com.hzya.frame.u8c.Encapsulation.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.u8c.Encapsulation.dao.IEncapsulationDao;
import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* (BdCorp)表数据库访问层
*
* @author makejava
* @since 2023-09-06 14:47:17
*/
@Repository("encapsulationDaoImpl")
public class EncapsulationDaoImpl extends MybatisGenericDao<EncapsulationEntity, String> implements IEncapsulationDao {
@DS("#entity.dataSourceCode")
@Override
public List<EncapsulationEntity> queryCgrkddh(EncapsulationEntity entity) {
List<EncapsulationEntity> o = (List<EncapsulationEntity>) super.selectList(getSqlIdPrifx() + "queryCgrkddh", entity);
return o;
}
}

View File

@ -1,53 +0,0 @@
package com.hzya.frame.u8c.Encapsulation.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (BdCorp)实体类
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
public class EncapsulationEntity extends BaseEntity {
//单据号
private String code;
//来源单据类型
private String type;
//公司
private String unitcode;
//单据类型
private String cbilltypecode;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCbilltypecode() {
return cbilltypecode;
}
public void setCbilltypecode(String cbilltypecode) {
this.cbilltypecode = cbilltypecode;
}
public String getUnitcode() {
return unitcode;
}
public void setUnitcode(String unitcode) {
this.unitcode = unitcode;
}
}

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.u8c.Encapsulation.dao.impl.EncapsulationDaoImpl">
<select id="queryCgrkddh" resultType="com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity" parameterType = "com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity">
SELECT
h.vbillcode as code,
a.unitcode
FROM
ic_general_h h
LEFT JOIN bd_corp a on a.pk_corp = h.pk_corp
WHERE
h.cgeneralhid in (
SELECT cgeneralhid FROM ic_general_b WHERE vfirstbillcode = #{code}
<if test="type != null and type != ''"> and csourcetype = #{type} </if>
)
<if test="cbilltypecode != null and cbilltypecode != ''"> and h.cbilltypecode = #{cbilltypecode} </if>
</select>
</mapper>

View File

@ -1,104 +0,0 @@
package com.hzya.frame.u8c.Encapsulation.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity;
/**
* (BdCorp)表服务接口
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
public interface IEncapsulationService extends IBaseService<EncapsulationEntity, String> {
/**
* @Author lvleigang
* @Description 采购订单删除接口
* 0根据采购订单号查询入库单号,1库存采购入库单取消签字2库存采购入库单删除,3采购订单弃审,4采购订单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object purchaseOrderDelete(JSONObject jsonObject);
SysExtensionApiEntity addPurchaseOrderDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 采购入库单删除接口
* 1库存采购入库单取消签字2库存采购入库单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object purchaseWarehousingDelete(JSONObject jsonObject);
SysExtensionApiEntity addPurchaseWarehousingDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 销售订单删除接口
* 0根据销售钉订单号查询出销售出库单号1库存销售出库单取消签字,2库存销售出库单删除,3销售订单取消审批,4销售订单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object salesOrderDelete(JSONObject jsonObject);
SysExtensionApiEntity addSalesOrderDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 调拨订单删除接口
* 0根据调拨订单号查询调拨入库调拨出库单据1库存调拨出库取消签字 2库存调拨出库删除 3调拨入库取消签字 4调拨入库删除 5调拨订单弃审 6调拨订单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object transferOrderDelete(JSONObject jsonObject);
SysExtensionApiEntity addTransferOrderDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 产成品入库删除接口
* 1库存产成品入库单取消签字 2库存产成品入库单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object finishedProductsAreStoredDelete(JSONObject jsonObject);
SysExtensionApiEntity addFinishedProductsAreStoredDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 材料出库删除接口
* 1库存材料出库取消签字 2库存材料出库单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object materialDeliveryDelete(JSONObject jsonObject);
SysExtensionApiEntity addMaterialDeliveryDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 其他出库单删除接口
* 1库存其他出库取消签字 2库存其他出库删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object otherWarehouseOrdersDelete(JSONObject jsonObject);
SysExtensionApiEntity addOtherWarehouseOrdersDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 其他入库单删除接口
* 1库存其他入库单取消签字. 2库存其他入库删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object otherWarehouseReceiptDelete(JSONObject jsonObject);
SysExtensionApiEntity addOtherWarehouseReceiptDelete(SysExtensionApiEntity jsonObject);
}

View File

@ -1,22 +0,0 @@
package com.hzya.frame.u8c.Invmandoc.dao;
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (bd_invmandoc: table)表数据库访问层
*
* @author makejava
* @since 2023-08-25 11:21:43
*/
public interface IBdInvmandocDao extends IBaseDao<BdInvmandocEntity, String> {
/**
* 根据存货编码查询存货管理档案
*
* @author liuyang
*/
List<BdInvmandocEntity> queryBdInvmandocByInvcode(BdInvmandocEntity bdInvmandocEntity) throws Exception;
}

View File

@ -1,25 +0,0 @@
package com.hzya.frame.u8c.Invmandoc.dao.impl;
import cn.hutool.core.lang.Assert;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
import com.hzya.frame.u8c.Invmandoc.dao.IBdInvmandocDao;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* (BdInvmandoc)表数据库访问层
*
* @author makejava
* @since 2023-08-25 11:21:44
*/
@Repository("serviceBdInvmandocDaoImpl")
public class BdInvmandocDaoImpl extends MybatisGenericDao<BdInvmandocEntity, String> implements IBdInvmandocDao {
@DS("sowow_sqlserver_pro")
@Override
public List<BdInvmandocEntity> queryBdInvmandocByInvcode(BdInvmandocEntity bdInvmandocEntity) throws Exception {
return (List<BdInvmandocEntity>) selectList("com.hzya.frame.u8c.Invmandoc.dao.impl.BdInvmandocDaoImpl.queryBdInvmandocByInvcode", bdInvmandocEntity);
}
}

View File

@ -1,69 +0,0 @@
package com.hzya.frame.u8c.Invmandoc.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (BdInvmandoc)实体类-存货管理档案
*
* @author makejava
* @since 2023-08-25 11:21:44
*/
public class BdInvmandocEntity extends BaseEntity {
private String pkInvbasdoc;
private String pkInvmandoc;
/**
* 存货编码
*/
private String invcode;
private String pkCorp;
/**
* 助记码=商家编码
*/
private String invmnecode;
public String getPkCorp() {
return pkCorp;
}
public void setPkCorp(String pkCorp) {
this.pkCorp = pkCorp;
}
public String getPkInvbasdoc() {
return pkInvbasdoc;
}
public void setPkInvbasdoc(String pkInvbasdoc) {
this.pkInvbasdoc = pkInvbasdoc;
}
public String getPkInvmandoc() {
return pkInvmandoc;
}
public void setPkInvmandoc(String pkInvmandoc) {
this.pkInvmandoc = pkInvmandoc;
}
public String getInvcode() {
return invcode;
}
public void setInvcode(String invcode) {
this.invcode = invcode;
}
public String getInvmnecode() {
return invmnecode;
}
public void setInvmnecode(String invmnecode) {
this.invmnecode = invmnecode;
}
}

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.u8c.Invmandoc.dao.impl.BdInvmandocDaoImpl">
<resultMap id="get-BdInvmandocEntity-result" type="com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity" >
<result property="abctype" column="abctype" jdbcType="VARCHAR"/>
<result property="pkInvbasdoc" column="pk_invbasdoc" jdbcType="VARCHAR"/>
<result property="pkInvmandoc" column="pk_invmandoc" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "BdInvmandocEntity_Base_Column_List">
pk_invbasdoc
,pk_invmandoc
</sql>
<select id="queryBdInvmandocByInvcode" parameterType="com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity" resultMap="get-BdInvmandocEntity-result">
select pk_invbasdoc
,pk_invmandoc
from bd_invmandoc where pk_invbasdoc in (
select pk_invbasdoc from bd_invbasdoc bib
where bib.dr = 0
<if test="invcode!=null and invcode!=''">
and bib.invcode = #{invcode}
</if>
<if test="invmnecode!=null and invmnecode!=''">
and bib.invmnecode = #{invmnecode}
</if>
) and dr = 0 and pk_corp = #{pkCorp}
</select>
</mapper>

View File

@ -1,13 +0,0 @@
package com.hzya.frame.u8c.Invmandoc.service;
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (BdInvmandoc)表服务接口
*
* @author makejava
* @since 2023-08-25 11:21:44
*/
public interface IBdInvmandocService extends IBaseService<BdInvmandocEntity, String> {
}

View File

@ -1,29 +0,0 @@
package com.hzya.frame.u8c.Invmandoc.service.impl;
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
import com.hzya.frame.u8c.Invmandoc.dao.IBdInvmandocDao;
import com.hzya.frame.u8c.Invmandoc.service.IBdInvmandocService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* (BdInvmandoc)表服务实现类
*
* @author makejava
* @since 2023-08-25 11:21:44
*/
@Service("serviceBdInvmandocService")
public class BdInvmandocServiceImpl extends BaseService<BdInvmandocEntity, String> implements IBdInvmandocService {
private IBdInvmandocDao bdInvmandocDao;
@Autowired
public void setBdInvmandocDao(IBdInvmandocDao dao) {
this.bdInvmandocDao = dao;
this.dao = dao;
}
}

View File

@ -1,24 +0,0 @@
package com.hzya.frame.u8c.ax.dao;
import com.hzya.frame.u8c.ax.entity.ArchivesEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (bd_corp: table)表数据库访问层
*
* @author makejava
* @since 2023-09-06 14:47:17
*/
public interface IAxDao extends IBaseDao<ArchivesEntity, String> {
List<ArchivesEntity> queryArchivesData(ArchivesEntity archivesEntity);
ArchivesEntity saveArchivesByType(ArchivesEntity archivesEntity);
Integer updateArchivesByType(ArchivesEntity archivesEntity);
Integer deleteArchivesByType(ArchivesEntity archivesEntity);
}

View File

@ -1,42 +0,0 @@
package com.hzya.frame.u8c.ax.dao.impl;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
import com.hzya.frame.u8c.ax.dao.IAxDao;
import com.hzya.frame.u8c.ax.entity.ArchivesEntity;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (BdCorp)表数据库访问层
*
* @author makejava
* @since 2023-09-06 14:47:17
*/
@Repository("axDaoImpl")
public class AxDaoImpl extends MybatisGenericDao<ArchivesEntity, String> implements IAxDao {
@Override
public List<ArchivesEntity> queryArchivesData(ArchivesEntity entity) {
List<ArchivesEntity> o = super.query(getSqlIdPrifx() + "queryArchivesData", entity);
return o;
}
@Override
public ArchivesEntity saveArchivesByType(ArchivesEntity entity) {
entity = super.save(getSqlIdPrifx() + "saveArchivesByType", entity);
return entity;
}
@Override
public Integer updateArchivesByType(ArchivesEntity entity) {
Integer o = super.update(getSqlIdPrifx() + "updateArchivesByType", entity);
return o;
}
@Override
public Integer deleteArchivesByType(ArchivesEntity entity) {
Integer o = super.update(getSqlIdPrifx() + "deleteArchivesByType", entity);
return o;
}
}

View File

@ -1,188 +0,0 @@
package com.hzya.frame.u8c.ax.entity;
import cn.dev33.satoken.stp.StpUtil;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseEntity;
import java.util.Date;
/**
* (BdCorp)实体类
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
public class ArchivesEntity extends BaseEntity {
private String archivesType;//类型
private String leftCode;//左编码
private String rightCode;//右编码
private String leftAppId;//左应用id
private String leftAppCode;//左应用编码
private String leftAppName;//左应用名称
private String leftApiId;//左接口ID
private String leftId;//左id
private String leftName;//左名称
private String rightAppId;//右应用id
private String rightAppCode;//右应用编码
private String rightAppName;//右应用名称
private String rightApiId;//右接口ID
private String rightId;//右id
private String rightName;//右名称
private String leftOrg;//左公司
private String rightOrg;//右公司
public String getArchivesType() {
return archivesType;
}
public void setArchivesType(String archivesType) {
this.archivesType = archivesType;
}
public String getLeftCode() {
return leftCode;
}
public void setLeftCode(String leftCode) {
this.leftCode = leftCode;
}
public String getRightCode() {
return rightCode;
}
public void setRightCode(String rightCode) {
this.rightCode = rightCode;
}
public String getLeftAppId() {
return leftAppId;
}
public void setLeftAppId(String leftAppId) {
this.leftAppId = leftAppId;
}
public String getLeftAppCode() {
return leftAppCode;
}
public void setLeftAppCode(String leftAppCode) {
this.leftAppCode = leftAppCode;
}
public String getLeftAppName() {
return leftAppName;
}
public void setLeftAppName(String leftAppName) {
this.leftAppName = leftAppName;
}
public String getLeftApiId() {
return leftApiId;
}
public void setLeftApiId(String leftApiId) {
this.leftApiId = leftApiId;
}
public String getLeftId() {
return leftId;
}
public void setLeftId(String leftId) {
this.leftId = leftId;
}
public String getLeftName() {
return leftName;
}
public void setLeftName(String leftName) {
this.leftName = leftName;
}
public String getRightAppId() {
return rightAppId;
}
public void setRightAppId(String rightAppId) {
this.rightAppId = rightAppId;
}
public String getRightAppCode() {
return rightAppCode;
}
public void setRightAppCode(String rightAppCode) {
this.rightAppCode = rightAppCode;
}
public String getRightAppName() {
return rightAppName;
}
public void setRightAppName(String rightAppName) {
this.rightAppName = rightAppName;
}
public String getRightApiId() {
return rightApiId;
}
public void setRightApiId(String rightApiId) {
this.rightApiId = rightApiId;
}
public String getRightId() {
return rightId;
}
public void setRightId(String rightId) {
this.rightId = rightId;
}
public String getRightName() {
return rightName;
}
public void setRightName(String rightName) {
this.rightName = rightName;
}
public String getLeftOrg() {
return leftOrg;
}
public void setLeftOrg(String leftOrg) {
this.leftOrg = leftOrg;
}
public String getRightOrg() {
return rightOrg;
}
public void setRightOrg(String rightOrg) {
this.rightOrg = rightOrg;
}
public void setCreate() {
this.setId(UUIDUtils.getUUID());
this.setSts("Y");
this.setCreate_user_id("1");
this.setModify_user_id("1");
this.setCreate_time(new Date());
this.setModify_time(new Date());
this.setOrg_id("0");
this.setCompanyId("0");
}
//修改信息
public void setUpdate() {
this.setModify_user_id("1");
this.setModify_time(new Date());
}
}

View File

@ -1,207 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.u8c.ax.dao.impl.AxDaoImpl">
<resultMap id="get-ArchivesEntity-result" type="com.hzya.frame.u8c.ax.entity.ArchivesEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="leftAppId" column="left_app_id" jdbcType="VARCHAR"/>
<result property="leftAppCode" column="left_app_code" jdbcType="VARCHAR"/>
<result property="leftAppName" column="left_app_name" jdbcType="VARCHAR"/>
<result property="leftApiId" column="left_api_id" jdbcType="VARCHAR"/>
<result property="leftId" column="left_id" jdbcType="VARCHAR"/>
<result property="leftCode" column="left_code" jdbcType="VARCHAR"/>
<result property="leftName" column="left_name" jdbcType="VARCHAR"/>
<result property="rightAppId" column="right_app_id" jdbcType="VARCHAR"/>
<result property="rightAppCode" column="right_app_code" jdbcType="VARCHAR"/>
<result property="rightAppName" column="right_app_name" jdbcType="VARCHAR"/>
<result property="rightApiId" column="right_api_id" jdbcType="VARCHAR"/>
<result property="rightId" column="right_id" jdbcType="VARCHAR"/>
<result property="rightCode" column="right_code" jdbcType="VARCHAR"/>
<result property="rightName" column="right_name" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<select id="queryArchivesData" resultMap="get-ArchivesEntity-result"
parameterType="com.hzya.frame.u8c.ax.entity.ArchivesEntity">
select
right_code
from
<choose>
<when test="archivesType == '1'.toString()"> sys_personnel_control </when>
<when test="archivesType == '2'.toString()"> sys_org_control </when>
<when test="archivesType == '6'.toString()"> sys_stock_control </when>
<when test="archivesType == '73'.toString()"> sys_merchant_control </when>
<when test="archivesType == 'D01'.toString()"> sys_taxrate_control </when>
<when test="archivesType == 'jobass'.toString()"> sys_project_control </when>
<when test="archivesType == '93'.toString()"> sys_bank_control </when>
<when test="archivesType == '96'.toString()"> sys_bankaccount_control </when>
<when test="archivesType == '22'.toString()"> sys_assets_control </when>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="leftCode != null and leftCode != ''">and left_code = #{leftCode}</if>
<if test="leftOrg != null and leftOrg != ''">and left_org = #{leftOrg}</if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="saveArchivesByType" parameterType = "com.hzya.frame.u8c.ax.entity.ArchivesEntity">
insert into
<choose>
<when test="archivesType == '1'.toString()"> sys_personnel_control </when>
<when test="archivesType == '2'.toString()"> sys_org_control </when>
<when test="archivesType == '6'.toString()"> sys_stock_control </when>
<when test="archivesType == '73'.toString()"> sys_merchant_control </when>
<when test="archivesType == 'D01'.toString()"> sys_taxrate_control </when>
<when test="archivesType == 'jobass'.toString()"> sys_project_control </when>
<when test="archivesType == '93'.toString()"> sys_bank_control </when>
<when test="archivesType == '96'.toString()"> sys_bankaccount_control </when>
<when test="archivesType == '22'.toString()"> sys_assets_control </when>
</choose>
(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="leftAppId != null and leftAppId != ''"> left_app_id , </if>
<if test="leftAppCode != null and leftAppCode != ''"> left_app_code , </if>
<if test="leftAppName != null and leftAppName != ''"> left_app_name , </if>
<if test="leftApiId != null and leftApiId != ''"> left_api_id , </if>
<if test="leftId != null and leftId != ''"> left_id , </if>
<if test="leftCode != null and leftCode != ''"> left_code , </if>
<if test="leftName != null and leftName != ''"> left_name , </if>
<if test="rightAppId != null and rightAppId != ''"> right_app_id , </if>
<if test="rightAppCode != null and rightAppCode != ''"> right_app_code , </if>
<if test="rightAppName != null and rightAppName != ''"> right_app_name , </if>
<if test="rightApiId != null and rightApiId != ''"> right_api_id , </if>
<if test="rightId != null and rightId != ''"> right_id , </if>
<if test="rightCode != null and rightCode != ''"> right_code , </if>
<if test="rightName != null and rightName != ''"> right_name , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="companyId != null and companyId != ''"> company_id , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="leftAppId != null and leftAppId != ''"> #{leftAppId} ,</if>
<if test="leftAppCode != null and leftAppCode != ''"> #{leftAppCode} ,</if>
<if test="leftAppName != null and leftAppName != ''"> #{leftAppName} ,</if>
<if test="leftApiId != null and leftApiId != ''"> #{leftApiId} ,</if>
<if test="leftId != null and leftId != ''"> #{leftId} ,</if>
<if test="leftCode != null and leftCode != ''"> #{leftCode} ,</if>
<if test="leftName != null and leftName != ''"> #{leftName} ,</if>
<if test="rightAppId != null and rightAppId != ''"> #{rightAppId} ,</if>
<if test="rightAppCode != null and rightAppCode != ''"> #{rightAppCode} ,</if>
<if test="rightAppName != null and rightAppName != ''"> #{rightAppName} ,</if>
<if test="rightApiId != null and rightApiId != ''"> #{rightApiId} ,</if>
<if test="rightId != null and rightId != ''"> #{rightId} ,</if>
<if test="rightCode != null and rightCode != ''"> #{rightCode} ,</if>
<if test="rightName != null and rightName != ''"> #{rightName} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!--通过主键修改方法-->
<update id="updateArchivesByType" parameterType = "com.hzya.frame.u8c.ax.entity.ArchivesEntity" >
update
<choose>
<when test="archivesType == '1'.toString()"> sys_personnel_control </when>
<when test="archivesType == '2'.toString()"> sys_org_control </when>
<when test="archivesType == '6'.toString()"> sys_stock_control </when>
<when test="archivesType == '73'.toString()"> sys_merchant_control </when>
<when test="archivesType == 'D01'.toString()"> sys_taxrate_control </when>
<when test="archivesType == 'jobass'.toString()"> sys_project_control </when>
<when test="archivesType == '93'.toString()"> sys_bank_control </when>
<when test="archivesType == '96'.toString()"> sys_bankaccount_control </when>
<when test="archivesType == '22'.toString()"> sys_assets_control </when>
</choose>
set
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id = #{id},</if>
<if test="leftAppId != null and leftAppId != ''"> left_app_id = #{leftAppId},</if>
<if test="leftAppCode != null and leftAppCode != ''"> left_app_code = #{leftAppCode},</if>
<if test="leftAppName != null and leftAppName != ''"> left_app_name = #{leftAppName},</if>
<if test="leftApiId != null and leftApiId != ''"> left_api_id = #{leftApiId},</if>
<if test="leftId != null and leftId != ''"> left_id = #{leftId},</if>
<if test="leftCode != null and leftCode != ''"> left_code = #{leftCode},</if>
<if test="leftName != null and leftName != ''"> left_name = #{leftName},</if>
<if test="rightAppId != null and rightAppId != ''"> right_app_id = #{rightAppId},</if>
<if test="rightAppCode != null and rightAppCode != ''"> right_app_code = #{rightAppCode},</if>
<if test="rightAppName != null and rightAppName != ''"> right_app_name = #{rightAppName},</if>
<if test="rightApiId != null and rightApiId != ''"> right_api_id = #{rightApiId},</if>
<if test="rightId != null and rightId != ''"> right_id = #{rightId},</if>
<if test="rightCode != null and rightCode != ''"> right_code = #{rightCode},</if>
<if test="rightName != null and rightName != ''"> right_name = #{rightName},</if>
<if test="sorts != null"> sorts = #{sorts},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
</trim>
where right_id = #{rightId}
</update>
<!-- 多条件逻辑删除 -->
<update id="deleteArchivesByType" parameterType = "com.hzya.frame.u8c.ax.entity.ArchivesEntity" >
update
<choose>
<when test="archivesType == '1'.toString()"> sys_personnel_control </when>
<when test="archivesType == '2'.toString()"> sys_org_control </when>
<when test="archivesType == '6'.toString()"> sys_stock_control </when>
<when test="archivesType == '73'.toString()"> sys_merchant_control </when>
<when test="archivesType == 'D01'.toString()"> sys_taxrate_control </when>
<when test="archivesType == 'jobass'.toString()"> sys_project_control </when>
<when test="archivesType == '93'.toString()"> sys_bank_control </when>
<when test="archivesType == '96'.toString()"> sys_bankaccount_control </when>
<when test="archivesType == '22'.toString()"> sys_assets_control </when>
</choose>
set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="leftAppId != null and leftAppId != ''"> and left_app_id = #{leftAppId} </if>
<if test="leftAppCode != null and leftAppCode != ''"> and left_app_code = #{leftAppCode} </if>
<if test="leftAppName != null and leftAppName != ''"> and left_app_name = #{leftAppName} </if>
<if test="leftApiId != null and leftApiId != ''"> and left_api_id = #{leftApiId} </if>
<if test="leftId != null and leftId != ''"> and left_id = #{leftId} </if>
<if test="leftCode != null and leftCode != ''"> and left_code = #{leftCode} </if>
<if test="leftName != null and leftName != ''"> and left_name = #{leftName} </if>
<if test="rightAppId != null and rightAppId != ''"> and right_app_id = #{rightAppId} </if>
<if test="rightAppCode != null and rightAppCode != ''"> and right_app_code = #{rightAppCode} </if>
<if test="rightAppName != null and rightAppName != ''"> and right_app_name = #{rightAppName} </if>
<if test="rightApiId != null and rightApiId != ''"> and right_api_id = #{rightApiId} </if>
<if test="rightId != null and rightId != ''"> and right_id = #{rightId} </if>
<if test="rightCode != null and rightCode != ''"> and right_code = #{rightCode} </if>
<if test="rightName != null and rightName != ''"> and right_name = #{rightName} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
and sts='Y'
</trim>
</update>
</mapper>

View File

@ -1,24 +0,0 @@
package com.hzya.frame.u8c.ax.entity;
public class Ass {
private String checktypecode;
private String checkvaluecode;
public String getChecktypecode() {
return checktypecode;
}
public void setChecktypecode(String checktypecode) {
this.checktypecode = checktypecode;
}
public String getCheckvaluecode() {
return checkvaluecode;
}
public void setCheckvaluecode(String checkvaluecode) {
this.checkvaluecode = checkvaluecode;
}
}

View File

@ -1,23 +0,0 @@
package com.hzya.frame.u8c.ax.entity;
public class Cashflow {
private String money;
private String pk_cashflow;
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
public String getPk_cashflow() {
return pk_cashflow;
}
public void setPk_cashflow(String pk_cashflow) {
this.pk_cashflow = pk_cashflow;
}
}

View File

@ -1,69 +0,0 @@
package com.hzya.frame.u8c.ax.entity;
import java.util.List;
public class Voucher {
private List<VoucherDetails> details;
private String no;
private String pk_corp;
private String pk_glorgbook;
private String pk_prepared;
private String pk_vouchertype;
private String pk_voucher;
public List<VoucherDetails> getDetails() {
return details;
}
public void setDetails(List<VoucherDetails> details) {
this.details = details;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getPk_corp() {
return pk_corp;
}
public void setPk_corp(String pk_corp) {
this.pk_corp = pk_corp;
}
public String getPk_glorgbook() {
return pk_glorgbook;
}
public void setPk_glorgbook(String pk_glorgbook) {
this.pk_glorgbook = pk_glorgbook;
}
public String getPk_prepared() {
return pk_prepared;
}
public void setPk_prepared(String pk_prepared) {
this.pk_prepared = pk_prepared;
}
public String getPk_vouchertype() {
return pk_vouchertype;
}
public void setPk_vouchertype(String pk_vouchertype) {
this.pk_vouchertype = pk_vouchertype;
}
public String getPk_voucher() {
return pk_voucher;
}
public void setPk_voucher(String pk_voucher) {
this.pk_voucher = pk_voucher;
}
}

View File

@ -1,105 +0,0 @@
package com.hzya.frame.u8c.ax.entity;
import java.util.List;
public class VoucherDetails {
private List<Ass> ass;
private List<Cashflow> cashflow;
private String creditamount;
private String debitamount;
private String explanation;
private String localcreditamount;
private String localdebitamount;
private String pk_accsubj;
private String pk_currtype;
private String debitquantity;
private String price;
public String getDebitquantity() {
return debitquantity;
}
public void setDebitquantity(String debitquantity) {
this.debitquantity = debitquantity;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public List<Ass> getAss() {
return ass;
}
public void setAss(List<Ass> ass) {
this.ass = ass;
}
public List<Cashflow> getCashflow() {
return cashflow;
}
public void setCashflow(List<Cashflow> cashflow) {
this.cashflow = cashflow;
}
public String getCreditamount() {
return creditamount;
}
public void setCreditamount(String creditamount) {
this.creditamount = creditamount;
}
public String getDebitamount() {
return debitamount;
}
public void setDebitamount(String debitamount) {
this.debitamount = debitamount;
}
public String getExplanation() {
return explanation;
}
public void setExplanation(String explanation) {
this.explanation = explanation;
}
public String getLocalcreditamount() {
return localcreditamount;
}
public void setLocalcreditamount(String localcreditamount) {
this.localcreditamount = localcreditamount;
}
public String getLocaldebitamount() {
return localdebitamount;
}
public void setLocaldebitamount(String localdebitamount) {
this.localdebitamount = localdebitamount;
}
public String getPk_accsubj() {
return pk_accsubj;
}
public void setPk_accsubj(String pk_accsubj) {
this.pk_accsubj = pk_accsubj;
}
public String getPk_currtype() {
return pk_currtype;
}
public void setPk_currtype(String pk_currtype) {
this.pk_currtype = pk_currtype;
}
}

View File

@ -1,14 +0,0 @@
package com.hzya.frame.u8c.ax.entity;
import java.util.List;
public class VoucherRoot {
private List<Voucher> voucher;
public List<Voucher> getVoucher() {
return voucher;
}
public void setVoucher(List<Voucher> voucher) {
this.voucher = voucher;
}
}

View File

@ -1,41 +0,0 @@
package com.hzya.frame.u8c.ax.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.u8c.ax.entity.ArchivesEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface IAxService extends IBaseService<ArchivesEntity, String>{
/**
* @Author lvleigang
* @Description 凭证新增
* @Date 3:42 下午 2024/4/24
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
Object thirdInterfaceVoucherInsert(JSONObject object);
/**
* @Author lvleigang
* @Description 档案新增
* @Date 3:42 下午 2024/4/24
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
Object thirdInterfaceArchivesInsert(JSONObject object);
/**
* @Author lvleigang
* @Description 档案修改
* @Date 3:42 下午 2024/4/24
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
Object thirdInterfaceArchivesUpdate(JSONObject object);
/**
* @Author lvleigang
* @Description 档案删除
* @Date 3:42 下午 2024/4/24
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
Object thirdInterfaceArchivesDelete(JSONObject object);
}

View File

@ -1,836 +0,0 @@
package com.hzya.frame.u8c.ax.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.u8c.ax.dao.IAxDao;
import com.hzya.frame.u8c.ax.entity.*;
import com.hzya.frame.u8c.ax.service.IAxService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
/**
* (BdCorp)表服务实现类
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
@Service("axServiceImpl")
public class AxServiceImpl extends BaseService<ArchivesEntity, String> implements IAxService {
private IAxDao axDao;
@Autowired
public void setAxDao(IAxDao dao) {
this.axDao = dao;
this.dao = dao;
}
@Value("${zt.url}")
private String voucherUrl;
private final String publicKey = "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj";
private final String secretKey = "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=";
private final String appId = "800016";
private final String pzApiCodexz = "8000160014";//凭证新增
private final String pzApiCodexg = "8000160031";//凭证修改
private final String pzApiCodesc = "8000160033";//凭证删除
private final String pzApiCodezf = "8000160032";//凭证作废
private final String ryApiCodexz = "8000160029";//人员对照新增
private final String ryApiCodexg = "8000160029";//人员对照修改
private final String ryApiCodesc = "8000160030";//人员对照删除
private final String bmApiCodexz = "8000160015";//部门档案新增
private final String bmApiCodexg = "8000160016";//部门档案修改
private final String bmApiCodesc = "8000160017";//部门档案删除
private final String chApiCodexz = "8000160025";//存货对照新增
private final String chApiCodexg = "8000160026";//存货对照修改
private final String chApiCodesc = "8000160027";//存货对照删除
private final String ksApiCodexz = "8000160018";//客商辅助核算新增
private final String ksApiCodexg = "8000160019";//客商辅助核算修改
private final String ksApiCodesc = "8000160020";//客商辅助核算删除
private final String slApiCodexz = "8000160014";//税率新增
private final String slApiCodexg = "8000160014";//税率修改
private final String slApiCodesc = "8000160014";//税率删除
private final String xmApiCodexz = "8000160021";//项目辅助核算新增
private final String xmApiCodexg = "8000160022";//项目辅助核算修改
private final String xmApiCodesc = "8000160023";//项目辅助核算删除
private final String yhlbApiCodexz = "8000160014";//银行类别新增
private final String yhlbApiCodexg = "8000160014";//银行类别修改
private final String yhlbApiCodesc = "8000160014";//银行类别删除
private final String yhzhApiCodexz = "8000160014";//银行账户新增
private final String yhzhApiCodexg = "8000160014";//银行账户修改
private final String yhzhApiCodesc = "8000160014";//银行账户删除
private final String zcApiCodexz = "8000160014";//资产类别新增
private final String zcApiCodexg = "8000160014";//资产类别修改
private final String zcApiCodesc = "8000160014";//资产类别删除
private final Object lock = new Object();
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 凭证新增
* @Date 3:42 下午 2024/4/24
**/
@Override
public Object thirdInterfaceVoucherInsert(JSONObject object) {
JSONObject jsonObject = object.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
}
if (!checkStr(jsonObject.getString("voucherType"))) {
return BaseResult.getFailureMessageEntity("voucherType为空");
}
if (!checkStr(jsonObject.getString("usercode"))) {
return BaseResult.getFailureMessageEntity("usercode为空");
}
if (!checkStr(jsonObject.getString("password"))) {
return BaseResult.getFailureMessageEntity("password为空");
}
if (!checkStr(jsonObject.getString("trantype"))) {
return BaseResult.getFailureMessageEntity("trantype为空");
}
if (!checkStr(jsonObject.getString("system"))) {
return BaseResult.getFailureMessageEntity("system为空");
}
if (!checkStr(jsonObject.getString("data"))) {
return BaseResult.getFailureMessageEntity("data为空");
}
String bodys = jsonObject.getString("data");
List<String> fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01", "jobass", "93", "96", "22"});
switch (jsonObject.getString("voucherType")) {
case "add"://新增
VoucherRoot entity1 = getData("data", jsonObject, VoucherRoot.class);
if (entity1 == null || entity1.getVoucher() == null || entity1.getVoucher().size() == 0) {
return BaseResult.getFailureMessageEntity("data为空");
}
for (int i = 0; i < entity1.getVoucher().size(); i++) {
Voucher voucher = entity1.getVoucher().get(i);
if (voucher.getDetails() != null && voucher.getDetails().size() > 0) {
for (int a = 0; a < voucher.getDetails().size(); a++) {
VoucherDetails voucherDetails = voucher.getDetails().get(a);
if (voucherDetails.getAss() != null && voucherDetails.getAss().size() > 0) {
for (int b = 0; b < voucherDetails.getAss().size(); b++) {
Ass ass = voucherDetails.getAss().get(b);
if (ass.getChecktypecode() != null && !"".equals(ass.getChecktypecode())) {
//存在需要转换的
if (fzhs.contains(ass.getChecktypecode())) {
ArchivesEntity archivesEntity = new ArchivesEntity();
archivesEntity.setArchivesType(ass.getChecktypecode());
archivesEntity.setLeftCode(ass.getCheckvaluecode());
archivesEntity.setLeftOrg(voucher.getPk_corp());
List<ArchivesEntity> archivesEntities = axDao.queryArchivesData(archivesEntity);
if (archivesEntities != null && archivesEntities.size() > 0) {
ass.setCheckvaluecode(archivesEntities.get(0).getRightCode());
}
}
}
}
}
}
}
}
bodys = JSON.toJSONString(entity1);
break;
case "update"://修改
VoucherRoot entity = getData("data", jsonObject, VoucherRoot.class);
if (entity == null || entity.getVoucher() == null || entity.getVoucher().size() == 0) {
return BaseResult.getFailureMessageEntity("data为空");
}
for (int i = 0; i < entity.getVoucher().size(); i++) {
Voucher voucher = entity.getVoucher().get(i);
if (voucher.getDetails() != null && voucher.getDetails().size() > 0) {
for (int a = 0; a < voucher.getDetails().size(); a++) {
VoucherDetails voucherDetails = voucher.getDetails().get(a);
if (voucherDetails.getAss() != null && voucherDetails.getAss().size() > 0) {
for (int b = 0; b < voucherDetails.getAss().size(); b++) {
Ass ass = voucherDetails.getAss().get(b);
if (ass.getChecktypecode() != null && !"".equals(ass.getChecktypecode())) {
//存在需要转换的
if (fzhs.contains(ass.getChecktypecode())) {
ArchivesEntity archivesEntity = new ArchivesEntity();
archivesEntity.setArchivesType(ass.getChecktypecode());
archivesEntity.setLeftCode(ass.getCheckvaluecode());
archivesEntity.setLeftOrg(voucher.getPk_corp());
List<ArchivesEntity> archivesEntities = axDao.queryArchivesData(archivesEntity);
if (archivesEntities != null && archivesEntities.size() > 0) {
ass.setCheckvaluecode(archivesEntities.get(0).getRightCode());
}
}
}
}
}
}
}
}
bodys = JSON.toJSONString(entity);
break;
case "delete"://删除
break;
case "cancellation"://作废
break;
default:
break;
}
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
// HttpClient
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
HttpPost post = new HttpPost(voucherUrl);
CloseableHttpResponse response = null;
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
post.setConfig(requestConfig);//设置请求参数超时时间
post.setHeader("usercode", jsonObject.getString("usercode"));
post.setHeader("password", jsonObject.getString("password"));
post.setHeader("trantype", jsonObject.getString("trantype"));
post.setHeader("system", jsonObject.getString("system"));
post.setHeader("publicKey", publicKey);
post.setHeader("secretKey", secretKey);
post.setHeader("appId", appId);
post.setHeader("needStackTrace", jsonObject.getString("needStackTrace"));
switch (jsonObject.getString("voucherType")) {
case "add"://新增
post.setHeader("apiCode", pzApiCodexz);
break;
case "update"://修改
post.setHeader("apiCode", pzApiCodexg);
break;
case "delete"://删除
post.setHeader("apiCode", pzApiCodesc);
break;
case "cancellation"://作废
post.setHeader("apiCode", pzApiCodezf);
break;
default:
break;
}
StringBuilder body = new StringBuilder();
try {
if (bodys != null && !"".equals(bodys)) {
ByteArrayEntity byteArrayEntity = new ByteArrayEntity(bodys.getBytes("UTF-8"));
byteArrayEntity.setContentType("application/json");
post.setEntity(byteArrayEntity);
}
response = closeableHttpClient.execute(post);
HttpEntity httpEntity = response.getEntity();
synchronized (lock) {
body.append(EntityUtils.toString(httpEntity));
}
logger.info("返回结果:" + body);
JsonResultEntity resultEntity = JSON.parseObject(body.toString(), JsonResultEntity.class);
return resultEntity;
} catch (Exception e) {
logger.error("请求错误:" + e.getMessage());
body.append(e.getMessage());
return BaseResult.getFailureMessageEntity("转发失败", body);
} finally {
try {
// 关闭响应对象
if (response != null) {
response.close();
}
// 关闭响应对象
if (closeableHttpClient != null) {
closeableHttpClient.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 档案新增
* @Date 3:42 下午 2024/4/24
**/
@Override
public Object thirdInterfaceArchivesInsert(JSONObject object) {
JSONObject jsonObject = object.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
}
if (!checkStr(jsonObject.getString("archivesType"))) {
return BaseResult.getFailureMessageEntity("档案类型为空");
}
if (!checkStr(jsonObject.getString("usercode"))) {
return BaseResult.getFailureMessageEntity("usercode为空");
}
if (!checkStr(jsonObject.getString("password"))) {
return BaseResult.getFailureMessageEntity("password为空");
}
if (!checkStr(jsonObject.getString("trantype"))) {
return BaseResult.getFailureMessageEntity("trantype为空");
}
if (!checkStr(jsonObject.getString("system"))) {
return BaseResult.getFailureMessageEntity("system为空");
}
if (!checkStr(jsonObject.getString("data"))) {
return BaseResult.getFailureMessageEntity("data为空");
}
List<String> fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01", "jobass", "93", "96", "22"});
if (!fzhs.contains(jsonObject.getString("archivesType"))) {
return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员");
}
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
// HttpClient
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
HttpPost post = new HttpPost(voucherUrl);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
post.setConfig(requestConfig);//设置请求参数超时时间
post.setHeader("usercode", jsonObject.getString("usercode"));
post.setHeader("password", jsonObject.getString("password"));
post.setHeader("trantype", jsonObject.getString("trantype"));
post.setHeader("system", jsonObject.getString("system"));
post.setHeader("publicKey", publicKey);
post.setHeader("secretKey", secretKey);
post.setHeader("appId", appId);
CloseableHttpResponse response = null;
switch (jsonObject.getString("archivesType")) {
case "1"://人员对照
post.setHeader("apiCode", ryApiCodexz);
break;
case "2"://部门档案
post.setHeader("apiCode", bmApiCodexz);
break;
case "6"://存货对照
post.setHeader("apiCode", chApiCodexz);
break;
case "73"://客商辅助核算
post.setHeader("apiCode", ksApiCodexz);
break;
case "D01"://税率
post.setHeader("apiCode", slApiCodexz);
break;
case "jobass"://项目辅助核算
post.setHeader("apiCode", xmApiCodexz);
break;
case "93"://银行类别
post.setHeader("apiCode", yhlbApiCodexz);
break;
case "96"://银行账户
post.setHeader("apiCode", yhzhApiCodexz);
break;
case "22"://资产类别
post.setHeader("apiCode", zcApiCodexz);
break;
default:
break;
}
StringBuilder body = new StringBuilder();
try {
String senddata = jsonObject.getString("data");
if ("1".equals(jsonObject.getString("archivesType"))) {
JSONObject sendJson = JSONObject.parseObject(senddata);
JSONObject sendObject = new JSONObject();
if (sendJson != null) {
JSONArray psn = sendJson.getJSONArray("psn");
JSONArray sendpsn = new JSONArray();
if (psn != null && psn.size() > 0) {
for (int i = 0; i < psn.size(); i++) {
JSONObject person = psn.getJSONObject(i);
JSONObject parentvo = person.getJSONObject("parentvo");
JSONObject psnmanvo = parentvo.getJSONObject("psnmanvo");
ArchivesEntity archivesEntity = new ArchivesEntity();
archivesEntity.setArchivesType("2");
archivesEntity.setLeftCode(psnmanvo.getString("pk_deptdoc"));
archivesEntity.setLeftOrg(parentvo.getString("currentcorp"));
List<ArchivesEntity> archivesEntities = axDao.queryArchivesData(archivesEntity);
if (archivesEntities != null && archivesEntities.size() > 0) {
psnmanvo.put("pk_deptdoc",archivesEntities.get(0).getRightCode());
}
parentvo.put("psnmanvo",psnmanvo);
person.put("parentvo",parentvo);
sendpsn.add(person);
}
}
sendObject.put("psn",sendpsn);
}
senddata = sendObject.toJSONString();
}
ByteArrayEntity byteArrayEntity = new ByteArrayEntity(senddata.getBytes("UTF-8"));
byteArrayEntity.setContentType("application/json");
post.setEntity(byteArrayEntity);
response = closeableHttpClient.execute(post);
HttpEntity httpEntity = response.getEntity();
synchronized (lock) {
body.append(EntityUtils.toString(httpEntity));
}
logger.info("返回结果:" + body);
JsonResultEntity resultEntity = JSON.parseObject(body.toString(), JsonResultEntity.class);
return resultEntity;
//todo 暂时不保存
//JsonResultEntity resultEntity = JSON.parseObject(body.toString(),JsonResultEntity.class);
//if(resultEntity.isFlag() && "200".equals(resultEntity.getStatus())){
// if(JSONUtil.isTypeJSON(resultEntity.getAttribute().toString())){
// JSONObject attribute = JSONObject.parseObject(resultEntity.getAttribute().toString());
// if("success".equals(attribute.getString("status"))){
// if(attribute.getString("data") == null || "".equals(attribute.getString("data")) ){
// return resultEntity;
// }
// JSONArray jsonArray = JSONArray.parseArray(attribute.getString("data"));
// if(jsonArray == null || jsonArray.size() == 0 ){
// return resultEntity;
// }
// //解析具体数据
// switch (jsonObject.getString("archivesType")){
// case "1"://人员对照
//
//
// break;
// case "2"://部门档案
// //[{"pk_corp":"1001","unitcode":"01","unitname":"临安奥星电子股份有限公司","createdate":"2024-04-24","deptattr":"1","deptname":"DEV测试一级部门","deptcode":"99","pk_deptdoc":"1001F1100000000067BR"}]
// for (int i = 0; i < jsonArray.size(); i++) {
// JSONObject object1 = jsonArray.getJSONObject(i);
// ArchivesEntity archivesEntity = new ArchivesEntity();
// archivesEntity.setArchivesType(jsonObject.getString("archivesType"));
// archivesEntity.setCreate();
// archivesEntity.setLeftCode(object1.getString("unitcode"));//
// archivesEntity.setLeftName(object1.getString("unitname"));//
// archivesEntity.setRightId(object1.getString("pk_deptdoc"));//
// archivesEntity.setRightCode(object1.getString("unitcode"));//
// archivesEntity.setRightName(object1.getString("unitname"));//
// axDao.saveArchivesByType(archivesEntity);
// }
// break;
// case "6"://存货对照
// for (int i = 0; i < jsonArray.size(); i++) {
// JSONObject object1 = jsonArray.getJSONObject(i);
// ArchivesEntity archivesEntity = new ArchivesEntity();
// archivesEntity.setArchivesType(jsonObject.getString("archivesType"));
// archivesEntity.setCreate();
// archivesEntity.setLeftCode(object1.getString("invclasscode"));//
// archivesEntity.setLeftName(object1.getString("invclassname"));//
// archivesEntity.setRightId(object1.getString("pk_invcl"));//
// archivesEntity.setRightCode(object1.getString("invclasscode"));//
// archivesEntity.setRightName(object1.getString("invclassname"));//
// axDao.saveArchivesByType(archivesEntity);
// }
// break;
// case "73"://客商辅助核算
// break;
// case "D01"://税率
// break;
// case "jobass"://项目辅助核算
// break;
// case "93"://银行类别
// break;
// case "96"://银行账户
// break;
// case "22"://资产类别
// break;
// default:
// break;
// }
// return resultEntity;
// }else {
// return resultEntity;
// }
// }else {
// return resultEntity;
// }
//}else {
// //解析返回
// return resultEntity;
//}
} catch (Exception e) {
logger.error("请求错误:" + e.getMessage());
body.append(e.getMessage());
return BaseResult.getFailureMessageEntity("转发失败", body);
} finally {
try {
// 关闭响应对象
if (response != null) {
response.close();
}
// 关闭响应对象
if (closeableHttpClient != null) {
closeableHttpClient.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 档案修改
* @Date 3:42 下午 2024/4/24
**/
@Override
public Object thirdInterfaceArchivesUpdate(JSONObject object) {
JSONObject jsonObject = object.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
}
if (!checkStr(jsonObject.getString("archivesType"))) {
return BaseResult.getFailureMessageEntity("档案类型为空");
}
if (!checkStr(jsonObject.getString("usercode"))) {
return BaseResult.getFailureMessageEntity("usercode为空");
}
if (!checkStr(jsonObject.getString("password"))) {
return BaseResult.getFailureMessageEntity("password为空");
}
if (!checkStr(jsonObject.getString("trantype"))) {
return BaseResult.getFailureMessageEntity("trantype为空");
}
if (!checkStr(jsonObject.getString("system"))) {
return BaseResult.getFailureMessageEntity("system为空");
}
if (!checkStr(jsonObject.getString("data"))) {
return BaseResult.getFailureMessageEntity("data为空");
}
List<String> fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01", "jobass", "93", "96", "22"});
if (!fzhs.contains(jsonObject.getString("archivesType"))) {
return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员");
}
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
// HttpClient
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
HttpPost post = new HttpPost(voucherUrl);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
post.setConfig(requestConfig);//设置请求参数超时时间
post.setHeader("usercode", jsonObject.getString("usercode"));
post.setHeader("password", jsonObject.getString("password"));
post.setHeader("trantype", jsonObject.getString("trantype"));
post.setHeader("system", jsonObject.getString("system"));
post.setHeader("publicKey", publicKey);
post.setHeader("secretKey", secretKey);
post.setHeader("appId", appId);
CloseableHttpResponse response = null;
switch (jsonObject.getString("archivesType")) {
case "1"://人员对照
post.setHeader("apiCode", ryApiCodexg);
break;
case "2"://部门档案
post.setHeader("apiCode", bmApiCodexg);
break;
case "6"://存货对照
post.setHeader("apiCode", chApiCodexg);
break;
case "73"://客商辅助核算
post.setHeader("apiCode", ksApiCodexg);
break;
case "D01"://税率
post.setHeader("apiCode", slApiCodexg);
break;
case "jobass"://项目辅助核算
post.setHeader("apiCode", xmApiCodexg);
break;
case "93"://银行类别
post.setHeader("apiCode", yhlbApiCodexg);
break;
case "96"://银行账户
post.setHeader("apiCode", yhzhApiCodexg);
break;
case "22"://资产类别
post.setHeader("apiCode", zcApiCodexg);
break;
default:
break;
}
StringBuilder body = new StringBuilder();
try {
ByteArrayEntity byteArrayEntity = new ByteArrayEntity(jsonObject.getString("data").getBytes("UTF-8"));
byteArrayEntity.setContentType("application/json");
post.setEntity(byteArrayEntity);
response = closeableHttpClient.execute(post);
HttpEntity httpEntity = response.getEntity();
synchronized (lock) {
body.append(EntityUtils.toString(httpEntity));
}
logger.info("返回结果:" + body);
JsonResultEntity resultEntity = JSON.parseObject(body.toString(), JsonResultEntity.class);
return resultEntity;
//JsonResultEntity resultEntity = JSON.parseObject(body.toString(),JsonResultEntity.class);
//if(resultEntity.isFlag() && "200".equals(resultEntity.getStatus())){
// if(JSONUtil.isTypeJSON(resultEntity.getAttribute().toString())){
// //JSONObject attribute = JSONObject.parseObject(resultEntity.getAttribute().toString());
// JSONObject attribute = JSONObject.parseObject("{\n" +
// " \"status\": \"success\",\n" +
// " \"data\": \"[{\\\"pk_invcl\\\":\\\"0001F11000000000I6NN\\\",\\\"invclasscode\\\":\\\"04\\\",\\\"invclassname\\\":\\\"成品测试\\\",\\\"invclasslev\\\":\\\"1\\\",\\\"pk_corp\\\":\\\"0001\\\",\\\"unitcode\\\":\\\"0001\\\",\\\"unitname\\\":\\\"集团\\\"}]\",\n" +
// " \"taskNumber\": \"202404250048\"\n" +
// "}");
// if("success".equals(attribute.getString("status"))){
// if(attribute.getString("data") == null || "".equals(attribute.getString("data")) ){
// return resultEntity;
// }
// JSONArray jsonArray = JSONArray.parseArray(attribute.getString("data"));
// if(jsonArray == null || jsonArray.size() == 0 ){
// return resultEntity;
// }
// //解析具体数据
// switch (jsonObject.getString("archivesType")){
// case "1"://人员对照
// break;
// case "2"://部门档案
// break;
// case "6"://存货对照
// for (int i = 0; i < jsonArray.size(); i++) {
// JSONObject object1 = jsonArray.getJSONObject(i);
// ArchivesEntity archivesEntity = new ArchivesEntity();
// archivesEntity.setArchivesType(jsonObject.getString("archivesType"));
// archivesEntity.setUpdate();
// archivesEntity.setLeftCode(object1.getString("invclasscode"));//
// archivesEntity.setLeftName(object1.getString("invclassname"));//
// archivesEntity.setRightId(object1.getString("pk_invcl"));//
// archivesEntity.setRightCode(object1.getString("invclasscode"));//
// archivesEntity.setRightName(object1.getString("invclassname"));//
// axDao.updateArchivesByType(archivesEntity);
// }
// break;
// case "73"://客商辅助核算
// break;
// case "D01"://税率
// break;
// case "jobass"://项目辅助核算
// break;
// case "93"://银行类别
// break;
// case "96"://银行账户
// break;
// case "22"://资产类别
// break;
// default:
// break;
// }
// return resultEntity;
// }else {
// return resultEntity;
// }
// }else {
// return resultEntity;
// }
//}else {
// //解析返回
// return resultEntity;
//}
} catch (Exception e) {
logger.error("请求错误:" + e.getMessage());
body.append(e.getMessage());
return BaseResult.getFailureMessageEntity("转发失败", body);
} finally {
try {
// 关闭响应对象
if (response != null) {
response.close();
}
// 关闭响应对象
if (closeableHttpClient != null) {
closeableHttpClient.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 档案删除
* @Date 3:42 下午 2024/4/24
**/
@Override
public Object thirdInterfaceArchivesDelete(JSONObject object) {
JSONObject jsonObject = object.getJSONObject("jsonStr");
if (jsonObject == null) {
return BaseResult.getFailureMessageEntity("数据为空,请先传递数据");
}
if (!checkStr(jsonObject.getString("archivesType"))) {
return BaseResult.getFailureMessageEntity("档案类型为空");
}
if (!checkStr(jsonObject.getString("usercode"))) {
return BaseResult.getFailureMessageEntity("usercode为空");
}
if (!checkStr(jsonObject.getString("password"))) {
return BaseResult.getFailureMessageEntity("password为空");
}
if (!checkStr(jsonObject.getString("trantype"))) {
return BaseResult.getFailureMessageEntity("trantype为空");
}
if (!checkStr(jsonObject.getString("system"))) {
return BaseResult.getFailureMessageEntity("system为空");
}
if (!checkStr(jsonObject.getString("data"))) {
return BaseResult.getFailureMessageEntity("data为空");
}
List<String> fzhs = Arrays.asList(new String[]{"1", "2", "6", "73", "D01", "jobass", "93", "96", "22"});
if (!fzhs.contains(jsonObject.getString("archivesType"))) {
return BaseResult.getFailureMessageEntity("档案类型错误,请联系管理员");
}
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
// HttpClient
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
HttpPost post = new HttpPost(voucherUrl);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
post.setConfig(requestConfig);//设置请求参数超时时间
post.setHeader("usercode", jsonObject.getString("usercode"));
post.setHeader("password", jsonObject.getString("password"));
post.setHeader("trantype", jsonObject.getString("trantype"));
post.setHeader("system", jsonObject.getString("system"));
post.setHeader("publicKey", publicKey);
post.setHeader("secretKey", secretKey);
post.setHeader("appId", appId);
CloseableHttpResponse response = null;
switch (jsonObject.getString("archivesType")) {
case "1"://人员对照
post.setHeader("apiCode", ryApiCodesc);
break;
case "2"://部门档案
post.setHeader("apiCode", bmApiCodesc);
break;
case "6"://存货对照
post.setHeader("apiCode", chApiCodesc);
break;
case "73"://客商辅助核算
post.setHeader("apiCode", ksApiCodesc);
break;
case "D01"://税率
post.setHeader("apiCode", slApiCodesc);
break;
case "jobass"://项目辅助核算
post.setHeader("apiCode", xmApiCodesc);
break;
case "93"://银行类别
post.setHeader("apiCode", yhlbApiCodesc);
break;
case "96"://银行账户
post.setHeader("apiCode", yhzhApiCodesc);
break;
case "22"://资产类别
post.setHeader("apiCode", zcApiCodesc);
break;
default:
break;
}
StringBuilder body = new StringBuilder();
try {
ByteArrayEntity byteArrayEntity = new ByteArrayEntity(jsonObject.getString("data").getBytes("UTF-8"));
byteArrayEntity.setContentType("application/json");
post.setEntity(byteArrayEntity);
response = closeableHttpClient.execute(post);
HttpEntity httpEntity = response.getEntity();
synchronized (lock) {
body.append(EntityUtils.toString(httpEntity));
}
logger.info("返回结果:" + body);
JsonResultEntity resultEntity = JSON.parseObject(body.toString(), JsonResultEntity.class);
return resultEntity;
//JsonResultEntity resultEntity = JSON.parseObject(body.toString(),JsonResultEntity.class);
//if(resultEntity.isFlag() && "200".equals(resultEntity.getStatus())){
// if(JSONUtil.isTypeJSON(resultEntity.getAttribute().toString())){
// //JSONObject attribute = JSONObject.parseObject(resultEntity.getAttribute().toString());
// JSONObject attribute = JSONObject.parseObject("{\n" +
// " \"status\": \"success\",\n" +
// " \"data\": \"[{\\\"pk_invcl\\\":\\\"0001F11000000000I6NN\\\",\\\"invclasscode\\\":\\\"04\\\",\\\"invclassname\\\":\\\"成品测试\\\",\\\"invclasslev\\\":\\\"1\\\",\\\"pk_corp\\\":\\\"0001\\\",\\\"unitcode\\\":\\\"0001\\\",\\\"unitname\\\":\\\"集团\\\"}]\",\n" +
// " \"taskNumber\": \"202404250048\"\n" +
// "}");
// if("success".equals(attribute.getString("status"))){
// if(attribute.getString("data") == null || "".equals(attribute.getString("data")) ){
// return resultEntity;
// }
// JSONArray jsonArray = JSONArray.parseArray(attribute.getString("data"));
// if(jsonArray == null || jsonArray.size() == 0 ){
// return resultEntity;
// }
// //解析具体数据
// switch (jsonObject.getString("archivesType")){
// case "1"://人员对照
// break;
// case "2"://部门档案
// break;
// case "6"://存货对照
// for (int i = 0; i < jsonArray.size(); i++) {
// JSONObject object1 = jsonArray.getJSONObject(i);
// ArchivesEntity archivesEntity = new ArchivesEntity();
// archivesEntity.setArchivesType(jsonObject.getString("archivesType"));
// archivesEntity.setUpdate();
// archivesEntity.setLeftCode(object1.getString("invclasscode"));//
// archivesEntity.setLeftName(object1.getString("invclassname"));//
// archivesEntity.setRightId(object1.getString("pk_invcl"));//
// archivesEntity.setRightCode(object1.getString("invclasscode"));//
// archivesEntity.setRightName(object1.getString("invclassname"));//
// axDao.deleteArchivesByType(archivesEntity);
// }
// break;
// case "73"://客商辅助核算
// break;
// case "D01"://税率
// break;
// case "jobass"://项目辅助核算
// break;
// case "93"://银行类别
// break;
// case "96"://银行账户
// break;
// case "22"://资产类别
// break;
// default:
// break;
// }
// return resultEntity;
// }else {
// return resultEntity;
// }
// }else {
// return resultEntity;
// }
//}else {
// //解析返回
// return resultEntity;
//}
} catch (Exception e) {
logger.error("请求错误:" + e.getMessage());
body.append(e.getMessage());
return BaseResult.getFailureMessageEntity("转发失败", body);
} finally {
try {
// 关闭响应对象
if (response != null) {
response.close();
}
// 关闭响应对象
if (closeableHttpClient != null) {
closeableHttpClient.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

View File

@ -1,26 +0,0 @@
package com.hzya.frame.u8c.bdCumandoc.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.u8c.bdCumandoc.entity.BdCumandocEntity;
import java.util.List;
/**
* (bd_cumandoc: table)表数据库访问层
*
* @author makejava
* @since 2023-08-25 09:42:24
*/
public interface IBdCumandocDao extends IBaseDao<BdCumandocEntity, String> {
/**
*
* @content 通过组织以及客户编码查询客户管理档案主键
* @author javaboy
* @date 2024/1/24 0024 13:58
*
*/
List<BdCumandocEntity> selectIdByCodeAndCorp(BdCumandocEntity cumandoc);
}

View File

@ -1,26 +0,0 @@
package com.hzya.frame.u8c.bdCumandoc.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.u8c.bdCumandoc.dao.IBdCumandocDao;
import com.hzya.frame.u8c.bdCumandoc.entity.BdCumandocEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* (BdCumandoc)表数据库访问层
*
* @author makejava
* @since 2023-08-25 09:42:24
*/
@Repository("U8cBdCumandocDaoImpl")
public class BdCumandocDaoImpl extends MybatisGenericDao<BdCumandocEntity, String> implements IBdCumandocDao {
@DS("sowow_sqlserver_pro")
@Override
public List<BdCumandocEntity> selectIdByCodeAndCorp(BdCumandocEntity cumandoc) {
return (List<BdCumandocEntity>) super.selectList("com.hzya.frame.u8c.bdCumandoc.dao.impl.BdCumandocDaoImpl.entity_list_base",cumandoc);
}
}

View File

@ -1,874 +0,0 @@
package com.hzya.frame.u8c.bdCumandoc.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (BdCumandoc)实体类-客商管理档案
*
* @author makejava
* @since 2023-08-25 09:42:24
*/
public class BdCumandocEntity extends BaseEntity {
private String accawmny;
private String acclimit;
private String acclimitcontrol;
private String acclmtbegindate;
private String balancemny;
private String bp;
private String busawmny;
private String cmnecode;
private String cooperateflag;
private String cooperatingdayfrom;
private String cooperatingdayto;
private String correspsettleunit;
private String createtime;
private String creator;
private String creditcontrol;
private String creditlevel;
private String creditlimitnum;
private String creditmny;
private String creditmoney;
private Long credlimitflag;
private String custflag;
private Long custstate;
private String def1;
private String def10;
private String def11;
private String def12;
private String def13;
private String def14;
private String def15;
private String def16;
private String def17;
private String def18;
private String def19;
private String def2;
private String def20;
private String def21;
private String def22;
private String def23;
private String def24;
private String def25;
private String def26;
private String def27;
private String def28;
private String def29;
private String def3;
private String def30;
private String def4;
private String def5;
private String def6;
private String def7;
private String def8;
private String def9;
private String developdate;
private String diffcurrflag;
private String discountrate;
private Long dr;
private String freeofacclmtcheck;
private String freeofcremnycheck;
private String frozendate;
private String frozenflag;
private Long grade;
private Long innerctldays;
private String iounit;
private String isagent;
private String ispromtesettlement;
private String linkman;
private String memo;
private String mobilephone;
private String modifier;
private String modifytime;
private String ordawmny;
private String pkCalbody;
private String pkCorp;
private String pkCubasdoc;
private String pkCumandoc;
private String pkCurrtype1;
private String pkCusmandoc2;
private String pkCusmandoc3;
private String pkDefbusitype;
private String pkPayterm;
private String pkPricegroupcorp;
private String pkRespdept1;
private String pkResppsn1;
private String pkSalestru;
private String pkSendtype;
private String pkSettleunit;
private String pkStordoc2;
private Long prepaidratio;
private String ratifydate;
private String sealflag;
private Long stockpriceratio;
private String testsalemoney;
private String ts;
private String custcode;
public String getCustcode() {
return custcode;
}
public void setCustcode(String custcode) {
this.custcode = custcode;
}
/**
* 多个custflag值查询
*/
private String custflags;
public String getCustflags() {
return custflags;
}
public void setCustflags(String custflags) {
this.custflags = custflags;
}
public String getAccawmny() {
return accawmny;
}
public void setAccawmny(String accawmny) {
this.accawmny = accawmny;
}
public String getAcclimit() {
return acclimit;
}
public void setAcclimit(String acclimit) {
this.acclimit = acclimit;
}
public String getAcclimitcontrol() {
return acclimitcontrol;
}
public void setAcclimitcontrol(String acclimitcontrol) {
this.acclimitcontrol = acclimitcontrol;
}
public String getAcclmtbegindate() {
return acclmtbegindate;
}
public void setAcclmtbegindate(String acclmtbegindate) {
this.acclmtbegindate = acclmtbegindate;
}
public String getBalancemny() {
return balancemny;
}
public void setBalancemny(String balancemny) {
this.balancemny = balancemny;
}
public String getBp() {
return bp;
}
public void setBp(String bp) {
this.bp = bp;
}
public String getBusawmny() {
return busawmny;
}
public void setBusawmny(String busawmny) {
this.busawmny = busawmny;
}
public String getCmnecode() {
return cmnecode;
}
public void setCmnecode(String cmnecode) {
this.cmnecode = cmnecode;
}
public String getCooperateflag() {
return cooperateflag;
}
public void setCooperateflag(String cooperateflag) {
this.cooperateflag = cooperateflag;
}
public String getCooperatingdayfrom() {
return cooperatingdayfrom;
}
public void setCooperatingdayfrom(String cooperatingdayfrom) {
this.cooperatingdayfrom = cooperatingdayfrom;
}
public String getCooperatingdayto() {
return cooperatingdayto;
}
public void setCooperatingdayto(String cooperatingdayto) {
this.cooperatingdayto = cooperatingdayto;
}
public String getCorrespsettleunit() {
return correspsettleunit;
}
public void setCorrespsettleunit(String correspsettleunit) {
this.correspsettleunit = correspsettleunit;
}
public String getCreatetime() {
return createtime;
}
public void setCreatetime(String createtime) {
this.createtime = createtime;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getCreditcontrol() {
return creditcontrol;
}
public void setCreditcontrol(String creditcontrol) {
this.creditcontrol = creditcontrol;
}
public String getCreditlevel() {
return creditlevel;
}
public void setCreditlevel(String creditlevel) {
this.creditlevel = creditlevel;
}
public String getCreditlimitnum() {
return creditlimitnum;
}
public void setCreditlimitnum(String creditlimitnum) {
this.creditlimitnum = creditlimitnum;
}
public String getCreditmny() {
return creditmny;
}
public void setCreditmny(String creditmny) {
this.creditmny = creditmny;
}
public String getCreditmoney() {
return creditmoney;
}
public void setCreditmoney(String creditmoney) {
this.creditmoney = creditmoney;
}
public Long getCredlimitflag() {
return credlimitflag;
}
public void setCredlimitflag(Long credlimitflag) {
this.credlimitflag = credlimitflag;
}
public String getCustflag() {
return custflag;
}
public void setCustflag(String custflag) {
this.custflag = custflag;
}
public Long getCuststate() {
return custstate;
}
public void setCuststate(Long custstate) {
this.custstate = custstate;
}
public String getDef1() {
return def1;
}
public void setDef1(String def1) {
this.def1 = def1;
}
public String getDef10() {
return def10;
}
public void setDef10(String def10) {
this.def10 = def10;
}
public String getDef11() {
return def11;
}
public void setDef11(String def11) {
this.def11 = def11;
}
public String getDef12() {
return def12;
}
public void setDef12(String def12) {
this.def12 = def12;
}
public String getDef13() {
return def13;
}
public void setDef13(String def13) {
this.def13 = def13;
}
public String getDef14() {
return def14;
}
public void setDef14(String def14) {
this.def14 = def14;
}
public String getDef15() {
return def15;
}
public void setDef15(String def15) {
this.def15 = def15;
}
public String getDef16() {
return def16;
}
public void setDef16(String def16) {
this.def16 = def16;
}
public String getDef17() {
return def17;
}
public void setDef17(String def17) {
this.def17 = def17;
}
public String getDef18() {
return def18;
}
public void setDef18(String def18) {
this.def18 = def18;
}
public String getDef19() {
return def19;
}
public void setDef19(String def19) {
this.def19 = def19;
}
public String getDef2() {
return def2;
}
public void setDef2(String def2) {
this.def2 = def2;
}
public String getDef20() {
return def20;
}
public void setDef20(String def20) {
this.def20 = def20;
}
public String getDef21() {
return def21;
}
public void setDef21(String def21) {
this.def21 = def21;
}
public String getDef22() {
return def22;
}
public void setDef22(String def22) {
this.def22 = def22;
}
public String getDef23() {
return def23;
}
public void setDef23(String def23) {
this.def23 = def23;
}
public String getDef24() {
return def24;
}
public void setDef24(String def24) {
this.def24 = def24;
}
public String getDef25() {
return def25;
}
public void setDef25(String def25) {
this.def25 = def25;
}
public String getDef26() {
return def26;
}
public void setDef26(String def26) {
this.def26 = def26;
}
public String getDef27() {
return def27;
}
public void setDef27(String def27) {
this.def27 = def27;
}
public String getDef28() {
return def28;
}
public void setDef28(String def28) {
this.def28 = def28;
}
public String getDef29() {
return def29;
}
public void setDef29(String def29) {
this.def29 = def29;
}
public String getDef3() {
return def3;
}
public void setDef3(String def3) {
this.def3 = def3;
}
public String getDef30() {
return def30;
}
public void setDef30(String def30) {
this.def30 = def30;
}
public String getDef4() {
return def4;
}
public void setDef4(String def4) {
this.def4 = def4;
}
public String getDef5() {
return def5;
}
public void setDef5(String def5) {
this.def5 = def5;
}
public String getDef6() {
return def6;
}
public void setDef6(String def6) {
this.def6 = def6;
}
public String getDef7() {
return def7;
}
public void setDef7(String def7) {
this.def7 = def7;
}
public String getDef8() {
return def8;
}
public void setDef8(String def8) {
this.def8 = def8;
}
public String getDef9() {
return def9;
}
public void setDef9(String def9) {
this.def9 = def9;
}
public String getDevelopdate() {
return developdate;
}
public void setDevelopdate(String developdate) {
this.developdate = developdate;
}
public String getDiffcurrflag() {
return diffcurrflag;
}
public void setDiffcurrflag(String diffcurrflag) {
this.diffcurrflag = diffcurrflag;
}
public String getDiscountrate() {
return discountrate;
}
public void setDiscountrate(String discountrate) {
this.discountrate = discountrate;
}
public Long getDr() {
return dr;
}
public void setDr(Long dr) {
this.dr = dr;
}
public String getFreeofacclmtcheck() {
return freeofacclmtcheck;
}
public void setFreeofacclmtcheck(String freeofacclmtcheck) {
this.freeofacclmtcheck = freeofacclmtcheck;
}
public String getFreeofcremnycheck() {
return freeofcremnycheck;
}
public void setFreeofcremnycheck(String freeofcremnycheck) {
this.freeofcremnycheck = freeofcremnycheck;
}
public String getFrozendate() {
return frozendate;
}
public void setFrozendate(String frozendate) {
this.frozendate = frozendate;
}
public String getFrozenflag() {
return frozenflag;
}
public void setFrozenflag(String frozenflag) {
this.frozenflag = frozenflag;
}
public Long getGrade() {
return grade;
}
public void setGrade(Long grade) {
this.grade = grade;
}
public Long getInnerctldays() {
return innerctldays;
}
public void setInnerctldays(Long innerctldays) {
this.innerctldays = innerctldays;
}
public String getIounit() {
return iounit;
}
public void setIounit(String iounit) {
this.iounit = iounit;
}
public String getIsagent() {
return isagent;
}
public void setIsagent(String isagent) {
this.isagent = isagent;
}
public String getIspromtesettlement() {
return ispromtesettlement;
}
public void setIspromtesettlement(String ispromtesettlement) {
this.ispromtesettlement = ispromtesettlement;
}
public String getLinkman() {
return linkman;
}
public void setLinkman(String linkman) {
this.linkman = linkman;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getMobilephone() {
return mobilephone;
}
public void setMobilephone(String mobilephone) {
this.mobilephone = mobilephone;
}
public String getModifier() {
return modifier;
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getModifytime() {
return modifytime;
}
public void setModifytime(String modifytime) {
this.modifytime = modifytime;
}
public String getOrdawmny() {
return ordawmny;
}
public void setOrdawmny(String ordawmny) {
this.ordawmny = ordawmny;
}
public String getPkCalbody() {
return pkCalbody;
}
public void setPkCalbody(String pkCalbody) {
this.pkCalbody = pkCalbody;
}
public String getPkCorp() {
return pkCorp;
}
public void setPkCorp(String pkCorp) {
this.pkCorp = pkCorp;
}
public String getPkCubasdoc() {
return pkCubasdoc;
}
public void setPkCubasdoc(String pkCubasdoc) {
this.pkCubasdoc = pkCubasdoc;
}
public String getPkCumandoc() {
return pkCumandoc;
}
public void setPkCumandoc(String pkCumandoc) {
this.pkCumandoc = pkCumandoc;
}
public String getPkCurrtype1() {
return pkCurrtype1;
}
public void setPkCurrtype1(String pkCurrtype1) {
this.pkCurrtype1 = pkCurrtype1;
}
public String getPkCusmandoc2() {
return pkCusmandoc2;
}
public void setPkCusmandoc2(String pkCusmandoc2) {
this.pkCusmandoc2 = pkCusmandoc2;
}
public String getPkCusmandoc3() {
return pkCusmandoc3;
}
public void setPkCusmandoc3(String pkCusmandoc3) {
this.pkCusmandoc3 = pkCusmandoc3;
}
public String getPkDefbusitype() {
return pkDefbusitype;
}
public void setPkDefbusitype(String pkDefbusitype) {
this.pkDefbusitype = pkDefbusitype;
}
public String getPkPayterm() {
return pkPayterm;
}
public void setPkPayterm(String pkPayterm) {
this.pkPayterm = pkPayterm;
}
public String getPkPricegroupcorp() {
return pkPricegroupcorp;
}
public void setPkPricegroupcorp(String pkPricegroupcorp) {
this.pkPricegroupcorp = pkPricegroupcorp;
}
public String getPkRespdept1() {
return pkRespdept1;
}
public void setPkRespdept1(String pkRespdept1) {
this.pkRespdept1 = pkRespdept1;
}
public String getPkResppsn1() {
return pkResppsn1;
}
public void setPkResppsn1(String pkResppsn1) {
this.pkResppsn1 = pkResppsn1;
}
public String getPkSalestru() {
return pkSalestru;
}
public void setPkSalestru(String pkSalestru) {
this.pkSalestru = pkSalestru;
}
public String getPkSendtype() {
return pkSendtype;
}
public void setPkSendtype(String pkSendtype) {
this.pkSendtype = pkSendtype;
}
public String getPkSettleunit() {
return pkSettleunit;
}
public void setPkSettleunit(String pkSettleunit) {
this.pkSettleunit = pkSettleunit;
}
public String getPkStordoc2() {
return pkStordoc2;
}
public void setPkStordoc2(String pkStordoc2) {
this.pkStordoc2 = pkStordoc2;
}
public Long getPrepaidratio() {
return prepaidratio;
}
public void setPrepaidratio(Long prepaidratio) {
this.prepaidratio = prepaidratio;
}
public String getRatifydate() {
return ratifydate;
}
public void setRatifydate(String ratifydate) {
this.ratifydate = ratifydate;
}
public String getSealflag() {
return sealflag;
}
public void setSealflag(String sealflag) {
this.sealflag = sealflag;
}
public Long getStockpriceratio() {
return stockpriceratio;
}
public void setStockpriceratio(Long stockpriceratio) {
this.stockpriceratio = stockpriceratio;
}
public String getTestsalemoney() {
return testsalemoney;
}
public void setTestsalemoney(String testsalemoney) {
this.testsalemoney = testsalemoney;
}
public String getTs() {
return ts;
}
public void setTs(String ts) {
this.ts = ts;
}
}

View File

@ -1,212 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.u8c.bdCumandoc.dao.impl.BdCumandocDaoImpl">
<resultMap id="get-BdCumandocEntity-result" type="com.hzya.frame.u8c.bdCumandoc.entity.BdCumandocEntity" >
<result property="accawmny" column="accawmny" jdbcType="VARCHAR"/>
<result property="acclimit" column="acclimit" jdbcType="VARCHAR"/>
<result property="acclimitcontrol" column="acclimitcontrol" jdbcType="VARCHAR"/>
<result property="acclmtbegindate" column="acclmtbegindate" jdbcType="VARCHAR"/>
<result property="balancemny" column="balancemny" jdbcType="VARCHAR"/>
<result property="bp" column="bp" jdbcType="VARCHAR"/>
<result property="busawmny" column="busawmny" jdbcType="VARCHAR"/>
<result property="cmnecode" column="cmnecode" jdbcType="VARCHAR"/>
<result property="cooperateflag" column="cooperateflag" jdbcType="VARCHAR"/>
<result property="cooperatingdayfrom" column="cooperatingdayfrom" jdbcType="VARCHAR"/>
<result property="cooperatingdayto" column="cooperatingdayto" jdbcType="VARCHAR"/>
<result property="correspsettleunit" column="correspsettleunit" jdbcType="VARCHAR"/>
<result property="createtime" column="createtime" jdbcType="VARCHAR"/>
<result property="creator" column="creator" jdbcType="VARCHAR"/>
<result property="creditcontrol" column="creditcontrol" jdbcType="VARCHAR"/>
<result property="creditlevel" column="creditlevel" jdbcType="VARCHAR"/>
<result property="creditlimitnum" column="creditlimitnum" jdbcType="VARCHAR"/>
<result property="creditmny" column="creditmny" jdbcType="VARCHAR"/>
<result property="creditmoney" column="creditmoney" jdbcType="VARCHAR"/>
<result property="credlimitflag" column="credlimitflag" jdbcType="INTEGER"/>
<result property="custflag" column="custflag" jdbcType="VARCHAR"/>
<result property="custstate" column="custstate" jdbcType="INTEGER"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def10" column="def10" jdbcType="VARCHAR"/>
<result property="def11" column="def11" jdbcType="VARCHAR"/>
<result property="def12" column="def12" jdbcType="VARCHAR"/>
<result property="def13" column="def13" jdbcType="VARCHAR"/>
<result property="def14" column="def14" jdbcType="VARCHAR"/>
<result property="def15" column="def15" jdbcType="VARCHAR"/>
<result property="def16" column="def16" jdbcType="VARCHAR"/>
<result property="def17" column="def17" jdbcType="VARCHAR"/>
<result property="def18" column="def18" jdbcType="VARCHAR"/>
<result property="def19" column="def19" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def20" column="def20" jdbcType="VARCHAR"/>
<result property="def21" column="def21" jdbcType="VARCHAR"/>
<result property="def22" column="def22" jdbcType="VARCHAR"/>
<result property="def23" column="def23" jdbcType="VARCHAR"/>
<result property="def24" column="def24" jdbcType="VARCHAR"/>
<result property="def25" column="def25" jdbcType="VARCHAR"/>
<result property="def26" column="def26" jdbcType="VARCHAR"/>
<result property="def27" column="def27" jdbcType="VARCHAR"/>
<result property="def28" column="def28" jdbcType="VARCHAR"/>
<result property="def29" column="def29" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/>
<result property="def30" column="def30" jdbcType="VARCHAR"/>
<result property="def4" column="def4" jdbcType="VARCHAR"/>
<result property="def5" column="def5" jdbcType="VARCHAR"/>
<result property="def6" column="def6" jdbcType="VARCHAR"/>
<result property="def7" column="def7" jdbcType="VARCHAR"/>
<result property="def8" column="def8" jdbcType="VARCHAR"/>
<result property="def9" column="def9" jdbcType="VARCHAR"/>
<result property="developdate" column="developdate" jdbcType="VARCHAR"/>
<result property="diffcurrflag" column="diffcurrflag" jdbcType="VARCHAR"/>
<result property="discountrate" column="discountrate" jdbcType="VARCHAR"/>
<result property="dr" column="dr" jdbcType="INTEGER"/>
<result property="freeofacclmtcheck" column="freeofacclmtcheck" jdbcType="VARCHAR"/>
<result property="freeofcremnycheck" column="freeofcremnycheck" jdbcType="VARCHAR"/>
<result property="frozendate" column="frozendate" jdbcType="VARCHAR"/>
<result property="frozenflag" column="frozenflag" jdbcType="VARCHAR"/>
<result property="grade" column="grade" jdbcType="INTEGER"/>
<result property="innerctldays" column="innerctldays" jdbcType="INTEGER"/>
<result property="iounit" column="iounit" jdbcType="VARCHAR"/>
<result property="isagent" column="isagent" jdbcType="VARCHAR"/>
<result property="ispromtesettlement" column="ispromtesettlement" jdbcType="VARCHAR"/>
<result property="linkman" column="linkman" jdbcType="VARCHAR"/>
<result property="memo" column="memo" jdbcType="VARCHAR"/>
<result property="mobilephone" column="mobilephone" jdbcType="VARCHAR"/>
<result property="modifier" column="modifier" jdbcType="VARCHAR"/>
<result property="modifytime" column="modifytime" jdbcType="VARCHAR"/>
<result property="ordawmny" column="ordawmny" jdbcType="VARCHAR"/>
<result property="pkCalbody" column="pk_calbody" jdbcType="VARCHAR"/>
<result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
<result property="pkCubasdoc" column="pk_cubasdoc" jdbcType="VARCHAR"/>
<result property="pkCumandoc" column="pk_cumandoc" jdbcType="VARCHAR"/>
<result property="pkCurrtype1" column="pk_currtype1" jdbcType="VARCHAR"/>
<result property="pkCusmandoc2" column="pk_cusmandoc2" jdbcType="VARCHAR"/>
<result property="pkCusmandoc3" column="pk_cusmandoc3" jdbcType="VARCHAR"/>
<result property="pkDefbusitype" column="pk_defbusitype" jdbcType="VARCHAR"/>
<result property="pkPayterm" column="pk_payterm" jdbcType="VARCHAR"/>
<result property="pkPricegroupcorp" column="pk_pricegroupcorp" jdbcType="VARCHAR"/>
<result property="pkRespdept1" column="pk_respdept1" jdbcType="VARCHAR"/>
<result property="pkResppsn1" column="pk_resppsn1" jdbcType="VARCHAR"/>
<result property="pkSalestru" column="pk_salestru" jdbcType="VARCHAR"/>
<result property="pkSendtype" column="pk_sendtype" jdbcType="VARCHAR"/>
<result property="pkSettleunit" column="pk_settleunit" jdbcType="VARCHAR"/>
<result property="pkStordoc2" column="pk_stordoc2" jdbcType="VARCHAR"/>
<result property="prepaidratio" column="prepaidratio" jdbcType="INTEGER"/>
<result property="ratifydate" column="ratifydate" jdbcType="VARCHAR"/>
<result property="sealflag" column="sealflag" jdbcType="VARCHAR"/>
<result property="stockpriceratio" column="stockpriceratio" jdbcType="INTEGER"/>
<result property="testsalemoney" column="testsalemoney" jdbcType="VARCHAR"/>
<result property="ts" column="ts" jdbcType="VARCHAR"/>
<result property="custcode" column="custcode" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "BdCumandocEntity_Base_Column_List">
accawmny
,acclimit
,acclimitcontrol
,acclmtbegindate
,balancemny
,bp
,busawmny
,cmnecode
,cooperateflag
,cooperatingdayfrom
,cooperatingdayto
,correspsettleunit
,createtime
,creator
,creditcontrol
,creditlevel
,creditlimitnum
,creditmny
,creditmoney
,credlimitflag
,custflag
,custstate
,def1
,def10
,def11
,def12
,def13
,def14
,def15
,def16
,def17
,def18
,def19
,def2
,def20
,def21
,def22
,def23
,def24
,def25
,def26
,def27
,def28
,def29
,def3
,def30
,def4
,def5
,def6
,def7
,def8
,def9
,developdate
,diffcurrflag
,discountrate
,dr
,freeofacclmtcheck
,freeofcremnycheck
,frozendate
,frozenflag
,grade
,innerctldays
,iounit
,isagent
,ispromtesettlement
,linkman
,memo
,mobilephone
,modifier
,modifytime
,ordawmny
,pk_calbody
,pk_corp
,pk_cubasdoc
,pk_cumandoc
,pk_currtype1
,pk_cusmandoc2
,pk_cusmandoc3
,pk_defbusitype
,pk_payterm
,pk_pricegroupcorp
,pk_respdept1
,pk_resppsn1
,pk_salestru
,pk_sendtype
,pk_settleunit
,pk_stordoc2
,prepaidratio
,ratifydate
,sealflag
,stockpriceratio
,testsalemoney
,ts
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-BdCumandocEntity-result" parameterType = "com.hzya.frame.u8c.bdCumandoc.entity.BdCumandocEntity">
select
mand.pk_cumandoc ,
mand.pk_cubasdoc ,
basdoc.custcode,
mand.pk_corp
from bd_cumandoc mand
left join bd_cubasdoc basdoc on mand.pk_cubasdoc = basdoc.pk_cubasdoc and basdoc.dr = '0'
where mand.pk_corp = #{pkCorp} and basdoc.custcode = #{custcode}
and mand.dr='0'
and custflag in ('0','2')
</select>
</mapper>

View File

@ -1,40 +0,0 @@
package com.hzya.frame.u8c.bdcorp.dao;
import com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (bd_corp: table)表数据库访问层
*
* @author makejava
* @since 2023-09-06 14:47:17
*/
public interface IBdCorpDao extends IBaseDao<BdCorpEntity, String> {
/**
*
* @content 通过组织主键采购组织编码获取采购组织主键
* @author makejava
* @date 2023/12/11 0011 16:32
*
*/
List<BdCorpEntity> getPoPkByOrg(BdCorpEntity poCorp);
/**
*
* @content 通过组织主键采购组织编码获取库存组织主键
* @author makejava
* @date 2023/12/11 0011 16:32
*
*/
List<BdCorpEntity> getStockPkByOrg(BdCorpEntity poCorp);
/**
*
* @content 通过组织主键销售组织编码获取销售组织主键
* @author makejava
* @date 2023/12/11 0011 16:32
*
*/
List<BdCorpEntity> getSoPkByOrg(BdCorpEntity poCorp);
}

View File

@ -1,36 +0,0 @@
package com.hzya.frame.u8c.bdcorp.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
import com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity;
import com.hzya.frame.u8c.bdcorp.dao.IBdCorpDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (BdCorp)表数据库访问层
*
* @author makejava
* @since 2023-09-06 14:47:17
*/
@Repository("serviceBdCorpDaoImpl")
public class BdCorpDaoImpl extends MybatisGenericDao<BdCorpEntity, String> implements IBdCorpDao{
@DS("sowow_sqlserver_pro")
@Override
public List<BdCorpEntity> getPoPkByOrg(BdCorpEntity poCorp) {
return (List<BdCorpEntity>) super.selectList("com.hzya.frame.u8c.bdcorp.dao.impl.BdCorpDaoImpl.entity_list_base_po", poCorp);
}
@DS("sowow_sqlserver_pro")
@Override
public List<BdCorpEntity> getStockPkByOrg(BdCorpEntity poCorp) {
return (List<BdCorpEntity>) super.selectList("com.hzya.frame.u8c.bdcorp.dao.impl.BdCorpDaoImpl.entity_list_base_stock", poCorp);
}
@DS("sowow_sqlserver_pro")
@Override
public List<BdCorpEntity> getSoPkByOrg(BdCorpEntity poCorp) {
return (List<BdCorpEntity>) super.selectList("com.hzya.frame.u8c.bdcorp.dao.impl.BdCorpDaoImpl.entity_list_base_so", poCorp);
}
}

View File

@ -1,51 +0,0 @@
package com.hzya.frame.u8c.bdcorp.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (BdCorp)实体类
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
public class BdCorpEntity extends BaseEntity {
private String pkPurorg;//采购组织主键
private String pkCorp;//所属公司
private String code;//编码
private String pkCalbody;//库存组织主键
public String getPkCalbody() {
return pkCalbody;
}
public void setPkCalbody(String pkCalbody) {
this.pkCalbody = pkCalbody;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getPkPurorg() {
return pkPurorg;
}
public void setPkPurorg(String pkPurorg) {
this.pkPurorg = pkPurorg;
}
public String getPkCorp() {
return pkCorp;
}
public void setPkCorp(String pkCorp) {
this.pkCorp = pkCorp;
}
}

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.u8c.bdcorp.dao.impl.BdCorpDaoImpl">
<resultMap id="get-BdCorpEntity-result" type="com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity" >
<result property="begindate" column="begindate" jdbcType="VARCHAR"/>
<result property="pkPurorg" column="pk_purorg" jdbcType="VARCHAR"/>
<result property="pkCalbody" column="pk_calbody" jdbcType="VARCHAR"/>
<result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "BdCorpEntity_Base_Column_List">
id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base_po" resultMap="get-BdCorpEntity-result" parameterType = "com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity">
select pk_purorg,code,name ,ownercorp from bd_purorg
where ownercorp = #{pkCorp} and code = #{code}
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base_stock" resultMap="get-BdCorpEntity-result" parameterType = "com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity">
select pk_corp,bodycode,bodyname,pk_calbody from bd_calbody
where 1=1
<!-- and pk_corp = #{pkCorp}-->
and bodycode = #{code}
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base_so" resultMap="get-BdCorpEntity-result" parameterType = "com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity">
select vsalestrucode,vsalestruname,csalestruid,belongcorp from bd_salestru
where belongcorp = #{pkCorp} and vsalestrucode = #{code}
</select>
</mapper>

View File

@ -1,36 +0,0 @@
package com.hzya.frame.u8c.bdcorp.service;
import com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (BdCorp)表服务接口
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
public interface IBdCorpService extends IBaseService<BdCorpEntity, String>{
/**
*
* @content 通过组织主键采购组织编码获取采购组织主键
* @author makejava
* @date 2023/12/11 0011 16:32
*
*/
BdCorpEntity getPoPkByOrg(BdCorpEntity poCorp);
/**
*
* @content 通过组织主键库存组织编码获取库存组织主键
* @author makejava
* @date 2023/12/11 0011 16:32
*
*/
BdCorpEntity getStockPkByOrg(BdCorpEntity poCorp);
/**
*
* @content 通过组织主键销售组织编码获取销售组织主键
* @author makejava
* @date 2023/12/11 0011 16:32
*
*/
BdCorpEntity getSoPkByOrg(BdCorpEntity poCorp);
}

View File

@ -1,54 +0,0 @@
package com.hzya.frame.u8c.bdcorp.service.impl;
import com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity;
import com.hzya.frame.u8c.bdcorp.dao.IBdCorpDao;
import com.hzya.frame.u8c.bdcorp.service.IBdCorpService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* (BdCorp)表服务实现类
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
@Service("serviceCorpServiceImpl")
public class BdCorpServiceImpl extends BaseService<BdCorpEntity, String> implements IBdCorpService {
private IBdCorpDao bdCorpDao;
@Autowired
public void setBdCorpDao(IBdCorpDao dao) {
this.bdCorpDao = dao;
this.dao = dao;
}
@Override
public BdCorpEntity getPoPkByOrg(BdCorpEntity poCorp) {
List<BdCorpEntity> bdCorpEntityList = bdCorpDao.getPoPkByOrg(poCorp);
if(bdCorpEntityList != null && bdCorpEntityList.size() > 0){
return bdCorpEntityList.get(0);
}
return null;
}
@Override
public BdCorpEntity getStockPkByOrg(BdCorpEntity poCorp) {
List<BdCorpEntity> bdCorpEntityList = bdCorpDao.getStockPkByOrg(poCorp);
if(bdCorpEntityList != null && bdCorpEntityList.size() > 0){
return bdCorpEntityList.get(0);
}
return null;
}
@Override
public BdCorpEntity getSoPkByOrg(BdCorpEntity poCorp) {
List<BdCorpEntity> bdCorpEntityList = bdCorpDao.getSoPkByOrg(poCorp);
if(bdCorpEntityList != null && bdCorpEntityList.size() > 0){
return bdCorpEntityList.get(0);
}
return null;
}
}

View File

@ -1,64 +0,0 @@
package com.hzya.frame.u8c.gnsale.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (BdInvmandoc)表服务接口
*
* @author makejava
* @since 2023-08-25 11:21:44
*/
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);
}

View File

@ -1,102 +0,0 @@
package com.hzya.frame.u8c.gnsale.util;
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;
/**
* com.hzya.frame.u8c.hwsale.util
*
* @author makejava
* @date 2025-08 -14 13:25
*/
public class HjyUtil {
public static final String baseUrl = "http://332wh0cyoi.api.taobao.com/router/qm";
public static String slipt = ":";
public static String link = "&";
public static String appKey = "34176866";
public static String hjyAppKey = "5eff199a9de8e25b4968c7219e6c13b5bc558d2b";
public static String appSecret = "c44b90d3ba99d6d88df095f231d45fbe";
public static String appId = "04c6d000efc84a10bf442236fdec291f";
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";
/**
* 获取签名-慧经营开发平台
*
* @param params
* @param appKey
* @return
* @throws IOException
*/
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();
}
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();
}
public static boolean checkSign(Map<String, Object> params, String appKey, String remoteSign) {
try {
params.remove("sign");
params.remove("hjySign");
String localSign = sign(params, appKey);
System.out.println("根据远程调用的请求参数生成的签名:"+localSign);
if (localSign.equals(remoteSign)) {
return true;
}
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
}

View File

@ -1,31 +0,0 @@
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;
}

View File

@ -1,42 +0,0 @@
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());
}
}

View File

@ -1,52 +0,0 @@
package com.hzya.frame.u8c.hwsale.service;
import com.alibaba.fastjson.JSONObject;
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.web.entity.BaseEntity;
import java.util.HashMap;
import java.util.List;
/**
* (BdInvmandoc)表服务接口
*
* @author makejava
* @since 2023-08-25 11:21:44
*/
public interface IHwSaleService extends IBaseService<BaseEntity, String> {
/**
* 获取电商海外订单数据
*
* @param requestJson 请求参数
* @return 实例对象
*/
void getHwSaleOrder(JSONObject requestJson);
/**
* 获取电商海外退货数据
*
* @param requestJson 请求参数
* @return 实例对象
*/
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;
}

View File

@ -1,659 +0,0 @@
package com.hzya.frame.u8c.hwsale.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
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.u8c.Invmandoc.dao.IBdInvmandocDao;
import com.hzya.frame.u8c.Invmandoc.entity.BdInvmandocEntity;
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.util.HwUtil;
import com.hzya.frame.u8c.util.U8cHttpUtil;
import com.hzya.frame.web.entity.BaseEntity;
import org.apache.commons.collections.CollectionUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.time.LocalDate;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
/**
* (BdInvmandoc)表服务实现类
*
* @author makejava
* @since 2023-08-25 11:21:44
*/
@Service("HwSaleServiceImpl")
public class HwSaleServiceImpl extends BaseService<BaseEntity, String> implements IHwSaleService {
@Autowired
private ComparisonServiceImpl comparisonServiceimpl;
@Autowired
private IHwsaleDao hwsaleDao ;
/**
*
* @content 获取电商海外数据
* @className: Administrator
* @author laborer
* @date 2025-08-14 9:06
*
*/
@Override
public void getHwSaleOrder(JSONObject requestJson) {
String startDate = U8cHttpUtil.formatStartDateHW();
String endDate = U8cHttpUtil.formatEndDateHW();
JSONArray dataArr = new JSONArray();
StringBuffer url = new StringBuffer();
url.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesTradeList");
String timestamp = String.valueOf(System.currentTimeMillis());
Map<String, String> map = new TreeMap<>();
map.put("sid", HwUtil.sid);
map.put("appName", HwUtil.appName);
map.put("timestamp",timestamp );
JSONObject parmetersMap = new JSONObject();
parmetersMap.put("createTimeBegin", startDate);
parmetersMap.put("createTimeEnd", endDate);
int i = 0;
while (true){
i++;
parmetersMap.put("pageNo", i);
parmetersMap.put("pageSize", "100");
map.put("body",parmetersMap.toJSONString());
String sign = SecureUtil.md5(HwUtil.linkParams(map,HwUtil.appkey));
logger.info("获取跨境电商销售订单数据,请求参数"+parmetersMap.toJSONString());
url.append("?sid="+HwUtil.sid+"&appName="+HwUtil.appName+"&timestamp="+timestamp+"&sign="+sign);
String result = HwUtil.doPost(parmetersMap.toString(),url.toString());
logger.info("获取跨境电商销售订单数据,返回参数"+result);
if(StrUtil.isEmpty(result)){
throw new RuntimeException("获取跨境电商销售订单数据失败");
}
JSONObject resultObj = JSONObject.parseObject(result);
boolean ok = resultObj.getBoolean("ok");
if(!ok){
throw new RuntimeException("获取跨境电商销售订单数据失败");
}
JSONObject dataObj = resultObj.getJSONObject("data");
JSONArray datas = dataObj.getJSONArray("data");
//获取订单明细数据如果有数据递归向下查反之跳出循环
if(datas.size() >0){
JSONArray dataArrs = new JSONArray();
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);
}
}else{
break;
}
}
//如果数组不为空将数据写入中台业务中心先查询在写入如果数据已经存在则直接跳过反正写入中台业务中心
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 -> {
JSONObject dataItem = bdHwSaleParm(item);
});
}
}
}
/**
* 获取电商海外退货数据
*
* @param requestJson 请求参数
* @return 实例对象
*/
@Override
public void getHwSaleRec(JSONObject requestJson) {
JSONArray dataArr = new JSONArray();
StringBuffer url = new StringBuffer();
url.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesRefundList");
String timestamp = String.valueOf(System.currentTimeMillis());
Map<String, String> map = new TreeMap<>();
map.put("sid", HwUtil.sid);
map.put("appName", HwUtil.appName);
map.put("timestamp",timestamp );
map.put("timestamp",timestamp );
JSONObject parmetersMap = new JSONObject();
parmetersMap.put("createTimeBegin", "2025-08-27 00:00:00");
parmetersMap.put("createTimeEnd", "2025-09-09 23:59:59");
String []typeArr = new String[]{"1","2","3","4","5"};
// parmetersMap.put("typeList",typeArr);
int i = 0;
while (true){
i++;
parmetersMap.put("pageNo", i);
parmetersMap.put("pageSize", "100");
map.put("body",parmetersMap.toJSONString());
String sign = SecureUtil.md5(HwUtil.linkParams(map,HwUtil.appkey));
logger.info("获取跨境电商销售退货数据,请求参数"+parmetersMap.toJSONString());
url.append("?sid="+HwUtil.sid+"&appName="+HwUtil.appName+"&timestamp="+timestamp+"&sign="+sign);
String result = HwUtil.doPost(parmetersMap.toString(),url.toString());
if(StrUtil.isEmpty(result)){
throw new RuntimeException("获取跨境电商销售退货数据失败");
}
JSONObject resultObj = JSONObject.parseObject(result);
String code = resultObj.getString("code");
if(!"200".equals(code)){
throw new RuntimeException("获取跨境电商销售退货数据失败");
}
JSONObject dataObj = resultObj.getJSONObject("data");
JSONArray datas = dataObj.getJSONArray("data");
//获取订单明细数据如果有数据递归向下查反之跳出循环
if(datas.size() >0){
dataArr.addAll(datas);
}else{
break;
}
}
//如果数组不为空将数据写入中台业务中心先查询在写入如果数据已经存在则直接跳过反正写入中台业务中心
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 -> {
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")); // 存货IDSKU编码
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) {
JSONObject data = (JSONObject) item;
//组装表头参数
JSONArray orders = data.getJSONArray("skuSpuInfoList");
JSONObject jsonObjectUser = new JSONObject();
JSONObject jsonStr = new JSONObject();
jsonObjectUser.put("data_id", data.get("returnNo"));
jsonObjectUser.put("mdmCode", "10001");
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", "10002");
mainObject.put("optionName", "数智中台");
JSONObject hw_sale_rec = new JSONObject();
JSONArray hw_sale_recs = new JSONArray();
hw_sale_rec.put("data_id", data.getString("returnNo"));//平台退货订单号
hw_sale_rec.put("amount", data.getString("amount"));//退回总金额
hw_sale_rec.put("goods_all_cost", data.getString("goodsAllCost"));//退回货品总成本
hw_sale_rec.put("goods_count", data.getString("goodsCount"));//退回货品数量
hw_sale_rec.put("order_price", data.getString("orderPrice"));//退回总货款
hw_sale_rec.put("return_no", data.getString("returnNo"));//退换单号
hw_sale_rec.put("shop_name", data.getString("shopName"));//店铺名称
hw_sale_rec.put("shop_code", data.getString("shopCode"));//店铺编码20250702 迭代添加字段
hw_sale_rec.put("src_no", data.getString("srcNo"));//平台退货订单号
hw_sale_rec.put("src_tids", data.getString("srcTids"));//平台订单号多个订单号以逗号分割
hw_sale_rec.put("currency", data.getString("currency"));//币种
hw_sale_rec.put("exchange_rate", data.getString("exchangeRate"));//汇率
hw_sale_rec.put("created", data.getString("created"));//系统退换单创建时间
hw_sale_rec.put("api_refund_time", data.getString("apiRefundTime"));//平台退换单创建时间
hw_sale_rec.put("check_time", data.getString("checkTime"));//移入时间
hw_sale_rec.put("confirm_in_stock_time", data.getString("confirmInStockTime"));//入库时间
hw_sale_rec.put("receiver_name", data.getString("receiverName"));//收件人
hw_sale_rec.put("trade_nos", data.getString("tradeNos"));//ERP 订单号
hw_sale_rec.put("logistics_id", data.getString("logisticsId"));//物流编号
hw_sale_rec.put("logistics_no", data.getString("logisticsNo"));//物流单号
hw_sale_rec.put("logistics_text", data.getString("logisticsText"));//物流名称
hw_sale_rec.put("post_amount", data.getString("postAmount"));//退回邮费
hw_sale_rec.put("warehouse_id", data.getString("warehouseId"));//退回仓库 id
hw_sale_rec.put("warehouse_name", data.getString("warehouseName"));//退回仓库名称
hw_sale_rec.put("process_status_name", data.getString("processStatusName"));//入库状态
hw_sale_rec.put("type", data.getString("type"));//退货类型1退款退货 2换货 3其他 4退款不退货 5退货不退款
hw_sale_rec.put("refund_type_name", data.getString("refundTypeName"));//退货类型描述
if(orders.size()>0){
orders.forEach(items -> {
JSONObject bodys = (JSONObject)items;
JSONObject body = new JSONObject();
body.put("data_id", UUID.fastUUID().getLeastSignificantBits());//data_id
body.put("goods_name", bodys.getString("goodsName"));//SPU名称
body.put("goods_no", bodys.getString("goodsNo"));//SPU编码
body.put("spec_name", bodys.getString("specName"));//SKU名称
body.put("spec_no", bodys.getString("specNo"));//SKU编码
body.put("spec_num", bodys.getString("specNum"));//退回SKU数量
body.put("spec_price", bodys.getString("specPrice"));//商品单价
body.put("spec_amount", bodys.getString("specAmount"));//退回货款
hw_sale_recs.add( body);
});
}
mainObject.put("hw_sale_rec",hw_sale_rec);
mainObject.put("hw_sale_recs",hw_sale_recs);
jsonStr.put("jsonStr",mainObject);
Object result = comparisonServiceimpl.saveEntity(jsonStr);
logger.info("新增结果为:{}", JSON.toJSONString(result));
}
return data;
}
private JSONObject bdHwSaleParm(Object item) {
JSONObject data = (JSONObject) item;
//组装表头参数
JSONArray orders = data.getJSONArray("orders");
JSONObject jsonObjectUser = new JSONObject();
JSONObject jsonStr = new JSONObject();
jsonObjectUser.put("data_id", data.get("tradeId"));
jsonObjectUser.put("mdmCode", "10001");
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", "10001");
mainObject.put("optionName", "数智中台");
JSONObject hw_sale_order = new JSONObject();
JSONArray hw_sage_orders = new JSONArray();
hw_sale_order.put("data_id", data.getString("tradeId"));//订单id
hw_sale_order.put("trade_id", data.getString("tradeId"));//订单id
hw_sale_order.put("trade_no", data.getString("tradeNo"));//ERP订单号
hw_sale_order.put("src_tids", data.getString("srcTids"));//平台订单号
hw_sale_order.put("trade_time", data.getString("tradeTime"));//下单时间
hw_sale_order.put("trade_type", data.getString("tradeType"));//订单类型枚举值线下线上
hw_sale_order.put("shop_no", data.getString("shopNo"));//店铺编码
hw_sale_order.put("shop_text", data.getString("shopText"));//店铺名称
hw_sale_order.put("erp_remark", data.getString("erpRemark"));//系统备注
hw_sale_order.put("cs_remark", data.getString("csRemark"));//客服备注
hw_sale_order.put("buyer_message", data.getString("buyerMessage"));//买家备注
hw_sale_order.put("trade_source", data.getString("tradeSource"));//订单来源
hw_sale_order.put("platform_mask_list", data.getString("platformMaskList"));//平台标识
hw_sale_order.put("flag_list", data.getString("flagList"));//订单标记 ,取系统单中自定义标记名称
hw_sale_order.put("seller_full_name", data.getString("sellerFullName"));//业务员
hw_sale_order.put("warehouse_no", data.getString("warehouseNo"));//仓库编码
hw_sale_order.put("warehouse_text", data.getString("warehouseText"));//仓库名称
hw_sale_order.put("outer_no", data.getString("outerNo"));//外部仓单号
hw_sale_order.put("post_amount", data.getString("postAmount"));//买家支付邮费
hw_sale_order.put("receiver_telno", data.getString("receiverTelno"));//固话
hw_sale_order.put("receiver_name", data.getString("receiverName"));//收件人
hw_sale_order.put("receiver_mobile", data.getString("receiverMobile"));//手机
hw_sale_order.put("receiver_zip", data.getString("receiverZip"));//邮编
hw_sale_order.put("weight", data.getString("weight"));//重量
hw_sale_order.put("buyer_nick", data.getString("buyerNick"));//昵称
hw_sale_order.put("country", data.getString("country"));//国家
hw_sale_order.put("receiver_province", data.getString("receiverProvince"));///
hw_sale_order.put("receiver_city", data.getString("receiverCity"));//
hw_sale_order.put("receiver_district", data.getString("receiverDistrict"));//
hw_sale_order.put("receiver_address", data.getString("receiverAddress"));//详细地址1
hw_sale_order.put("receiver_address2", data.getString("receiverAddress2"));//详细地址2
hw_sale_order.put("logistics_id", data.getString("logisticsId"));//物流编号
hw_sale_order.put("logistics_text", data.getString("logisticsText"));//物流名称
hw_sale_order.put("logistics_no", data.getString("logisticsNo"));//物流单号
hw_sale_order.put("logistics_label_url", data.getString("logisticsLabelUrl"));//物流面单url
hw_sale_order.put("delivery_mobile", data.getString("deliveryMobile"));//发货人信息
hw_sale_order.put("currency_code", data.getString("currencyCode"));//订单币种
hw_sale_order.put("delivery_type", data.getString("deliveryType"));//付款方式
hw_sale_order.put("receivable", data.getString("receivable"));//应收金额
hw_sale_order.put("received", data.getString("received"));//实收金额
hw_sale_order.put("pay_time", data.getString("payTime"));//付款时间
hw_sale_order.put("over_time", data.getString("overTime"));//最晚发货时间
hw_sale_order.put("delivery_time", data.getString("deliveryTime"));//发货时间
hw_sale_order.put("out_bound_time", data.getString("outBoundTime"));//移入配货时间
hw_sale_order.put("estimated_vat", data.getString("estimatedVat"));//税费
hw_sale_order.put("discount", data.getString("discount"));//优惠
hw_sale_order.put("discount_codes", data.getString("discountCodes"));//折扣码
hw_sale_order.put("commission", data.getString("commission"));//佣金
hw_sale_order.put("post_cost", data.getString("postCost"));//预估邮费成本
hw_sale_order.put("bad_delivery", data.getString("badDelivery"));//是否异常发货true 异常false 无异常
hw_sale_order.put("frozen", data.getString("frozen"));//是否冻结true 已冻结false 未冻结
hw_sale_order.put("trade_status_code", data.getString("tradeStatusCode"));//订单状态编码123478
hw_sale_order.put("trade_status_desc", data.getString("tradeStatusDesc"));//订单状态描述递交中待处理配货中已发货已取消待审核
hw_sale_order.put("created", data.getString("created"));//创建时间
hw_sale_order.put("modified", data.getString("modified"));//修改时间
hw_sale_order.put("exchange_rate", data.getString("exchangeRate"));//汇率
hw_sale_order.put("platform_id", data.getString("platformId"));//平台id信息
hw_sale_order.put("sku_platform_discount", data.getString("skuPlatformDiscount"));//平台优惠
hw_sale_order.put("sku_seller_discount", data.getString("skuSellerDiscount"));//买家优惠
hw_sale_order.put("refund_status", data.getString("refundStatus"));//0:无退款1:申请退款2:部分退款3:退款成功
hw_sale_order.put("tid_number", data.getString("tidNumber"));//平台序列号(20250604迭代新增)
hw_sale_order.put("pay_account", data.getString("payAccount"));//支付账户20250702添加
if(orders.size()>0){
orders.forEach(items -> {
JSONObject bodys = (JSONObject)items;
JSONObject body = new JSONObject();
body.put("data_id", bodys.getString("orderId"));//订单id
body.put("order_id", bodys.getString("orderId"));//子单id
body.put("trade_id", bodys.getString("tradeId"));//订单id
body.put("src_oid", bodys.getString("srcOid"));//平台子单号
body.put("src_tid", bodys.getString("srcTid"));//平台订单号
body.put("api_spec_no", bodys.getString("apiSpecNo"));//平台SKU编码
body.put("api_spec_name", bodys.getString("apiSpecName"));//平台SKU编码
body.put("sku_no", bodys.getString("skuNo"));//SKU编码
body.put("sku_name", bodys.getString("skuName"));//SKU名称
body.put("spu_no", bodys.getString("spuNo"));//SPU编码
body.put("spu_name", bodys.getString("spuName"));//SPU名称
body.put("stock_num", bodys.getString("stockNum"));//库存数
body.put("use_able_stock_num", bodys.getString("useAbleStockNum"));//可用库存
body.put("delivery_able_stock_num", bodys.getString("deliveryAbleStockNum"));//可发库存
body.put("num", bodys.getString("num"));//销售数量
body.put("price", bodys.getString("price"));//单价
body.put("sku_amount", bodys.getString("skuAmount"));//货款
body.put("is_gift", bodys.getString("isGift"));//是否赠品
body.put("position_nos", bodys.getString("positionNos"));//货位编码
body.put("remark", bodys.getString("remark"));//子单备注
body.put("sku_price", bodys.getString("skuPrice"));//货品档案维护的标价
body.put("order_post_amount", bodys.getString("orderPostAmount"));//分摊邮费
body.put("latest_purchase_price", bodys.getString("latestPurchasePrice"));//最新采购入库价
body.put("platform_order_status", bodys.getString("platformOrderStatus"));//平台子单状态(5:未知,10:未确认,25:风控中,30:待发货,40:部分发货,50:已发货,60:已签收,70:已完成,80:已退款,90:已关闭)
body.put("detail_goods_amount", bodys.getString("detailGoodsAmount"));//商品成交价
body.put("suite_no", bodys.getString("suiteNo"));//组合SKU编码
body.put("suite_name", bodys.getString("suiteName"));//组合SKU名称
body.put("logistics_label_url", bodys.getString("logisticsLabelUrl"));//面单链接如果没有链接返回null
body.put("spec_img_url", bodys.getString("specImgUrl"));//sku图片
body.put("refund_status", bodys.getString("refundStatus"));//0:无退款1:取消退款 2:申请退款 5:退款成功 7:子单部分退款
body.put("tid_number", bodys.getString("tidNumber"));//平台序列号(20250604迭代新增)
body.put("special_info", bodys.getString("specialInfo"));//定制信息(20250702添加)
hw_sage_orders.add( body);
});
}
mainObject.put("hw_sale_order",hw_sale_order);
mainObject.put("hw_sale_orders",hw_sage_orders);
jsonStr.put("jsonStr",mainObject);
Object result = comparisonServiceimpl.saveEntity(jsonStr);
logger.info("新增结果为:{}", JSON.toJSONString(result));
}
return data;
}
@NotNull
private JSONArray getOrders(String timestamp, JSONArray tradeIds) {
// JSONObject data = (JSONObject) item;
//获取订单明细数据
// JSONArray tradeIds = new JSONArray();
// tradeIds.add(data.getString("tradeId"));
StringBuffer bUrl = new StringBuffer();
bUrl.append(HwUtil.baseUrl + "/api/openservices/trade/v1/getSalesTradeOrderList");
Map<String, String> bMap = new TreeMap<>();
bMap.put("sid", HwUtil.sid);
bMap.put("appName", HwUtil.appName);
bMap.put("timestamp", timestamp);
JSONObject bParmetersMap = new JSONObject();
bParmetersMap.put("tradeIds",tradeIds);
bMap.put("body",bParmetersMap.toJSONString());
String bSign = SecureUtil.md5(HwUtil.linkParams(bMap,HwUtil.appkey));
bUrl.append("?sid="+HwUtil.sid+"&appName="+HwUtil.appName+"&timestamp="+ timestamp +"&sign="+bSign);
String bResult = HwUtil.doPost(bParmetersMap.toString(),bUrl.toString());
if(StrUtil.isEmpty(bResult)){
throw new RuntimeException("获取跨境电商销售订单数据失败");
}
JSONObject bResultObj = JSONObject.parseObject(bResult);
logger.info("获取跨境电商销售订单数据结果为:{}", JSON.toJSONString(bResultObj));
boolean bOk = bResultObj.getBoolean("ok");
if(!bOk){
logger.info("获取跨境电商销售订单明细数据失败");
}
JSONArray bDataarr = bResultObj.getJSONArray("data");
// data.put("orders",bDataarr);
return bDataarr;
}
}

View File

@ -1,54 +0,0 @@
package com.hzya.frame.u8c.hwsale.util;
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;
/**
* com.hzya.frame.u8c.hwsale.util
*
* @author makejava
* @date 2025-08 -14 13:25
*/
public class HwUtil {
public static final String baseUrl = "https://openapi.qizhishangke.com";
public static final String appkey = "d754a2f4a3c7fcbf92c77cbb17cb330c";
public static final String sid = "jss3";
public static final String appName = "jss3";
/**
*
* @content 参数加密
* @className: Administrator
* @author laborer
* @date 2025-08-14 13:25
*
*/
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())
{
if (item.getKey().equals("sign"))
continue;
sb.append(item.getKey());
sb.append(item.getValue());
}
sb.append(secret);
return sb.toString();
}
public static String doPost(String parm,String url){
String result = HttpRequest.post(url)
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
return result;
}
}

View File

@ -1,308 +0,0 @@
package com.hzya.frame.u8c.util;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import 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
*
* @author yqh
* @date 2023-11 -14 18:45
*/
public class U8cHttpUtil {
protected Logger logger = LogManager.getLogger(super.getClass());
public static String baseUrl = "127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
public static JSONObject sendDataTOU8CEsb(String parm, String apiCode){
String result = HttpRequest.post(baseUrl)
.header("usercode", "U8CLOUD")//头信息多个头信息多次调用此方法即可
// .header("needStackTrace", "Y")//头信息多个头信息多次调用此方法即可
.header("password", "f37aa888e10dbf1046421f5d09df7646")//头信息多个头信息多次调用此方法即可
.header("trantype", "code")//头信息多个头信息多次调用此方法即可
.header("system", "U8CLOUD")//头信息多个头信息多次调用此方法即可
.header("appId", "800005")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
if(StrUtil.isNotEmpty(result)){
return analytic(result);
}
return null;
}
public static JSONObject analytic(String parm){
JSONObject main = JSON.parseObject(parm);
String status = main.getString("status");
if("200".equals(status)){
String attribute = main.getString("attribute");
JSONObject attributeObj = JSON.parseObject(attribute);
return attributeObj;
}
if("500".equals(status)){
String attribute = main.getString("attribute");
JSONObject attributeObj = JSON.parseObject(attribute);
return attributeObj;
}
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);
}
}

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
</web-app>

66
pom.xml
View File

@ -16,7 +16,7 @@
<!-- <module>fw-ningbobank</module>-->
<!-- <module>fw-oa</module>-->
<!-- <module>fw-u8</module>-->
<module>fw-u8c</module>
<!-- <module>fw-u8c</module>-->
<!-- <module>fw-u9c</module>-->
<!-- <module>fw-weixin</module>-->
</modules>
@ -44,8 +44,9 @@
<druid.version>1.1.22</druid.version>
<!-- <mybatis-spring-boot-starter.version>2.2.2</mybatis-spring-boot-starter.version>-->
<mybatis-plus-boot-starter.version>3.5.6</mybatis-plus-boot-starter.version>
<!-- <mysql-connector-j.version>8.0.33</mysql-connector-j.version>-->
<mysql-connector-java>5.1.49</mysql-connector-java>
<!-- <mysql-connector-j.version>8.0.13</mysql-connector-j.version>-->
<!-- <mysql-connector-java>5.1.49</mysql-connector-java>-->
<mysql-connector-java>8.0.33</mysql-connector-java>
<pagehelper-spring-boot-starter.version>1.4.6</pagehelper-spring-boot-starter.version>
<spring-boot-starter-cache.version>2.7.18</spring-boot-starter-cache.version>
<sa.token.version>1.30.0</sa.token.version>
@ -421,6 +422,11 @@
<artifactId>jsch</artifactId>
<version>0.1.53</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.5</version>
</dependency>
</dependencies>
<build>
@ -471,33 +477,33 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<!-- <resource>-->
<!-- <directory>${basedir}/../base-service/src/main/webapp/WEB-INF/lib</directory>-->
<!-- <targetPath>WEB-INF/lib/</targetPath>-->
<!-- <filtering>false</filtering>-->
<!-- <includes>-->
<!-- &lt;!&ndash; 匹配所有jar包 &ndash;&gt;-->
<!-- <include>**/*.jar</include>-->
<!-- </includes>-->
<!-- </resource>-->
<!-- <resource>-->
<!-- <directory>${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib</directory>-->
<!-- <targetPath>WEB-INF/lib/</targetPath>-->
<!-- <filtering>false</filtering>-->
<!-- <includes>-->
<!-- &lt;!&ndash; 匹配所有jar包 &ndash;&gt;-->
<!-- <include>**/*.jar</include>-->
<!-- </includes>-->
<!-- </resource>-->
<!-- <resource>-->
<!-- <directory>${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib</directory>-->
<!-- <targetPath>WEB-INF/lib/</targetPath>-->
<!-- <filtering>false</filtering>-->
<!-- <includes>-->
<!-- &lt;!&ndash; 匹配所有jar包 &ndash;&gt;-->
<!-- <include>**/*.jar</include>-->
<!-- </includes>-->
<!-- </resource>-->
<resource>
<directory>${basedir}/../base-service/src/main/webapp/WEB-INF/lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<filtering>false</filtering>
<includes>
<!-- 匹配所有jar包 -->
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<filtering>false</filtering>
<includes>
<!-- 匹配所有jar包 -->
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<filtering>false</filtering>
<includes>
<!-- 匹配所有jar包 -->
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>