refactor: 删除未使用的旧代码

- 移除 BackUpDatabaseInitializer 类的全部内容
- 删除 MdmDaoImpl、IMdmDao 和 MdmEntity 类
-清理了数据库备份和主数据管理相关的无用代码
This commit is contained in:
liuy 2025-09-02 15:15:27 +08:00
parent 08b2211d17
commit 2cc010b3d9
62 changed files with 980 additions and 3407 deletions

View File

@ -18,6 +18,10 @@
<artifactId>base-webapp</artifactId> <artifactId>base-webapp</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
</dependencies> </dependencies>
<profiles> <profiles>
@ -50,6 +54,12 @@
<profile.active>zqtlocal</profile.active> <profile.active>zqtlocal</profile.active>
</properties> </properties>
</profile> </profile>
<profile>
<id>zanhuoprod</id> <!--刘洋-->
<properties>
<profile.active>zanhuoprod</profile.active>
</properties>
</profile>
</profiles> </profiles>
<build> <build>

View File

@ -1,386 +0,0 @@
package com.hzya.frame.plugin.BackUpDatabase.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpATTRS;
import com.jcraft.jsch.SftpException;
import org.apache.commons.net.ftp.FTPClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
/**
* 主数据模版(MdmModule)表服务接口
*
* @author makejava
* @since 2024-06-18 10:33:32
*/
public class BackUpDatabaseInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(BackUpDatabaseInitializer.class);
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "BackUpDatabasePlugin";
}
@Override
public String getPluginName() {
return "数据库备份下发";
}
@Override
public String getPluginLabel() {
return "BackUpDatabasePlugin";
}
@Override
public String getPluginType() {
return "1";
}
@Value("${database.filePase:}")
private String filePase;//文件保存路径
@Value("${database.fileName:data.sql}")
private String fileName;//文件保存名称
@Value("${database.databaseName:}")
private String databaseName;//库名
@Value("${database.host:}")
private String host;//地址
@Value("${database.port:}")
private String port;//端口
@Value("${database.username:}")
private String username;//用户名
@Value("${database.password:}")
private String password;//密码
@Value("${sftp.host:}")
private String sftpHost;
@Value("${sftp.port:}")
private Integer sftpPort;
@Value("${sftp.username:}")
private String sftpUsername;
@Value("${sftp.password:}")
private String sftpPassword;
@Value("${sftp.filePase:}")
private String sftpFilePase;
private ChannelSftp sftp = null;
private Session sshSession = null;
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
if(filePase == null || "".equals(filePase)
|| databaseName == null || "".equals(databaseName)
|| fileName == null || "".equals(fileName)
|| host == null || "".equals(host)
|| port == null || "".equals(port)
|| username == null || "".equals(username)
|| password == null || "".equals(password)
){
return BaseResult.getSuccessMessageEntity("系统参数未配置不执行,数据库备份");
}
//查找是否存在当天数据库
//格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String data = sdf.format(new Date());
//当天路径
String nowDatabasePase = filePase + File.separator + data;
//不判断文件是否存在直接执行
if(!backFile(nowDatabasePase)){
return BaseResult.getFailureMessageEntity("备份失败");
}
//判断是否有sftp配置有的备份没有的不备份
if(sftpHost != null && !"".equals(sftpHost)
&& sftpPort != null && !"".equals(sftpPort)
&& sftpUsername != null && !"".equals(sftpUsername)
&& sftpPassword != null && !"".equals(sftpPassword)
&& sftpFilePase != null && !"".equals(sftpFilePase)
){
String sftpnowDatabasePase = sftpFilePase + File.separator + data;
if(!sendFile(nowDatabasePase,sftpnowDatabasePase)){
return BaseResult.getFailureMessageEntity("备份失败");
}
}
logger.info("执行成功");
return BaseResult.getSuccessMessageEntity("执行成功");
} catch (Exception e) {
logger.error("执行失败{}", e.getMessage());
return BaseResult.getFailureMessageEntity("备份失败");
}
}
private boolean backFile(String nowDatabasePase) {
try {
// 构建 mysqldump 命令
ProcessBuilder processBuilder = new ProcessBuilder(
"mysqldump",
"--ssl-mode=DISABLED",
"-h", host,
"-u", username,
"-p" + password,
"-P" + port,
databaseName);
// 启动进程并获取输入流
Process process = processBuilder.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
File f = creatFile(nowDatabasePase,fileName);
// 将备份内容写入文件
FileWriter writer = new FileWriter(f);
String line;
while ((line = reader.readLine())!= null) {
writer.write(line + "\n");
}
// 关闭资源
reader.close();
writer.close();
process.waitFor();
logger.info("文件备份成功路径:"+nowDatabasePase+ File.separator +fileName);
return true;
} catch (IOException | InterruptedException e) {
logger.info("文件备份失败:"+e.getMessage());
return false;
}
}
/**
* @Author lvleigang
* @Description 创建目录及文件
* @Date 8:59 上午 2024/10/22
* @param filePath
* @param fileName
* @return java.io.File
**/
public File creatFile(String filePath, String fileName) {
File folder = new File(filePath);
//文件夹路径不存在
if (!folder.exists()) {
boolean mkdirs = folder.mkdirs();
}
// 如果文件不存在就创建
File file = new File(filePath + File.separator + fileName);
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
logger.error("创建备份文件失败:"+e.getMessage());
}
}
return file;
}
private boolean sendFile(String localFilePath,String remoteFileName) {
try {
connect();
uploadFile(remoteFileName,fileName,localFilePath,fileName);
disconnect();
return true;
} catch (Exception e) {
logger.error("sftp文件上传失败:"+e.getMessage());
return false;
}
}
public void connect() {
try {
JSch jsch = new JSch();
jsch.getSession(sftpUsername, sftpHost, sftpPort);
sshSession = jsch.getSession(sftpUsername, sftpHost, sftpPort);
if (logger.isInfoEnabled()) {
logger.info("Session created.");
}
sshSession.setPassword(sftpPassword);
Properties sshConfig = new Properties();
sshConfig.put("StrictHostKeyChecking", "no");
sshSession.setConfig(sshConfig);
sshSession.connect();
if (logger.isInfoEnabled()) {
logger.info("Session connected.");
}
Channel channel = sshSession.openChannel("sftp");
channel.connect();
if (logger.isInfoEnabled()) {
logger.info("Opening Channel.");
}
sftp = (ChannelSftp) channel;
if (logger.isInfoEnabled()) {
logger.info("Connected to " + host + ".");
}
} catch (Exception e) {
}
}
/**
* 关闭连接
*/
public void disconnect() {
if (this.sftp != null) {
if (this.sftp.isConnected()) {
this.sftp.disconnect();
if (logger.isInfoEnabled()) {
logger.info("sftp is closed already");
}
}
}
if (this.sshSession != null) {
if (this.sshSession.isConnected()) {
this.sshSession.disconnect();
if (logger.isInfoEnabled()) {
logger.info("sshSession is closed already");
}
}
}
}
/**
* 上传单个文件
*
* @param remotePath远程保存目录
* @param remoteFileName保存文件名
* @param localPath本地上传目录(以路径符号结束)
* @param localFileName上传的文件名
* @return
*/
public boolean uploadFile(String remotePath, String remoteFileName, String localPath, String localFileName) {
FileInputStream in = null;
try {
createDir(remotePath);
File file = new File(localPath + File.separator + localFileName);
in = new FileInputStream(file);
sftp.put(in, remoteFileName, 65536);
return true;
} catch (FileNotFoundException e) {
} catch (SftpException e) {
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
}
}
}
return false;
}
/**
* 创建目录
*
* @param createpath
* @return
*/
public boolean createDir(String createpath) {
try {
if (isDirExist(createpath)) {
this.sftp.cd(createpath);
return true;
}
String pathArry[] = createpath.split("/");
StringBuffer filePath = new StringBuffer("/");
for (String path : pathArry) {
if (path.equals("")) {
continue;
}
filePath.append(path + "/");
if (isDirExist(filePath.toString())) {
sftp.cd(filePath.toString());
} else {
// 建立目录
sftp.mkdir(filePath.toString());
// 进入并设置为当前目录
sftp.cd(filePath.toString());
}
}
this.sftp.cd(createpath);
return true;
} catch (SftpException e) {
}
return false;
}
/**
* 判断目录是否存在
*
* @param directory
* @return
*/
public boolean isDirExist(String directory) {
boolean isDirExistFlag = false;
try {
SftpATTRS sftpATTRS = sftp.lstat(directory);
isDirExistFlag = true;
return sftpATTRS.isDir();
} catch (Exception e) {
if (e.getMessage().toLowerCase().equals("no such file")) {
isDirExistFlag = false;
}
}
return isDirExistFlag;
}
/**
* 如果目录不存在就创建目录
*
* @param path
*/
public void mkdirs(String path) {
File f = new File(path);
String fs = f.getParent();
f = new File(fs);
if (!f.exists()) {
f.mkdirs();
}
}
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.plugin.masterData.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.masterData.entity.MdmEntity;
/**
* 客户档案(mdm_customer: table)表数据库访问层
*
* @author makejava
* @since 2024-06-21 13:52:35
*/
public interface IMdmDao extends IBaseDao<MdmEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.plugin.masterData.dao.impl;
import com.hzya.frame.plugin.masterData.entity.MdmEntity;
import com.hzya.frame.plugin.masterData.dao.IMdmDao;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 客户档案(MdmCustomer)表数据库访问层
*
* @author makejava
* @since 2024-06-21 13:52:35
*/
public class MdmDaoImpl extends MybatisGenericDao<MdmEntity, String> implements IMdmDao {
}

View File

@ -1,186 +0,0 @@
package com.hzya.frame.plugin.masterData.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 客户档案(MdmCustomer)实体类
*
* @author makejava
* @since 2024-06-21 13:52:35
*/
public class MdmEntity extends BaseEntity {
/** 单据规则 */
private String documentRule;
/** 单据规则流水号 */
private Long documentRuleNum;
/** 数据状态 Y正常 N删除 F修改 */
private String dataStatus;
/** 新增数据状态 0待下发 1已下发 */
private String addStatus;
/** 修改数据状态 0待下发 1已下发 */
private String updateStatus;
/** 删除数据状态 0待下发 1已下发 */
private String deleteStatus;
/** 公司id */
private String companyId;
/** 客户编码 */
private String code;
/** 客户类型 */
private String custprop;
/** 客户状态 */
private String custstate;
/** 启用状态 */
private String enablestate;
/** 客户名称 */
private String name;
/** 国家/地区 */
private String pkCountry;
/** 客户基本分类 */
private String pkCustclass;
/** 所属集团 */
private String pkGroup;
/** 所属组织 */
private String pkOrg;
/** 纳税人登记号 */
private String taxpayerid;
public String getDocumentRule() {
return documentRule;
}
public void setDocumentRule(String documentRule) {
this.documentRule = documentRule;
}
public Long getDocumentRuleNum() {
return documentRuleNum;
}
public void setDocumentRuleNum(Long documentRuleNum) {
this.documentRuleNum = documentRuleNum;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public String getAddStatus() {
return addStatus;
}
public void setAddStatus(String addStatus) {
this.addStatus = addStatus;
}
public String getUpdateStatus() {
return updateStatus;
}
public void setUpdateStatus(String updateStatus) {
this.updateStatus = updateStatus;
}
public String getDeleteStatus() {
return deleteStatus;
}
public void setDeleteStatus(String deleteStatus) {
this.deleteStatus = deleteStatus;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCustprop() {
return custprop;
}
public void setCustprop(String custprop) {
this.custprop = custprop;
}
public String getCuststate() {
return custstate;
}
public void setCuststate(String custstate) {
this.custstate = custstate;
}
public String getEnablestate() {
return enablestate;
}
public void setEnablestate(String enablestate) {
this.enablestate = enablestate;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPkCountry() {
return pkCountry;
}
public void setPkCountry(String pkCountry) {
this.pkCountry = pkCountry;
}
public String getPkCustclass() {
return pkCustclass;
}
public void setPkCustclass(String pkCustclass) {
this.pkCustclass = pkCustclass;
}
public String getPkGroup() {
return pkGroup;
}
public void setPkGroup(String pkGroup) {
this.pkGroup = pkGroup;
}
public String getPkOrg() {
return pkOrg;
}
public void setPkOrg(String pkOrg) {
this.pkOrg = pkOrg;
}
public String getTaxpayerid() {
return taxpayerid;
}
public void setTaxpayerid(String taxpayerid) {
this.taxpayerid = taxpayerid;
}
}

View File

@ -1,375 +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.plugin.masterData.dao.impl.MdmDaoImpl">
<resultMap id="get-MdmCustomerEntity-result" type="com.hzya.frame.plugin.masterData.entity.MdmEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="documentRule" column="document_rule" jdbcType="VARCHAR"/>
<result property="documentRuleNum" column="document_rule_num" jdbcType="INTEGER"/>
<result property="dataStatus" column="data_status" jdbcType="VARCHAR"/>
<result property="addStatus" column="add_status" jdbcType="VARCHAR"/>
<result property="updateStatus" column="update_status" jdbcType="VARCHAR"/>
<result property="deleteStatus" column="delete_status" 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="code" column="code" jdbcType="VARCHAR"/>
<result property="custprop" column="custprop" jdbcType="VARCHAR"/>
<result property="custstate" column="custstate" jdbcType="VARCHAR"/>
<result property="enablestate" column="enablestate" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="pkCountry" column="pk_country" jdbcType="VARCHAR"/>
<result property="pkCustclass" column="pk_custclass" jdbcType="VARCHAR"/>
<result property="pkGroup" column="pk_group" jdbcType="VARCHAR"/>
<result property="pkOrg" column="pk_org" jdbcType="VARCHAR"/>
<result property="taxpayerid" column="taxpayerid" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "MdmCustomerEntity_Base_Column_List">
id
,document_rule
,document_rule_num
,data_status
,add_status
,update_status
,delete_status
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,code
,custprop
,custstate
,enablestate
,name
,pk_country
,pk_custclass
,pk_group
,pk_org
,taxpayerid
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmCustomerEntity-result" parameterType = "com.hzya.frame.plugin.masterData.entity.MdmEntity">
select
<include refid="MdmCustomerEntity_Base_Column_List" />
from mdm_customer
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="documentRule != null and documentRule != ''"> and document_rule = #{documentRule} </if>
<if test="documentRuleNum != null"> and document_rule_num = #{documentRuleNum} </if>
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
<if test="addStatus != null and addStatus != ''"> and add_status = #{addStatus} </if>
<if test="updateStatus != null and updateStatus != ''"> and update_status = #{updateStatus} </if>
<if test="deleteStatus != null and deleteStatus != ''"> and delete_status = #{deleteStatus} </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="code != null and code != ''"> and code = #{code} </if>
<if test="custprop != null and custprop != ''"> and custprop = #{custprop} </if>
<if test="custstate != null and custstate != ''"> and custstate = #{custstate} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="pkCountry != null and pkCountry != ''"> and pk_country = #{pkCountry} </if>
<if test="pkCustclass != null and pkCustclass != ''"> and pk_custclass = #{pkCustclass} </if>
<if test="pkGroup != null and pkGroup != ''"> and pk_group = #{pkGroup} </if>
<if test="pkOrg != null and pkOrg != ''"> and pk_org = #{pkOrg} </if>
<if test="taxpayerid != null and taxpayerid != ''"> and taxpayerid = #{taxpayerid} </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.plugin.masterData.entity.MdmEntity">
select count(1) from mdm_customer
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="documentRule != null and documentRule != ''"> and document_rule = #{documentRule} </if>
<if test="documentRuleNum != null"> and document_rule_num = #{documentRuleNum} </if>
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
<if test="addStatus != null and addStatus != ''"> and add_status = #{addStatus} </if>
<if test="updateStatus != null and updateStatus != ''"> and update_status = #{updateStatus} </if>
<if test="deleteStatus != null and deleteStatus != ''"> and delete_status = #{deleteStatus} </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="code != null and code != ''"> and code = #{code} </if>
<if test="custprop != null and custprop != ''"> and custprop = #{custprop} </if>
<if test="custstate != null and custstate != ''"> and custstate = #{custstate} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="pkCountry != null and pkCountry != ''"> and pk_country = #{pkCountry} </if>
<if test="pkCustclass != null and pkCustclass != ''"> and pk_custclass = #{pkCustclass} </if>
<if test="pkGroup != null and pkGroup != ''"> and pk_group = #{pkGroup} </if>
<if test="pkOrg != null and pkOrg != ''"> and pk_org = #{pkOrg} </if>
<if test="taxpayerid != null and taxpayerid != ''"> and taxpayerid = #{taxpayerid} </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>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-MdmCustomerEntity-result" parameterType = "com.hzya.frame.plugin.masterData.entity.MdmEntity">
select
<include refid="MdmCustomerEntity_Base_Column_List" />
from mdm_customer
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="documentRule != null and documentRule != ''"> and document_rule like concat('%',#{documentRule},'%') </if>
<if test="documentRuleNum != null"> and document_rule_num like concat('%',#{documentRuleNum},'%') </if>
<if test="dataStatus != null and dataStatus != ''"> and data_status like concat('%',#{dataStatus},'%') </if>
<if test="addStatus != null and addStatus != ''"> and add_status like concat('%',#{addStatus},'%') </if>
<if test="updateStatus != null and updateStatus != ''"> and update_status like concat('%',#{updateStatus},'%') </if>
<if test="deleteStatus != null and deleteStatus != ''"> and delete_status like concat('%',#{deleteStatus},'%') </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>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="custprop != null and custprop != ''"> and custprop like concat('%',#{custprop},'%') </if>
<if test="custstate != null and custstate != ''"> and custstate like concat('%',#{custstate},'%') </if>
<if test="enablestate != null and enablestate != ''"> and enablestate like concat('%',#{enablestate},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="pkCountry != null and pkCountry != ''"> and pk_country like concat('%',#{pkCountry},'%') </if>
<if test="pkCustclass != null and pkCustclass != ''"> and pk_custclass like concat('%',#{pkCustclass},'%') </if>
<if test="pkGroup != null and pkGroup != ''"> and pk_group like concat('%',#{pkGroup},'%') </if>
<if test="pkOrg != null and pkOrg != ''"> and pk_org like concat('%',#{pkOrg},'%') </if>
<if test="taxpayerid != null and taxpayerid != ''"> and taxpayerid like concat('%',#{taxpayerid},'%') </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>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmCustomerentity_list_or" resultMap="get-MdmCustomerEntity-result" parameterType = "com.hzya.frame.plugin.masterData.entity.MdmEntity">
select
<include refid="MdmCustomerEntity_Base_Column_List" />
from mdm_customer
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="documentRule != null and documentRule != ''"> or document_rule = #{documentRule} </if>
<if test="documentRuleNum != null"> or document_rule_num = #{documentRuleNum} </if>
<if test="dataStatus != null and dataStatus != ''"> or data_status = #{dataStatus} </if>
<if test="addStatus != null and addStatus != ''"> or add_status = #{addStatus} </if>
<if test="updateStatus != null and updateStatus != ''"> or update_status = #{updateStatus} </if>
<if test="deleteStatus != null and deleteStatus != ''"> or delete_status = #{deleteStatus} </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="code != null and code != ''"> or code = #{code} </if>
<if test="custprop != null and custprop != ''"> or custprop = #{custprop} </if>
<if test="custstate != null and custstate != ''"> or custstate = #{custstate} </if>
<if test="enablestate != null and enablestate != ''"> or enablestate = #{enablestate} </if>
<if test="name != null and name != ''"> or name = #{name} </if>
<if test="pkCountry != null and pkCountry != ''"> or pk_country = #{pkCountry} </if>
<if test="pkCustclass != null and pkCustclass != ''"> or pk_custclass = #{pkCustclass} </if>
<if test="pkGroup != null and pkGroup != ''"> or pk_group = #{pkGroup} </if>
<if test="pkOrg != null and pkOrg != ''"> or pk_org = #{pkOrg} </if>
<if test="taxpayerid != null and taxpayerid != ''"> or taxpayerid = #{taxpayerid} </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>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.masterData.entity.MdmEntity" keyProperty="id" useGeneratedKeys="true">
insert into mdm_customer(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="documentRule != null and documentRule != ''"> document_rule , </if>
<if test="documentRuleNum != null"> document_rule_num , </if>
<if test="dataStatus != null and dataStatus != ''"> data_status , </if>
<if test="addStatus != null and addStatus != ''"> add_status , </if>
<if test="updateStatus != null and updateStatus != ''"> update_status , </if>
<if test="deleteStatus != null and deleteStatus != ''"> delete_status , </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="code != null and code != ''"> code , </if>
<if test="custprop != null and custprop != ''"> custprop , </if>
<if test="custstate != null and custstate != ''"> custstate , </if>
<if test="enablestate != null and enablestate != ''"> enablestate , </if>
<if test="name != null and name != ''"> name , </if>
<if test="pkCountry != null and pkCountry != ''"> pk_country , </if>
<if test="pkCustclass != null and pkCustclass != ''"> pk_custclass , </if>
<if test="pkGroup != null and pkGroup != ''"> pk_group , </if>
<if test="pkOrg != null and pkOrg != ''"> pk_org , </if>
<if test="taxpayerid != null and taxpayerid != ''"> taxpayerid , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="documentRule != null and documentRule != ''"> #{documentRule} ,</if>
<if test="documentRuleNum != null"> #{documentRuleNum} ,</if>
<if test="dataStatus != null and dataStatus != ''"> #{dataStatus} ,</if>
<if test="addStatus != null and addStatus != ''"> #{addStatus} ,</if>
<if test="updateStatus != null and updateStatus != ''"> #{updateStatus} ,</if>
<if test="deleteStatus != null and deleteStatus != ''"> #{deleteStatus} ,</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="code != null and code != ''"> #{code} ,</if>
<if test="custprop != null and custprop != ''"> #{custprop} ,</if>
<if test="custstate != null and custstate != ''"> #{custstate} ,</if>
<if test="enablestate != null and enablestate != ''"> #{enablestate} ,</if>
<if test="name != null and name != ''"> #{name} ,</if>
<if test="pkCountry != null and pkCountry != ''"> #{pkCountry} ,</if>
<if test="pkCustclass != null and pkCustclass != ''"> #{pkCustclass} ,</if>
<if test="pkGroup != null and pkGroup != ''"> #{pkGroup} ,</if>
<if test="pkOrg != null and pkOrg != ''"> #{pkOrg} ,</if>
<if test="taxpayerid != null and taxpayerid != ''"> #{taxpayerid} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into mdm_customer(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, code, custprop, custstate, enablestate, name, pk_country, pk_custclass, pk_group, pk_org, taxpayerid, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.code},#{entity.custprop},#{entity.custstate},#{entity.enablestate},#{entity.name},#{entity.pkCountry},#{entity.pkCustclass},#{entity.pkGroup},#{entity.pkOrg},#{entity.taxpayerid}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into mdm_customer(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, code, custprop, custstate, enablestate, name, pk_country, pk_custclass, pk_group, pk_org, taxpayerid)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.code},#{entity.custprop},#{entity.custstate},#{entity.enablestate},#{entity.name},#{entity.pkCountry},#{entity.pkCustclass},#{entity.pkGroup},#{entity.pkOrg},#{entity.taxpayerid})
</foreach>
on duplicate key update
document_rule = values(document_rule),
document_rule_num = values(document_rule_num),
data_status = values(data_status),
add_status = values(add_status),
update_status = values(update_status),
delete_status = values(delete_status),
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),
code = values(code),
custprop = values(custprop),
custstate = values(custstate),
enablestate = values(enablestate),
name = values(name),
pk_country = values(pk_country),
pk_custclass = values(pk_custclass),
pk_group = values(pk_group),
pk_org = values(pk_org),
taxpayerid = values(taxpayerid)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.masterData.entity.MdmEntity" >
update mdm_customer set
<trim suffix="" suffixOverrides=",">
<if test="documentRule != null and documentRule != ''"> document_rule = #{documentRule},</if>
<if test="documentRuleNum != null"> document_rule_num = #{documentRuleNum},</if>
<if test="dataStatus != null and dataStatus != ''"> data_status = #{dataStatus},</if>
<if test="addStatus != null and addStatus != ''"> add_status = #{addStatus},</if>
<if test="updateStatus != null and updateStatus != ''"> update_status = #{updateStatus},</if>
<if test="deleteStatus != null and deleteStatus != ''"> delete_status = #{deleteStatus},</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>
<if test="code != null and code != ''"> code = #{code},</if>
<if test="custprop != null and custprop != ''"> custprop = #{custprop},</if>
<if test="custstate != null and custstate != ''"> custstate = #{custstate},</if>
<if test="enablestate != null and enablestate != ''"> enablestate = #{enablestate},</if>
<if test="name != null and name != ''"> name = #{name},</if>
<if test="pkCountry != null and pkCountry != ''"> pk_country = #{pkCountry},</if>
<if test="pkCustclass != null and pkCustclass != ''"> pk_custclass = #{pkCustclass},</if>
<if test="pkGroup != null and pkGroup != ''"> pk_group = #{pkGroup},</if>
<if test="pkOrg != null and pkOrg != ''"> pk_org = #{pkOrg},</if>
<if test="taxpayerid != null and taxpayerid != ''"> taxpayerid = #{taxpayerid},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.masterData.entity.MdmEntity" >
update mdm_customer 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.plugin.masterData.entity.MdmEntity" >
update mdm_customer 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="documentRule != null and documentRule != ''"> and document_rule = #{documentRule} </if>
<if test="documentRuleNum != null"> and document_rule_num = #{documentRuleNum} </if>
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
<if test="addStatus != null and addStatus != ''"> and add_status = #{addStatus} </if>
<if test="updateStatus != null and updateStatus != ''"> and update_status = #{updateStatus} </if>
<if test="deleteStatus != null and deleteStatus != ''"> and delete_status = #{deleteStatus} </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>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="custprop != null and custprop != ''"> and custprop = #{custprop} </if>
<if test="custstate != null and custstate != ''"> and custstate = #{custstate} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="pkCountry != null and pkCountry != ''"> and pk_country = #{pkCountry} </if>
<if test="pkCustclass != null and pkCustclass != ''"> and pk_custclass = #{pkCustclass} </if>
<if test="pkGroup != null and pkGroup != ''"> and pk_group = #{pkGroup} </if>
<if test="pkOrg != null and pkOrg != ''"> and pk_org = #{pkOrg} </if>
<if test="taxpayerid != null and taxpayerid != ''"> and taxpayerid = #{taxpayerid} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from mdm_customer where id = #{id}
</delete>
</mapper>

View File

@ -1,61 +0,0 @@
package com.hzya.frame.plugin.masterData.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 主数据同步
*
* @author makejava
* @since 2024-06-21 13:52:35
*/
public class MdmPluginInitializer extends PluginBaseEntity{
Logger logger = LoggerFactory.getLogger(MdmPluginInitializer.class);
@Autowired
private IMasterDataService masterDataService;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "MdmCustomerPlugin";
}
@Override
public String getPluginName() {
return "MdmCustomerPlugin插件";
}
@Override
public String getPluginLabel() {
return "MdmCustomerPlugin";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
logger.info("======开始执行主数据信息同步========");
return masterDataService.queryArchives(requestJson);
}catch (Exception e){
logger.info("======执行主数据同步失败:{}========",e.getMessage());
e.printStackTrace();
}
return null;
}
}

View File

@ -1,12 +0,0 @@
package com.hzya.frame.plugin.masterData.service;
import com.hzya.frame.plugin.masterData.entity.MdmEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* 客户档案(MdmCustomer)表服务接口
*
* @author makejava
* @since 2024-06-21 13:52:35
*/
public interface IMdmService extends IBaseService<MdmEntity, String>{
}

View File

@ -1,24 +0,0 @@
package com.hzya.frame.plugin.masterData.service.impl;
import com.hzya.frame.plugin.masterData.entity.MdmEntity;
import com.hzya.frame.plugin.masterData.dao.IMdmDao;
import com.hzya.frame.plugin.masterData.service.IMdmService;
import com.hzya.frame.plugin.masterData.service.IMdmService;
import org.springframework.beans.factory.annotation.Autowired;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* 客户档案(MdmCustomer)表服务实现类
*
* @author makejava
* @since 2024-06-21 13:52:35
*/
public class MdmServiceImpl extends BaseService<MdmEntity, String> implements IMdmService {
private IMdmDao mdmCustomerDao;
@Autowired
public void setMdmCustomerDao(IMdmDao dao) {
this.mdmCustomerDao = dao;
this.dao = dao;
}
}

View File

@ -1,7 +0,0 @@
package com.hzya.frame.plugin.pushMessage.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
public interface IPushMessageDao extends IBaseDao<PushMessageEntity, String> {
}

View File

@ -1,8 +0,0 @@
package com.hzya.frame.plugin.pushMessage.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
public class PushMessageDaoImpl extends MybatisGenericDao<PushMessageEntity, String> implements IPushMessageDao {
}

View File

@ -1,106 +0,0 @@
package com.hzya.frame.plugin.pushMessage.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class PushMessageEntity extends BaseEntity {
private String pushMethod;
private String warningAppCode;
private String warningApiCode;
private String recipientIdList;
private String warningAppType;
private String sendAppName;
private String receiveAppName;
private String receiveApiName;
private String returnData;
private String receiveApiCode;
private String status;
public String getPushMethod() {
return pushMethod;
}
public void setPushMethod(String pushMethod) {
this.pushMethod = pushMethod;
}
public String getWarningAppCode() {
return warningAppCode;
}
public void setWarningAppCode(String warningAppCode) {
this.warningAppCode = warningAppCode;
}
public String getWarningApiCode() {
return warningApiCode;
}
public void setWarningApiCode(String warningApiCode) {
this.warningApiCode = warningApiCode;
}
public String getRecipientIdList() {
return recipientIdList;
}
public void setRecipientIdList(String recipientIdList) {
this.recipientIdList = recipientIdList;
}
public String getWarningAppType() {
return warningAppType;
}
public void setWarningAppType(String warningAppType) {
this.warningAppType = warningAppType;
}
public String getSendAppName() {
return sendAppName;
}
public void setSendAppName(String sendAppName) {
this.sendAppName = sendAppName;
}
public String getReceiveAppName() {
return receiveAppName;
}
public void setReceiveAppName(String receiveAppName) {
this.receiveAppName = receiveAppName;
}
public String getReceiveApiName() {
return receiveApiName;
}
public void setReceiveApiName(String receiveApiName) {
this.receiveApiName = receiveApiName;
}
public String getReturnData() {
return returnData;
}
public void setReturnData(String returnData) {
this.returnData = returnData;
}
public String getReceiveApiCode() {
return receiveApiCode;
}
public void setReceiveApiCode(String receiveApiCode) {
this.receiveApiCode = receiveApiCode;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

View File

@ -1,43 +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.plugin.pushMessage.dao.impl.PushMessageDaoImpl">
<resultMap id="get-PushMessageEntity-result" type="com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity" >
<result property="pushMessage" column="push_message" jdbcType="VARCHAR"/>
<result property="warningAppCode" column="warning_app_code" jdbcType="VARCHAR"/>
<result property="warningApiCode" column="warning_api_code" jdbcType="VARCHAR"/>
<result property="appType" column="app_type" jdbcType="VARCHAR"/>
<result property="recipientIdList" column="recipient_id_list" jdbcType="VARCHAR"/>
<result property="sendAppName" column="send_app_name" jdbcType="VARCHAR"/>
<result property="receiveAppName" column="receive_app_name" jdbcType="VARCHAR"/>
<result property="receiveApiName" column="receive_api_name" jdbcType="VARCHAR"/>
<result property="receiveApiCode" column="receive_api_code" jdbcType="VARCHAR"/>
<result property="returnData" column="return_data" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-PushMessageEntity-result" parameterType = "com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity">
SELECT
warning_config.push_method,
warning_config.sendAppid AS warning_app_code,
warning_config.endApiCode AS warning_api_code,
warning_config.app_type,
warning_config.recipient_id AS recipient_id_list,
log.send_app_name,
log.receive_app_name,
receive_api_name,
log.receive_api_code,
log.return_data,
log.STATUS
FROM
v_hzya_sys_warning warning_config
LEFT JOIN v_hzya_sys_send_message_log log ON warning_config.api_code = log.receive_api_code
WHERE
log.STATUS = '4'
AND warning_config.push_method = '定时'
</select>
</mapper>

View File

@ -1,78 +0,0 @@
package com.hzya.frame.plugin.pushMessage.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import com.hzya.frame.sysnew.pushMessage.service.ISysPushMessageService;
import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("PushMessagePluginInitializer")
public class PushMessagePluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PushMessagePluginInitializer.class);
@Autowired
private ISysPushMessageDao sysPushMessageDao;
@Resource
public ISysSendMessageLogService sysSendMessageLogService;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "PushMessagePlugin";
}
@Override
public String getPluginName() {
return "PushMessagePlugin插件";
}
@Override
public String getPluginLabel() {
return "PushMessagePlugin";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
logger.info("======开始执行定时消息推送========");
//目前只查询一周内的异常日志进行消息推送
List<SysPushMessageEntity> list = sysPushMessageDao.getAll();
for(SysPushMessageEntity entity : list){
sysSendMessageLogService.sendMessage(entity);
}
return BaseResult.getSuccessMessageEntity("定时推送消息成功");
}catch (Exception e){
logger.info("======执行定时消息推送失败:{}========",e.getMessage());
e.printStackTrace();
}
return null;
}
}

View File

@ -1,10 +0,0 @@
package com.hzya.frame.plugin.pushMessage.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface IPushMessageService extends IBaseService<PushMessageEntity, String> {
}

View File

@ -1,25 +0,0 @@
package com.hzya.frame.plugin.pushMessage.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.plugin.pushMessage.service.IPushMessageService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
public class PushMessageServiceImpl extends BaseService<PushMessageEntity, String> implements IPushMessageService {
private IPushMessageDao pushMessageDao;
@Autowired
public void setPushMessageDao(IPushMessageDao dao) {
this.pushMessageDao = dao;
this.dao = dao;
}
}

View File

@ -1,12 +0,0 @@
package com.hzya.frame.plugin.sysMessageManageLogBack.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class SysESBMessageManageLogEntity extends BaseEntity {
private String name;
}

View File

@ -1,59 +0,0 @@
package com.hzya.frame.plugin.sysMessageManageLogBack.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 消息管理日志(SysMessageManageLog)表服务接口
*
* @author makejava
* @since 2024-03-08 10:22:00
*/
public class SysMessageManageLogPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(SysMessageManageLogPluginInitializer.class);
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "SysMessageManageLogPlugin";
}
@Override
public String getPluginName() {
return "ESB消息日志备份";
}
@Override
public String getPluginLabel() {
return "ESB消息日志备份";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("执行成功");
return BaseResult.getSuccessMessageEntity("执行成功");
}catch (Exception e){
e.printStackTrace();
}
return BaseResult.getSuccessMessageEntity("执行成功");
}
}

View File

@ -1,13 +0,0 @@
package com.hzya.frame.plugin.sysMessageManageLogBack.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.sysMessageManageLogBack.entity.SysESBMessageManageLogEntity;
/**
* 消息管理日志(SysMessageManageLog)表服务接口
*
* @author makejava
* @since 2024-03-08 10:22:00
*/
public interface ISysESBMessageManageLogService extends IBaseService<SysESBMessageManageLogEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.plugin.sysMessageManageLogBack.service.impl;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.sysMessageManageLogBack.entity.SysESBMessageManageLogEntity;
import com.hzya.frame.plugin.sysMessageManageLogBack.service.ISysESBMessageManageLogService;
/**
* 消息管理日志(SysMessageManageLog)表服务实现类
*
* @author makejava
* @since 2024-03-08 10:22:00
*/
public class SysESBMessageManageLogServiceImpl extends BaseService<SysESBMessageManageLogEntity, String> implements ISysESBMessageManageLogService {
}

View File

@ -0,0 +1,44 @@
package com.hzya.frame.plugin.zanhuo.config;
import com.mongodb.ConnectionString;
import com.mongodb.MongoClientSettings;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import org.springframework.boot.autoconfigure.mongo.MongoProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.zanhuo.config
* @ProjectkangarooDataCenterV3
* @nameMongoConfig
* @Date2025/8/29 17:07
* @FilenameMongoConfig
*/
@Configuration
public class MongoConfig {
@Bean
public MongoClient mongoClient(MongoProperties properties) {
// 1. application.properties 中读取现有的 URI
ConnectionString connectionString = new ConnectionString(properties.getUri());
// 2. 在现有配置基础上构建 MongoClientSettings
MongoClientSettings settings = MongoClientSettings.builder().applyConnectionString(connectionString) // 应用 URI 中的所有设置
.applyToSocketSettings(builder -> builder
// 设置读超时这里是 15
.readTimeout(60, TimeUnit.SECONDS)
// 设置连接超时这里是 10
.connectTimeout(60, TimeUnit.SECONDS))
// 你还可以配置连接池写确认等
.applyToConnectionPoolSettings(builder -> builder.maxSize(200) // 最大连接数
.minSize(20) // 最小连接数
).build();
return MongoClients.create(settings);
}
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.plugin.zanhuo.constant;
/**
* 吉客云开放平台常量
*
* @author liuyang
*/
public class JackYunConstant {
public static String jackyum_appKey = "12346738";
public static String jackyum_version = "v1.0";
public static String jackyum_appSecret = "94d715fc68214ce1ba48803b3bf19a9f";
public static String jackyum_api = "https://open.jackyun.com/open/openapi/do";
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.zanhuo.dto.jackyun;
import lombok.Data;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.dto
* @Projectnifi-hzyadev-bundle
* @nameResultDataDto
* @Date2025/8/27 16:15
* @FilenameResultDataDto
*/
@Data
public class ResultDataDto<T> {
private String code;
private String developerInfo;
private String msg;
private ResultDto<T> result;
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.zanhuo.dto.jackyun;
import lombok.Data;
import java.util.List;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.dto
* @Projectnifi-hzyadev-bundle
* @nameResultDataDto
* @Date2025/8/27 16:15
* @FilenameResultDataDto
*/
@Data
public class ResultDto<T> {
private String contextId;
private List<T> data;
}

View File

@ -0,0 +1,53 @@
package com.hzya.frame.plugin.zanhuo.dto.jackyun.datadto.salessettlement;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.List;
@Data
@Document(collection = "JackYunSalesSettlementData")
public class JsonRootBeanSalesSettlement {
@Id
private String id;//用于保存到mongodb
private List<String> unSplitAssemblyTradeIds;
private List<String> unSplitAssemblySubTradeIds;
private String lazyQueryEnable;
private List<String> distributionSetupEnums;
private TradeSettleOrderSalesSettlement tradeSettleOrder;
private List<TradeSettleOrderDetailArrSalesSettlement> tradeSettleOrderDetailArr;
private TradeSettleOrderFinSalesSettlement tradeSettleOrderFin;
private String settleInvoiceStatus;
private String settleInvoiceStatusExplain;
private String tradeNo;
private String hasDesensitization;
private String settleDiffer;
private String localSettleFee;
private String existMergeOrSplit;
/**
* 准备持久化将嵌套ID提升为根ID
*
* @return 返回当前实例以支持链式调用
*/
public JsonRootBeanSalesSettlement prepareForSave() {
if (this.tradeSettleOrder != null && this.tradeSettleOrder.getId() != null) {
this.setId(this.tradeSettleOrder.getId());
} else {
throw new IllegalStateException("缺少tradeSettleOrder中所需的Id无法处理批处理");
}
if (this.tradeSettleOrder != null && this.tradeSettleOrder.getAuditTime() != null && this.getTradeSettleOrderDetailArr() != null) {
List<TradeSettleOrderDetailArrSalesSettlement> tradeSettleOrderDetailArr = this.getTradeSettleOrderDetailArr();
tradeSettleOrderDetailArr.forEach(tradeSettleOrderDetailArrSalesSettlement -> {
tradeSettleOrderDetailArrSalesSettlement.setBusinessType(this.tradeSettleOrder.getAuditTime());
});
} else {
throw new IllegalStateException("缺少tradeSettleOrder中所需的auditTime无法处理批处理");
}
return this;
}
}

View File

@ -0,0 +1,82 @@
package com.hzya.frame.plugin.zanhuo.dto.jackyun.datadto.salessettlement;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
@Data
public class TradeSettleOrderDetailArrSalesSettlement {
private String payTypeExplain;
private String accountStatusExplain;
@Id
private String id;
private String settleId;
private String tradeId;
private String tradeNo;
private String sourceTradeNo;
private String subTradeId;
private String goodsId;
private String goodsNo;
private String goodsName;
private String specId;
private String sellCount;
private String sellTotal;
private String goodsTags;
private String isFit;
private String isGift;
private String shareFavourableFee;
private String goodsFlagIds;
private String shareFavourableAfterFee;
private String isSplitGoods;
private String isMergeGoods;
/**
* 数据拉取时间
*/
private String pullData;
/**
* 推送时间
*/
private String newPushDate;
/**
* 报错详情
*/
private String newTransmitInfo;
/**
* 推送状态
*/
private String newstate;
/**
* 下游单号
*/
private String newSystemNumber;
/**
* 下游主键
*/
private String newSystemPrimary;
/**
* 目标业务日期
*/
private String businessType;
/**
* 当时拉取的总行数
*/
private String currentNumber;
/**
* 日志推送状态
* 忽略字段newState此时需要手动生成get/set方法
*/
@Transient
private String newState;
public String getNewState() {
return newState;
}
public void setNewState(String newState) {
this.newState = newState;
}
}

View File

@ -0,0 +1,16 @@
package com.hzya.frame.plugin.zanhuo.dto.jackyun.datadto.salessettlement;
import lombok.Data;
@Data
public class TradeSettleOrderFinSalesSettlement {
private String settleStatusExplain;
private String receiptStatusExplain;
private String finReceiptStatusExplain;
private String finDocStatusExplain;
private String billCheckStatusExplain;
private String settleId;
private String billCheckStatus;
private String gmtCreate;
private String gmtModified;
}

View File

@ -0,0 +1,31 @@
package com.hzya.frame.plugin.zanhuo.dto.jackyun.datadto.salessettlement;
import lombok.Data;
import org.springframework.data.annotation.Id;
@Data
public class TradeSettleOrderSalesSettlement {
private String settleStatusExplain;
private String receiptStatusExplain;
private String finDocStatusExplain;
private String billCheckStatusExplain;
private String id;
private String settleId;
private String settleNo;
private String settleStatus;
private String settleTime;
private String sysFlagIds;
private String auditTime;
private String onlinePayTime;
private String shopId;
private String shopName;
private String companyId;
private String companyName;
private String totalFee;
private String settleFee;
private String payment;
private String settleFrom;
private String gmtCreate;
private String gmtModified;
private String isCompanySettle;
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,342 @@
package com.hzya.frame.plugin.zanhuo.sale;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.zanhuo.dto.jackyun.ResultDataDto;
import com.hzya.frame.plugin.zanhuo.dto.jackyun.ResultDto;
import com.hzya.frame.plugin.zanhuo.dto.jackyun.datadto.salessettlement.JsonRootBeanSalesSettlement;
import com.hzya.frame.plugin.zanhuo.dto.jackyun.datadto.salessettlement.TradeSettleOrderDetailArrSalesSettlement;
import com.hzya.frame.plugin.zanhuo.dto.jackyun.datadto.salessettlement.TradeSettleOrderSalesSettlement;
import com.hzya.frame.plugin.zanhuo.jackyun.JackyunApi;
import com.hzya.frame.plugin.zanhuo.util.SplitListByCountUtil;
import com.hzya.frame.plugin.zanhuo.util.jackyun.JackYunApiUtil;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.zanhuo.sale
* @ProjectkangarooDataCenterV3
* @nameTocSalesSettlement
* @Date2025/8/28 15:17
* @FilenameTocSalesSettlement
*/
public class TocSalesSettlement extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(TocSalesSettlement.class);
private static final ReentrantLock LOCK1 = new ReentrantLock(true);
@Autowired
private MongoTemplate mongoTemplate;
@Override
public void initialize() {
logger.info(getPluginLabel() + "执行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "执行销毁方法destroy()");
}
@Override
public String getPluginId() {
return "sales.TocSalesSettlement";
}
@Override
public String getPluginName() {
return "吉客云销售结算单生成YS销售订单";
}
@Override
public String getPluginLabel() {
return "吉客云销售结算单生成YS销售订单";
}
@Override
public String getPluginType() {
return "3";
}
@Autowired
private JackyunApi jackyunApi;
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
return null;
}
/**
* TOC业务-拉取吉客云销售结算单生成YS销售订单
*/
public void getSetStock(List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList) {
LOCK1.lock();
try {
//过滤掉成功数据
List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList1 = filterSuccessfulData(jsonRootBeanSalesSettlementList);
//执行推送主逻辑
} catch (Exception e) {
logger.error("getSetStock方法抛出异常", e);
} finally {
LOCK1.unlock();
}
}
/**
* 根据时间范围查询,保存到mongodb底表
*/
public void queryjackYumSalesSettlementByTime(String auditTimeBegin, String auditTimeEnd) {
try {
Assert.notNull(auditTimeBegin, "auditTimeBegin不能为空");
Assert.notNull(auditTimeEnd, "auditTimeEnd不能为空");
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
Map<String, String> paramsMap = new HashMap<>();
paramsMap.put("auditTimeBegin", auditTimeBegin);
paramsMap.put("auditTimeEnd", auditTimeEnd);
List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList = jackyunApi.queryJackYumSalesSettlement(paramsMap, 0L);
if (jsonRootBeanSalesSettlementList != null && jsonRootBeanSalesSettlementList.size() > 0) {
batchSaveToMongoDB(jsonRootBeanSalesSettlementList, dtf.format(now));
}
} catch (Exception e) {
logger.error("queryjackYumSalesSettlementByTime方法抛出异常", e);
throw new RuntimeException(e);
}
}
/**
* 根据单号查结算单
*
* @author liuyang
*/
public void queryjackYumSalesSettlementByCode(String settleNo) throws Exception {
try {
Assert.notNull(settleNo, "结算单号不能为空");
Map<String, String> paramsMap = new HashMap<>();
paramsMap.put("settleNo", settleNo);
List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList = jackyunApi.queryJackYumSalesSettlement(paramsMap, 0L);
if (jsonRootBeanSalesSettlementList != null && jsonRootBeanSalesSettlementList.size() > 0) {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
batchSaveToMongoDB(jsonRootBeanSalesSettlementList, dtf.format(now));
}
} catch (Exception e) {
logger.error("queryjackYumSalesSettlementByCode方法抛出异常", e);
throw new RuntimeException(e);
}
}
/**
* 批量保存到mongodb
*
* @param jsonRootBeanSalesSettlementList 总数据行
* @param pullData 拉取数据的时间
* @author liuyang
*/
public void batchSaveToMongoDB(List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList, String pullData) throws Exception {
if (jsonRootBeanSalesSettlementList != null && jsonRootBeanSalesSettlementList.size() > 0 && pullData != null) {
long startTime = System.currentTimeMillis();
try {
String sizeStr = String.valueOf(jsonRootBeanSalesSettlementList.size());
jsonRootBeanSalesSettlementList.forEach(settlement -> {
List<TradeSettleOrderDetailArrSalesSettlement> detailList = settlement.getTradeSettleOrderDetailArr();
if (detailList != null) {
detailList.forEach(detail -> {
detail.setPullData(pullData);
detail.setCurrentNumber(sizeStr);
});
}
// 为根文档的保存做准备例如设置ID
settlement.prepareForSave();
});
mongoTemplate.insert(jsonRootBeanSalesSettlementList, JsonRootBeanSalesSettlement.class);
} catch (Exception e) {
logger.error("batchSaveToMongoDB方法抛出异常", e);
throw new RuntimeException(e);
}
long endTime = System.currentTimeMillis();
logger.info("mongodb批量保存耗时:{} 行数:{}", endTime - startTime, jsonRootBeanSalesSettlementList.size());
}
}
/**
* 根据审核时间范围查询结算单
* <p>
* 注意此方法依赖于 auditTime 字段的字符串格式是可按字典序排序的 'YYYY-MM-DD HH:mm:ss'
* 为了保证查询性能请务必在 tradeSettleOrder.auditTime 字段上创建索引
*
* @param auditTimeBegin 审核开始时间, 格式应为 'YYYY-MM-DD HH:mm:ss'
* @param auditTimeEnd 审核结束时间, 格式应为 'YYYY-MM-DD HH:mm:ss'
* @return 查询到的结算单列表
* @author liuyang
*/
public List<JsonRootBeanSalesSettlement> findSettlementsByAuditTimeRange(String auditTimeBegin, String auditTimeEnd) {
logger.info("开始根据审核时间范围查询结算单,开始时间: {}, 结束时间: {}", auditTimeBegin, auditTimeEnd);
long startTime = System.currentTimeMillis();
try {
Assert.notNull(auditTimeBegin, "auditTimeBegin不能为空");
Assert.notNull(auditTimeEnd, "auditTimeEnd不能为空");
//创建 Query 对象用于封装所有查询条件
Query query = new Query();
//构建查询条件 (Criteria)
// - 使用点"."符号来访问内嵌文档 'tradeSettleOrder' 'auditTime' 字段
// - gte: Greater Than or Equal (大于等于 >=)
// - lte: Less Than or Equal (小于等于 <=)
Criteria criteria = Criteria.where("tradeSettleOrder.auditTime").gte(auditTimeBegin).lte(auditTimeEnd);
query.addCriteria(criteria);// 将构建好的条件添加到 Query 对象中
List<JsonRootBeanSalesSettlement> resultList = mongoTemplate.find(query, JsonRootBeanSalesSettlement.class); //使用 MongoTemplate 执行查询
long endTime = System.currentTimeMillis();
logger.info("根据审核时间范围查询完成,耗时: {}ms, 查询到数据: {} 行", endTime - startTime, resultList.size());
return resultList;
} catch (Exception e) {
logger.error("findSettlementsByAuditTimeRange方法抛出异常", e);
throw new RuntimeException(e);
}
}
/**
* 过滤成功数据
*
* @author liuyang
*/
public List<JsonRootBeanSalesSettlement> filterSuccessfulData(List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList) {
List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList3 = new ArrayList<>();
try {
List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList2 = new ArrayList<>();
List<List<JsonRootBeanSalesSettlement>> lists = SplitListByCountUtil.splitListByCount(jsonRootBeanSalesSettlementList, 5000);
for (int i = 0; i < lists.size(); i++) {
List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList1 = lists.get(i);
String[] idArray = jsonRootBeanSalesSettlementList1.stream().map(JsonRootBeanSalesSettlement::getId).map(Object::toString).toArray(String[]::new);
List<JsonRootBeanSalesSettlement> settlementStateById = findSettlementStateById(idArray);
jsonRootBeanSalesSettlementList2.addAll(settlementStateById);
}
if (jsonRootBeanSalesSettlementList2.size() > 0) {
jsonRootBeanSalesSettlementList3 = filterFailedOrUnreleasedDataRows(jsonRootBeanSalesSettlementList, jsonRootBeanSalesSettlementList2);
}
} catch (Exception e) {
logger.error("filterSuccessfulData方法抛出异常", e);
throw new RuntimeException(e);
}
return jsonRootBeanSalesSettlementList3;
}
/**
* 筛选出失败或未推送的数据行
*
* @param jsonRootBeanSalesSettlementList 通过接口查询出来的数据
* @param jsonRootBeanSalesSettlementList2 底表的历史记录
* @author liuyang
*/
public List<JsonRootBeanSalesSettlement> filterFailedOrUnreleasedDataRows(List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList, List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList2) {
List<JsonRootBeanSalesSettlement> targetJsonRootBeanSalesSettlement = new ArrayList<>();
if (jsonRootBeanSalesSettlementList != null && jsonRootBeanSalesSettlementList.size() > 0) {
List<TradeSettleOrderDetailArrSalesSettlement> tradeSettleOrderDetailArrAll = new ArrayList<>();
for (int i = 0; i < jsonRootBeanSalesSettlementList2.size(); i++) {
JsonRootBeanSalesSettlement jsonRootBeanSalesSettlement = jsonRootBeanSalesSettlementList2.get(i);
if (jsonRootBeanSalesSettlement.getTradeSettleOrderDetailArr() != null) {
List<TradeSettleOrderDetailArrSalesSettlement> tradeSettleOrderDetailArr = jsonRootBeanSalesSettlement.getTradeSettleOrderDetailArr();
tradeSettleOrderDetailArrAll.addAll(tradeSettleOrderDetailArr);
}
}
List<TradeSettleOrderDetailArrSalesSettlement> resultList = tradeSettleOrderDetailArrAll.stream().map(obj -> {
if (obj.getNewState() == null) {
obj.setNewState("");
}
return obj;
}).collect(Collectors.toList());
Map<String, String> no2NameMap = resultList.stream().collect(Collectors.toMap(TradeSettleOrderDetailArrSalesSettlement::getId, TradeSettleOrderDetailArrSalesSettlement::getNewState));
String succeseeY = "Y";
String succeseeH = "H";
for (int i = 0; i < jsonRootBeanSalesSettlementList.size(); i++) {
JsonRootBeanSalesSettlement jsonRootBeanSalesSettlement = jsonRootBeanSalesSettlementList.get(i);
List<TradeSettleOrderDetailArrSalesSettlement> tradeSettleOrderDetailArr = jsonRootBeanSalesSettlement.getTradeSettleOrderDetailArr();
if (tradeSettleOrderDetailArr != null) {
List<TradeSettleOrderDetailArrSalesSettlement> targetDetails = new ArrayList<>();
for (int j = 0; j < tradeSettleOrderDetailArr.size(); j++) {
TradeSettleOrderDetailArrSalesSettlement tradeSettleOrderDetailArrSalesSettlement = tradeSettleOrderDetailArr.get(j);
boolean isSuccess = false;
String newstate = no2NameMap.get(tradeSettleOrderDetailArrSalesSettlement.getId());
if (newstate != null && !"".equals(newstate) && (succeseeY.equals(newstate) || succeseeH.equals(newstate))) {
isSuccess = true;
}
if (!isSuccess) {
tradeSettleOrderDetailArrSalesSettlement.setNewState(newstate);
targetDetails.add(tradeSettleOrderDetailArrSalesSettlement);
}
}
if (targetDetails.size() > 0) {
//如果明细行中还存在未推送或者失败的数据则需要更新明细行
jsonRootBeanSalesSettlement.setTradeSettleOrderDetailArr(targetDetails);
targetJsonRootBeanSalesSettlement.add(jsonRootBeanSalesSettlement);
}
}
}
}
return targetJsonRootBeanSalesSettlement;
}
/**
* 根据id查询结算单
*/
private List<JsonRootBeanSalesSettlement> findSettlementStateById(String[] idList) {
List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList1 = new ArrayList<>();
try {
Query query = new Query();
//构建查询条件
//主键在 MongoDB 中存储的字段名固定为 "_id"
//.in() 方法接收一个 Collection ( List) 或数组构建 { "_id": { "$in": [...] } } 查询
Criteria criteria = Criteria.where("_id").in(idList);
//将条件添加到 Query 对象
query.addCriteria(criteria);
//执行查询并返回结果
jsonRootBeanSalesSettlementList1 = mongoTemplate.find(query, JsonRootBeanSalesSettlement.class);
} catch (Exception e) {
logger.error("findSettlementStateById方法抛出异常", e);
throw new RuntimeException(e);
}
return jsonRootBeanSalesSettlementList1;
}
}

View File

@ -0,0 +1,38 @@
package com.hzya.frame.plugin.zanhuo.util;
import java.util.ArrayList;
import java.util.List;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.split
* @ProjectkangarooDataCenterV3
* @nameSplitListByCountUtil
* @Date2024/8/2 14:20
* @FilenameSplitListByCountUtil
*/
public class SplitListByCountUtil {
/**
* List集合拆分
*
* @param list 原始数据 6000
* @param count 每个list的元素数量 1000
* @return 拆分得到的list集合
*/
public static <T> List<List<T>> splitListByCount(List<T> list, int count) {
List<List<T>> listAll = new ArrayList<>();
int size = list.size();
if (size > count) { //*size:6000 > count: 1000
int absInt = Math.abs(size / count); //6
if (size - absInt * count > 0) {
listAll.add(list.subList(absInt * count, size));
}
for (int i = 1; i < absInt + 1; i++) {
listAll.add(list.subList((i - 1) * count, i * count));
}
} else {
listAll.add(list);
}
return listAll;
}
}

View File

@ -0,0 +1,94 @@
package com.hzya.frame.plugin.zanhuo.util.jackyun;
import com.alibaba.fastjson.JSON;
import com.hzya.frame.plugin.zanhuo.constant.JackYunConstant;
import com.hzya.frame.plugin.zanhuo.dto.jackyun.ResultDataDto;
import com.hzya.frame.plugin.zanhuo.jackyun.JackyunApi;
import okhttp3.*;
import com.alibaba.fastjson.TypeReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.zanhuo.util.jackyun
* @ProjectkangarooDataCenterV3
* @nameJackYunApiUtil
* @Date2025/8/28 15:28
* @FilenameJackYunApiUtil
*/
public class JackYunApiUtil {
static Logger logger = LoggerFactory.getLogger(JackYunApiUtil.class);
private static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
private volatile static OkHttpClient httpClient;
static {
httpClient = new OkHttpClient.Builder().connectTimeout(30, TimeUnit.SECONDS).readTimeout(60, TimeUnit.SECONDS).build();
}
/**
* 调用 JackYun API 的通用方法
*
* @param bizData 业务数据
* @param method API 方法名
* @param typeRef 类型引用用于精确指定泛型 T 的具体类型
* @param <T> 泛型参数代表 data 列表中的元素类型
* @return 携带正确数据类型的 ResultDataDto 对象
* @throws IOException
* @throws NoSuchAlgorithmException
*/
public static <T> ResultDataDto<T> callJackYunApi(String bizData, String method, TypeReference<ResultDataDto<T>> typeRef) throws IOException, NoSuchAlgorithmException {
SortedMap<String, String> sortedMap = new TreeMap<>();
sortedMap.put("method", method);
sortedMap.put("appkey", JackYunConstant.jackyum_appKey);
sortedMap.put("version", JackYunConstant.jackyum_version);
sortedMap.put("contenttype", "json");
sortedMap.put("timestamp", DATETIME_FORMATTER.format(LocalDateTime.now()));
sortedMap.put("bizcontent", bizData);
StringBuilder sbSignData = new StringBuilder(JackYunConstant.jackyum_appSecret);
for (Map.Entry<String, String> entry : sortedMap.entrySet()) {
sbSignData.append(entry.getKey()).append(entry.getValue());
}
sbSignData.append(JackYunConstant.jackyum_appSecret);
sortedMap.put("sign", Md5EncryptUtil.md5Encrypt(sbSignData.toString().toLowerCase()));
FormBody.Builder formBodyBuilder = new FormBody.Builder();
for (Map.Entry<String, String> entry : sortedMap.entrySet()) {
formBodyBuilder.add(entry.getKey(), entry.getValue());
}
RequestBody formBody = formBodyBuilder.build();
Request request = new Request.Builder().url(JackYunConstant.jackyum_api).post(formBody).build();
logger.info("开始 调用吉客云接口:{} method:{}", JackYunConstant.jackyum_api, method);
long startTime = System.currentTimeMillis();
try (Response response = httpClient.newCall(request).execute()) {
if (!response.isSuccessful()) {
String errorBody = response.body() != null ? response.body().string() : "null";
throw new IOException("非预期的HTTP响应码: " + response.code() + ", 响应体: " + errorBody);
}
if (response.body() == null) {
return null;
}
String responseBodyString = response.body().string();
long endTime = System.currentTimeMillis();
logger.info("结束 调用吉客云接口:{} method:{} 耗时:{}毫秒 {}秒", JackYunConstant.jackyum_api, method, (endTime - startTime), ((endTime - startTime) / 1000));
//可以打断点
return JSON.parseObject(responseBodyString, typeRef);
}
}
}

View File

@ -0,0 +1,30 @@
package com.hzya.frame.plugin.zanhuo.util.jackyun;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.zanhuo.util.jackyun
* @ProjectkangarooDataCenterV3
* @nameMd5EncryptUtil
* @Date2025/8/28 15:28
* @FilenameMd5EncryptUtil
*/
public class Md5EncryptUtil {
public static String md5Encrypt(String text) throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
byte[] resultByte = text.getBytes(StandardCharsets.UTF_8);
byte[] md5Bytes = md5.digest(resultByte);
StringBuilder hexValue = new StringBuilder();
for (byte md5Byte : md5Bytes) {
int val = (md5Byte) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
}

View File

@ -1,23 +0,0 @@
#######################澳星环境#######################
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

@ -2,23 +2,26 @@
logging: logging:
#日志级别 指定目录级别 #日志级别 指定目录级别
level: level:
root: warn root: info
encodings: UTF-8 encodings: UTF-8
file: file:
# 日志保存路径 # 日志保存路径
path: /home/webservice/zt/log path: /Users/liuyang/workspaces/hzya/zanhuoproject/kangarooDataCenterV3/ztlog
spring: spring:
datasource: datasource:
dynamic: dynamic:
datasource: datasource:
master: 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 url: jdbc:mysql://192.168.99.4: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 username: root
password: 62e4295b615a30dbf3b8ee96f41c820b password: da51213c6d9d6a7f7c364a3d1a71345f
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
data:
mongodb:
uri: mongodb://businesscenter:Hzya%401314@192.168.99.4:27017/businesscenter?authSource=admin&connectTimeoutMS=10000&socketTimeoutMS=15000&wtimeoutMS=15000
savefile: savefile:
# 文件保存路径 # 文件保存路径
path: /home/webservice/zt/file path: /Users/liuyang/workspaces/hzya/zanhuoproject/kangarooDataCenterV3/ztfile
# path: D:\webservice\file # path: D:\webservice\file
# pluginpath: D:\webservice\plugin # pluginpath: D:\webservice\plugin
pluginpath: /home/webservice/zt/plugin pluginpath: /home/webservice/zt/plugin

View File

@ -1,27 +0,0 @@
#######################本地环境#######################
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

@ -1,82 +0,0 @@
#######################本地环境#######################
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

@ -1,23 +0,0 @@
#######################本地环境#######################
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

@ -1,23 +0,0 @@
#######################本地环境#######################
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

@ -1,90 +0,0 @@
#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

@ -1,21 +0,0 @@
#######################本地环境#######################
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

@ -1,31 +0,0 @@
#######################本地环境#######################
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

@ -1,23 +0,0 @@
#######################本地环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
encodings: UTF-8
file:
# 日志保存路径
path: E:\yongansystem\log
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: E:\yongansystem\log
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -1,39 +0,0 @@
#######################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,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<plugin> <plugin>
<id>MdmPlugin</id> <id>SoSalePlugin</id>
<name>MdmPlugin插件</name> <name>SoSalePlugin插件</name>
<category>90000001</category> <category>90000001</category>
</plugin> </plugin>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName"> <beans default-autowire="byName">
</beans> </beans>

View File

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

View File

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

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="backUpDatabaseInitializer" class="com.hzya.frame.plugin.BackUpDatabase.plugin.BackUpDatabaseInitializer" />
</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="mdmCustomerInitializer" class="com.hzya.frame.plugin.masterData.plugin.MdmPluginInitializer" />
</beans>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>MdmModulePlugin</id>
<name>MdmModulePlugin插件</name>
<category>90000001</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="mdmModuleInitializer" class="com.hzya.frame.plugin.mdmDistribute.plugin.MdmModulePluginInitializer" />
</beans>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>SysMessageManageLogPlugin</id>
<name>SysMessageManageLogPlugin插件</name>
<category>202403080010</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="sysMessageManageLogInitializer" class="com.hzya.frame.plugin.sysMessageManageLogBack.plugin.SysMessageManageLogPluginInitializer" />
</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="sysESBMessageManageLogService" class="com.hzya.frame.plugin.sysMessageManageLogBack.service.impl.SysESBMessageManageLogServiceImpl" />
</beans>

View File

@ -0,0 +1,76 @@
package com.hzya.frame.plugin.zanhuo.sale;
import com.hzya.frame.WebappApplication;
import com.hzya.frame.plugin.zanhuo.dto.jackyun.datadto.salessettlement.JsonRootBeanSalesSettlement;
import com.hzya.frame.plugin.zanhuo.jackyun.JackyunApi;
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;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.*;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.zanhuo.sale
* @ProjectkangarooDataCenterV3
* @nameTocSalesSettlementTest
* @Date2025/8/28 16:57
* @FilenameTocSalesSettlementTest
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = WebappApplication.class)
public class TocSalesSettlementTest {
@Autowired
private TocSalesSettlement tocSalesSettlement;
@Autowired
private JackyunApi jackyunApi;
// @Test
// public void testQueryJackYumSalesSettlement() {
// try {
// TocSalesSettlement tocSalesSettlement = new TocSalesSettlement();
// tocSalesSettlement.queryJackYumSalesSettlement("2025-08-27 00:00:00", "2025-08-27 23:59:59");
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
@Test
public void testQueryJackYumSalesSettlement() {
try {
// Map<String, String> paramsMap = new HashMap<>();
// paramsMap.put("auditTimeBegin", "2025-08-28 00:00:00");
// paramsMap.put("auditTimeEnd", "2025-08-28 23:59:59");
//
// jackyunApi.queryJackYumSalesSettlement(paramsMap,0L);
// Map<String, String> paramsMap = new HashMap<>();
// paramsMap.put("settleNo", "XSJS2025082924332");
// List<JsonRootBeanSalesSettlement> jsonRootBeanSalesSettlementList = jackyunApi.queryJackYumSalesSettlement(paramsMap, 0L);
// System.out.println(jsonRootBeanSalesSettlementList.size());
tocSalesSettlement.queryjackYumSalesSettlementByTime("2025-08-28 00:00:00", "2025-08-28 23:59:59");
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testFindSettlementsByAuditTimeRange() {
try {
tocSalesSettlement.findSettlementsByAuditTimeRange("2025-08-28 00:00:00", "2025-08-28 23:59:59");
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -36,7 +36,7 @@ public class temButtom {
@Test @Test
public void test01() { public void test01() {
String a = AESUtil.encrypt("hzya@1314"); String a = AESUtil.encrypt("Hzya@1314");
System.out.println(a); System.out.println(a);
String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b"); String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b");
System.out.println(b); System.out.println(b);

54
pom.xml
View File

@ -477,33 +477,33 @@
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<configuration> <configuration>
<webResources> <webResources>
<resource> <!-- <resource>-->
<directory>${basedir}/../base-service/src/main/webapp/WEB-INF/lib</directory> <!-- <directory>${basedir}/../base-service/src/main/webapp/WEB-INF/lib</directory>-->
<targetPath>WEB-INF/lib/</targetPath> <!-- <targetPath>WEB-INF/lib/</targetPath>-->
<filtering>false</filtering> <!-- <filtering>false</filtering>-->
<includes> <!-- <includes>-->
<!-- 匹配所有jar包 --> <!-- &lt;!&ndash; 匹配所有jar包 &ndash;&gt;-->
<include>**/*.jar</include> <!-- <include>**/*.jar</include>-->
</includes> <!-- </includes>-->
</resource> <!-- </resource>-->
<resource> <!-- <resource>-->
<directory>${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib</directory> <!-- <directory>${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib</directory>-->
<targetPath>WEB-INF/lib/</targetPath> <!-- <targetPath>WEB-INF/lib/</targetPath>-->
<filtering>false</filtering> <!-- <filtering>false</filtering>-->
<includes> <!-- <includes>-->
<!-- 匹配所有jar包 --> <!-- &lt;!&ndash; 匹配所有jar包 &ndash;&gt;-->
<include>**/*.jar</include> <!-- <include>**/*.jar</include>-->
</includes> <!-- </includes>-->
</resource> <!-- </resource>-->
<resource> <!-- <resource>-->
<directory>${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib</directory> <!-- <directory>${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib</directory>-->
<targetPath>WEB-INF/lib/</targetPath> <!-- <targetPath>WEB-INF/lib/</targetPath>-->
<filtering>false</filtering> <!-- <filtering>false</filtering>-->
<includes> <!-- <includes>-->
<!-- 匹配所有jar包 --> <!-- &lt;!&ndash; 匹配所有jar包 &ndash;&gt;-->
<include>**/*.jar</include> <!-- <include>**/*.jar</include>-->
</includes> <!-- </includes>-->
</resource> <!-- </resource>-->
</webResources> </webResources>
</configuration> </configuration>
</plugin> </plugin>