Merge branches 'fw-ncc' and 'jianhui0521' of http://ufidahz.com.cn:9015/hzya/kangarooDataCenterV3 into jianhui0521

This commit is contained in:
lvleigang 2025-06-12 13:59:11 +08:00
commit 61f604bad4
298 changed files with 25889 additions and 1025 deletions

3
.gitignore vendored
View File

@ -63,3 +63,6 @@ $RECYCLE.BIN/
/base-buildpackage/target/
/base-common/target/
/base-core/target/
/base-webapp/target/classes/com/hzya/frame/
/fw-weixin/target/
/E:/yongansystem/log/2024-10-15/

View File

@ -38,6 +38,18 @@
<profile.active>llg</profile.active>
</properties>
</profile>
<profile>
<id>xel</id> <!--xel-->
<properties>
<profile.active>xel</profile.active>
</properties>
</profile>
<profile>
<id>jianhui</id><!-- 建辉环境打包用这个-->
<properties>
<profile.active>jianhui</profile.active>
</properties>
</profile>
</profiles>
<build>

View File

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

@ -452,6 +452,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
}
} catch (Exception e) {
logger.info("执行异常错误原因:"+e);
logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute());
taskDetailEntity.setResult("新增返回脚本解析保存三方id错误");
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
@ -543,7 +544,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
map1.put("dataStatus", "N");
map1.put("deleteStatus", "0");
map1.put("size", 10);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -738,7 +739,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "F");
map1.put("updateStatus", "0");
map1.put("size", 10);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -926,7 +927,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "Y");
map1.put("addStatus", "0");
map1.put("size", 100);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -991,6 +992,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
mdmModuleSendLogEntity.setTableName(mainDb+"_send_log");
mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id"));
mdmModuleSendLogEntity.setSts("Y");
mdmModuleSendLogEntity.setDataType("1");
mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId());
mdmModuleSendLogEntity.setApiId(apiEntity.getId());
//mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId());
@ -1121,10 +1123,12 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
objects.get(i).put("sendsanfzt123",true);
continue;
}else {
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
objects.get(i).put("sendsanfzt123",false);
continue;
}
}
@ -1132,12 +1136,14 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
//所有下发发送完成修改数据状态
for (int i = 0; i < objects.size(); i++) {
Map<String, Object> updateMap = new HashMap<>();
updateMap.put("tableName",mainDb);
//updateMap.put("dataStatus", "Y");
updateMap.put("addStatus", "1");
updateMap.put("id", objects.get(i).getString("id"));
mdmModuleDao.updateMdmSTs(updateMap);
if(objects.get(i).getBoolean("sendsanfzt123")){
Map<String, Object> updateMap = new HashMap<>();
updateMap.put("tableName",mainDb);
//updateMap.put("dataStatus", "Y");
updateMap.put("addStatus", "1");
updateMap.put("id", objects.get(i).getString("id"));
mdmModuleDao.updateMdmSTs(updateMap);
}
}
}

View File

@ -0,0 +1,16 @@
package com.hzya.frame.plugin.ncc.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.ncc.entity.POrderBEntity;
/**
* @description: 采购订单子表 dao
* @tableName: po_order_b
* @entityName: POrderBEntity
* @author: code_generator
* @history: 1.0
*/
public interface IPOrderBDao extends IBaseDao<POrderBEntity, String> {
}

View File

@ -0,0 +1,16 @@
package com.hzya.frame.plugin.ncc.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.ncc.entity.POrderHEntity;
/**
* @description: 采购订单主表 dao
* @tableName: po_order
* @entityName: POrderHEntity
* @author: code_generator
* @history: 1.0
*/
public interface IPOrderHDao extends IBaseDao<POrderHEntity, String> {
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.ncc.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.ncc.dao.IPOrderBDao;
import com.hzya.frame.plugin.ncc.entity.POrderBEntity;
import org.springframework.stereotype.Repository;
/**
* @description: 采购订单子表 dao
* @tableName: po_order_b
* @entityName: POrderBEntity
* @author: code_generator
* @history:1.0
*/
@Repository("po_order_bdao")
public class POrderBDaoImpl extends MybatisGenericDao<POrderBEntity, String> implements IPOrderBDao {
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.ncc.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.ncc.dao.IPOrderHDao;
import com.hzya.frame.plugin.ncc.entity.POrderHEntity;
import org.springframework.stereotype.Repository;
/**
* @description: 采购订单主表 dao
* @tableName: po_order
* @entityName: POrderHEntity
* @author: code_generator
* @history:1.0
*/
@Repository("po_orderdao")
public class POrderHDaoImpl extends MybatisGenericDao<POrderHEntity, String> implements IPOrderHDao {
}

View File

@ -0,0 +1,869 @@
package com.hzya.frame.plugin.ncc.entity;
import com.hzya.frame.web.entity.BaseEntity;
import java.math.BigDecimal;
/**
* @description: 采购订单子表
* @tableName: po_order_b
* @entityName: POrderBEntity
* @author: code_generator
* @history: 1.0
*/
public class POrderBEntity extends BaseEntity {
/** */
private String pk_order;
/** */
private String pk_order_b;
/** 集团 */
private String pk_group;
/** 组织 */
private String pk_org;
/** 行号 */
private String crowno;
/** 物料 */
private String pk_material;
/** 物料编码 */
private String material_code;
/** 物料名称 */
private String material_name;
private String material_class_id;
/** 主单位 */
private String cunitid;
/** 主单位名称 */
private String cunitid_name;
/** 辅单位 */
private String castunitid;
/** 副单位名称 */
private String castunitid_name;
/** 吨数 */
private BigDecimal nnum;
/** 件数 */
private BigDecimal nastnum;
/** 换算率 */
private String vchangerate;
/** 无税单价 */
private BigDecimal norigprice;
/** 含税单价 */
private BigDecimal norigtaxprice;
/** 无税金额 */
private BigDecimal norignetprice;
/** 含税金额 */
private BigDecimal norigtaxnetprice;
/** 税额 */
private BigDecimal ntax;
/** 价税合计 */
private BigDecimal norigtaxmny;
/** 税率 */
private BigDecimal ntaxrate;
/** 币种 */
private String corigcurrencyid;
private String corigcurrencyid_name;
/** 来源单据类型 */
private String csourcetypecode;
/** 来源单据 */
private String csourceid;
/** 来源单据明细 */
private String csourcebid;
/** 源头单据类型 */
private String cfirsttypecode;
/** 源头单据 */
private String cfirstid;
/** 源头单据明细 */
private String cfirstbid;
/** 是否赠品 */
private String blargess;
/** 源头交易类型 */
private String vfirsttrantype;
/** 源头单据号 */
private String vfirstcode;
/** 源头单据行号 */
private String vfirstrowno;
/** 来源交易类型 */
private String vsourcetrantype;
/** 来源单据号 */
private String vsourcecode;
/** 来源单据行号 */
private String vsourcerowno;
/** 自由辅助属性1 */
private String vfree1;
/** 自由辅助属性2 */
private String vfree2;
/** 自由辅助属性3 */
private String vfree3;
/** 自由辅助属性4 */
private String vfree4;
/** 自由辅助属性5 */
private String vfree5;
/** 自由辅助属性6 */
private String vfree6;
private String pk_grade;
/** 自由辅助属性7 */
private String vfree7;
/** FSC/EUDR主键 */
private String pk_vfree8;
/** FSC/EUDR */
private String vfree8;
/** 自由辅助属性9 */
private String vfree9;
/** 品牌主键 */
private String pk_vfree10;
/** 品牌 */
private String vfree10;
/** 自定义项1 */
private String vbdef1;
/** 自定义项2 */
private String vbdef2;
/** 自定义项3 */
private String vbdef3;
/** 自定义项4 */
private String vbdef4;
/** 自定义项5 */
private String vbdef5;
/** 自定义项6 */
private String vbdef6;
/** 自定义项7 */
private String vbdef7;
/** 自定义项8 */
private String vbdef8;
/** 自定义项9 */
private String vbdef9;
/** 自定义项10 */
private String vbdef10;
/** 自定义项11 */
private String vbdef11;
/** 自定义项12 */
private String vbdef12;
/** 自定义项13 */
private String vbdef13;
/** 自定义项14 */
private String vbdef14;
/** 自定义项15 */
private String vbdef15;
/** 自定义项16 */
private String vbdef16;
/** 自定义项17 */
private String vbdef17;
/** 自定义项18 */
private String vbdef18;
/** 自定义项19 */
private String vbdef19;
/** 自定义项20 */
private String vbdef20;
private String vbmemo;
private String external_material_spec;
/** 报价单位 */
private String cqtunitid;
private String cqtunitid_name;
/** 报价数量 */
private BigDecimal nqtunitnum;
/** 折本汇率 */
private BigDecimal nexchangerate;
/** 收货仓库 */
private String pk_recvstordoc;
private String recvstordoc_name;
/** 计划到货日期 */
private String dplanarrvdate;
private String special_type;
private String vbatchcode;
private String ic_id;
private BigDecimal price;
private BigDecimal taxprice;
private String material_id;
public String getPk_order() {
return pk_order;
}
public void setPk_order(String pk_order) {
this.pk_order = pk_order;
}
public String getPk_order_b() {
return pk_order_b;
}
public void setPk_order_b(String pk_order_b) {
this.pk_order_b = pk_order_b;
}
public String getPk_group() {
return pk_group;
}
public void setPk_group(String pk_group) {
this.pk_group = pk_group;
}
public String getPk_org() {
return pk_org;
}
public void setPk_org(String pk_org) {
this.pk_org = pk_org;
}
public String getCrowno() {
return crowno;
}
public void setCrowno(String crowno) {
this.crowno = crowno;
}
public String getPk_material() {
return pk_material;
}
public void setPk_material(String pk_material) {
this.pk_material = pk_material;
}
public String getMaterial_code() {
return material_code;
}
public void setMaterial_code(String material_code) {
this.material_code = material_code;
}
public String getMaterial_name() {
return material_name;
}
public void setMaterial_name(String material_name) {
this.material_name = material_name;
}
public String getMaterial_class_id() {
return material_class_id;
}
public void setMaterial_class_id(String material_class_id) {
this.material_class_id = material_class_id;
}
public String getCunitid() {
return cunitid;
}
public void setCunitid(String cunitid) {
this.cunitid = cunitid;
}
public String getCunitid_name() {
return cunitid_name;
}
public void setCunitid_name(String cunitid_name) {
this.cunitid_name = cunitid_name;
}
public String getCastunitid() {
return castunitid;
}
public void setCastunitid(String castunitid) {
this.castunitid = castunitid;
}
public String getCastunitid_name() {
return castunitid_name;
}
public void setCastunitid_name(String castunitid_name) {
this.castunitid_name = castunitid_name;
}
public BigDecimal getNnum() {
return nnum;
}
public void setNnum(BigDecimal nnum) {
this.nnum = nnum;
}
public BigDecimal getNastnum() {
return nastnum;
}
public void setNastnum(BigDecimal nastnum) {
this.nastnum = nastnum;
}
public String getVchangerate() {
return vchangerate;
}
public void setVchangerate(String vchangerate) {
this.vchangerate = vchangerate;
}
public BigDecimal getNorigprice() {
return norigprice;
}
public void setNorigprice(BigDecimal norigprice) {
this.norigprice = norigprice;
}
public BigDecimal getNorigtaxprice() {
return norigtaxprice;
}
public void setNorigtaxprice(BigDecimal norigtaxprice) {
this.norigtaxprice = norigtaxprice;
}
public BigDecimal getNorignetprice() {
return norignetprice;
}
public void setNorignetprice(BigDecimal norignetprice) {
this.norignetprice = norignetprice;
}
public BigDecimal getNorigtaxnetprice() {
return norigtaxnetprice;
}
public void setNorigtaxnetprice(BigDecimal norigtaxnetprice) {
this.norigtaxnetprice = norigtaxnetprice;
}
public BigDecimal getNtax() {
return ntax;
}
public void setNtax(BigDecimal ntax) {
this.ntax = ntax;
}
public BigDecimal getNorigtaxmny() {
return norigtaxmny;
}
public void setNorigtaxmny(BigDecimal norigtaxmny) {
this.norigtaxmny = norigtaxmny;
}
public BigDecimal getNtaxrate() {
return ntaxrate;
}
public void setNtaxrate(BigDecimal ntaxrate) {
this.ntaxrate = ntaxrate;
}
public String getCorigcurrencyid() {
return corigcurrencyid;
}
public void setCorigcurrencyid(String corigcurrencyid) {
this.corigcurrencyid = corigcurrencyid;
}
public String getCorigcurrencyid_name() {
return corigcurrencyid_name;
}
public void setCorigcurrencyid_name(String corigcurrencyid_name) {
this.corigcurrencyid_name = corigcurrencyid_name;
}
public String getCsourcetypecode() {
return csourcetypecode;
}
public void setCsourcetypecode(String csourcetypecode) {
this.csourcetypecode = csourcetypecode;
}
public String getCsourceid() {
return csourceid;
}
public void setCsourceid(String csourceid) {
this.csourceid = csourceid;
}
public String getCsourcebid() {
return csourcebid;
}
public void setCsourcebid(String csourcebid) {
this.csourcebid = csourcebid;
}
public String getCfirsttypecode() {
return cfirsttypecode;
}
public void setCfirsttypecode(String cfirsttypecode) {
this.cfirsttypecode = cfirsttypecode;
}
public String getCfirstid() {
return cfirstid;
}
public void setCfirstid(String cfirstid) {
this.cfirstid = cfirstid;
}
public String getCfirstbid() {
return cfirstbid;
}
public void setCfirstbid(String cfirstbid) {
this.cfirstbid = cfirstbid;
}
public String getBlargess() {
return blargess;
}
public void setBlargess(String blargess) {
this.blargess = blargess;
}
public String getVfirsttrantype() {
return vfirsttrantype;
}
public void setVfirsttrantype(String vfirsttrantype) {
this.vfirsttrantype = vfirsttrantype;
}
public String getVfirstcode() {
return vfirstcode;
}
public void setVfirstcode(String vfirstcode) {
this.vfirstcode = vfirstcode;
}
public String getVfirstrowno() {
return vfirstrowno;
}
public void setVfirstrowno(String vfirstrowno) {
this.vfirstrowno = vfirstrowno;
}
public String getVsourcetrantype() {
return vsourcetrantype;
}
public void setVsourcetrantype(String vsourcetrantype) {
this.vsourcetrantype = vsourcetrantype;
}
public String getVsourcecode() {
return vsourcecode;
}
public void setVsourcecode(String vsourcecode) {
this.vsourcecode = vsourcecode;
}
public String getVsourcerowno() {
return vsourcerowno;
}
public void setVsourcerowno(String vsourcerowno) {
this.vsourcerowno = vsourcerowno;
}
public String getVfree1() {
return vfree1;
}
public void setVfree1(String vfree1) {
this.vfree1 = vfree1;
}
public String getVfree2() {
return vfree2;
}
public void setVfree2(String vfree2) {
this.vfree2 = vfree2;
}
public String getVfree3() {
return vfree3;
}
public void setVfree3(String vfree3) {
this.vfree3 = vfree3;
}
public String getVfree4() {
return vfree4;
}
public void setVfree4(String vfree4) {
this.vfree4 = vfree4;
}
public String getVfree5() {
return vfree5;
}
public void setVfree5(String vfree5) {
this.vfree5 = vfree5;
}
public String getVfree6() {
return vfree6;
}
public void setVfree6(String vfree6) {
this.vfree6 = vfree6;
}
public String getPk_grade() {
return pk_grade;
}
public void setPk_grade(String pk_grade) {
this.pk_grade = pk_grade;
}
public String getVfree7() {
return vfree7;
}
public void setVfree7(String vfree7) {
this.vfree7 = vfree7;
}
public String getPk_vfree8() {
return pk_vfree8;
}
public void setPk_vfree8(String pk_vfree8) {
this.pk_vfree8 = pk_vfree8;
}
public String getVfree8() {
return vfree8;
}
public void setVfree8(String vfree8) {
this.vfree8 = vfree8;
}
public String getVfree9() {
return vfree9;
}
public void setVfree9(String vfree9) {
this.vfree9 = vfree9;
}
public String getPk_vfree10() {
return pk_vfree10;
}
public void setPk_vfree10(String pk_vfree10) {
this.pk_vfree10 = pk_vfree10;
}
public String getVfree10() {
return vfree10;
}
public void setVfree10(String vfree10) {
this.vfree10 = vfree10;
}
public String getVbdef1() {
return vbdef1;
}
public void setVbdef1(String vbdef1) {
this.vbdef1 = vbdef1;
}
public String getVbdef2() {
return vbdef2;
}
public void setVbdef2(String vbdef2) {
this.vbdef2 = vbdef2;
}
public String getVbdef3() {
return vbdef3;
}
public void setVbdef3(String vbdef3) {
this.vbdef3 = vbdef3;
}
public String getVbdef4() {
return vbdef4;
}
public void setVbdef4(String vbdef4) {
this.vbdef4 = vbdef4;
}
public String getVbdef5() {
return vbdef5;
}
public void setVbdef5(String vbdef5) {
this.vbdef5 = vbdef5;
}
public String getVbdef6() {
return vbdef6;
}
public void setVbdef6(String vbdef6) {
this.vbdef6 = vbdef6;
}
public String getVbdef7() {
return vbdef7;
}
public void setVbdef7(String vbdef7) {
this.vbdef7 = vbdef7;
}
public String getVbdef8() {
return vbdef8;
}
public void setVbdef8(String vbdef8) {
this.vbdef8 = vbdef8;
}
public String getVbdef9() {
return vbdef9;
}
public void setVbdef9(String vbdef9) {
this.vbdef9 = vbdef9;
}
public String getVbdef10() {
return vbdef10;
}
public void setVbdef10(String vbdef10) {
this.vbdef10 = vbdef10;
}
public String getVbdef11() {
return vbdef11;
}
public void setVbdef11(String vbdef11) {
this.vbdef11 = vbdef11;
}
public String getVbdef12() {
return vbdef12;
}
public void setVbdef12(String vbdef12) {
this.vbdef12 = vbdef12;
}
public String getVbdef13() {
return vbdef13;
}
public void setVbdef13(String vbdef13) {
this.vbdef13 = vbdef13;
}
public String getVbdef14() {
return vbdef14;
}
public void setVbdef14(String vbdef14) {
this.vbdef14 = vbdef14;
}
public String getVbdef15() {
return vbdef15;
}
public void setVbdef15(String vbdef15) {
this.vbdef15 = vbdef15;
}
public String getVbdef16() {
return vbdef16;
}
public void setVbdef16(String vbdef16) {
this.vbdef16 = vbdef16;
}
public String getVbdef17() {
return vbdef17;
}
public void setVbdef17(String vbdef17) {
this.vbdef17 = vbdef17;
}
public String getVbdef18() {
return vbdef18;
}
public void setVbdef18(String vbdef18) {
this.vbdef18 = vbdef18;
}
public String getVbdef19() {
return vbdef19;
}
public void setVbdef19(String vbdef19) {
this.vbdef19 = vbdef19;
}
public String getVbdef20() {
return vbdef20;
}
public void setVbdef20(String vbdef20) {
this.vbdef20 = vbdef20;
}
public String getVbmemo() {
return vbmemo;
}
public void setVbmemo(String vbmemo) {
this.vbmemo = vbmemo;
}
public String getExternal_material_spec() {
return external_material_spec;
}
public void setExternal_material_spec(String external_material_spec) {
this.external_material_spec = external_material_spec;
}
public String getCqtunitid() {
return cqtunitid;
}
public void setCqtunitid(String cqtunitid) {
this.cqtunitid = cqtunitid;
}
public String getCqtunitid_name() {
return cqtunitid_name;
}
public void setCqtunitid_name(String cqtunitid_name) {
this.cqtunitid_name = cqtunitid_name;
}
public BigDecimal getNqtunitnum() {
return nqtunitnum;
}
public void setNqtunitnum(BigDecimal nqtunitnum) {
this.nqtunitnum = nqtunitnum;
}
public BigDecimal getNexchangerate() {
return nexchangerate;
}
public void setNexchangerate(BigDecimal nexchangerate) {
this.nexchangerate = nexchangerate;
}
public String getPk_recvstordoc() {
return pk_recvstordoc;
}
public void setPk_recvstordoc(String pk_recvstordoc) {
this.pk_recvstordoc = pk_recvstordoc;
}
public String getRecvstordoc_name() {
return recvstordoc_name;
}
public void setRecvstordoc_name(String recvstordoc_name) {
this.recvstordoc_name = recvstordoc_name;
}
public String getDplanarrvdate() {
return dplanarrvdate;
}
public void setDplanarrvdate(String dplanarrvdate) {
this.dplanarrvdate = dplanarrvdate;
}
public String getSpecial_type() {
return special_type;
}
public void setSpecial_type(String special_type) {
this.special_type = special_type;
}
public String getVbatchcode() {
return vbatchcode;
}
public void setVbatchcode(String vbatchcode) {
this.vbatchcode = vbatchcode;
}
public String getIc_id() {
return ic_id;
}
public void setIc_id(String ic_id) {
this.ic_id = ic_id;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public BigDecimal getTaxprice() {
return taxprice;
}
public void setTaxprice(BigDecimal taxprice) {
this.taxprice = taxprice;
}
public String getMaterial_id() {
return material_id;
}
public void setMaterial_id(String material_id) {
this.material_id = material_id;
}
}

View File

@ -0,0 +1,183 @@
<?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.ncc.dao.impl.POrderBDaoImpl">
<resultMap id="get-POrderBEntity-result" type="com.hzya.frame.plugin.ncc.entity.POrderBEntity">
<!-- -->
<!-- -->
<result property="pk_order" column="pk_order" />
<!-- -->
<result property="pk_order_b" column="pk_order_b" />
<!--集团 -->
<result property="pk_group" column="pk_group" />
<!--组织 -->
<result property="pk_org" column="pk_org" />
<!--行号 -->
<result property="crowno" column="crowno" />
<!--物料 -->
<result property="pk_material" column="pk_material" />
<!--物料编码 -->
<result property="material_code" column="material_code" />
<!--物料名称 -->
<result property="material_name" column="material_name" />
<!--主单位 -->
<result property="cunitid" column="cunitid" />
<!--主单位名称 -->
<result property="cunitid_name" column="cunitid_name" />
<!--辅单位 -->
<result property="castunitid" column="castunitid" />
<!--副单位名称 -->
<result property="castunitid_name" column="castunitid_name" />
<!--吨数 -->
<result property="nnum" column="nnum" />
<!--件数 -->
<result property="nastnum" column="nastnum" />
<!--换算率 -->
<result property="vchangerate" column="vchangerate" />
<!--无税单价 -->
<result property="norigprice" column="norigprice" />
<!--含税单价 -->
<result property="norigtaxprice" column="norigtaxprice" />
<!--无税金额 -->
<result property="norignetprice" column="norignetprice" />
<!--含税金额 -->
<result property="norigtaxnetprice" column="norigtaxnetprice" />
<!--税额 -->
<result property="ntax" column="ntax" />
<!--价税合计 -->
<result property="norigtaxmny" column="norigtaxmny" />
<!--税率 -->
<result property="ntaxrate" column="ntaxrate" />
<!--币种 -->
<result property="corigcurrencyid" column="corigcurrencyid" />
<result property="corigcurrencyid_name" column="corigcurrencyid_name" />
<!--来源单据类型 -->
<result property="csourcetypecode" column="csourcetypecode" />
<!--来源单据 -->
<result property="csourceid" column="csourceid" />
<!--来源单据明细 -->
<result property="csourcebid" column="csourcebid" />
<!--源头单据类型 -->
<result property="cfirsttypecode" column="cfirsttypecode" />
<!--源头单据 -->
<result property="cfirstid" column="cfirstid" />
<!--源头单据明细 -->
<result property="cfirstbid" column="cfirstbid" />
<!--是否赠品 -->
<result property="blargess" column="blargess" />
<!--源头交易类型 -->
<result property="vfirsttrantype" column="vfirsttrantype" />
<!--源头单据号 -->
<result property="vfirstcode" column="vfirstcode" />
<!--源头单据行号 -->
<result property="vfirstrowno" column="vfirstrowno" />
<!--来源交易类型 -->
<result property="vsourcetrantype" column="vsourcetrantype" />
<!--来源单据号 -->
<result property="vsourcecode" column="vsourcecode" />
<!--来源单据行号 -->
<result property="vsourcerowno" column="vsourcerowno" />
<!--自由辅助属性1 -->
<result property="vfree1" column="vfree1" />
<!--自由辅助属性2 -->
<result property="vfree2" column="vfree2" />
<!--自由辅助属性3 -->
<result property="vfree3" column="vfree3" />
<!--自由辅助属性4 -->
<result property="vfree4" column="vfree4" />
<!--自由辅助属性5 -->
<result property="vfree5" column="vfree5" />
<!--自由辅助属性6 -->
<result property="vfree6" column="vfree6" />
<!--自由辅助属性7 -->
<result property="vfree7" column="vfree7" />
<!--FSC/EUDR主键 -->
<result property="pk_vfree8" column="pk_vfree8" />
<!--FSC/EUDR -->
<result property="vfree8" column="vfree8" />
<!--自由辅助属性9 -->
<result property="vfree9" column="vfree9" />
<!--品牌主键 -->
<result property="pk_vfree10" column="pk_vfree10" />
<!--品牌 -->
<result property="vfree10" column="vfree10" />
<!--自定义项1 -->
<result property="vbdef1" column="vbdef1" />
<!--自定义项2 -->
<result property="vbdef2" column="vbdef2" />
<!--自定义项3 -->
<result property="vbdef3" column="vbdef3" />
<!--自定义项4 -->
<result property="vbdef4" column="vbdef4" />
<!--自定义项5 -->
<result property="vbdef5" column="vbdef5" />
<!--自定义项6 -->
<result property="vbdef6" column="vbdef6" />
<!--自定义项7 -->
<result property="vbdef7" column="vbdef7" />
<!--自定义项8 -->
<result property="vbdef8" column="vbdef8" />
<!--自定义项9 -->
<result property="vbdef9" column="vbdef9" />
<!--自定义项10 -->
<result property="vbdef10" column="vbdef10" />
<!--自定义项11 -->
<result property="vbdef11" column="vbdef11" />
<!--自定义项12 -->
<result property="vbdef12" column="vbdef12" />
<!--自定义项13 -->
<result property="vbdef13" column="vbdef13" />
<!--自定义项14 -->
<result property="vbdef14" column="vbdef14" />
<!--自定义项15 -->
<result property="vbdef15" column="vbdef15" />
<!--自定义项16 -->
<result property="vbdef16" column="vbdef16" />
<!--自定义项17 -->
<result property="vbdef17" column="vbdef17" />
<!--自定义项18 -->
<result property="vbdef18" column="vbdef18" />
<!--自定义项19 -->
<result property="vbdef19" column="vbdef19" />
<!--自定义项20 -->
<result property="vbdef20" column="vbdef20" />
<result property="vbmemo" column="vbmemo" />
<!--报价单位 -->
<result property="cqtunitid" column="cqtunitid" />
<result property="cqtunitid_name" column="cqtunitid_name" />
<!--报价数量 -->
<result property="nqtunitnum" column="nqtunitnum" />
<!--折本汇率 -->
<result property="nexchangerate" column="nexchangerate" />
<!--收货仓库 -->
<result property="pk_recvstordoc" column="pk_recvstordoc" />
<!--计划到货日期 -->
<result property="dplanarrvdate" column="dplanarrvdate" />
<result property="dr" column="dr" />
</resultMap>
<!--获取NCC采购订单表体数据 -->
<select id="entity_list_base" resultMap="get-POrderBEntity-result" parameterType="com.hzya.frame.plugin.ncc.entity.POrderBEntity">
SELECT
po_order_b.*,
bd_material.code material_code,
bd_material.name material_name,
bdm1.name cunitid_name,
bdm2.name castunitid_name,
bdm3.name cqtunitid_name,
bd_currtype.name corigcurrencyid_name,
po_order_b.dr
FROM
po_order_b
left join bd_material on po_order_b.pk_material = bd_material.pk_material
left join bd_measdoc bdm1 on po_order_b.cunitid = bdm1.pk_measdoc
left join bd_measdoc bdm2 on po_order_b.castunitid = bdm2.pk_measdoc
left join bd_measdoc bdm3 on po_order_b.cqtunitid = bdm3.pk_measdoc
left join bd_currtype on po_order_b.corigcurrencyid = bd_currtype.pk_currtype
<trim prefix="where" prefixOverrides="and">
1 = 1
<if test="pk_order != null "> and po_order_b.pk_order = #{pk_order}</if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,163 @@
package com.hzya.frame.plugin.ncc.entity;
import com.hzya.frame.web.entity.BaseEntity;
import java.util.List;
import java.util.Map;
/**
* @description: 采购订单主表
* @tableName: po_order
* @entityName: POrderHEntity
* @author: code_generator
* @history: 1.0
*/
public class POrderHEntity extends BaseEntity {
/** 采购订单 */
private String pk_order;
/** 集团 */
private String pk_group;
/** 集团名称 */
private String group_name;
/** 采购组织 */
private String pk_org;
private String pk_orgs;
private String pk_org_search;
/** 采购组织版本信息 */
private String pk_org_v;
/** 组织名称 */
private String org_name;
/** 订单编号 */
private String vbillcode;
/** 订单日期 */
private String dbilldate;
/** 供应商 */
private String pk_supplier;
/** 供应商版本 */
private String pk_supplier_v;
/** 供应商名称 */
private String supplier_name;
/** 采购部门 */
private String pk_dept;
/** 部门名称 */
private String dept_name;
/** 采购员 */
private String cemployeeid;
/** 采购员名称 */
private String cemployeeid_name;
/** 订单类型编码 */
private String vtrantypecode;
/** 订单类型名称 */
private String vtrantypecode_name;
/** 供应商发货地址 */
private String pk_deliveradd;
/** 供应商发货地址 */
private String deliveradd_name;
/** 单据状态 */
private String forderstatus;
private String forderstatus_name;
/** 备注 */
private String vmemo;
/** 运输方式 */
private String pk_transporttype;
/** 运输方式 */
private String transporttype_name;
/** 付款协议 */
private String pk_payterm;
/** 付款协议名称 */
private String payterm_name;
/** 最新版本 */
private String bislatest;
private String bislatest_name;
/** 总数量 */
private String ntotalastnum;
/** 总件数 */
private String ntotalpiece;
/** 价税合计 */
private String ntotalorigmny;
/** 业务流程 */
private String pk_busitype;
/** 结算方式 */
private String pk_balatype;
/** 币种 */
private String corigcurrencyid;
private String corigcurrencyid_name;
/** 进口合同号*/
private String vdef1;
/** */
private String vdef2;
/** 提单号 */
private String vdef3;
/** */
private String vdef4;
/** */
private String vdef5;
/** */
private String vdef6;
/** 承运商 */
private String vdef7;
private String vdef7_name;
/** */
private String vdef8;
/** */
private String vdef9;
/** */
private String vdef10;
/** */
private String vdef11;
/** */
private String vdef12;
/** */
private String vdef13;
/** 合同号 */
private String vdef14;
/** */
private String vdef15;
/** */
private String vdef16;
/** */
private String vdef17;
/** */
private String vdef18;
/** */
private String vdef19;
/** */
private String vdef20;
private String breturn;
/** 推送状态 */
private String push_status;
/** 项目 */
private String pk_project;
/** 项目名称 */
private String project_name;
private String type;
private String systate = "0";
private List<String> rowIds;
private List<POrderBEntity> detailList;
private Map<String, Object> icMap;
private String ic_id;
private String it_type;
private Boolean exempted_flag;
private Boolean isNotPo;
private String tms_bill_code;
private String bill_code_search;
// 是否关闭
private String bfinalclose;
// 发货地址
private String ship_address;
}

View File

@ -0,0 +1,168 @@
<?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.ncc.dao.impl.POrderHDaoImpl">
<resultMap id="get-POrderHEntity-result" type="com.hzya.frame.plugin.ncc.entity.POrderHEntity">
<!-- -->
<!--采购订单 -->
<result property="pk_order" column="pk_order" />
<!--集团 -->
<result property="pk_group" column="pk_group" />
<!--集团名称 -->
<result property="group_name" column="group_name" />
<!--采购组织 -->
<result property="pk_org" column="pk_org" />
<!--采购组织版本信息 -->
<result property="pk_org_v" column="pk_org_v" />
<!--组织名称 -->
<result property="org_name" column="org_name" />
<!--订单编号 -->
<result property="vbillcode" column="vbillcode" />
<!--订单日期 -->
<result property="dbilldate" column="dbilldate" />
<!--供应商 -->
<result property="pk_supplier" column="pk_supplier" />
<!--供应商版本 -->
<result property="pk_supplier_v" column="pk_supplier_v" />
<!--供应商名称 -->
<result property="supplier_name" column="supplier_name" />
<!--采购部门 -->
<result property="pk_dept" column="pk_dept" />
<!--部门名称 -->
<result property="dept_name" column="dept_name" />
<!--采购员 -->
<result property="cemployeeid" column="cemployeeid" />
<!--采购员名称 -->
<result property="cemployeeid_name" column="cemployeeid_name" />
<!--订单类型编码 -->
<result property="vtrantypecode" column="vtrantypecode" />
<!--订单类型名称 -->
<result property="vtrantypecode_name" column="vtrantypecode_name" />
<!--供应商发货地址 -->
<result property="pk_deliveradd" column="pk_deliveradd" />
<!--供应商发货地址 -->
<result property="deliveradd_name" column="deliveradd_name" />
<!--单据状态 -->
<result property="forderstatus" column="forderstatus" />
<result property="forderstatus_name" column="forderstatus_name" />
<!--备注 -->
<result property="vmemo" column="vmemo" />
<!--运输方式 -->
<result property="pk_transporttype" column="pk_transporttype" />
<!--运输方式 -->
<result property="transporttype_name" column="transporttype_name" />
<!--付款协议 -->
<result property="pk_payterm" column="pk_payterm" />
<!--付款协议名称 -->
<result property="payterm_name" column="payterm_name" />
<!--最新版本 -->
<result property="bislatest" column="bislatest" />
<!--总数量 -->
<result property="ntotalastnum" column="ntotalastnum" />
<!--总件数 -->
<result property="ntotalpiece" column="ntotalpiece" />
<!--价税合计 -->
<result property="ntotalorigmny" column="ntotalorigmny" />
<!--业务流程 -->
<result property="pk_busitype" column="pk_busitype" />
<!--结算方式 -->
<result property="pk_balatype" column="pk_balatype" />
<!--币种 -->
<result property="corigcurrencyid" column="corigcurrencyid" />
<result property="corigcurrencyid_name" column="corigcurrencyid_name" />
<!--进口合同号
-->
<result property="vdef1" column="vdef1" />
<!-- -->
<result property="vdef2" column="vdef2" />
<!--提单号 -->
<result property="vdef3" column="vdef3" />
<!-- -->
<result property="vdef4" column="vdef4" />
<!-- -->
<result property="vdef5" column="vdef5" />
<!-- -->
<result property="vdef6" column="vdef6" />
<!--承运商 -->
<result property="vdef7" column="vdef7" />
<!-- -->
<result property="vdef8" column="vdef8" />
<!-- -->
<result property="vdef9" column="vdef9" />
<!-- -->
<result property="vdef10" column="vdef10" />
<!-- -->
<result property="vdef11" column="vdef11" />
<!-- -->
<result property="vdef12" column="vdef12" />
<!-- -->
<result property="vdef13" column="vdef13" />
<!--合同号 -->
<result property="vdef14" column="vdef14" />
<!-- -->
<result property="vdef15" column="vdef15" />
<!-- -->
<result property="vdef16" column="vdef16" />
<!-- -->
<result property="vdef17" column="vdef17" />
<!-- -->
<result property="vdef18" column="vdef18" />
<!-- -->
<result property="vdef19" column="vdef19" />
<!-- -->
<result property="vdef20" column="vdef20" />
<result property="breturn" column="breturn" />
<result property="bfinalclose" column="bfinalclose" />
<!--项目 -->
<result property="pk_project" column="pk_project" />
<!--项目名称 -->
<result property="project_name" column="project_name" />
<result property="dr" column="dr" />
</resultMap>
<!--获取NCC采购订单表头数据 -->
<select id="entity_list_base" resultMap="get-POrderHEntity-result" parameterType="com.hzya.frame.plugin.ncc.entity.POrderHEntity">
SELECT
po_order.*,
po_order.dr,
org_orgs.name org_name,
bd_supplier.name supplier_name,
org_dept.name dept_name,
bd_psndoc.name cemployeeid_name,
bd_billtype.billtypename vtrantypecode_name,
bd_payment.name transporttype_name,
bd_project.project_name project_name,
bd_currtype.name corigcurrencyid_name,
CASE po_order.forderstatus
WHEN 0 THEN
'自由'
WHEN 1 THEN
'提交'
WHEN 2 THEN
'正在审批'
WHEN 4 THEN
'审批不通过'
ELSE
'审批通过'
END forderstatus_name
FROM
po_order
left join org_orgs on po_order.pk_org = org_orgs.pk_org
left join bd_supplier on po_order.pk_supplier = bd_supplier.pk_supplier
left join org_dept on po_order.pk_dept = org_dept.pk_dept
left join bd_psndoc on po_order.cemployeeid = bd_psndoc.pk_psndoc
left join bd_billtype on po_order.vtrantypecode = bd_billtype.pk_billtypecode
left join bd_payment on po_order.pk_transporttype = bd_payment.pk_payment
left join bd_project on po_order.pk_project = bd_project.pk_project
left join bd_currtype on po_order.corigcurrencyid = bd_currtype.pk_currtype
<trim prefix="where" prefixOverrides="and">
po_order.forderstatus = '3'
<if test="pk_org != null and pk_org != ''"> and po_order.pk_org = #{pk_org}</if>
<if test="pk_orgs != null and pk_orgs != ''"> and po_order.pk_org in (${pk_orgs})</if>
<if test="vbillcode != null and vbillcode != ''"> and po_order.vbillcode = #{vbillcode}</if>
<if test="dbilldate != null and dbilldate != ''"> and po_order.dbilldate &gt;= #{dbilldate}</if>
<if test="timestamp != null and timestamp != ''"> and po_order.ts &gt;= #{timestamp}</if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,102 @@
package com.hzya.frame.plugin.ncc.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;
/**
* @Description NCC采购订单传发起OA审批
* @Author xiangerlin
* @Date 2025/6/3 19:01
**/
public class PoOrderPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PoOrderPluginInitializer.class);
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 10:48
* @Param []
* @return void
**/
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
/****
* 插件销毁方法
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
/****
* 插件的ID
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginId() {
return "PoOrderPluginInitializer";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "NCC采购订单传OA";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "NCC采购订单传OA";
}
/***
* 插件类型 1场景插件
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 14:01
* @Param []
* @return java.lang.String
**/
@Override
public String getPluginType() {
return "1";
}
/***
* 执行业务代码
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-07 11:20
* @param requestJson 执行业务代码的参数
* @return void
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("======开始执行NCC采购订单传OA插件======");
}catch (Exception e){
logger.info("======执行NCC采购订单传OA插件出错======{}",e.getMessage());
return BaseResult.getFailureMessageEntity("请NCC采购订单传OA插件执行失败",e.getMessage());
}
return BaseResult.getSuccessMessageEntity("NCC采购订单传OA插件执行成功");
}
}

View File

@ -0,0 +1,24 @@
package com.hzya.frame.plugin.ncc.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.ncc.entity.POrderBEntity;
import java.util.List;
/**
* @description: 采购订单子表 service
* @tableName: po_order_b
* @entityName: POrderBEntity
* @author: code_generator
* @history: 1.0
*/
public interface IPOrderBService extends IBaseService<POrderBEntity,String> {
/**
* 查询采购订单子表
* @param entity
* @return
*/
List<POrderBEntity> queryList(POrderBEntity entity);
}

View File

@ -0,0 +1,24 @@
package com.hzya.frame.plugin.ncc.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.ncc.entity.POrderHEntity;
import java.util.List;
/**
* @description: 采购订单主表 service
* @tableName: po_order
* @entityName: POrderHEntity
* @author: code_generator
* @history: 1.0
*/
public interface IPOrderHService extends IBaseService<POrderHEntity,String> {
/**
* 查询采购订单主表
* @param entity
* @return
*/
List<POrderHEntity> queryList(POrderHEntity entity);
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.ncc.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* @Description NCC采购订单
* @Author xiangerlin
* @Date 2025/6/3 19:09
**/
public interface IPoOrderPluginInService {
/**
* NCC采购订单传到OA走审批流
* @param requestJson
* @return
*/
JsonResultEntity sync2oa(JSONObject requestJson);
}

View File

@ -0,0 +1,44 @@
package com.hzya.frame.plugin.ncc.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.ncc.dao.IPOrderBDao;
import com.hzya.frame.plugin.ncc.entity.POrderBEntity;
import com.hzya.frame.plugin.ncc.service.IPOrderBService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @description: 采购订单子表 service
* @tableName: po_order_b
* @entityName: POrderBEntity
* @author: code_generator
* @history: 1.0
*/
@Service(value="po_order_bService")
public class POrderBServiceImpl extends BaseService<POrderBEntity,String> implements IPOrderBService {
protected IPOrderBDao porderbDao;
@Autowired
public void setPOrderBDao(IPOrderBDao dao) {
this.porderbDao = dao;
this.dao=dao;
}
/**
* 查询采购订单子表
*
* @param entity
* @return
*/
@DS(value = "#entity.dataSourceCode")
@Override
public List<POrderBEntity> queryList(POrderBEntity entity) {
List<POrderBEntity> queryList = porderbDao.query(entity);
return queryList;
}
}

View File

@ -0,0 +1,53 @@
package com.hzya.frame.plugin.ncc.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.lang.Assert;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.ncc.dao.IPOrderHDao;
import com.hzya.frame.plugin.ncc.entity.POrderHEntity;
import com.hzya.frame.plugin.ncc.service.IPOrderHService;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @description: 采购订单主表 service
* @tableName: po_order
* @entityName: POrderHEntity
* @author: code_generator
* @history: 1.0
*/
@Service(value="po_orderService")
public class POrderHServiceImpl extends BaseService<POrderHEntity,String> implements IPOrderHService {
protected IPOrderHDao porderhDao;
@Autowired
public void setPOrderHDao(IPOrderHDao dao) {
this.porderhDao = dao;
this.dao=dao;
}
/**
* 查询采购订单主表
*
* @param entity
* @return
*/
@DS(value = "#entity.dataSourceCode")
@Override
public List<POrderHEntity> queryList(POrderHEntity entity) {
List<POrderHEntity> queryList = porderhDao.query(entity);
return queryList;
}
}

View File

@ -0,0 +1,104 @@
package com.hzya.frame.plugin.ncc.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.ncc.service.IPOrderBService;
import com.hzya.frame.plugin.ncc.service.IPOrderHService;
import com.hzya.frame.plugin.ncc.service.IPoOrderPluginInService;
import com.hzya.frame.seeyon.util.OARestUtil;
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.beans.factory.annotation.Value;
import java.util.LinkedList;
import java.util.List;
/**
* @Description NCC采购订单
* @Author xiangerlin
* @Date 2025/6/3 19:09
**/
public class PoOrderPluginInServiceImpl implements IPoOrderPluginInService {
Logger logger = LoggerFactory.getLogger(PoOrderPluginInServiceImpl.class);
@Autowired
private IPOrderHService pOrderHService;
@Autowired
private IPOrderBService pOrderBService;
@Value("${zt.url}")
private String interfaceUrl;
@Autowired
private OARestUtil oaRestUtil;
/**
* NCC采购订单传到OA走审批流
*
* @param requestJson
* @return
*/
@Override
public JsonResultEntity sync2oa(JSONObject requestJson) {
//数据源编码
String datasourceCode = requestJson.getString("sourceCode");
if (StrUtil.isNotEmpty(datasourceCode)){
//查NCC单据
//组装参数
JSONObject formmain_0256 = new JSONObject();//主表数据
List<JSONObject> formson_0257_list = new LinkedList<>();//子表数据
formmain_0256.put("采购组织","");
formmain_0256.put("订单编号","");
formmain_0256.put("订单日期","");
formmain_0256.put("供应商","");
formmain_0256.put("采购员","");
formmain_0256.put("开票供应商","");
formmain_0256.put("付款协议","");
formmain_0256.put("发起人","");
formmain_0256.put("单据状态","");
formmain_0256.put("备注","");
formmain_0256.put("补货","");
formmain_0256.put("退货","");
formmain_0256.put("总数量","");
formmain_0256.put("总价税合计","");
formmain_0256.put("币种","");
formmain_0256.put("退货退库基于原订单补货","");
formmain_0256.put("最终关闭","");
formmain_0256.put("采购部门","");
formmain_0256.put("订单类型","");
//子表
JSONObject formson_0257 = new JSONObject();
formson_0257.put("收货库存组织","");
formson_0257.put("行号","");
formson_0257.put("物料编码","");
formson_0257.put("物料名称","");
formson_0257.put("单位","");
formson_0257.put("数量","");
formson_0257.put("换算率","");
formson_0257.put("无税单价","");
formson_0257.put("含税单价","");
formson_0257.put("集团本币无税金额","");
formson_0257.put("集团本币价税合计","");
formson_0257.put("计划收货日期","");
formson_0257.put("收货仓库","");
formson_0257.put("税率","");
formson_0257_list.add(formson_0257);
String param = oaRestUtil.processParamValueOf(formmain_0256, formson_0257_list, "模板编号", "formmain_0256", "formson_0257");
String token = oaRestUtil.getToken("hzyaRest", "8000640001");
logger.info("NCC发起OA采购订单请求参数{}",param);
//调用OA接口
String result = HttpRequest.post(interfaceUrl)
.header("token",token)// token
.header("appId","800064")// 建辉OA应用
.header("apiCode","8000640000")//流程表单接口
.header("publicKey","ZJYAAr9TeFduBYu7uJeie2KYdQsnBaEYZHmOjPWMMVZmzelCe7eDIk+3zDUT+v578prj")//NCC应用key
.header("secretKey","f4SSnYcDQmdkwwuGJd2+934q6lM1NnUm5dmOw/4Wvy2mo6PgkKsI/drXYyyLWQCaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//NCC应用密钥
.body(param).execute().body();
// JsonResultEntity resultEntity = (JsonResultEntity) oerDjmlService.handleOerDjml(paramJSON);
// logger.info("保存GRPU8响应参数:{}",JSONObject.toJSON(resultEntity));
logger.info("NCC发起OA采购订单响应参数:{}",result);
//更新NCC推送状态
}
return null;
}
}

View File

@ -0,0 +1,102 @@
package com.hzya.frame.plugin.oa.payment.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService;
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;
/**
* @Description 查询交易结果
* @Author xiangerlin
* @Date 2025/5/29 17:19
**/
public class PayResultPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PayResultPluginInitializer.class);
@Autowired
private IPaymentPluginService paymentPluginService;
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 10:48
* @Param []
* @return void
**/
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
/****
* 插件销毁方法
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
/****
* 插件的ID
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginId() {
return "PayResultPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "查询CBS交易结果";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "查询CBS交易结果";
}
/***
* 插件类型 1场景插件
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 14:01
* @Param []
* @return java.lang.String
**/
@Override
public String getPluginType() {
return "0";
}
/***
* 执行业务代码
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-07 11:20
* @param requestJson 执行业务代码的参数
* @return void
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("======开始查询CBS交易结果======");
paymentPluginService.payRequest(requestJson);
return BaseResult.getSuccessMessageEntity("执行成功");
}
}

View File

@ -0,0 +1,107 @@
package com.hzya.frame.plugin.oa.payment.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService;
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;
/**
* @Description 支付申请
* @Author xiangerlin
* @Date 2025/5/29 15:40
**/
public class PaymentRequestPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PaymentRequestPluginInitializer.class);
@Autowired
private IPaymentPluginService paymentPluginService;
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 10:48
* @Param []
* @return void
**/
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
/****
* 插件销毁方法
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
/****
* 插件的ID
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginId() {
return "PaymentRequestPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "OA支付申请CBS插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "OA支付申请CBS插件";
}
/***
* 插件类型 1场景插件
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 14:01
* @Param []
* @return java.lang.String
**/
@Override
public String getPluginType() {
return "1";
}
/***
* 执行业务代码
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-07 11:20
* @param requestJson 执行业务代码的参数
* @return void
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("======开始执行OA支付申请CBS插件======");
JsonResultEntity jsonResultEntity = paymentPluginService.payRequest(requestJson);
return BaseResult.getSuccessMessageEntity("OA支付申请CBS插件执行成功",jsonResultEntity);
}catch (Exception e){
logger.info("======执行OA支付申请CBS插件出错======{}",e.getMessage());
return BaseResult.getFailureMessageEntity("OA支付申请CBS插件执行失败",e.getMessage());
}
}
}

View File

@ -0,0 +1,24 @@
package com.hzya.frame.plugin.oa.payment.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* @Description 支付申请
* @Author xiangerlin
* @Date 2025/5/29 15:43
**/
public interface IPaymentPluginService {
/**
* 支付申请
* @param requestJson
* @return
*/
JsonResultEntity payRequest(JSONObject requestJson);
/**
* 查询交易结果
* @param requestJson
*/
void queryPayResult(JSONObject requestJson);
}

View File

@ -0,0 +1,181 @@
package com.hzya.frame.plugin.oa.payment.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.cbs8.dto.req.PayResultRequestDTO;
import com.hzya.frame.cbs8.dto.res.PayResponseDTO;
import com.hzya.frame.cbs8.dto.res.PayResultResDTO;
import com.hzya.frame.cbs8.service.ICbs8Service;
import com.hzya.frame.cbs8.util.CBSUtil;
import com.hzya.frame.cbs8.util.PayState;
import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService;
import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity;
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
import com.hzya.frame.seeyon.cbs8.service.ICbsLogService;
import com.hzya.frame.seeyon.cbs8.service.IPaymentService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Description 支付申请
* @Author xiangerlin
* @Date 2025/5/29 15:43
**/
public class PaymentPluginServiceImpl implements IPaymentPluginService {
Logger logger = LoggerFactory.getLogger(PaymentPluginServiceImpl.class);
@Autowired
private IPaymentService paymentService;
@Autowired
private ICbs8Service cbs8Service;
@Autowired
private ICbsLogService cbsLogService;;
/**
* 支付申请
*
* @param requestJson
* @return
*/
@Override
public JsonResultEntity payRequest(JSONObject requestJson) {
String headersStr = requestJson.getString("headers");//请求头
String formAppId = requestJson.getString("formAppId");
String eventType = requestJson.getString("eventType");
String id = requestJson.getString("id");
String dataSouceCode = requestJson.getString("sourceCode");
Assert.notEmpty(id,"id不能为空");
Assert.notEmpty(formAppId,"formAppId不能为空");
Assert.notEmpty(eventType,"eventType不能为空");
Assert.notEmpty(headersStr,"headers不能为空");
Assert.notEmpty(dataSouceCode,"数据源编码不能为空");
logger.info("准备开始查询待支付的单据");
PaymentEntity paymentEntity = new PaymentEntity();
paymentEntity.setId(id);
paymentEntity.setDataSourceCode(dataSouceCode);
try {
//查询OA待支付的数据
List<PaymentEntity> paymentList = paymentService.queryUnpaid(paymentEntity);
if (CollectionUtils.isNotEmpty(paymentList) && paymentList.size() == 1){
PaymentEntity pay = paymentList.get(0);
PayResponseDTO payResponseDTO = cbs8Service.payApply(JSONObject.toJSONString(pay));
String payResStr = JSONObject.toJSONString(payResponseDTO);
logger.info("支付申请响应结果:{}",payResStr);
if (null != payResponseDTO){
//保存支付日志
saveCbsLog(pay,payResponseDTO,dataSouceCode);
if (payResponseDTO.getSuccessed()) {
return BaseResult.getSuccessMessageEntity("支付申请成功",payResponseDTO.getBusNum());
}else {
BaseResult.getFailureMessageEntity("支付申请失败:{}",payResStr);
}
}else {
BaseResult.getFailureMessageEntity("支付申请失败");
}
return BaseResult.getSuccessMessageEntity("",payResponseDTO);
}
}catch (Exception e){
logger.error("OA单据推CBS支付申请失败:{}",e);
}
return null;
}
/**
* 查询交易结果
*
* @param requestJson
*/
@Override
public void queryPayResult(JSONObject requestJson) {
String dataSourceCode = requestJson.getString("sourceCode");
Assert.notEmpty(dataSourceCode,"数据源编码不能为空");
try {
CbsLogEntity cbsLogEntity = new CbsLogEntity();
cbsLogEntity.setDataSourceCode(dataSourceCode);
List<CbsLogEntity> queryList = cbsLogService.queryInPayment(cbsLogEntity);
if (CollectionUtils.isNotEmpty(queryList)){
for (CbsLogEntity entity : queryList) {
List<PayResultResDTO> payResultResDTOList = cbs8Service.queryPayResult(new PayResultRequestDTO(entity.getBill_code()));
if (CollectionUtils.isNotEmpty(payResultResDTOList)){
PayResultResDTO payResultResDTO = payResultResDTOList.get(0);
String status = payResultResDTO.getStatus();//支付申请状态
String pay_status = payResultResDTO.getPayStatus();//支付状态
if (!PayState.p.getType().equals(pay_status)){//不等于支付中的时候才更新
//如果支付状态为空保存支付申请状态如果支付状态不为空则保存支付状态
PaymentEntity paymentEntity = new PaymentEntity();
paymentEntity.setOaId(entity.getOa_id());
paymentEntity.setDataSourceCode(dataSourceCode);
List<PaymentEntity> paymentList = paymentService.query(paymentEntity);
if (CollectionUtils.isNotEmpty(paymentList)){
paymentEntity = paymentList.get(0);
if (StrUtil.isEmpty(pay_status)) {
paymentEntity.setPayResult(PayState.payStateGetValue(status));//支付申请状态 支付状态和支付申请状态用一个
} else {
paymentEntity.setPayResult(PayState.payStateGetValue(pay_status));//支付状态 支付状态和支付申请状态用一个
}
if (StrUtil.isNotEmpty(pay_status) && pay_status.equals(PayState.g.getType())) {
paymentEntity.setPayDate(CBSUtil.convertTimestampToString(payResultResDTO.getPayDate()));//支付时间
}
paymentService.updatePayState(paymentEntity);
//更新日志表状态
entity.setPay_state(paymentEntity.getPayResult());
entity.setApply_state(PayState.payStateGetValue(status));
entity.setDataSourceCode(dataSourceCode);
cbsLogService.update(entity);
}
}
}
}
}
}catch (Exception e){
logger.error("查询交易结果出错:{}",e);
}
}
/**
* 保存支付日志
* @param entity 支付参数
* @param payResponseDTO cbs返回参数
* @param dataSourceCode 数据源编码
* @throws Exception
*/
private void saveCbsLog(PaymentEntity entity,PayResponseDTO payResponseDTO,String dataSourceCode)throws Exception{
if (null != payResponseDTO){
//4. 保存日志
CbsLogEntity cbsLogEntity = new CbsLogEntity();
cbsLogEntity.setTitle(entity.getTitle());
cbsLogEntity.setPay_company(entity.getPayCompany());
cbsLogEntity.setPayee(entity.getRevAccountName());
cbsLogEntity.setAmount(entity.getAmount());
cbsLogEntity.setOa_id(entity.getOaId());
cbsLogEntity.setBill_code(Convert.toStr(entity.getReferenceNumNew(),entity.getReferenceNum()));
cbsLogEntity.setTab_name_ch(entity.getBillName());
cbsLogEntity.setTab_name_en(entity.getTableName());
Boolean successed = payResponseDTO.getSuccessed();
if (successed){
cbsLogEntity.setPay_state(PayState.p.getValue());
cbsLogEntity.setApply_state(PayState.two.getValue());
cbsLogEntity.setCbs_apply_code(payResponseDTO.getBusNum());
cbsLogEntity.setSuccessed("true");
entity.setPayResult(PayState.p.getValue());
}else {
cbsLogEntity.setPay_state("推送失败");
cbsLogEntity.setMessage(payResponseDTO.getErrorMsg());
cbsLogEntity.setSuccessed("false");
entity.setPayResult("推送失败");
}
cbsLogEntity.setDataSourceCode(dataSourceCode);
cbsLogService.saveLog(cbsLogEntity);
//5.更新视图的支付状态
paymentService.updatePayState(entity);
}
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.oa.praybill.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
/**
* @Description OA请购单
* @Author xiangerlin
* @Date 2025/6/8 17:06
**/
public interface IRequisitionOrderDao extends IBaseDao<RequisitionOrderEntity,String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.plugin.oa.praybill.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.oa.praybill.dao.IRequisitionOrderDao;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
import org.springframework.stereotype.Repository;
/**
* @Description OA请购单
* @Author xiangerlin
* @Date 2025/6/8 17:08
**/
@Repository("requisitionOrderDaoImpl")
public class RequisitionOrderDaoImpl extends MybatisGenericDao<RequisitionOrderEntity,String> implements IRequisitionOrderDao {
}

View File

@ -0,0 +1,31 @@
package com.hzya.frame.plugin.oa.praybill.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description OA请购单
*
* @Author xiangerlin
* @Date 2025/6/8 17:04
**/
public class RequisitionOrderEntity extends BaseEntity {
private String field0001;//单据号
private String field0059;//NCC
public String getField0001() {
return field0001;
}
public void setField0001(String field0001) {
this.field0001 = field0001;
}
public String getField0059() {
return field0059;
}
public void setField0059(String field0059) {
this.field0059 = field0059;
}
}

View File

@ -0,0 +1,8 @@
<?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.oa.praybill.dao.impl.RequisitionOrderDaoImpl">
<update id="entity_update" parameterType="com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity">
update formmain_0254 set field0059 = #{field0059} where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,108 @@
package com.hzya.frame.plugin.oa.praybill.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderPluginService;
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;
/**
* @Description 请购单传NCC
* @Author xiangerlin
* @Date 2025/5/21 16:50
**/
public class RequisitionOrderPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(RequisitionOrderPluginInitializer.class);
@Autowired
private IRequisitionOrderPluginService requisitionOrderPluginService;
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 10:48
* @Param []
* @return void
**/
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
/****
* 插件销毁方法
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
/****
* 插件的ID
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginId() {
return "RequisitionOrderPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "请购单传NCC插件";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "请购单传NCC插件";
}
/***
* 插件类型 1场景插件
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 14:01
* @Param []
* @return java.lang.String
**/
@Override
public String getPluginType() {
return "1";
}
/***
* 执行业务代码
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-07 11:20
* @param requestJson 执行业务代码的参数
* @return void
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("======开始执行请购单传NCC插件======{}",JSONObject.toJSONString(requestJson));
requisitionOrderPluginService.sync2ncc(requestJson);
}catch (Exception e){
e.printStackTrace();
logger.info("======执行请购单传NCC插件出错======{}",e.getMessage());
return BaseResult.getFailureMessageEntity("请购单传NCC插件执行失败",e.getMessage());
}
return BaseResult.getSuccessMessageEntity("请购单传NCC插件执行成功");
}
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.oa.praybill.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* @Description 请购单传nCC
* @Author xiangerlin
* @Date 2025/5/21 17:44
**/
public interface IRequisitionOrderPluginService {
/**
* 请购单同步到ncc
* @param requestJson
* @return
*/
JsonResultEntity sync2ncc(JSONObject requestJson);
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.plugin.oa.praybill.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
/**
* @Description OA 请购单
* @Author xiangerlin
* @Date 2025/6/8 17:10
**/
public interface IRequisitionOrderService extends IBaseService<RequisitionOrderEntity,String> {
/**
* 更新OA单据
* @param entity
* @return
*/
int updateOrder(RequisitionOrderEntity entity);
}

View File

@ -0,0 +1,299 @@
package com.hzya.frame.plugin.oa.praybill.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderPluginService;
import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderService;
import com.hzya.frame.seeyon.entity.CollAttachmentResDTO;
import com.hzya.frame.seeyon.enums.ColEventTypeEnum;
import com.hzya.frame.seeyon.util.OARestUtil;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.io.File;
import java.net.URLDecoder;
import java.util.Base64;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
/**
* @Description OA请购单传NCC
* @Author xiangerlin
* @Date 2025/5/21 17:44
**/
public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPluginService {
@Value("${zt.url}")
private String baseUrl;
@Autowired
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IRequisitionOrderService requisitionOrderService;
@Autowired
private OARestUtil oaRestUtil;
Logger logger = LoggerFactory.getLogger(IRequisitionOrderPluginService.class);
/**
* 请购单同步到ncc
*
* @param requestJson
* @return
*/
@Override
public JsonResultEntity sync2ncc(JSONObject requestJson) {
//数据源编码
String datasourceCode = requestJson.getString("sourceCode");
String task_living_details_id = requestJson.getString("integration_task_living_details_id");
String headersStr = requestJson.getString("headers");//请求头
String eventType = requestJson.getString("eventType");
String summaryId = requestJson.getString("summaryId");
JSONObject headers = requestJson.getJSONObject("headers");
Assert.notEmpty(eventType,"eventType不能为空");
Assert.notEmpty(headersStr,"headers不能为空");
String formmainTableName = headers.getString("formmainTableName");
String forsonTableName = headers.getString("forsonTableName");
String fileApiCode = headers.getString("fileApiCode");
JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr");
JSONObject businessData = jsonStrObj.getJSONObject("businessDataStr");
JSONObject formmainData = businessData.getJSONObject(formmainTableName);
JSONArray forsonData = businessData.getJSONArray(forsonTableName);
//流程结束
if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){
//组装请购单报文
JSONArray reqParams = praybillVaueOf(headers, formmainData, forsonData);
String req = JSONObject.toJSONString(reqParams);
logger.info("======OA请购单传NCC请求参数:{}======",req);
String result = HttpRequest.post(baseUrl)
.header("appId", "800065")//NCC请购单接口
.header("apiCode", "8000650000")//NCC应用
.header("publicKey", "ZJYAbkr9+XjnDrlfQCRKXtpVvg/BjxqtxzcLgg5TIGagEKJCe7eDIk+3zDUT+v578prj")//OA公钥
.header("secretKey", "2GR4+yrcx+Ev+pN0Q6V6wxCdvisPX7wzNKBgc5SsIYGxYI5GTISXT6GvTPfp1u2Rj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
.body(req)//表单内容
.timeout(30000)//超时毫秒
.execute().body();
logger.info("======OA请购单传NCC响应参数:{}======",result);
if (StrUtil.isNotEmpty(result)){
JSONObject resultJson = JSONObject.parseObject(result);
Boolean flag = resultJson.getBoolean("flag");
//保存日志
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
Date now = new Date();
taskLivingDetail.setCreate_time(now);
taskLivingDetail.setModify_time(now);
taskLivingDetail.setRootAppPk(formmainData.getString("id"));
taskLivingDetail.setRootAppBill(formmainData.getString("field0001"));
taskLivingDetail.setPluginId("RequisitionOrderPlugin");
taskLivingDetail.setRootAppNewData(req);
taskLivingDetail.setNewTransmitInfo(result);
taskLivingDetail.setNewPushDate(now);
saveLog(task_living_details_id,flag,taskLivingDetail);
//回写NCC单号到OA单据
JSONObject attribute = resultJson.getJSONObject("attribute");
if (null != attribute){
String code = attribute.getString("code");
if ("success".equals(code)){
JSONObject data = attribute.getJSONObject("data");
if (null != data){
JSONObject headVO = data.getJSONObject("headVO");
if (null != headVO){
String vbillcode = headVO.getString("code");
String pk_bill = headVO.getString("id");
logger.info("======vbillcode======:{}",vbillcode);
RequisitionOrderEntity requisitionOrderEntity = new RequisitionOrderEntity();
requisitionOrderEntity.setField0059(vbillcode);
requisitionOrderEntity.setDataSourceCode(datasourceCode);
requisitionOrderEntity.setId(formmainData.getString("id"));
requisitionOrderService.updateOrder(requisitionOrderEntity);
//下载OA附件上传到NCC
try {
uploadFile(summaryId, headers, fileApiCode, pk_bill);
}catch (Exception e){
logger.error("下载OA附件上传到NCC出错:{}",e);
}
}
}
}
}
}
}
return BaseResult.getSuccessMessageEntity("请购单推NCC成功");
}
/**
* 下载OA附件上传到NCC
* @param summaryId
* @param headers
* @param fileApiCode
* @param pk_bill
*/
public void uploadFile(String summaryId, JSONObject headers, String fileApiCode, String pk_bill) {
String token = oaRestUtil.getToken(null, fileApiCode);
List<CollAttachmentResDTO> collAttachmentList = oaRestUtil.getColAttachments(summaryId, "0", fileApiCode, token);
if (CollectionUtils.isNotEmpty(collAttachmentList)){
//获取OA token
for (CollAttachmentResDTO collAttachment : collAttachmentList) {
try {
String fileName = URLDecoder.decode(collAttachment.getFilename(), "UTF-8");
byte[] bytes = oaRestUtil.downloadFileBytes("hzya", fileApiCode, collAttachment.getFileUrl(), fileName, token);
String base64File = Base64.getEncoder().encodeToString(bytes);
JSONObject fileParams = new JSONObject();
fileParams.put("creator", headers.getString("creator"));
fileParams.put("pk_bill", pk_bill);
fileParams.put("filename",fileName);
fileParams.put("file",base64File);
String result = HttpRequest.post(baseUrl)
.header("appId", "800065")//NCC应用
.header("apiCode", "8000650001")//NCC附件上传接口
.header("publicKey", "ZJYAbkr9+XjnDrlfQCRKXtpVvg/BjxqtxzcLgg5TIGagEKJCe7eDIk+3zDUT+v578prj")//OA公钥
.header("secretKey", "2GR4+yrcx+Ev+pN0Q6V6wxCdvisPX7wzNKBgc5SsIYGxYI5GTISXT6GvTPfp1u2Rj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
.body(fileParams.toString())//表单内容
.timeout(30000)//超时毫秒
.execute().body();
logger.info("======OA请购单附件上传到NCC响应参数:{}======",result);
}catch(Exception e){
e.printStackTrace();
logger.error("下载OA附件出错:{}",e);
}
}
}
}
/**
* 组装请购单报文
* @param headers 请求头
* @param formmainData 主表数据
* @param forsonData 子表数据
* @return
*/
@NotNull
private static JSONArray praybillVaueOf(JSONObject headers, JSONObject formmainData, JSONArray forsonData) {
JSONObject paramObj = new JSONObject();
JSONObject praybill = new JSONObject();
paramObj.put("head", praybill);
praybill.put("pk_group", formmainData.getString("field0058"));//集团
praybill.put("pk_org", formmainData.getString("field0027"));//库存组织
praybill.put("pk_org_v", formmainData.getString("field0051"));//库存组织v
//praybill.put("vbillcode",formmainData.getString("field0001"));//请购单号
praybill.put("dbilldate", formmainData.getString("field0004"));//请购日期
boolean bsctype = false;
if ("1".equals(formmainData.getString("field0009"))){
bsctype = true;
}
praybill.put("bsctype",bsctype);//委外
praybill.put("pk_planpsn", formmainData.getString("field0030"));//计划员
praybill.put("pk_plandept", formmainData.getString("field0052"));//计划部门
praybill.put("pk_plandept_v", formmainData.getString("field0053"));//计划部门v
praybill.put("vmemo", formmainData.getString("field0013"));//备注
praybill.put("fbillstatus", headers.getString("fbillstatus"));//单据状态
praybill.put("bdirecttransit",false);//zhiyun
praybill.put("billmaker", headers.getString("billmaker"));//制单人 yonyou99
praybill.put("dmakedate", formmainData.getString("field0004"));//制单日期
praybill.put("ctrantypeid", formmainData.getString("field0039"));//请购类型
praybill.put("bislatest", true);//最新版本
praybill.put("vdef1", formmainData.getString("field0037"));
praybill.put("creator", headers.getString("creator"));//
praybill.put("fpraysource", headers.getString("fpraysource"));//
praybill.put("ccurrencyid", headers.getString("ccurrencyid"));//
praybill.put("nversion", headers.getString("nversion"));//
praybill.put("nversion", headers.getString("nversion"));//
List<JSONObject> parybillList = new LinkedList<>();
paramObj.put("body",parybillList);
String pk_org = formmainData.getString("field0027");
String pk_org_v = formmainData.getString("field0051");
for(int i = 0; i< forsonData.size(); i++){
JSONObject forson = forsonData.getJSONObject(i);
JSONObject praybillB = new JSONObject();
praybillB.put("crowno",forson.getString("field0014"));
praybillB.put("nnum",forson.getString("field0020"));
praybillB.put("pk_org",pk_org);
praybillB.put("pk_org_v",pk_org_v);
praybillB.put("vchangerate","1");
praybillB.put("pk_srcmaterial",forson.getString("field0054"));//物料pk带版本的那个
praybillB.put("pk_material",forson.getString("field0031"));//物料pk
praybillB.put("castunitid",forson.getString("field0055"));//计量单位pk
praybillB.put("cunitid",forson.getString("field0055"));//计量单位pk
praybillB.put("nastnum",forson.getString("field0020"));//数量
praybillB.put("dreqdate",forson.getString("field0021"));//需求日期
praybillB.put("dsuggestdate",forson.getString("field0022"));//建议订货日期
praybillB.put("pk_purchaseorg",pk_org);//采购组织
praybillB.put("pk_purchaseorg_v",pk_org_v);//采购组织 带版本的那个
praybillB.put("pk_suggestsupplier",forson.getString("field0056"));//建议供应商
praybillB.put("pk_suggestsupplier_v",forson.getString("field0056"));//建议供应商
praybillB.put("pk_reqstoorg",pk_org);
praybillB.put("pk_reqstoorg_v",pk_org_v);
praybillB.put("pk_group", formmainData.getString("field0058"));
praybillB.put("browclose","N");//行关闭
praybillB.put("vbdef1",forson.getString("field0032"));//现存量
praybillB.put("vbdef2",forson.getString("field0033"));//在途量
praybillB.put("vbdef3",forson.getString("field0035"));//月度消耗
praybillB.put("vbdef4",forson.getString("field0034"));//安全库存
parybillList.add(praybillB);
}
//调用NCC接口
JSONArray reqParams = new JSONArray();
reqParams.add(paramObj);
return reqParams;
}
public static void main(String[] args) {
String result = "{\"msg\":\"转发失败\",\"type\":null,\"flag\":false,\"status\":\"500\",\"attribute\":{\"code\":\"success\",\"data\":{\"bodyVOList\":[{\"rowno\":\"1\",\"pk_material\":\"1001P1100000000IT34Q\",\"id\":\"1001A3100000001B2UOG\"}],\"headVO\":{\"code\":\"QG2025060800000182\",\"id\":\"1001A3100000001B2UOF\",\"vtrantypeid\":\"1001P1100000000IR21W\"}},\"message\":\"提示:========NCC-请购单保存提交《成功》!!!========。单据信息《id》 = 1001A3100000001B2UOF ,《code》 = QG2025060800000182\"}}";
JSONObject resultJson = JSONObject.parseObject(result);
JSONObject attribute = resultJson.getJSONObject("attribute");
if (null != attribute){
String code = attribute.getString("code");
if ("success".equals(code)){
JSONObject data = attribute.getJSONObject("data");
if (null != data){
JSONObject headVO = data.getJSONObject("headVO");
if (null != headVO){
String vbillcode = headVO.getString("code");
System.out.println(vbillcode);
}
}
}
}
JSONObject headers =new JSONObject();
headers.put("creator","1001P1100000000NUULI");
RequisitionOrderPluginServiceImpl service = new RequisitionOrderPluginServiceImpl();
service.uploadFile("-333447786976688302",headers,"8000640003","1001A3100000001B4COB");
}
//保存日志
public void saveLog(String integration_task_living_details_id, Boolean flag, IntegrationTaskLivingDetailsEntity taskLivingDetail){
try {
//判断成功调用这个方法
if (StrUtil.isEmpty(integration_task_living_details_id)){
if (flag){
taskLivingDetailsService.saveLogToSuccess(taskLivingDetail);
}else {
//失败 调用这个方法
taskLivingDetailsService.saveLogToFail(taskLivingDetail);
}
}else {
taskLivingDetail.setId(integration_task_living_details_id);
if (flag){
//如果是重试 成功调这个方法
taskLivingDetailsService.saveLogFailToSuccess(taskLivingDetail);
}else {
//如果是重试 失败调这个方法
taskLivingDetailsService.updateLogFailToSuccess(taskLivingDetail);
}
}
}catch (Exception e){
logger.error("保存日志出错:{}",e);
}
}
}

View File

@ -0,0 +1,42 @@
package com.hzya.frame.plugin.oa.praybill.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.oa.praybill.dao.IRequisitionOrderDao;
import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity;
import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description OA请购单
* @Author xiangerlin
* @Date 2025/6/8 17:11
**/
@Service(value = "requisitionOrderServiceImpl")
public class RequisitionOrderServiceImpl extends BaseService<RequisitionOrderEntity,String> implements IRequisitionOrderService {
private IRequisitionOrderDao requisitionOrderDao;
@Autowired
public void setRequisitionOrderDao(IRequisitionOrderDao dao) {
this.requisitionOrderDao = dao;
this.dao = dao;
}
/**
* 更新OA单据
*
* @param entity
* @return
*/
@DS(value = "#entity.dataSourceCode")
@Override
public int updateOrder(RequisitionOrderEntity entity) {
if (null != entity && StrUtil.isNotEmpty(entity.getId())){
requisitionOrderDao.update(entity);
}
return 0;
}
}

View File

@ -62,6 +62,7 @@ public class PushMessagePluginInitializer extends PluginBaseEntity {
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
logger.info("======开始执行定时消息推送========");
//目前只查询一周内的异常日志进行消息推送
List<SysPushMessageEntity> list = sysPushMessageDao.getAll();
for(SysPushMessageEntity entity : list){

View File

@ -0,0 +1,29 @@
#######################本地环境#######################
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://127.0.0.1:3307/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: D:\yongansystem\kangarooDataCenter\v3\logs
tomcatpath: D:\yongansystem\kangarooDataCenter\v3\tomcat
pluginpath: D:\yongansystem\kangarooDataCenter\v3\plugin
zt:
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -45,7 +45,7 @@ savefile:
tomcatpath: /Users/apple/Desktop/log/local
pluginpath: /Users/apple/Desktop/log/local
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
@ -59,4 +59,24 @@ cbs8:
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc_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

@ -14,22 +14,24 @@ spring:
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
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
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: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185
cbs_public_key: 0469146F06BF3B01236E84632441E826
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc-test
elec_path: /Users/xiangerlin/Downloads/

View File

@ -36,4 +36,4 @@ cbs8:
OA:
data_source_code: yc_oa
zt:
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -1,5 +1,5 @@
server:
port: 9999
port: 10086
servlet:
context-path: /kangarooDataCenterV3
localIP: 127.0.0.1
@ -93,7 +93,7 @@ mybatis-plus:
db-config:
id-type: auto # 主键策略
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
#JimuReport[minidao配置]
minidao :
base-package: org.jeecg.modules.jmreport.desreport.dao*
@ -126,3 +126,17 @@ jeecg :
bucketName: ??
data:
use: true
database:
databaseName:
host:
port:
username:
password:
filePase:
fileName:
sftp:
host:
port:
username:
password:
filePase:

View File

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

View File

@ -0,0 +1,5 @@
<?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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>JHNCCPlugin</id>
<name>建辉NCC插件</name>
<category>202505210001</category>
</plugin>

View File

@ -0,0 +1,4 @@
<?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">
</beans>

View File

@ -0,0 +1,6 @@
<?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="requisitionOrderPluginInitializer" class="com.hzya.frame.plugin.oa.praybill.plugin.RequisitionOrderPluginInitializer" />
<bean name="poOrderPluginInitializer" class="com.hzya.frame.plugin.ncc.plugin.PoOrderPluginInitializer" />
</beans>

View File

@ -0,0 +1,6 @@
<?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="requisitionOrderPluginServiceImpl" class="com.hzya.frame.plugin.oa.praybill.service.impl.RequisitionOrderPluginServiceImpl" />
<bean name="poOrderPluginInServiceImpl" class="com.hzya.frame.plugin.ncc.service.impl.PoOrderPluginInServiceImpl" />
</beans>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>JHOAPlugin</id>
<name>建辉OA插件</name>
<category>202505230001</category>
</plugin>

View File

@ -0,0 +1,5 @@
<?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">
</beans>

View File

@ -0,0 +1,6 @@
<?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="paymentRequestPluginInitializer" class="com.hzya.frame.plugin.oa.payment.plugin.PaymentRequestPluginInitializer" />
<bean name="payResultPluginInitializer" class="com.hzya.frame.plugin.oa.payment.plugin.PayResultPluginInitializer" />
</beans>

View File

@ -0,0 +1,5 @@
<?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="paymentRequestPluginServiceImpl" class="com.hzya.frame.plugin.oa.payment.service.impl.PaymentPluginServiceImpl" />
</beans>

View File

@ -0,0 +1,30 @@
package com.hzya.frame;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.oa.praybill.service.impl.RequisitionOrderPluginServiceImpl;
import com.hzya.frame.util.AESUtil;
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;
/**
* @Description
* @Author xiangerlin
* @Date 2025/6/11 10:20
**/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {WebappApplication.class})
public class Test1 {
@Autowired
private RequisitionOrderPluginServiceImpl requisitionOrderPluginService;
@Test
public void test01() {
JSONObject headers =new JSONObject();
headers.put("creator","1001P1100000000NUULI");
RequisitionOrderPluginServiceImpl service = new RequisitionOrderPluginServiceImpl();
requisitionOrderPluginService.uploadFile("-333447786976688302",headers,"8000640001","1001A3100000001B4COB");
}
}

View File

@ -1,30 +1,146 @@
package com.hzya.frame;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.util.AESUtil;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName dsasas
* @Description
* @Author llg
* Date 2023/7/16 8:18 上午
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {WebappApplication.class})
//@RunWith(SpringRunner.class)
//@SpringBootTest(classes = {WebappApplication.class})
public class temButtom {
@Test
public void test01() {
String a = AESUtil.encrypt("hzya@1314");
String a = AESUtil.encrypt("hzya1314");
System.out.println(a);
String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b");
System.out.println(b);
}
@Test
public void test02() {
// 1056162015172640840 -7858803986346327947 3178176833471791293 合同评审-待办测试(bdmanager 2024-10-22 16:45) 7743552636545550897 bdmanager 18058147870 pending start success 新增成功!
// success 更新待办为已办成功
// task7803207f54ff047d6008dcce31c2628f 新增成功!
// 2024-10-24 2024-10-24
String phone ="19357235324";
String taskid ="task8b0c7ca72439bc9b0c1c89e8866c8275";
//token
Map<String, String> headers = new HashMap<>();
String token ="https://oapi.dingtalk.com/gettoken?appkey=dingxewtjaserj292ggu&appsecret=DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1";
String body = sendGet(token,headers);
JSONObject tokenobject = JSONObject.parseObject(body);
//钉钉id
headers = new HashMap<>();
//https://oapi.dingtalk.com/user/get_by_mobile?access_token=9abd3996cb103ba48dd8c69fea5473e7&mobile=15700100840
String ddid ="https://oapi.dingtalk.com/user/get_by_mobile?access_token="+tokenobject.get("access_token")+"&mobile="+phone;
String ddidbody = sendGet(ddid,headers);
JSONObject ddidobject = JSONObject.parseObject(ddidbody);
//人员id
headers = new HashMap<>();
//https://oapi.dingtalk.com/user/get?userid=111336474727636213&access_token=3d21a6614fb037a98542a537336e8149
String userid ="https://oapi.dingtalk.com/user/get?userid="+ddidobject.get("userid")+"&access_token="+tokenobject.get("access_token");
String useridbody = sendGet(userid,headers);
JSONObject useridobject = JSONObject.parseObject(useridbody);
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPut httpPut = new HttpPut("https://api.dingtalk.com/v1.0/todo/users/"+useridobject.get("unionid")+"/tasks/"+taskid);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build();
httpPut.setConfig(requestConfig);
httpPut.setHeader("Content-type", "application/json");
httpPut.setHeader("x-acs-dingtalk-access-token", tokenobject.getString("access_token"));
Map<String, Object> dataMap = new HashMap();
dataMap.put("done", true);
CloseableHttpResponse httpResponse = null;
try {
httpPut.setEntity(new StringEntity("{\"done\": true}"));
httpResponse = httpClient.execute(httpPut);
HttpEntity entity = httpResponse.getEntity();
String results = EntityUtils.toString(entity);
System.out.println(results);
} catch (Exception var15) {
} finally {
try {
httpResponse.close();
httpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
private String sendGet(String url, Map<String, String> headers) {
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
// HttpClient
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
HttpGet get = new HttpGet(url.toString());
CloseableHttpResponse response = null;
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
get.setConfig(requestConfig);//设置请求参数超时时间
if (headers != null && headers.size() > 0) {
for (String key : headers.keySet()) {
get.setHeader(key, headers.get(key));
}
}
StringBuilder body = new StringBuilder();
try {
response = closeableHttpClient.execute(get);
HttpEntity entity = response.getEntity();
body.append(EntityUtils.toString(entity,"UTF-8"));
} catch (Exception e) {
body.append(e.getMessage());
} finally {
try {
// 关闭响应对象
if (response != null) {
response.close();
}
// 关闭响应对象
if (closeableHttpClient != null) {
closeableHttpClient.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return body.toString();
}
}

View File

@ -96,7 +96,7 @@ public abstract class MybatisGenericDao<E extends Serializable, PK extends Seria
public E query(E o, String stamentID) {
return (E) this.sqlSession.selectOne(stamentID, o);
}
@DS("#o.dataSourceCode")
@Override
public List<E> queryList(E o, String stamentID) {
List<E> tempList = this.sqlSession.selectList(stamentID, o);

View File

@ -0,0 +1,48 @@
package com.hzya.frame.dingtalk.enums;
/**
* @Description 通讯录事件类型
* @Author xiangerlin
* @Date 2024/8/27 15:58
**/
public enum OrgEventEnum {
USER_ADD_ORG("user_add_org","通讯录用户新增"),
USER_MODIFY_ORG("user_modify_org","通讯录用户更改"),
USER_LEAVE_ORG("user_leave_org","通讯录用户离职"),
USER_ACTIVE_ORG("user_active_org","加入企业后用户激活"),
ORG_DEPT_CREATE("org_dept_create","通讯录企业部门创建"),
ORG_DEPT_MODIFY("org_dept_modify","通讯录企业部门更改"),
ORG_DEPT_REMOVE("org_dept_remove","通讯录企业部门删除"),
;
private String code;
private String explain;
OrgEventEnum(String code, String explain) {
this.code = code;
this.explain = explain;
}
public String getCode() {
return code;
}
public String getExplain() {
return explain;
}
/**
* 根据code获取事件类型
* @param code
* @return
*/
public static OrgEventEnum getByCode(String code){
for (OrgEventEnum org : OrgEventEnum.values()) {
if (org.getCode().equals(code)){
return org;
}
}
return null;
}
}

View File

@ -0,0 +1,32 @@
package com.hzya.frame.dingtalk.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
/**
* @Description 钉钉集成扩展类
* @Author xiangerlin
* @Date 2024/8/28 14:25
**/
public interface IDingTalkExtService {
/**
* 调用这个方法初始化钉钉参数
* @param entity
* @return
*/
SysExtensionApiEntity init(SysExtensionApiEntity entity);
/**
* 查询配置在应用上的钉钉参数
* @param sysApplication
* @return
*/
JSONObject getDingTalkConfig(SysApplicationEntity sysApplication);
/**
* 清空配置缓存
*/
void clearDingTalkConfigCatch();
}

View File

@ -0,0 +1,66 @@
package com.hzya.frame.dingtalk.service;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import java.util.List;
/**
* @Description 钉钉service
* @Author xiangerlin
* @Date 2024/8/27 16:17
**/
public interface IDingTalkService {
/**
* 根据userid获取用户详情
* @param userId 钉钉userid
* @param appKey
* @param appSecret
* @return
*/
OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret);
/**
* 根据userid获取用户详情
* @param userId
* @return
*/
OapiV2UserGetResponse.UserGetResponse getUserById(String userId);
/**
* 获取部门用户列表
* @param req 请求参数
* @param appKey
* @param appSecret
* @return
*/
OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret);
/**
* 根据部门id获取部门详情
* @param deptId 钉钉部门id
* @param appKey
* @param appSecret
* @return
*/
OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret);
/**
* 根据部门id获取部门详情
* @param deptId
* @return
*/
OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId);
/**
* 获取部门列表此接口只会返回下一级部门信息
* @param deptId 部门id如果不传则查询一级部门
* @param appKey
* @param appSecret
* @return
*/
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId, String appKey, String appSecret);
}

View File

@ -0,0 +1,100 @@
package com.hzya.frame.dingtalk.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.dingtalk.service.IDingTalkExtService;
import com.hzya.frame.dingtalk.util.DingTalkAccessToken;
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
import com.hzya.frame.sysnew.application.apiPara.dao.ISysApplicationApiParaDao;
import com.hzya.frame.sysnew.application.apiPara.entity.SysApplicationApiParaEntity;
import com.hzya.frame.sysnew.application.apiPara.service.ISysApplicationApiParaService;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Description 钉钉集成扩展类
* @Author xiangerlin
* @Date 2024/8/28 14:25
**/
@Service(value = "dingTalkExtService")
public class DingTalkExtServiceImpl implements IDingTalkExtService {
@Resource
private ISysApplicationApiParaDao sysApplicationApiParaDao;
private final ConcurrentHashMap<String, JSONObject> dingTalkMap = new ConcurrentHashMap<>();
/**
* 调用这个方法初始化钉钉参数
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity init(SysExtensionApiEntity entity) {
Map<String, String> headers = entity.getHeaders();
if (null == headers){
headers = new HashMap<>();
}
SysApplicationEntity receiveApp = entity.getReceiveApp();
//查询应用上配置的参数
JSONObject dingTalkConfig = getDingTalkConfig(receiveApp);
//给token赋值
entity.setQuerys("access_token="+DingTalkAccessToken.getAccessToken(dingTalkConfig.getString("appKey"),dingTalkConfig.getString("appSecret")));
return entity;
}
/**
* 查询配置在应用上的钉钉参数
*
* @param sysApplication
* @return
*/
@Override
public JSONObject getDingTalkConfig(SysApplicationEntity sysApplication) {
if (null != sysApplication && StrUtil.isNotEmpty(sysApplication.getId()) && null != sysApplication.getAppId()){
JSONObject jsonObject = new JSONObject();
String key = sysApplication.getAppId()+"dingTalk";
if (null != dingTalkMap.get(key)){
return dingTalkMap.get(key);
}else {
//查询应用上配置的参数
SysApplicationApiParaEntity paraEntity = new SysApplicationApiParaEntity();
paraEntity.setAppId(sysApplication.getId());
List<SysApplicationApiParaEntity> paraList = sysApplicationApiParaDao.query(paraEntity);
if (CollectionUtils.isNotEmpty(paraList)) {
List<SysApplicationApiParaEntity> appKeyList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appKey")).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(appKeyList)) {
jsonObject.put("appKey", appKeyList.get(0).getInterfaceValue());
}
List<SysApplicationApiParaEntity> appSecretList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appSecret")).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(appSecretList)) {
jsonObject.put("appSecret", appSecretList.get(0).getInterfaceValue());
}
dingTalkMap.put(key,jsonObject);
return dingTalkMap.get(key);
}
}
}
return null;
}
/**
* 清空配置缓存
*/
@Override
public void clearDingTalkConfigCatch() {
dingTalkMap.clear();
}
}

View File

@ -0,0 +1,164 @@
package com.hzya.frame.dingtalk.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiV2DepartmentGetRequest;
import com.dingtalk.api.request.OapiV2DepartmentListsubRequest;
import com.dingtalk.api.request.OapiV2UserGetRequest;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import com.hzya.frame.dingtalk.service.IDingTalkService;
import com.hzya.frame.dingtalk.util.DingTalkAccessToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description 钉钉service
* @Author xiangerlin
* @Date 2024/8/27 16:17
**/
@Service(value = "dingTalkService")
public class DingTalkServiceImpl implements IDingTalkService {
Logger logger = LoggerFactory.getLogger(getClass());
@Value("${dingtalk.appKey:}")
private String dAppKey;
@Value("${dingtalk.appSecret:}")
private String dAppSecret;
/**
* 根据userid获取用户详情
*
* @param userId 钉钉userid
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret) {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get");
OapiV2UserGetRequest req = new OapiV2UserGetRequest();
req.setUserid(userId);
req.setLanguage("zh_CN");
try {
OapiV2UserGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
OapiV2UserGetResponse.UserGetResponse result = rsp.getResult();
String s = JSONObject.toJSONString(result);
logger.info("人员详情信息:{}",s);
return result;
}
}catch (Exception e){
logger.error("根据部门id获取钉钉用户详情出错{}",e);
}
return null;
}
/**
* 根据userid获取用户详情
*
* @param userId
* @return
*/
@Override
public OapiV2UserGetResponse.UserGetResponse getUserById(String userId) {
return getUserById(userId,dAppKey,dAppSecret);
}
/**
* 获取部门用户列表
*
* @param req 请求参数
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/list");
req.setSize(100L);//每页最大只能查100条
req.setOrderField("modify_desc");
req.setContainAccessLimit(false);
req.setLanguage("zh_CN");
OapiV2UserListResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
OapiV2UserListResponse.PageResult result = rsp.getResult();
return result;
}catch (Exception e){
e.printStackTrace();
}
return null;
}
/**
* 根据部门id获取部门详情
*
* @param deptId 钉钉部门id
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret) {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/get");
OapiV2DepartmentGetRequest req = new OapiV2DepartmentGetRequest();
req.setDeptId(deptId);
req.setLanguage("zh_CN");
try {
OapiV2DepartmentGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
OapiV2DepartmentGetResponse.DeptGetResponse result = rsp.getResult();
String s = JSONObject.toJSONString(result);
logger.info("部门详情信息:{}",s);
return result;
}
}catch(Exception e){
logger.error("根据部门id获取钉钉部门出错{}",e);
}
return null;
}
/**
* 根据部门id获取部门详情
*
* @param deptId
* @return
*/
@Override
public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId) {
return getDeptById(deptId,dAppKey,dAppSecret);
}
/**
* 获取部门列表此接口只会返回下一级部门信息
* @param deptId 部门id如果不传则查询一级部门
* @param appKey
* @param appSecret
* @return
*/
@Override
public List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId,String appKey,String appSecret) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub");
OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest();
req.setDeptId(deptId);
req.setLanguage("zh_CN");
OapiV2DepartmentListsubResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> result = rsp.getResult();
return result;
}
}catch (Exception e){
logger.error("获取部门列表接口出错:{}",e);
}
return null;
}
}

View File

@ -0,0 +1,103 @@
package com.hzya.frame.dingtalk.util;
import cn.hutool.core.util.StrUtil;
import com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenResponse;
import com.aliyun.tea.TeaException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import java.time.Instant;
/**
* @Description 钉钉获取accessToken
* @Author xiangerlin
* @Date 2024/8/27 14:05
**/
public class DingTalkAccessToken {
static Logger logger = LoggerFactory.getLogger(DingTalkAccessToken.class);
//token
private static String accessToken;
//过期时间
private static Instant expireTime;
private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间
//应用key
private static String appKey;
//应用密钥
private static String appSecret;
@Value("${dingtalk.appKey:}")
public static void setAppKey(String appKey) {
DingTalkAccessToken.appKey = appKey;
}
@Value("${dingtalk.appSecret:}")
public static void setAppSecret(String appSecret) {
DingTalkAccessToken.appSecret = appSecret;
}
/**
* 获取token
* @return
*/
public static String getAccessToken(){
return getAccessToken(appKey,appSecret);
}
/**
* 获取accessToken
*
* @param appKey
* @param appSecret
* @return
*/
public static String getAccessToken(String appKey,String appSecret) {
//判断是否过期 如果没过期直接返回
if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) {
return accessToken;
}
//获取新的accessToken
accessToken = fetchNewAccessToken(appKey,appSecret);
//过期时间设置成当前事件+7000s预留200s的时间
expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME);
return accessToken;
}
/**
* 获取新的accessToken
*
* @return
*/
private static String fetchNewAccessToken(String appKey,String appSecret) {
try {
//查询应用上配置的钉钉信息
if (StrUtil.isNotEmpty(appKey) && StrUtil.isNotEmpty(appSecret)) {
//查询应用上的信息
com.aliyun.dingtalkoauth2_1_0.Client client = DingTalkAccessToken.createClient();
com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest getAccessTokenRequest = new com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest()
.setAppKey(appKey)
.setAppSecret(appSecret);
GetAccessTokenResponse accessToken = client.getAccessToken(getAccessTokenRequest);
String accessToken1 = accessToken.getBody().getAccessToken();
return accessToken1;
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code message 属性可帮助开发定位问题
}
logger.error("获取钉钉token出错:{}", _err);
}
return null;
}
/**
* 使用 Token 初始化账号Client
*
* @return Client
* @throws Exception
*/
private static com.aliyun.dingtalkoauth2_1_0.Client createClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
return new com.aliyun.dingtalkoauth2_1_0.Client(config);
}
}

View File

@ -50,6 +50,7 @@ public class HomeServiceImpl extends BaseService<HomeEntity, String> implements
for (int a = 0; a < sysApplicationEntities.size(); a++) {
if(homeEntities.get(i).getAppId()!= null && sysApplicationEntities.get(a).getId().equals(homeEntities.get(i).getAppId())){
homeEntities.get(i).setPath(sysApplicationEntities.get(a).getAppLogo());
homeEntities.get(i).setName(sysApplicationEntities.get(a).getName());
continue;
}
}

View File

@ -0,0 +1,77 @@
package com.hzya.frame.mdm.entity;
public class MdmFiledsRuleDto {
/** 主数据模版ID */
private String mdmId;
/** 模版数据库id */
private String dbId;
/** 模版数据库字段id */
private String filedId;
/** 字段类型 1、select 2、treeselect */
private String filedType;
/** 字段服务 */
private String typeFiled;
/** 字段服务 */
private String id;
/** 字段服务 */
private String dataId;
public String getMdmId() {
return mdmId;
}
public void setMdmId(String mdmId) {
this.mdmId = mdmId;
}
public String getDbId() {
return dbId;
}
public void setDbId(String dbId) {
this.dbId = dbId;
}
public String getFiledId() {
return filedId;
}
public void setFiledId(String filedId) {
this.filedId = filedId;
}
public String getFiledType() {
return filedType;
}
public void setFiledType(String filedType) {
this.filedType = filedType;
}
public String getTypeFiled() {
return typeFiled;
}
public void setTypeFiled(String typeFiled) {
this.typeFiled = typeFiled;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
}

View File

@ -3,6 +3,7 @@ package com.hzya.frame.mdm.mdmModule.dao;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.entity.MdmDataDto;
import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmFiledsRuleDto;
import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
@ -68,5 +69,7 @@ public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
void updataTreeUpData(Map<String, String> updateMaps);
void updataTreeUpDataDetail(Map<String, String> updateMaps);
MdmFiledsRuleDto queryDataId(MdmFiledsRuleDto mdmFiledsRuleDto);
}

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.mdm.entity.MdmDataDto;
import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmFiledsRuleDto;
import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
@ -181,6 +182,12 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
super.update(getSqlIdPrifx() + "updataTreeUpDataDetail", maps);
}
@Override
public MdmFiledsRuleDto queryDataId(MdmFiledsRuleDto mdmFiledsRuleDto) {
MdmFiledsRuleDto o = (MdmFiledsRuleDto) super.selectOne(getSqlIdPrifx() + "queryDataId", mdmFiledsRuleDto);
return o;
}
@Override
public List<String> queryMdMFields(Map<String, Object> maps) {
List<String> o = (List<String>) super.selectList(getSqlIdPrifx() + "queryMdMFields", maps);

View File

@ -974,10 +974,10 @@ where id = #{id}
&lt; #{item.filedVaule}
</when>
<when test="item.compareType == '5'.toString() ">
like concat('%',#{item.filedVaule},'%')
like #{item.filedVaule}
</when>
<when test="item.compareType == '6'.toString() ">
not like concat('%',#{item.filedVaule},'%')
not like #{item.filedVaule}
</when>
</choose>
@ -1086,5 +1086,14 @@ where id = #{id}
AND b.sts = 'Y'
AND b.data_status != 'N'
</update>
<!-- 分页查询列表 采用like格式 -->
<select id="queryDataId" resultType="com.hzya.frame.mdm.entity.MdmFiledsRuleDto"
parameterType="com.hzya.frame.mdm.entity.MdmFiledsRuleDto">
select
data_id as dataId
from ${typeFiled} where sts='Y' and id = #{id}
</select>
</mapper>

View File

@ -2340,7 +2340,20 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
xf.setCreate();
sysButtonConfigDao.save(xf);
}
if ("viewData".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) {
SysButtonConfigEntity xf = new SysButtonConfigEntity();
xf.setCode("viewData");
xf.setNameCh("查看数据格式");
xf.setNameEn("viewData");
xf.setMenuId(module.getId());
xf.setIconName("");
xf.setStyles("");
xf.setBtnFunction("viewData");
xf.setRemark("查看数据格式");
xf.setSorts(i + 1L);
xf.setCreate();
sysButtonConfigDao.save(xf);
}
}
}

View File

@ -87,6 +87,15 @@ public interface IMdmService {
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据详情数据字典
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmShowDetailsDictionary(JSONObject jsonObject);
//
/**
* @param jsonObject

View File

@ -101,12 +101,6 @@ public class MdmServiceImpl implements IMdmService {
@Resource
private IMdmServiceCache mdmServiceCache;
@Resource
private ISysMenuConfigDao sysMenuConfigDao;
@Resource
private ISysButtonConfigDao sysButtonConfigDao;
@Resource
private ISysPopedomOperateDao sysPopedomOperateDao;
@Resource
private IMdmModuleDbDao mdmModuleDbDao;
@Resource
private ISysUserDao sysUserDao;
@ -1381,15 +1375,188 @@ public class MdmServiceImpl implements IMdmService {
}
}
//if (tablename != null && !"".equals(tablename)) {
// Map<String, Object> queryData = new HashMap<>();
// queryData.put("tableName", tablename);//表名
// queryData.put("id", entity.getId());//字段
// List<HashMap<String, Object>> datas = mdmModuleDbDao.getServiceByDistributeId(queryData);
// jsonObject.put(tablename, datas);
//}
return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject);
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据详情数据字典
* @Date 9:40 上午 2023/10/18
**/
@Override
public JsonResultEntity queryMdmShowDetailsDictionary(JSONObject object) {
MdmDto entity = getData("jsonStr", object, MdmDto.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//查询模版
MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode());
if (mdmModuleEntity == null) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//查询数据源主表
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId());
mdmModuleDbEntity.setSts("Y");
List<MdmModuleDbEntity> mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity);
if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) {
return BaseResult.getFailureMessageEntity("系统错误");
}
MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity();
queryFild.setMdmId(mdmModuleEntity.getId());
queryFild.setSts("Y");
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild);
MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity();
mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId());
mdmModuleDbFiledsRuleEntity.setSts("Y");
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity);
List<MdmFiledsRuleDto> mdmFiledsRuleDtos = new ArrayList<>();
if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) {
if("treeselect".equals(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue()) || "select".equals(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue())){
MdmFiledsRuleDto mdmFiledsRuleDto = new MdmFiledsRuleDto();
mdmFiledsRuleDto.setDbId(mdmModuleDbFiledsRuleEntities.get(i).getDbId());
mdmFiledsRuleDto.setFiledId(mdmModuleDbFiledsRuleEntities.get(i).getFiledId());
mdmFiledsRuleDto.setMdmId(mdmModuleDbFiledsRuleEntities.get(i).getMdmId());
mdmFiledsRuleDto.setFiledType(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue());
mdmFiledsRuleDtos.add(mdmFiledsRuleDto);
}
}
}
if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){
for (int i = 0; i < mdmFiledsRuleDtos.size(); i++) {
for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) {
if(mdmFiledsRuleDtos.get(i).getFiledId().equals(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId())
&& "service".equals(mdmModuleDbFiledsRuleEntities.get(i1).getRuleCode())){
mdmFiledsRuleDtos.get(i).setTypeFiled(mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
}
}
}
}
//String tablename = null;
JSONObject jsonObject = new JSONObject();
jsonObject.put("appName","数智中台");
jsonObject.put("appCode","800004");
jsonObject.put("mdmCode",entity.getMdmCode());
jsonObject.put("optionName","admin");
for (int i = 0; i < mdmModuleDbEntityList.size(); i++) {
if ("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())) {
//查询数据
Map<String, Object> queryData = new HashMap<>();
queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名
if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) {
queryData.put("detailFlag", false);//是否明细
queryData.put("id", entity.getId());//字段
HashMap<String, Object> datas = mdmModuleDbDao.getServiceDataById(queryData);
convertKeysToLowerCase(datas);
JSONObject zbdata = new JSONObject();
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){
if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){
//判断是否是下拉类型
Object data = datas.get(mdmModuleDbFiledsEntities.get(i2).getEnName());
if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){
for (int i1 = 0; i1 < mdmFiledsRuleDtos.size(); i1++) {
if(mdmModuleDbFiledsEntities.get(i2).getId().equals(mdmFiledsRuleDtos.get(i1).getFiledId())){
//查询对应的data_id
String strData = String.valueOf(data);
int index = strData.lastIndexOf(',');
if (index!= -1) {
strData = strData.substring(index + 1);
}
mdmFiledsRuleDtos.get(i1).setId(strData);
MdmFiledsRuleDto mdmFiledsRuleDto = mdmModuleDao.queryDataId(mdmFiledsRuleDtos.get(i1));
if(mdmFiledsRuleDto != null && mdmFiledsRuleDto.getDataId() != null && !"".equals(mdmFiledsRuleDto.getDataId())){
data = mdmFiledsRuleDto.getDataId();
}else {
data = null;
}
}
}
}
zbdata.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),data);
}
}
}
}
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), zbdata);
} else {
queryData.put("detailFlag", true);//是否明细
queryData.put("id", entity.getId());//字段
List<HashMap<String, Object>> datas = mdmModuleDbDao.getServiceByFormmainId(queryData);
convertKeysToLowerCase(datas);
List<JSONObject> mxDataList = new ArrayList<>();
if(datas != null && datas.size() > 0){
for (int i1 = 0; i1 < datas.size(); i1++) {
JSONObject mxData = new JSONObject();
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){
if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){
//判断是否是下拉类型
Object data = datas.get(i1).get(mdmModuleDbFiledsEntities.get(i2).getEnName());
if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){
for (int b = 0; b < mdmFiledsRuleDtos.size(); b++) {
if(mdmModuleDbFiledsEntities.get(i2).getId().equals(mdmFiledsRuleDtos.get(b).getFiledId())){
//查询对应的data_id
String strData = String.valueOf(data);
int index = strData.lastIndexOf(',');
if (index!= -1) {
strData = strData.substring(index + 1);
}
mdmFiledsRuleDtos.get(b).setId(strData);
MdmFiledsRuleDto mdmFiledsRuleDto = mdmModuleDao.queryDataId(mdmFiledsRuleDtos.get(b));
if(mdmFiledsRuleDto != null && mdmFiledsRuleDto.getDataId() != null && !"".equals(mdmFiledsRuleDto.getDataId())){
data = mdmFiledsRuleDto.getDataId();
}else {
data = null;
}
}
}
}
mxData.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),data);
}
}
}
}
mxDataList.add(mxData);
}
}else {
JSONObject mxData = new JSONObject();
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){
if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){
mxData.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),null);
}
}
}
}
mxDataList.add(mxData);
}
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), mxDataList);
}
}
}
return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject);
}
@ -1944,7 +2111,8 @@ public class MdmServiceImpl implements IMdmService {
return BaseResult.getSuccessMessageEntity("发送成功");
} else {
saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败:"+jsonResultEntity.getAttribute(), dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type);
return BaseResult.getFailureMessageEntity("发送错误:" + jsonResultEntity.getAttribute());
JSONObject object1 = JSONObject.parseObject(jsonResultEntity.getAttribute().toString());
return BaseResult.getFailureMessageEntity("发送错误:" +object1.getString("msg"));
}
}

View File

@ -13,4 +13,13 @@ import com.hzya.frame.sys.dictionaryshopNew.entity.SysDictionaryshopNew;
public interface ISysDictionaryshopNewService {
JsonResultEntity test(SysDictionaryshopNew object);
/**
* 查询数据字典
* @param tabName 表名
* @param columnName 字段名
* @param columnValue 字典值
* @return
*/
SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue);
}

View File

@ -33,4 +33,20 @@ public class SysDictionaryshopNewServiceImpl extends ServiceUtil implements ISy
return BaseResult.getSuccessMessageEntity("获取应用成功");
}
/**
* 查询数据字典
*
* @param tabName 表名
* @param columnName 字段名
* @param columnValue 字典值
* @return
*/
@Override
public SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue) {
SysDictionaryshopNew sysDictionaryshopNew = new SysDictionaryshopNew();
sysDictionaryshopNew.setTabName(tabName);
sysDictionaryshopNew.setColumnName(columnName);
sysDictionaryshopNew.setColumnValue(columnValue);
return sysdictionaryshopnewMapper.entity_get_by_value(sysDictionaryshopNew);
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowClassEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程分类;对应数环通项目分类(sys_flow_class: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowClassDao extends IBaseDao<SysFlowClassEntity, String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程分类权限表(sys_flow_class_rule: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowClassRuleDao extends IBaseDao<SysFlowClassRuleEntity, String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程主表;流程就是数环通的Linkup(sys_flow: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:19
*/
public interface ISysFlowDao extends IBaseDao<SysFlowEntity, String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* nifi常量(sys_flow_nifi_constant: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowNifiConstantDao extends IBaseDao<SysFlowNifiConstantEntity, String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程步骤账户表(sys_flow_step_account: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowStepAccountDao extends IBaseDao<SysFlowStepAccountEntity, String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 映射信息表体(sys_flow_step_config_b: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepConfigBDao extends IBaseDao<SysFlowStepConfigBEntity, String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 映射信息主表(sys_flow_step_config: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepConfigDao extends IBaseDao<SysFlowStepConfigEntity, String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程步骤信息(sys_flow_step: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowStepDao extends IBaseDao<SysFlowStepEntity, String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 步骤关联关系表(sys_flow_step_relation: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepRelationDao extends IBaseDao<SysFlowStepRelationEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowClassEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowClassDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程分类;对应数环通项目分类(SysFlowClass)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowClassDaoImpl")
public class SysFlowClassDaoImpl extends MybatisGenericDao<SysFlowClassEntity, String> implements ISysFlowClassDao{
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowClassRuleDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程分类权限表(SysFlowClassRule)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowClassRuleDaoImpl")
public class SysFlowClassRuleDaoImpl extends MybatisGenericDao<SysFlowClassRuleEntity, String> implements ISysFlowClassRuleDao{
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程主表;流程就是数环通的Linkup(SysFlow)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:21
*/
@Repository(value = "SysFlowDaoImpl")
public class SysFlowDaoImpl extends MybatisGenericDao<SysFlowEntity, String> implements ISysFlowDao{
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowNifiConstantDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* nifi常量(SysFlowNifiConstant)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowNifiConstantDaoImpl")
public class SysFlowNifiConstantDaoImpl extends MybatisGenericDao<SysFlowNifiConstantEntity, String> implements ISysFlowNifiConstantDao{
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程步骤账户表(SysFlowStepAccount)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowStepAccountDaoImpl")
public class SysFlowStepAccountDaoImpl extends MybatisGenericDao<SysFlowStepAccountEntity, String> implements ISysFlowStepAccountDao{
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigBDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 映射信息表体(SysFlowStepConfigB)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Repository(value = "SysFlowStepConfigBDaoImpl")
public class SysFlowStepConfigBDaoImpl extends MybatisGenericDao<SysFlowStepConfigBEntity, String> implements ISysFlowStepConfigBDao{
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 映射信息主表(SysFlowStepConfig)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Repository(value = "SysFlowStepConfigDaoImpl")
public class SysFlowStepConfigDaoImpl extends MybatisGenericDao<SysFlowStepConfigEntity, String> implements ISysFlowStepConfigDao{
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程步骤信息(SysFlowStep)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowStepDaoImpl")
public class SysFlowStepDaoImpl extends MybatisGenericDao<SysFlowStepEntity, String> implements ISysFlowStepDao{
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepRelationDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 步骤关联关系表(SysFlowStepRelation)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Repository(value = "SysFlowStepRelationDaoImpl")
public class SysFlowStepRelationDaoImpl extends MybatisGenericDao<SysFlowStepRelationEntity, String> implements ISysFlowStepRelationDao{
}

View File

@ -0,0 +1,36 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程分类;对应数环通项目分类(SysFlowClass)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowClassEntity extends BaseEntity {
/** 分类名称 */
private String name;
/** 上级id */
private String parentId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
}

View File

@ -0,0 +1,195 @@
<?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.sys.flow.dao.impl.SysFlowClassDaoImpl">
<resultMap id="get-SysFlowClassEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowClassEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<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="name" column="name" jdbcType="VARCHAR"/>
<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowClassEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,name
,parent_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowClassEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity">
select
<include refid="SysFlowClassEntity_Base_Column_List" />
from sys_flow_class
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="name != null and name != ''"> and name = #{name} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </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.sys.flow.entity.SysFlowClassEntity">
select count(1) from sys_flow_class
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="name != null and name != ''"> and name = #{name} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </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-SysFlowClassEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity">
select
<include refid="SysFlowClassEntity_Base_Column_List" />
from sys_flow_class
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="parentId != null and parentId != ''"> and parent_id like concat('%',#{parentId},'%') </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="SysFlowClassentity_list_or" resultMap="get-SysFlowClassEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity">
select
<include refid="SysFlowClassEntity_Base_Column_List" />
from sys_flow_class
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="name != null and name != ''"> or name = #{name} </if>
<if test="parentId != null and parentId != ''"> or parent_id = #{parentId} </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.sys.flow.entity.SysFlowClassEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</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="name != null and name != ''">name ,</if>
<if test="parentId != null and parentId != ''">parent_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</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="name != null and name != ''">#{name} ,</if>
<if test="parentId != null and parentId != ''">#{parentId} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_class a WHERE
a.sts = 'Y' ),1),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class(create_user_id, create_time, modify_user_id, modify_time, sts, name, parent_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.parentId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class(create_user_id, create_time, modify_user_id, modify_time, sts, name, parent_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.parentId})
</foreach>
on duplicate key update
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),
name = values(name),
parent_id = values(parent_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity" >
update sys_flow_class set
<trim suffix="" suffixOverrides=",">
<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="name != null and name != ''"> name = #{name},</if>
<if test="parentId != null and parentId != ''"> parent_id = #{parentId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity" >
update sys_flow_class 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.sys.flow.entity.SysFlowClassEntity" >
update sys_flow_class 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="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_class where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,75 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import java.util.List;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程分类权限表(SysFlowClassRule)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowClassRuleEntity extends BaseEntity {
/** 流程分类id */
private String flowClassId;
/** 用户id */
private String userId;
/** 用户名 */
private String userName;
/** 用户编码 */
private String userCode;
/** 头像 */
private String profileIcon;
//权限列表
List<SysFlowClassRuleEntity> ruleList;
public String getFlowClassId() {
return flowClassId;
}
public void setFlowClassId(String flowClassId) {
this.flowClassId = flowClassId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getProfileIcon() {
return profileIcon;
}
public void setProfileIcon(String profileIcon) {
this.profileIcon = profileIcon;
}
public List<SysFlowClassRuleEntity> getRuleList() {
return ruleList;
}
public void setRuleList(List<SysFlowClassRuleEntity> ruleList) {
this.ruleList = ruleList;
}
}

View File

@ -0,0 +1,247 @@
<?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.sys.flow.dao.impl.SysFlowClassRuleDaoImpl">
<resultMap id="get-SysFlowClassRuleEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<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="flowClassId" column="flow_class_id" jdbcType="VARCHAR"/>
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="userCode" column="user_code" jdbcType="VARCHAR"/>
<result property="profileIcon" column="profile_icon" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysFlowClassRuleEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,flow_class_id
,user_id
,user_name
,user_code
,profile_icon
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowClassRuleEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
select
<include refid="SysFlowClassRuleEntity_Base_Column_List"/>
from sys_flow_class_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</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="flowClassId != null and flowClassId != ''">and flow_class_id = #{flowClassId}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="userName != null and userName != ''">and user_name = #{userName}</if>
<if test="userCode != null and userCode != ''">and user_code = #{userCode}</if>
<if test="profileIcon != null and profileIcon != ''">and profile_icon = #{profileIcon}</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.sys.flow.entity.SysFlowClassRuleEntity">
select count(1) from sys_flow_class_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</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="flowClassId != null and flowClassId != ''">and flow_class_id = #{flowClassId}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="userName != null and userName != ''">and user_name = #{userName}</if>
<if test="userCode != null and userCode != ''">and user_code = #{userCode}</if>
<if test="profileIcon != null and profileIcon != ''">and profile_icon = #{profileIcon}</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-SysFlowClassRuleEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
select
<include refid="SysFlowClassRuleEntity_Base_Column_List"/>
from sys_flow_class_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</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="flowClassId != null and flowClassId != ''">and flow_class_id like concat('%',#{flowClassId},'%')
</if>
<if test="userId != null and userId != ''">and user_id like concat('%',#{userId},'%')</if>
<if test="userName != null and userName != ''">and user_name like concat('%',#{userName},'%')</if>
<if test="userCode != null and userCode != ''">and user_code like concat('%',#{userCode},'%')</if>
<if test="profileIcon != null and profileIcon != ''">and profile_icon like concat('%',#{profileIcon},'%')
</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="SysFlowClassRuleentity_list_or" resultMap="get-SysFlowClassRuleEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
select
<include refid="SysFlowClassRuleEntity_Base_Column_List"/>
from sys_flow_class_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</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="flowClassId != null and flowClassId != ''">or flow_class_id = #{flowClassId}</if>
<if test="userId != null and userId != ''">or user_id = #{userId}</if>
<if test="userName != null and userName != ''">or user_name = #{userName}</if>
<if test="userCode != null and userCode != ''">or user_code = #{userCode}</if>
<if test="profileIcon != null and profileIcon != ''">or profile_icon = #{profileIcon}</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.sys.flow.entity.SysFlowClassRuleEntity" keyProperty="id"
useGeneratedKeys="true">
insert into sys_flow_class_rule(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</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="flowClassId != null and flowClassId != ''">flow_class_id ,</if>
<if test="userId != null and userId != ''">user_id ,</if>
<if test="userName != null and userName != ''">user_name ,</if>
<if test="userCode != null and userCode != ''">user_code ,</if>
<if test="profileIcon != null and profileIcon != ''">profile_icon ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</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="flowClassId != null and flowClassId != ''">#{flowClassId} ,</if>
<if test="userId != null and userId != ''">#{userId} ,</if>
<if test="userName != null and userName != ''">#{userName} ,</if>
<if test="userCode != null and userCode != ''">#{userCode} ,</if>
<if test="profileIcon != null and profileIcon != ''">#{profileIcon} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_class_rule a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class_rule(create_user_id, create_time, modify_user_id, modify_time, sts, flow_class_id,
user_id, user_name, user_code, profile_icon, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowClassId},#{entity.userId},#{entity.userName},#{entity.userCode},#{entity.profileIcon},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class_rule(create_user_id, create_time, modify_user_id, modify_time, sts, flow_class_id,
user_id, user_name, user_code, profile_icon)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowClassId},#{entity.userId},#{entity.userName},#{entity.userCode},#{entity.profileIcon})
</foreach>
on duplicate key update
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),
flow_class_id = values(flow_class_id),
user_id = values(user_id),
user_name = values(user_name),
user_code = values(user_code),
profile_icon = values(profile_icon)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
update sys_flow_class_rule set
<trim suffix="" suffixOverrides=",">
<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="flowClassId != null and flowClassId != ''">flow_class_id = #{flowClassId},</if>
<if test="userId != null and userId != ''">user_id = #{userId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="userCode != null and userCode != ''">user_code = #{userCode},</if>
<if test="profileIcon != null and profileIcon != ''">profile_icon = #{profileIcon},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
update sys_flow_class_rule
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.sys.flow.entity.SysFlowClassRuleEntity">
update sys_flow_class_rule 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="sts != null and sts != ''">and sts = #{sts}</if>
<if test="flowClassId != null and flowClassId != ''">and flow_class_id = #{flowClassId}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="userName != null and userName != ''">and user_name = #{userName}</if>
<if test="userCode != null and userCode != ''">and user_code = #{userCode}</if>
<if test="profileIcon != null and profileIcon != ''">and profile_icon = #{profileIcon}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from sys_flow_class_rule
where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,92 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程主表;流程就是数环通的Linkup(SysFlow)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:23
*/
public class SysFlowEntity extends BaseEntity {
/** 流程名称 */
private String name;
/** 流程分类id */
private String classId;
private String className;
/** 触发方式id */
private String triggerModeId;
private String triggerModeName;
/** 应用组id */
private String nifiGroupId;
/** 流程描述 */
private String description;
//状态 启动/停止
private String status;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getClassId() {
return classId;
}
public void setClassId(String classId) {
this.classId = classId;
}
public String getTriggerModeId() {
return triggerModeId;
}
public void setTriggerModeId(String triggerModeId) {
this.triggerModeId = triggerModeId;
}
public String getNifiGroupId() {
return nifiGroupId;
}
public void setNifiGroupId(String nifiGroupId) {
this.nifiGroupId = nifiGroupId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getTriggerModeName() {
return triggerModeName;
}
public void setTriggerModeName(String triggerModeName) {
this.triggerModeName = triggerModeName;
}
}

View File

@ -0,0 +1,241 @@
<?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.sys.flow.dao.impl.SysFlowDaoImpl">
<resultMap id="get-SysFlowEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<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="name" column="name" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="classId" column="class_id" jdbcType="VARCHAR"/>
<result property="className" column="className" jdbcType="VARCHAR"/>
<result property="triggerModeId" column="trigger_mode_id" jdbcType="VARCHAR"/>
<result property="nifiGroupId" column="nifi_group_id" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowEntity_Base_Column_List">
sf.id
,sf.create_user_id
,sf.create_time
,sf.modify_user_id
,sf.modify_time
,sf.sts
,sf.name
,sf.status
,sf.class_id
,sfc.name as className
,sf.trigger_mode_id
,sf.nifi_group_id
,sf.description
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and sf.id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and sf.create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and sf.create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and sf.modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and sf.modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sf.sts = #{sts} </if>
<if test="name != null and name != ''"> and sf.name = #{name} </if>
<if test="status != null and status != ''"> and sf.status = #{status} </if>
<if test="classId != null and classId != ''"> and sf.class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> and sf.trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and sf.nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> and sf.description = #{description} </if>
and sf.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sf.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.sys.flow.entity.SysFlowEntity">
select count(1) from sys_flow
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="name != null and name != ''"> and name = #{name} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="classId != null and classId != ''"> and class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> and trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> and description = #{description} </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-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and sf.id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and sf.create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and sf.create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and sf.modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and sf.modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sf.sts like concat('%',#{sts},'%') </if>
<if test="name != null and name != ''"> and sf.name like concat('%',#{name},'%') </if>
<if test="status != null and status != ''"> and sf.status like concat('%',#{status},'%') </if>
<if test="classId != null and classId != ''"> and sf.class_id like concat('%',#{classId},'%') </if>
<if test="triggerModeId != null and triggerModeId != ''"> and sf.trigger_mode_id like concat('%',#{triggerModeId},'%') </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and sf.nifi_group_id like concat('%',#{nifiGroupId},'%') </if>
<if test="description != null and description != ''"> and sf.description like concat('%',#{description},'%') </if>
and sf.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sf.sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowentity_list_or" resultMap="get-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or sf.id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or sf.create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or sf.create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or sf.modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or sf.modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sf.sts = #{sts} </if>
<if test="name != null and name != ''"> or sf.name = #{name} </if>
<if test="status != null and status != ''"> or sf.status = #{status} </if>
<if test="classId != null and classId != ''"> or sf.class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> or sf.trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> or sf.nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> or sf.description = #{description} </if>
and sf.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.sys.flow.entity.SysFlowEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</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="name != null and name != ''">name ,</if>
<if test="status != null and status != ''">status ,</if>
<if test="classId != null and classId != ''">class_id ,</if>
<if test="triggerModeId != null and triggerModeId != ''">trigger_mode_id ,</if>
<if test="nifiGroupId != null and nifiGroupId != ''">nifi_group_id ,</if>
<if test="description != null and description != ''">description ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</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="name != null and name != ''">#{name} ,</if>
<if test="status != null and status != ''">#{status} ,</if>
<if test="classId != null and classId != ''">#{classId} ,</if>
<if test="triggerModeId != null and triggerModeId != ''">#{triggerModeId} ,</if>
<if test="nifiGroupId != null and nifiGroupId != ''">#{nifiGroupId} ,</if>
<if test="description != null and description != ''">#{description} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow a WHERE a.sts = 'Y' ),1),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow(create_user_id, create_time, modify_user_id, modify_time, sts, name,status, class_id, trigger_mode_id, nifi_group_id, description, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},${entity.status},#{entity.classId},#{entity.triggerModeId},#{entity.nifiGroupId},#{entity.description}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow(create_user_id, create_time, modify_user_id, modify_time, sts, name, status,class_id, trigger_mode_id, nifi_group_id, description)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.status},#{entity.classId},#{entity.triggerModeId},#{entity.nifiGroupId},#{entity.description})
</foreach>
on duplicate key update
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),
name = values(name),
class_id = values(class_id),
trigger_mode_id = values(trigger_mode_id),
nifi_group_id = values(nifi_group_id),
description = values(description)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity" >
update sys_flow set
<trim suffix="" suffixOverrides=",">
<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="name != null and name != ''"> name = #{name},</if>
<if test="status != null and status != ''"> status = #{status},</if>
<if test="classId != null and classId != ''"> class_id = #{classId},</if>
<if test="triggerModeId != null and triggerModeId != ''"> trigger_mode_id = #{triggerModeId},</if>
<if test="nifiGroupId != null and nifiGroupId != ''"> nifi_group_id = #{nifiGroupId},</if>
<if test="description != null and description != ''"> description = #{description},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity" >
update sys_flow 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.sys.flow.entity.SysFlowEntity" >
update sys_flow 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="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="classId != null and classId != ''"> and class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> and trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,66 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* nifi常量(SysFlowNifiConstant)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowNifiConstantEntity extends BaseEntity {
/** 键 */
private String nifiKey;
/** 值 */
private String nifiValue;
/** 显示值 */
private String showValue;
/** 描述 */
private String description;
/** 分类 */
private String type;
public String getNifiKey() {
return nifiKey;
}
public void setNifiKey(String nifiKey) {
this.nifiKey = nifiKey;
}
public String getNifiValue() {
return nifiValue;
}
public void setNifiValue(String nifiValue) {
this.nifiValue = nifiValue;
}
public String getShowValue() {
return showValue;
}
public void setShowValue(String showValue) {
this.showValue = showValue;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -0,0 +1,226 @@
<?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.sys.flow.dao.impl.SysFlowNifiConstantDaoImpl">
<resultMap id="get-SysFlowNifiConstantEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<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="nifiKey" column="nifi_key" jdbcType="VARCHAR"/>
<result property="nifiValue" column="nifi_value" jdbcType="VARCHAR"/>
<result property="showValue" column="show_value" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowNifiConstantEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,nifi_key
,nifi_value
,show_value
,description
,type
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowNifiConstantEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity">
select
<include refid="SysFlowNifiConstantEntity_Base_Column_List" />
from sys_flow_nifi_constant
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="nifiKey != null and nifiKey != ''"> and nifi_key = #{nifiKey} </if>
<if test="nifiValue != null and value != ''"> and nifi_value = #{nifiValue} </if>
<if test="showValue != null and showValue != ''"> and show_value = #{showValue} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
<if test="type != null and type != ''"> and type = #{type} </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.sys.flow.entity.SysFlowNifiConstantEntity">
select count(1) from sys_flow_nifi_constant
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="nifiKey != null and nifiKey != ''"> and nifi_key = #{nifiKey} </if>
<if test="nifiValue != null and nifiValue != ''"> and nifi_value = #{nifiValue} </if>
<if test="showValue != null and showValue != ''"> and show_value = #{showValue} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
<if test="type != null and type != ''"> and type = #{type} </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-SysFlowNifiConstantEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity">
select
<include refid="SysFlowNifiConstantEntity_Base_Column_List" />
from sys_flow_nifi_constant
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="nifiKey != null and nifiKey != ''"> and nifi_key like concat('%',#{nifiKey},'%') </if>
<if test="nifiValue != null and nifiValue != ''"> and nifi_value like concat('%',#{nifiValue},'%') </if>
<if test="showValue != null and showValue != ''"> and show_value like concat('%',#{showValue},'%') </if>
<if test="description != null and description != ''"> and description like concat('%',#{description},'%') </if>
<if test="type != null and type != ''"> and type like concat('%',#{type},'%') </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="SysFlowNifiConstantentity_list_or" resultMap="get-SysFlowNifiConstantEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity">
select
<include refid="SysFlowNifiConstantEntity_Base_Column_List" />
from sys_flow_nifi_constant
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="nifiKey != null and nifiKey != ''"> or nifi_key = #{nifiKey} </if>
<if test="nifiValue != null and nifiValue != ''"> or nifi_value = #{nifiValue} </if>
<if test="showValue != null and showValue != ''"> or show_value = #{showValue} </if>
<if test="description != null and description != ''"> or description = #{description} </if>
<if test="type != null and type != ''"> or type = #{type} </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.sys.flow.entity.SysFlowNifiConstantEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_nifi_constant(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="nifiKey != null and nifiKey != ''"> nifi_key , </if>
<if test="nifiValue != null and nifiValue != ''"> nifi_value , </if>
<if test="showValue != null and showValue != ''"> show_value , </if>
<if test="description != null and description != ''"> description , </if>
<if test="type != null and type != ''"> type , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="nifiKey != null and nifiKey != ''"> #{nifiKey} ,</if>
<if test="nifiValue != null and nifiValue != ''"> #{nifiValue} ,</if>
<if test="showValue != null and showValue != ''"> #{showValue} ,</if>
<if test="description != null and description != ''"> #{description} ,</if>
<if test="type != null and type != ''"> #{type} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_nifi_constant a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_nifi_constant(create_user_id, create_time, modify_user_id, modify_time, sts, nifi_key, nifi_value, show_value, description, type, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.nifiKey},#{entity.nifiValue},#{entity.showValue},#{entity.description},#{entity.type}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_nifi_constant(create_user_id, create_time, modify_user_id, modify_time, sts, nifi_key, nifi_value, show_value, description, type)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.nifiKey},#{entity.nifiValue},#{entity.showValue},#{entity.description},#{entity.type})
</foreach>
on duplicate key update
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),
nifi_key = values(nifiKey),
nifi_value = values(nifiValue),
show_value = values(show_value),
description = values(description),
type = values(type)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity" >
update sys_flow_nifi_constant set
<trim suffix="" suffixOverrides=",">
<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="nifiKey != null and nifiKey != ''"> nifi_key = #{nifiKey},</if>
<if test="nifiValue != null and nifiValue != ''"> nifi_value = #{nifiValue},</if>
<if test="showValue != null and showValue != ''"> show_value = #{showValue},</if>
<if test="description != null and description != ''"> description = #{description},</if>
<if test="type != null and type != ''"> type = #{type},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity" >
update sys_flow_nifi_constant 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.sys.flow.entity.SysFlowNifiConstantEntity" >
update sys_flow_nifi_constant 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="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="nifiKey != null and nifiKey != ''"> andnifi_ key = #{nifiKey} </if>
<if test="nifiValue != null and nifiValue != ''"> and nifi_value = #{nifiValue} </if>
<if test="showValue != null and showValue != ''"> and show_value = #{showValue} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_nifi_constant where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,126 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程步骤账户表(SysFlowStepAccount)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowStepAccountEntity extends BaseEntity {
/** 账户名称 */
private String name;
/** ip地址 */
private String ipAddress;
/** 端口 */
private String port;
/** 数据库名称 */
private String dbName;
/** 用户名 */
private String userName;
/** 密码 */
private String password;
/** 数据库类型 */
private String dbType;
/** 应用key */
private String appKey;
/** 应用密钥 */
private String appSecret;
/** 企业id */
private String corpid;
/** 应用id */
private String agentid;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public String getPort() {
return port;
}
public void setPort(String port) {
this.port = port;
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
public String getAppSecret() {
return appSecret;
}
public void setAppSecret(String appSecret) {
this.appSecret = appSecret;
}
public String getCorpid() {
return corpid;
}
public void setCorpid(String corpid) {
this.corpid = corpid;
}
public String getAgentid() {
return agentid;
}
public void setAgentid(String agentid) {
this.agentid = agentid;
}
}

View File

@ -0,0 +1,292 @@
<?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.sys.flow.dao.impl.SysFlowStepAccountDaoImpl">
<resultMap id="get-SysFlowStepAccountEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<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="name" column="name" jdbcType="VARCHAR"/>
<result property="ipAddress" column="ip_address" jdbcType="VARCHAR"/>
<result property="port" column="port" jdbcType="VARCHAR"/>
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
<result property="appSecret" column="app_secret" jdbcType="VARCHAR"/>
<result property="corpid" column="corpId" jdbcType="VARCHAR"/>
<result property="agentid" column="agentId" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowStepAccountEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,name
,ip_address
,port
,db_name
,user_name
,password
,db_type
,app_key
,app_secret
,corpId
,agentId
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepAccountEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity">
select
<include refid="SysFlowStepAccountEntity_Base_Column_List" />
from sys_flow_step_account
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="name != null and name != ''"> and name = #{name} </if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress} </if>
<if test="port != null and port != ''"> and port = #{port} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
<if test="corpid != null and corpid != ''"> and corpId = #{corpid} </if>
<if test="agentid != null and agentid != ''"> and agentId = #{agentid} </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.sys.flow.entity.SysFlowStepAccountEntity">
select count(1) from sys_flow_step_account
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="name != null and name != ''"> and name = #{name} </if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress} </if>
<if test="port != null and port != ''"> and port = #{port} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
<if test="corpid != null and corpid != ''"> and corpId = #{corpid} </if>
<if test="agentid != null and agentid != ''"> and agentId = #{agentid} </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-SysFlowStepAccountEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity">
select
<include refid="SysFlowStepAccountEntity_Base_Column_List" />
from sys_flow_step_account
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address like concat('%',#{ipAddress},'%') </if>
<if test="port != null and port != ''"> and port like concat('%',#{port},'%') </if>
<if test="dbName != null and dbName != ''"> and db_name like concat('%',#{dbName},'%') </if>
<if test="userName != null and userName != ''"> and user_name like concat('%',#{userName},'%') </if>
<if test="password != null and password != ''"> and password like concat('%',#{password},'%') </if>
<if test="dbType != null and dbType != ''"> and db_type like concat('%',#{dbType},'%') </if>
<if test="appKey != null and appKey != ''"> and app_key like concat('%',#{appKey},'%') </if>
<if test="appSecret != null and appSecret != ''"> and app_secret like concat('%',#{appSecret},'%') </if>
<if test="corpid != null and corpid != ''"> and corpId like concat('%',#{corpid},'%') </if>
<if test="agentid != null and agentid != ''"> and agentId like concat('%',#{agentid},'%') </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="SysFlowStepAccountentity_list_or" resultMap="get-SysFlowStepAccountEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity">
select
<include refid="SysFlowStepAccountEntity_Base_Column_List" />
from sys_flow_step_account
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="name != null and name != ''"> or name = #{name} </if>
<if test="ipAddress != null and ipAddress != ''"> or ip_address = #{ipAddress} </if>
<if test="port != null and port != ''"> or port = #{port} </if>
<if test="dbName != null and dbName != ''"> or db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> or user_name = #{userName} </if>
<if test="password != null and password != ''"> or password = #{password} </if>
<if test="dbType != null and dbType != ''"> or db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> or app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> or app_secret = #{appSecret} </if>
<if test="corpid != null and corpid != ''"> or corpId = #{corpid} </if>
<if test="agentid != null and agentid != ''"> or agentId = #{agentid} </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.sys.flow.entity.SysFlowStepAccountEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_account(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="name != null and name != ''"> name , </if>
<if test="ipAddress != null and ipAddress != ''"> ip_address , </if>
<if test="port != null and port != ''"> port , </if>
<if test="dbName != null and dbName != ''"> db_name , </if>
<if test="userName != null and userName != ''"> user_name , </if>
<if test="password != null and password != ''"> password , </if>
<if test="dbType != null and dbType != ''"> db_type , </if>
<if test="appKey != null and appKey != ''"> app_key , </if>
<if test="appSecret != null and appSecret != ''"> app_secret , </if>
<if test="corpid != null and corpid != ''"> corpId , </if>
<if test="agentid != null and agentid != ''"> agentId , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="name != null and name != ''"> #{name} ,</if>
<if test="ipAddress != null and ipAddress != ''"> #{ipAddress} ,</if>
<if test="port != null and port != ''"> #{port} ,</if>
<if test="dbName != null and dbName != ''"> #{dbName} ,</if>
<if test="userName != null and userName != ''"> #{userName} ,</if>
<if test="password != null and password != ''"> #{password} ,</if>
<if test="dbType != null and dbType != ''"> #{dbType} ,</if>
<if test="appKey != null and appKey != ''"> #{appKey} ,</if>
<if test="appSecret != null and appSecret != ''"> #{appSecret} ,</if>
<if test="corpid != null and corpid != ''"> #{corpid} ,</if>
<if test="agentid != null and agentid != ''"> #{agentid} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_account a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid})
</foreach>
on duplicate key update
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),
name = values(name),
ip_address = values(ip_address),
port = values(port),
db_name = values(db_name),
user_name = values(user_name),
password = values(password),
db_type = values(db_type),
app_key = values(app_key),
app_secret = values(app_secret),
corpId = values(corpId),
agentId = values(agentId)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity" >
update sys_flow_step_account set
<trim suffix="" suffixOverrides=",">
<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="name != null and name != ''"> name = #{name},</if>
<if test="ipAddress != null and ipAddress != ''"> ip_address = #{ipAddress},</if>
<if test="port != null and port != ''"> port = #{port},</if>
<if test="dbName != null and dbName != ''"> db_name = #{dbName},</if>
<if test="userName != null and userName != ''"> user_name = #{userName},</if>
<if test="password != null and password != ''"> password = #{password},</if>
<if test="dbType != null and dbType != ''"> db_type = #{dbType},</if>
<if test="appKey != null and appKey != ''"> app_key = #{appKey},</if>
<if test="appSecret != null and appSecret != ''"> app_secret = #{appSecret},</if>
<if test="corpid != null and corpid != ''"> corpId = #{corpid},</if>
<if test="agentid != null and agentid != ''"> agentId = #{agentid},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity" >
update sys_flow_step_account 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.sys.flow.entity.SysFlowStepAccountEntity" >
update sys_flow_step_account 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="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress} </if>
<if test="port != null and port != ''"> and port = #{port} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
<if test="corpid != null and corpid != ''"> and corpId = #{corpid} </if>
<if test="agentid != null and agentid != ''"> and agentId = #{agentid} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_step_account where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,126 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 映射信息表体(SysFlowStepConfigB)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public class SysFlowStepConfigBEntity extends BaseEntity {
/** 主表id */
private String mainId;
/** 流程id */
private String flowId;
/** 步骤id */
private String stepId;
/** 是否主键 */
private String primaryKeyFlag;
/** 字段名 */
private String fieldName;
/** 字段备注 */
private String fieldDescription;
/** 字段类型 */
private String fieldType;
/** 查询条件 */
private String whereCondition;
/** 源字段名称;适用于插入场景 */
private String sourceFieldName;
/** 源字段类型;适用于插入场景 */
private String sourceFieldType;
/** 源字段描述;适用于插入场景 */
private String sourceFieldDescription;
public String getMainId() {
return mainId;
}
public void setMainId(String mainId) {
this.mainId = mainId;
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getPrimaryKeyFlag() {
return primaryKeyFlag;
}
public void setPrimaryKeyFlag(String primaryKeyFlag) {
this.primaryKeyFlag = primaryKeyFlag;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getFieldDescription() {
return fieldDescription;
}
public void setFieldDescription(String fieldDescription) {
this.fieldDescription = fieldDescription;
}
public String getFieldType() {
return fieldType;
}
public void setFieldType(String fieldType) {
this.fieldType = fieldType;
}
public String getWhereCondition() {
return whereCondition;
}
public void setWhereCondition(String whereCondition) {
this.whereCondition = whereCondition;
}
public String getSourceFieldName() {
return sourceFieldName;
}
public void setSourceFieldName(String sourceFieldName) {
this.sourceFieldName = sourceFieldName;
}
public String getSourceFieldType() {
return sourceFieldType;
}
public void setSourceFieldType(String sourceFieldType) {
this.sourceFieldType = sourceFieldType;
}
public String getSourceFieldDescription() {
return sourceFieldDescription;
}
public void setSourceFieldDescription(String sourceFieldDescription) {
this.sourceFieldDescription = sourceFieldDescription;
}
}

View File

@ -0,0 +1,292 @@
<?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.sys.flow.dao.impl.SysFlowStepConfigBDaoImpl">
<resultMap id="get-SysFlowStepConfigBEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<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="mainId" column="main_id" jdbcType="VARCHAR"/>
<result property="flowId" column="flow_id" jdbcType="VARCHAR"/>
<result property="stepId" column="step_id" jdbcType="VARCHAR"/>
<result property="primaryKeyFlag" column="primary_key_flag" jdbcType="VARCHAR"/>
<result property="fieldName" column="field_name" jdbcType="VARCHAR"/>
<result property="fieldDescription" column="field_description" jdbcType="VARCHAR"/>
<result property="fieldType" column="field_type" jdbcType="VARCHAR"/>
<result property="whereCondition" column="where_condition" jdbcType="VARCHAR"/>
<result property="sourceFieldName" column="source_field_name" jdbcType="VARCHAR"/>
<result property="sourceFieldType" column="source_field_type" jdbcType="VARCHAR"/>
<result property="sourceFieldDescription" column="source_field_description" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowStepConfigBEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,main_id
,flow_id
,step_id
,primary_key_flag
,field_name
,field_description
,field_type
,where_condition
,source_field_name
,source_field_type
,source_field_description
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepConfigBEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity">
select
<include refid="SysFlowStepConfigBEntity_Base_Column_List" />
from sys_flow_step_config_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="mainId != null and mainId != ''"> and main_id = #{mainId} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> and primary_key_flag = #{primaryKeyFlag} </if>
<if test="fieldName != null and fieldName != ''"> and field_name = #{fieldName} </if>
<if test="fieldDescription != null and fieldDescription != ''"> and field_description = #{fieldDescription} </if>
<if test="fieldType != null and fieldType != ''"> and field_type = #{fieldType} </if>
<if test="whereCondition != null and whereCondition != ''"> and where_condition = #{whereCondition} </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> and source_field_name = #{sourceFieldName} </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> and source_field_type = #{sourceFieldType} </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> and source_field_description = #{sourceFieldDescription} </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.sys.flow.entity.SysFlowStepConfigBEntity">
select count(1) from sys_flow_step_config_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="mainId != null and mainId != ''"> and main_id = #{mainId} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> and primary_key_flag = #{primaryKeyFlag} </if>
<if test="fieldName != null and fieldName != ''"> and field_name = #{fieldName} </if>
<if test="fieldDescription != null and fieldDescription != ''"> and field_description = #{fieldDescription} </if>
<if test="fieldType != null and fieldType != ''"> and field_type = #{fieldType} </if>
<if test="whereCondition != null and whereCondition != ''"> and where_condition = #{whereCondition} </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> and source_field_name = #{sourceFieldName} </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> and source_field_type = #{sourceFieldType} </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> and source_field_description = #{sourceFieldDescription} </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-SysFlowStepConfigBEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity">
select
<include refid="SysFlowStepConfigBEntity_Base_Column_List" />
from sys_flow_step_config_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="mainId != null and mainId != ''"> and main_id like concat('%',#{mainId},'%') </if>
<if test="flowId != null and flowId != ''"> and flow_id like concat('%',#{flowId},'%') </if>
<if test="stepId != null and stepId != ''"> and step_id like concat('%',#{stepId},'%') </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> and primary_key_flag like concat('%',#{primaryKeyFlag},'%') </if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%',#{fieldName},'%') </if>
<if test="fieldDescription != null and fieldDescription != ''"> and field_description like concat('%',#{fieldDescription},'%') </if>
<if test="fieldType != null and fieldType != ''"> and field_type like concat('%',#{fieldType},'%') </if>
<if test="whereCondition != null and whereCondition != ''"> and where_condition like concat('%',#{whereCondition},'%') </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> and source_field_name like concat('%',#{sourceFieldName},'%') </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> and source_field_type like concat('%',#{sourceFieldType},'%') </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> and source_field_description like concat('%',#{sourceFieldDescription},'%') </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="SysFlowStepConfigBentity_list_or" resultMap="get-SysFlowStepConfigBEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity">
select
<include refid="SysFlowStepConfigBEntity_Base_Column_List" />
from sys_flow_step_config_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="mainId != null and mainId != ''"> or main_id = #{mainId} </if>
<if test="flowId != null and flowId != ''"> or flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> or step_id = #{stepId} </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> or primary_key_flag = #{primaryKeyFlag} </if>
<if test="fieldName != null and fieldName != ''"> or field_name = #{fieldName} </if>
<if test="fieldDescription != null and fieldDescription != ''"> or field_description = #{fieldDescription} </if>
<if test="fieldType != null and fieldType != ''"> or field_type = #{fieldType} </if>
<if test="whereCondition != null and whereCondition != ''"> or where_condition = #{whereCondition} </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> or source_field_name = #{sourceFieldName} </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> or source_field_type = #{sourceFieldType} </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> or source_field_description = #{sourceFieldDescription} </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.sys.flow.entity.SysFlowStepConfigBEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config_b(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="mainId != null and mainId != ''"> main_id , </if>
<if test="flowId != null and flowId != ''"> flow_id , </if>
<if test="stepId != null and stepId != ''"> step_id , </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> primary_key_flag , </if>
<if test="fieldName != null and fieldName != ''"> field_name , </if>
<if test="fieldDescription != null and fieldDescription != ''"> field_description , </if>
<if test="fieldType != null and fieldType != ''"> field_type , </if>
<if test="whereCondition != null and whereCondition != ''"> where_condition , </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> source_field_name , </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> source_field_type , </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> source_field_description , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="mainId != null and mainId != ''"> #{mainId} ,</if>
<if test="flowId != null and flowId != ''"> #{flowId} ,</if>
<if test="stepId != null and stepId != ''"> #{stepId} ,</if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> #{primaryKeyFlag} ,</if>
<if test="fieldName != null and fieldName != ''"> #{fieldName} ,</if>
<if test="fieldDescription != null and fieldDescription != ''"> #{fieldDescription} ,</if>
<if test="fieldType != null and fieldType != ''"> #{fieldType} ,</if>
<if test="whereCondition != null and whereCondition != ''"> #{whereCondition} ,</if>
<if test="sourceFieldName != null and sourceFieldName != ''"> #{sourceFieldName} ,</if>
<if test="sourceFieldType != null and sourceFieldType != ''"> #{sourceFieldType} ,</if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> #{sourceFieldDescription} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config_b a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config_b(create_user_id, create_time, modify_user_id, modify_time, sts, main_id, flow_id, step_id, primary_key_flag, field_name, field_description, field_type, where_condition, source_field_name, source_field_type, source_field_description, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.mainId},#{entity.flowId},#{entity.stepId},#{entity.primaryKeyFlag},#{entity.fieldName},#{entity.fieldDescription},#{entity.fieldType},#{entity.whereCondition},#{entity.sourceFieldName},#{entity.sourceFieldType},#{entity.sourceFieldDescription}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config_b(create_user_id, create_time, modify_user_id, modify_time, sts, main_id, flow_id, step_id, primary_key_flag, field_name, field_description, field_type, where_condition, source_field_name, source_field_type, source_field_description)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.mainId},#{entity.flowId},#{entity.stepId},#{entity.primaryKeyFlag},#{entity.fieldName},#{entity.fieldDescription},#{entity.fieldType},#{entity.whereCondition},#{entity.sourceFieldName},#{entity.sourceFieldType},#{entity.sourceFieldDescription})
</foreach>
on duplicate key update
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),
main_id = values(main_id),
flow_id = values(flow_id),
step_id = values(step_id),
primary_key_flag = values(primary_key_flag),
field_name = values(field_name),
field_description = values(field_description),
field_type = values(field_type),
where_condition = values(where_condition),
source_field_name = values(source_field_name),
source_field_type = values(source_field_type),
source_field_description = values(source_field_description)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity" >
update sys_flow_step_config_b set
<trim suffix="" suffixOverrides=",">
<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="mainId != null and mainId != ''"> main_id = #{mainId},</if>
<if test="flowId != null and flowId != ''"> flow_id = #{flowId},</if>
<if test="stepId != null and stepId != ''"> step_id = #{stepId},</if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> primary_key_flag = #{primaryKeyFlag},</if>
<if test="fieldName != null and fieldName != ''"> field_name = #{fieldName},</if>
<if test="fieldDescription != null and fieldDescription != ''"> field_description = #{fieldDescription},</if>
<if test="fieldType != null and fieldType != ''"> field_type = #{fieldType},</if>
<if test="whereCondition != null and whereCondition != ''"> where_condition = #{whereCondition},</if>
<if test="sourceFieldName != null and sourceFieldName != ''"> source_field_name = #{sourceFieldName},</if>
<if test="sourceFieldType != null and sourceFieldType != ''"> source_field_type = #{sourceFieldType},</if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> source_field_description = #{sourceFieldDescription},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity" >
update sys_flow_step_config_b 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.sys.flow.entity.SysFlowStepConfigBEntity" >
update sys_flow_step_config_b 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="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="mainId != null and mainId != ''"> and main_id = #{mainId} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> and primary_key_flag = #{primaryKeyFlag} </if>
<if test="fieldName != null and fieldName != ''"> and field_name = #{fieldName} </if>
<if test="fieldDescription != null and fieldDescription != ''"> and field_description = #{fieldDescription} </if>
<if test="fieldType != null and fieldType != ''"> and field_type = #{fieldType} </if>
<if test="whereCondition != null and whereCondition != ''"> and where_condition = #{whereCondition} </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> and source_field_name = #{sourceFieldName} </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> and source_field_type = #{sourceFieldType} </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> and source_field_description = #{sourceFieldDescription} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_step_config_b where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,136 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 映射信息主表(SysFlowStepConfig)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public class SysFlowStepConfigEntity extends BaseEntity {
/** 流程id */
private String flowId;
/** 步骤id */
private String stepId;
/** 流程操作步骤配置表id */
private String setpConfigId;
/** 操作类型 */
private String actionName;
/** 数据库类型;数据库类型+版本 */
private String dbType;
/** 表名称 */
private String tableName;
/** 页码 */
private String rowNum;
/** 每页条数 */
private String pageLimit;
/** 增量数据字段;例如ts */
private String maxValueField;
/** 是否建表 */
private String createTableFlag;
/** 写入模式;覆盖写入/增量写入 */
private String writeType;
/** 动态sql语句 */
private String sqlStatement;
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getSetpConfigId() {
return setpConfigId;
}
public void setSetpConfigId(String setpConfigId) {
this.setpConfigId = setpConfigId;
}
public String getActionName() {
return actionName;
}
public void setActionName(String actionName) {
this.actionName = actionName;
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getRowNum() {
return rowNum;
}
public void setRowNum(String rowNum) {
this.rowNum = rowNum;
}
public String getpageLimit() {
return pageLimit;
}
public void setpageLimit(String pageLimit) {
this.pageLimit = pageLimit;
}
public String getMaxValueField() {
return maxValueField;
}
public void setMaxValueField(String maxValueField) {
this.maxValueField = maxValueField;
}
public String getCreateTableFlag() {
return createTableFlag;
}
public void setCreateTableFlag(String createTableFlag) {
this.createTableFlag = createTableFlag;
}
public String getWriteType() {
return writeType;
}
public void setWriteType(String writeType) {
this.writeType = writeType;
}
public String getSqlStatement() {
return sqlStatement;
}
public void setSqlStatement(String sqlStatement) {
this.sqlStatement = sqlStatement;
}
}

View File

@ -0,0 +1,303 @@
<?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.sys.flow.dao.impl.SysFlowStepConfigDaoImpl">
<resultMap id="get-SysFlowStepConfigEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<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="flowId" column="flow_id" jdbcType="VARCHAR"/>
<result property="stepId" column="step_id" jdbcType="VARCHAR"/>
<result property="setpConfigId" column="setp_config_id" jdbcType="VARCHAR"/>
<result property="actionName" column="action_name" jdbcType="VARCHAR"/>
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
<result property="tableName" column="table_name" jdbcType="VARCHAR"/>
<result property="rowNum" column="row_num" jdbcType="VARCHAR"/>
<result property="pageLimit" column="page_limit" jdbcType="VARCHAR"/>
<result property="maxValueField" column="max_value_field" jdbcType="VARCHAR"/>
<result property="createTableFlag" column="create_table_flag" jdbcType="VARCHAR"/>
<result property="writeType" column="write_type" jdbcType="VARCHAR"/>
<result property="sqlStatement" column="sql_statement" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowStepConfigEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,flow_id
,step_id
,setp_config_id
,action_name
,db_type
,table_name
,row_num
,page_limit
,max_value_field
,create_table_flag
,write_type
,sql_statement
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepConfigEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity">
select
<include refid="SysFlowStepConfigEntity_Base_Column_List" />
from sys_flow_step_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="setpConfigId != null and setpConfigId != ''"> and setp_config_id = #{setpConfigId} </if>
<if test="actionName != null and actionName != ''"> and action_name = #{actionName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
<if test="rowNum != null and rowNum != ''"> and row_num = #{rowNum} </if>
<if test="pageLimit != null and pageLimit != ''"> and page_limit = #{pageLimit} </if>
<if test="maxValueField != null and maxValueField != ''"> and max_value_field = #{maxValueField} </if>
<if test="createTableFlag != null and createTableFlag != ''"> and create_table_flag = #{createTableFlag} </if>
<if test="writeType != null and writeType != ''"> and write_type = #{writeType} </if>
<if test="sqlStatement != null and sqlStatement != ''"> and sql_statement = #{sqlStatement} </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.sys.flow.entity.SysFlowStepConfigEntity">
select count(1) from sys_flow_step_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="setpConfigId != null and setpConfigId != ''"> and setp_config_id = #{setpConfigId} </if>
<if test="actionName != null and actionName != ''"> and action_name = #{actionName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
<if test="rowNum != null and rowNum != ''"> and row_num = #{rowNum} </if>
<if test="pageLimit != null and pageLimit != ''"> and page_limit = #{pageLimit} </if>
<if test="maxValueField != null and maxValueField != ''"> and max_value_field = #{maxValueField} </if>
<if test="createTableFlag != null and createTableFlag != ''"> and create_table_flag = #{createTableFlag} </if>
<if test="writeType != null and writeType != ''"> and write_type = #{writeType} </if>
<if test="sqlStatement != null and sqlStatement != ''"> and sql_statement = #{sqlStatement} </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-SysFlowStepConfigEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity">
select
<include refid="SysFlowStepConfigEntity_Base_Column_List" />
from sys_flow_step_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="flowId != null and flowId != ''"> and flow_id like concat('%',#{flowId},'%') </if>
<if test="stepId != null and stepId != ''"> and step_id like concat('%',#{stepId},'%') </if>
<if test="setpConfigId != null and setpConfigId != ''"> and setp_config_id like concat('%',#{setpConfigId},'%') </if>
<if test="actionName != null and actionName != ''"> and action_name like concat('%',#{actionName},'%') </if>
<if test="dbType != null and dbType != ''"> and db_type like concat('%',#{dbType},'%') </if>
<if test="tableName != null and tableName != ''"> and table_name like concat('%',#{tableName},'%') </if>
<if test="rowNum != null and rowNum != ''"> and row_num like concat('%',#{rowNum},'%') </if>
<if test="pageLimit != null and pageLimit != ''"> and page_limit like concat('%',#{pageLimit},'%') </if>
<if test="maxValueField != null and maxValueField != ''"> and max_value_field like concat('%',#{maxValueField},'%') </if>
<if test="createTableFlag != null and createTableFlag != ''"> and create_table_flag like concat('%',#{createTableFlag},'%') </if>
<if test="writeType != null and writeType != ''"> and write_type like concat('%',#{writeType},'%') </if>
<if test="sqlStatement != null and sqlStatement != ''"> and sql_statement like concat('%',#{sqlStatement},'%') </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="SysFlowStepConfigentity_list_or" resultMap="get-SysFlowStepConfigEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity">
select
<include refid="SysFlowStepConfigEntity_Base_Column_List" />
from sys_flow_step_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="flowId != null and flowId != ''"> or flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> or step_id = #{stepId} </if>
<if test="setpConfigId != null and setpConfigId != ''"> or setp_config_id = #{setpConfigId} </if>
<if test="actionName != null and actionName != ''"> or action_name = #{actionName} </if>
<if test="dbType != null and dbType != ''"> or db_type = #{dbType} </if>
<if test="tableName != null and tableName != ''"> or table_name = #{tableName} </if>
<if test="rowNum != null and rowNum != ''"> or row_num = #{rowNum} </if>
<if test="pageLimit != null and pageLimit != ''"> or page_limit = #{pageLimit} </if>
<if test="maxValueField != null and maxValueField != ''"> or max_value_field = #{maxValueField} </if>
<if test="createTableFlag != null and createTableFlag != ''"> or create_table_flag = #{createTableFlag} </if>
<if test="writeType != null and writeType != ''"> or write_type = #{writeType} </if>
<if test="sqlStatement != null and sqlStatement != ''"> or sql_statement = #{sqlStatement} </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.sys.flow.entity.SysFlowStepConfigEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="flowId != null and flowId != ''"> flow_id , </if>
<if test="stepId != null and stepId != ''"> step_id , </if>
<if test="setpConfigId != null and setpConfigId != ''"> setp_config_id , </if>
<if test="actionName != null and actionName != ''"> action_name , </if>
<if test="dbType != null and dbType != ''"> db_type , </if>
<if test="tableName != null and tableName != ''"> table_name , </if>
<if test="rowNum != null and rowNum != ''"> row_num , </if>
<if test="pageLimit != null and pageLimit != ''"> page_limit , </if>
<if test="maxValueField != null and maxValueField != ''"> max_value_field , </if>
<if test="createTableFlag != null and createTableFlag != ''"> create_table_flag , </if>
<if test="writeType != null and writeType != ''"> write_type , </if>
<if test="sqlStatement != null and sqlStatement != ''"> sql_statement , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="flowId != null and flowId != ''"> #{flowId} ,</if>
<if test="stepId != null and stepId != ''"> #{stepId} ,</if>
<if test="setpConfigId != null and setpConfigId != ''"> #{setpConfigId} ,</if>
<if test="actionName != null and actionName != ''"> #{actionName} ,</if>
<if test="dbType != null and dbType != ''"> #{dbType} ,</if>
<if test="tableName != null and tableName != ''"> #{tableName} ,</if>
<if test="rowNum != null and rowNum != ''"> #{rowNum} ,</if>
<if test="pageLimit != null and pageLimit != ''"> #{pageLimit} ,</if>
<if test="maxValueField != null and maxValueField != ''"> #{maxValueField} ,</if>
<if test="createTableFlag != null and createTableFlag != ''"> #{createTableFlag} ,</if>
<if test="writeType != null and writeType != ''"> #{writeType} ,</if>
<if test="sqlStatement != null and sqlStatement != ''"> #{sqlStatement} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config(create_user_id, create_time, modify_user_id, modify_time, sts, flow_id, step_id, setp_config_id, action_name, db_type, table_name, row_num, page_limit, max_value_field, create_table_flag, write_type, sql_statement, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowId},#{entity.stepId},#{entity.setpConfigId},#{entity.actionName},#{entity.dbType},#{entity.tableName},#{entity.rowNum},#{entity.pageLimit},#{entity.maxValueField},#{entity.createTableFlag},#{entity.writeType},#{entity.sqlStatement}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config(create_user_id, create_time, modify_user_id, modify_time, sts, flow_id, step_id, setp_config_id, action_name, db_type, table_name, row_num, page_limit, max_value_field, create_table_flag, write_type, sql_statement)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowId},#{entity.stepId},#{entity.setpConfigId},#{entity.actionName},#{entity.dbType},#{entity.tableName},#{entity.rowNum},#{entity.pageLimit},#{entity.maxValueField},#{entity.createTableFlag},#{entity.writeType},#{entity.sqlStatement})
</foreach>
on duplicate key update
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),
flow_id = values(flow_id),
step_id = values(step_id),
setp_config_id = values(setp_config_id),
action_name = values(action_name),
db_type = values(db_type),
table_name = values(table_name),
row_num = values(row_num),
page_limit = values(page_limit),
max_value_field = values(max_value_field),
create_table_flag = values(create_table_flag),
write_type = values(write_type),
sql_statement = values(sql_statement)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity" >
update sys_flow_step_config set
<trim suffix="" suffixOverrides=",">
<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="flowId != null and flowId != ''"> flow_id = #{flowId},</if>
<if test="stepId != null and stepId != ''"> step_id = #{stepId},</if>
<if test="setpConfigId != null and setpConfigId != ''"> setp_config_id = #{setpConfigId},</if>
<if test="actionName != null and actionName != ''"> action_name = #{actionName},</if>
<if test="dbType != null and dbType != ''"> db_type = #{dbType},</if>
<if test="tableName != null and tableName != ''"> table_name = #{tableName},</if>
<if test="rowNum != null and rowNum != ''"> row_num = #{rowNum},</if>
<if test="pageLimit != null and pageLimit != ''"> page_limit = #{pageLimit},</if>
<if test="maxValueField != null and maxValueField != ''"> max_value_field = #{maxValueField},</if>
<if test="createTableFlag != null and createTableFlag != ''"> create_table_flag = #{createTableFlag},</if>
<if test="writeType != null and writeType != ''"> write_type = #{writeType},</if>
<if test="sqlStatement != null and sqlStatement != ''"> sql_statement = #{sqlStatement},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity" >
update sys_flow_step_config 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.sys.flow.entity.SysFlowStepConfigEntity" >
update sys_flow_step_config 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="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="setpConfigId != null and setpConfigId != ''"> and setp_config_id = #{setpConfigId} </if>
<if test="actionName != null and actionName != ''"> and action_name = #{actionName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
<if test="rowNum != null and rowNum != ''"> and row_num = #{rowNum} </if>
<if test="pageLimit != null and pageLimit != ''"> and page_limit = #{pageLimit} </if>
<if test="maxValueField != null and maxValueField != ''"> and max_value_field = #{maxValueField} </if>
<if test="createTableFlag != null and createTableFlag != ''"> and create_table_flag = #{createTableFlag} </if>
<if test="writeType != null and writeType != ''"> and write_type = #{writeType} </if>
<if test="sqlStatement != null and sqlStatement != ''"> and sql_statement = #{sqlStatement} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_step_config where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,125 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程步骤信息(SysFlowStep)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowStepEntity extends BaseEntity {
/** 步骤序号 */
private Integer step;
//流程id
private String flowId;
/** 步骤类型;1定时任务2数据库3应用 */
private String stepType;
/** 描述 */
private String description;
/** 操作动作(名称);api名称/插件名称 */
private String apiName;
/** 操作动作类型;api/插件 */
private String actionType;
/** 应用id */
private String appId;
/** 操作动作id;api_id,根据操作动作类型来决定是查api还是插件 */
private String apiId;
/** nifi返回的应用id;刘工接口返回的nifi应用id不确定要不要 */
private String nifiAppId;
/** nifi的apiId */
private String nifiApiId;
/** nifi应用排序模式;先进先出/先进后出 */
private String sortMode;
public Integer getStep() {
return step;
}
public void setStep(Integer step) {
this.step = step;
}
public String getStepType() {
return stepType;
}
public void setStepType(String stepType) {
this.stepType = stepType;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getApiId() {
return apiId;
}
public void setApiId(String apiId) {
this.apiId = apiId;
}
public String getNifiAppId() {
return nifiAppId;
}
public void setNifiAppId(String nifiAppId) {
this.nifiAppId = nifiAppId;
}
public String getNifiApiId() {
return nifiApiId;
}
public void setNifiApiId(String nifiApiId) {
this.nifiApiId = nifiApiId;
}
public String getSortMode() {
return sortMode;
}
public void setSortMode(String sortMode) {
this.sortMode = sortMode;
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
}

Some files were not shown because too many files have changed in this diff Show More