Compare commits

...

28 Commits

Author SHA1 Message Date
lixinyu 6f6ae29386 单点登录 2025-09-12 16:08:47 +08:00
lixinyu b441549956 1.消息模板配置功能代码修改
2.通知规则配置功能代码修改
3.单点登录
2025-09-11 17:20:46 +08:00
lixinyu eb05e825aa 1.字段模板注释 2025-09-10 18:19:51 +08:00
lixinyu 7751b36351 1.消息模板配置功能修改
2.通知规则配置功能修改
3.导入数据校验重复
2025-09-10 17:12:45 +08:00
zhengyf 9e0bb28da0 1、认领优化 2025-09-10 14:36:19 +08:00
lixinyu 1cd26a247a 1.消息模板配置
2.通知规则配置
3.数据模板批量导入
2025-09-09 11:19:52 +08:00
zhengyf 7438069201 1、新增bip获取token方法 2025-09-09 08:34:07 +08:00
zhengyf 4d92ccbaa5 1、认领方案优化。
2、优化认领单查询。
3、优化待认领单明细功能
2025-09-05 13:26:07 +08:00
zhengyf 4b21bf7efa 1、新增收付款模板模块接口。 2025-09-03 23:22:34 +08:00
zhengyf 35ebfff445 1、新增浦发明细调用方法,接口,配置文件等。 2025-09-03 11:36:07 +08:00
lixinyu cd161e7e89 1.消息模板配置
2.通知规则配置
2025-08-30 14:36:16 +08:00
zhengyf 55c9d339dc 1、新增自动归集、根据id认领提交。 2025-08-29 17:42:07 +08:00
zhengyf b742852031 1、认领单模块新增搜索条件:收付类型,推送未推送。2、认领单模块新增功能:取消认领,推送,收回。 2025-08-28 20:05:57 +08:00
zhengyf 5900822643 Merge remote-tracking branch 'origin/finance-coco' into finance-coco 2025-08-28 20:05:15 +08:00
zhengyf 73ad1f5269 1、新增认领功能。 2025-08-26 22:39:32 +08:00
zhengyf 158b9bee73 1、新增认领功能。 2025-08-26 18:42:50 +08:00
zhengyf f468be5cf2 1、新增浦发GTS签名校验 2025-08-26 18:42:11 +08:00
zhengyf 2efad33655 1、新增认领单模块 2025-08-26 13:39:00 +08:00
zhengyf ee243d889d 1、认领/待认领合并查询 2025-08-26 11:20:36 +08:00
zhengyf 469a277797 1、新增单据号生成自增工具类 2025-08-25 16:07:00 +08:00
zhengyf a43c03e681 1、新增获取bip-token接口。
2、新增付款收款实体类等。
3、认领清单:收款,付款,已认领,待认领合并一个节点。
2025-08-25 14:09:41 +08:00
lixinyu b8ac7e93e3 1.下载数据模版
2.导入数据模版
2025-08-22 16:05:49 +08:00
zhengyf bb1d1f2c49 1、修改对照表,认领方案等模块以及相关方法。
2、新增待认领清单模块
2025-08-20 23:44:33 +08:00
zhengyf 0d657561df 1、新增档案特征模块 2025-08-19 19:39:21 +08:00
zhengyf 6a4be4b8ae 1、删除多余配置文件 2025-08-18 17:10:34 +08:00
zhengyf 0eee09b867 1、去除添加flatten-maven-plugin插件 2025-08-18 17:08:15 +08:00
zhengyf a71ea6bcb0 1、引入项目代码 2025-08-18 16:56:43 +08:00
zhengyf fd1a6ecac0 项目基础搭建 2025-08-18 16:55:36 +08:00
315 changed files with 35655 additions and 848 deletions

View File

@ -2,27 +2,84 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>kangarooDataCenterV3</artifactId>
<groupId>com.hzya.frame</groupId>
<artifactId>kangarooDataCenterV3</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>base-buildpackage</artifactId>
<packaging>war</packaging>
<version>${revision}</version>
<!-- 统一管理依赖版本-->
<dependencies>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>base-webapp</artifactId>
<version>${revision}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcmail-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<version>1.56</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.57</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.57</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.xiaoleilu/hutool-all -->
<dependency>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-all</artifactId>
<version>3.0.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okio/okio -->
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>dev</id> <!--开发环境-->
<id>dev</id> <!-- 开发环境 -->
<properties>
<profile.active>dev</profile.active>
</properties>
@ -30,30 +87,21 @@
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>llg</id> <!--吕磊钢-->
<properties>
<profile.active>llg</profile.active>
</properties>
</profile>
<profile>
<id>xel</id> <!--xel-->
<properties>
<profile.active>xel</profile.active>
</properties>
</profile>
<profile>
<id>zqtlocal</id> <!--曾庆拓-->
<properties>
<profile.active>zqtlocal</profile.active>
</properties>
</profile>
</profiles>
<build>
<finalName>kangarooDataCenterV3</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<!-- 移除了引用不存在目录的webResources配置 -->
<!-- Maven会自动将依赖的jar包打包到WEB-INF/lib目录 -->
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,396 @@
package com.hzya.frame.finance.bd;
import cn.hutool.core.lang.Assert;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.claim.entity.ClaimVO;
import com.hzya.frame.finance.utils.ClaimBillCodeUtil;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.voucher.ae.comf.bd.dao.*;
import com.hzya.frame.voucher.ae.comf.bd.entity.AccsubjTreeNode;
import com.hzya.frame.voucher.ae.comf.bd.entity.AeConfBdAccsubjEntity;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.*;
import com.hzya.frame.voucher.ae.comf.bd.utils.AccsubjTreeBuilder;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.stream.Collectors;
/**
* Created by zydd on 2025-06-04 15:04
*/
@RestController("financeBdController")
@RequestMapping("/fe/finance/bd")
public class BdController extends DefaultController {
@Autowired
private IAeConfBdOrgBookVODao aeConfBdOrgBookVODao;
@Autowired
private IAeConfBdBdinfoDao aeConfBdBdinfoDao;
@Autowired
private IAeConfBdAccsubjDao aeConfBdAccsubjDao;
@Autowired
private IMdmDBQueryVODAO mdmDBQueryVODAO;
@Autowired
private IMdmModuleService mdmModuleService;
@Autowired
private IMdmModuleDao mdmModuleDao;
@Autowired
private IMdmModuleDbDao mdmModuleDbDao;
@Autowired
private IMdmDbFiledVODAO mdmDbFiledVODAO;
/**
* 查询所有公司
*/
@RequestMapping(value = "/queryOrgVO", method = RequestMethod.POST)
public JsonResultEntity queryOrgVO(@RequestBody OrgBookVO vo) {
try {
List<OrgBookVO> all = aeConfBdOrgBookVODao.queryOrgVO(vo);
return getSuccessMessageEntity("请求成功", all);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询所有公司账簿信息
*/
@RequestMapping(value = "/queryOrgBookVO", method = RequestMethod.POST)
public JsonResultEntity queryOrgBookVO(@RequestBody OrgBookVO vo) {
try {
List<OrgBookVO> all = aeConfBdOrgBookVODao.queryOrgBookVO(vo);
return getSuccessMessageEntity("请求成功", all);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询基础数据资源表
*/
@RequestMapping(value = "/queryPkCodeName", method = RequestMethod.POST)
public JsonResultEntity queryPkCodeName(@RequestBody MdmDbFiledVO entity) {
try {
List<MdmDbFiledVO> mdmDbFiledVOList = mdmDbFiledVODAO.queryMdmDbFiledVOByMdmID(entity);
for (MdmDbFiledVO dbFiledVO : mdmDbFiledVOList) {
dbFiledVO.setPkBdinfo(dbFiledVO.getMdmId());
dbFiledVO.setBdcode(dbFiledVO.getMdmCode());
dbFiledVO.setBdname(dbFiledVO.getMdmName());
dbFiledVO.setTablepkname(dbFiledVO.getTablepkname());
}
return getSuccessMessageEntity("请求成功", mdmDbFiledVOList);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询科目表根据账簿id
*/
@RequestMapping(value = "/queryAccSubjByOrgBookId", method = RequestMethod.POST)
public JsonResultEntity queryAccSubjByOrgBookId(@RequestBody AeConfBdAccsubjEntity entity) {
try {
Assert.notNull(entity.getPkGlorgbook(), "查询科目表时账簿id不允许为空");
List<AeConfBdAccsubjEntity> all = aeConfBdAccsubjDao.query(entity);
//辅助核算
for (AeConfBdAccsubjEntity aeConfBdAccsubjEntity : all) {
List<AeConfBdAccsubjEntity> assists = aeConfBdAccsubjDao.queryAssist(aeConfBdAccsubjEntity);
List<String> codes = Optional.ofNullable(assists).orElse(Collections.emptyList()).stream()
.map(AeConfBdAccsubjEntity::getBdcode)
.filter(s -> s != null && !s.isEmpty())
.collect(Collectors.toList());
List<String> names = Optional.ofNullable(assists).orElse(Collections.emptyList()).stream()
.map(AeConfBdAccsubjEntity::getBdname)
.filter(s -> s != null && !s.isEmpty())
.collect(Collectors.toList());
aeConfBdAccsubjEntity.setAssistCodes(codes);
aeConfBdAccsubjEntity.setAssistNames(names);
}
List<AccsubjTreeNode> tree = AccsubjTreeBuilder.buildTree(all);
return getSuccessMessageEntity("请求成功", tree);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
// /**
// * 查询基础数据数据表直连U8C数据库
// */
// @RequestMapping(value = "/queryDataByMap", method = RequestMethod.POST)
// public JsonResultEntity queryDataByMap(@RequestBody HashMap<String, String> map) {
// try {
// if (map.get("tablename") == null || "".equals(map.get("tablename"))) {
// return getSuccessMessageEntity("请求成功", null);
// }
// //查询u8c数据库
// U8CQueryVO u8CQueryVO = new U8CQueryVO();
// u8CQueryVO.setDataSourceCode(ProfilesActiveConstant.LETS_PROD_DATE_SOURCE);
// u8CQueryVO.setTablename(map.get("tablename"));
// List<Map<String, Object>> objectList = u8CQueryVODAO.queryU8CBD(u8CQueryVO);
//
// return getSuccessMessageEntity("请求成功", objectList);
// } catch (Exception e) {
// e.printStackTrace();
// return getFailureMessageEntity(e.getMessage());
// }
// }
/**
* 查询基础数据数据表查询本地库
*/
@RequestMapping(value = "/queryDataByMap", method = RequestMethod.POST)
public JsonResultEntity queryDataByMap(@RequestBody MdmDBQueryVO mdmDBQueryVO) {
try {
if (mdmDBQueryVO.getTablename() == null || "".equals(mdmDBQueryVO.getTablename())) {
return getSuccessMessageEntity("请求成功", null);
}
//查询表remark是否包含管理
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
mdmModuleDbEntity.setDbName(mdmDBQueryVO.getTablename());
List<MdmModuleDbEntity> dbEntityList = mdmModuleDbDao.query(mdmModuleDbEntity);
if (dbEntityList.size() == 0) {
return getFailureMessageEntity("该表不存在");
}
String remark = dbEntityList.get(0).getRemark();
if (remark != null && !"".equals(remark)) {
if (!remark.contains("管理")) {
mdmDBQueryVO.setPkentityorg(null);
}
}
List<Map<String, Object>> objectList = mdmDBQueryVODAO.queryMdmDb(mdmDBQueryVO);
return getSuccessMessageEntity("请求成功", objectList);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询基础数据数据表
*/
@RequestMapping(value = "/queryDataPagedByMap", method = RequestMethod.POST)
public JsonResultEntity queryDataPagedByMap(@RequestBody MdmDBQueryVO mdmDBQueryVO) {
try {
if (mdmDBQueryVO.getTablename() == null || "".equals(mdmDBQueryVO.getTablename())) {
return getSuccessMessageEntity("请求成功", null);
}
//查询表remark是否包含管理
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
mdmModuleDbEntity.setDbName(mdmDBQueryVO.getTablename());
List<MdmModuleDbEntity> dbEntityList = mdmModuleDbDao.query(mdmModuleDbEntity);
if (dbEntityList.size() == 0) {
return getFailureMessageEntity("该表不存在");
}
String remark = dbEntityList.get(0).getRemark();
if (remark != null && !"".equals(remark)) {
if (!remark.contains("管理")) {
mdmDBQueryVO.setPkentityorg(null);
}
}
PageHelper.startPage(mdmDBQueryVO.getPageNum(), mdmDBQueryVO.getPageSize());
List<Map<String, Object>> objectList = mdmDBQueryVODAO.queryMdmDb(mdmDBQueryVO);
PageInfo pageInfo = new PageInfo(objectList);
return getSuccessMessageEntity("请求成功", pageInfo);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询现金流映射表
*/
@RequestMapping(value = "/queryCashFlowMap", method = RequestMethod.POST)
public JsonResultEntity queryCashFlowMap(@RequestBody CashFlowVO entity) {
try {
List<CashFlowVO> cashFlowVOS = mdmDBQueryVODAO.queryCashflowVO(entity);
return getSuccessMessageEntity("请求成功", cashFlowVOS);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询科目对应表
*/
@RequestMapping(value = "/queryGlsubrelation", method = RequestMethod.POST)
public JsonResultEntity queryGlsubrelation(@RequestBody GlSubrelationVO entity) {
try {
List<GlSubrelationVO> glSubrelationVOS = mdmDBQueryVODAO.queryGlsubrelationVO(entity);
return getSuccessMessageEntity("请求成功", glSubrelationVOS);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询基础档案表bd_bdinfo
*/
@RequestMapping(value = "/queryBdInfo", method = RequestMethod.POST)
public JsonResultEntity queryBdInfo(@RequestBody BdBdinfoEntity entity) {
try {
List<BdBdinfoEntity> list = mdmDBQueryVODAO.queryBdBdinfoList(entity);
return getSuccessMessageEntity("请求成功", list);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询辅助核算关联的档案
*/
@RequestMapping(value = "/queryBdInfoBySubjass", method = RequestMethod.POST)
public JsonResultEntity queryBdInfoBySubjass(@RequestBody BdAccassitemVO entity) {
try {
List<BdAccassitemVO> list = mdmDBQueryVODAO.queryBdInfoBySubjass(entity);
return getSuccessMessageEntity("请求成功", list);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询辅助核算关联的档案-事项分录可选
*/
@RequestMapping(value = "/queryBdInfoBySubjassFilter", method = RequestMethod.POST)
public JsonResultEntity queryBdInfoBySubjassFilter(@RequestBody BdAccassitemVO entity) {
try {
List<BdAccassitemVO> all = new ArrayList<>();
//查询所有关联
List<BdAccassitemVO> list = mdmDBQueryVODAO.queryBdInfoBySubjass(entity);
//查询现有的档案
List<MdmModuleEntity> query = mdmModuleDao.queryMdm(null);
System.out.println(query);
for (BdAccassitemVO bdBdinfoEntity : list) {
for (MdmModuleEntity mdmModuleEntity : query) {
if (bdBdinfoEntity.getPkAccassitem().equals(mdmModuleEntity.getU8cDbPk())
|| bdBdinfoEntity.getPkAccassitem().equals(mdmModuleEntity.getNccDbPk())
|| bdBdinfoEntity.getPkAccassitem().equals(mdmModuleEntity.getYsDbPk())) {
all.add(bdBdinfoEntity);
break;
}
}
}
return getSuccessMessageEntity("请求成功", all);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询凭证类别
*/
@RequestMapping(value = "/queryVoucherType", method = RequestMethod.POST)
public JsonResultEntity queryVoucherType(@RequestBody BdVoucherTypeVO entity) {
try {
List<BdVoucherTypeVO> list = mdmDBQueryVODAO.queryVoucherType(entity);
return getSuccessMessageEntity("请求成功", list);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 币种查询
*/
@RequestMapping(value = "/queryBdCurrtype", method = RequestMethod.POST)
public JsonResultEntity queryBdCurrtype(@RequestBody BdCurrtypeVO entity) {
try {
List<BdCurrtypeVO> list = mdmDBQueryVODAO.queryBdCurrtype(entity);
return getSuccessMessageEntity("请求成功", list);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@Autowired
private ClaimBillCodeUtil claimBillCodeUtil;
/**
* 根据类型获取当前最大编码
*/
@RequestMapping(value = "/queryMaxBillCodeByType", method = RequestMethod.POST)
public JsonResultEntity queryMaxBillCodeByType (@RequestBody ClaimVO claimVO) {
try {
Assert.notNull(claimVO.getBillType(),"获取最大单据号时:单据类型不能为空");
String s = claimBillCodeUtil.queryMaxBillCodeByType(claimVO.getBillType());
return getSuccessMessageEntity("请求成功", s);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 根据类型获取当前最大编码
*/
@RequestMapping(value = "/saveBillCodeByTypeAndSourceCode", method = RequestMethod.POST)
public JsonResultEntity saveBillCodeByTypeAndSourceCode (@RequestBody ClaimVO claimVO) {
try {
Assert.notNull(claimVO.getBillType(),"获取最大单据号时:单据类型不能为空");
Assert.notNull(claimVO.getSourceCode(),"获取最大单据号时:来源单据号不能为空");
String s = claimBillCodeUtil.saveBillCodeByTypeAndSourceCode(claimVO.getBillType(),claimVO.getSourceCode());
return getSuccessMessageEntity("请求成功", s);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
// /**
// *
// */
// @RequestMapping(value = "/", method = RequestMethod.POST)
// public JsonResultEntity (@RequestBody entity) {
// try {
// List<> list = mdmDBQueryVODAO.(entity);
// return getSuccessMessageEntity("请求成功", list);
// } catch (Exception e) {
// e.printStackTrace();
// return getFailureMessageEntity(e.getMessage());
// }
// }
}

View File

@ -0,0 +1,43 @@
package com.hzya.frame.finance.bip.controller;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.hzya.frame.finance.bip.entity.BIPTokenResVO;
import com.hzya.frame.finance.bip.service.IBipApiService;
import com.hzya.frame.voucher.utils.ZTResult;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by zydd on 2025-08-22 14:17
*/
@RestController
@RequestMapping("/fe/bip/api")
public class BipApiController extends DefaultController {
@Autowired
private IBipApiService bipApiService;
@RequestMapping(value = "/getToken", method = RequestMethod.POST)
public JsonResultEntity getToken() {
try {
String bipToken = bipApiService.getToekn();
BIPTokenResVO bipTokenResVO = JSON.parseObject(bipToken).toJavaObject(BIPTokenResVO.class);
String success = bipTokenResVO.getSuccess();
if ("true".equals(success)) {
return getSuccessMessageEntity("查询成功",bipTokenResVO);
} else {
return getFailureMessageEntity("查询成功",bipTokenResVO);
}
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity("获取token失败失败原因{}。", e.getMessage());
}
}
}

View File

@ -0,0 +1,28 @@
package com.hzya.frame.finance.bip.entity;
import lombok.Data;
/**
* Created by zydd on 2025-09-08 18:34
*/
@lombok.Data
public class BIPTokenResVO {
private String success;
private String code;
private String message;
private String errorStack;
private String pageInfo;
private Data data;
@lombok.Data
public static class Data {
private String access_token;
private String expires_in;
private String refresh_token;
private String security_key;
private String ts;
private String grant_type;
private String security_level;
}
}

View File

@ -0,0 +1,9 @@
package com.hzya.frame.finance.bip.service;
/**
* Created by zydd on 2025-08-22 14:19
*/
public interface IBipApiService {
String getToekn() throws Exception;
}

View File

@ -0,0 +1,204 @@
package com.hzya.frame.finance.bip.service.impl;
import cn.hutool.core.lang.Assert;
import com.google.gson.Gson;
import com.hzya.frame.finance.bip.service.IBipApiService;
import com.hzya.frame.finance.utils.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
* Created by zydd on 2025-08-22 14:19
*/
@Service
public class IBipApiServiceImpl implements IBipApiService {
// app_secret
private String grant_type = "client";
private String apiUrl;
private String secret_level = "L0";
private String baseUrl;
@Value("${BIP.ip}")
private String ip;
@Value("${BIP.port}")
private String port;
// @Value("${BIP.biz_center}")
private String biz_center="01";
@Value("${BIP.client_id}")
private String client_id;
@Value("${BIP.client_secret}")
private String client_secret;
@Value("${BIP.pubKey}")
private String pubKey;
@Value("${BIP.user_name}")
private String user_name;
@Value("${BIP.pwd}")
private String pwd;
class SecretConst {
public static final String LEVEL0 = "L0";
public static final String LEVEL1 = "L1";
public static final String LEVEL2 = "L2";
public static final String LEVEL3 = "L3";
public static final String LEVEL4 = "L4";
}
@Override
public String getToekn() throws Exception {
String token = null;
if ("password".equals(grant_type)) {
token = getTokenByPWD();
} else if ("client".equals(grant_type)) {
token = getTokenByClient();
} else {
Assert.state(false, "token获取模式错误");
}
return token;
}
private String getTokenByPWD() throws Exception {
Map<String, String> paramMap = new HashMap<>();
paramMap.put("grant_type", "password");
paramMap.put("client_id", client_id);
paramMap.put("client_secret", URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "UTF-8"));
paramMap.put("username", user_name);
paramMap.put("password", URLEncoder.encode(Encryption.pubEncrypt(pubKey, pwd), "UTF-8"));
paramMap.put("biz_center", biz_center);
String sign = SHA256Util.getSHA256(String.valueOf(client_id) + client_secret + user_name + pwd + pubKey, pubKey);
paramMap.put("signature", sign);
String url = String.valueOf(baseUrl) + "nccloud/opm/accesstoken";
String mediaType = "application/x-www-form-urlencoded";
String token = doPost(url, paramMap, mediaType, null, "");
return token;
}
public String getTokenByClient() throws Exception {
Map<String, String> paramMap = new HashMap<>();
paramMap.put("grant_type", "client_credentials");
paramMap.put("client_id", client_id);
paramMap.put("client_secret", URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "UTF-8"));
paramMap.put("biz_center", biz_center);
String sign = SHA256Util.getSHA256(String.valueOf(client_id) + client_secret + pubKey, pubKey);
paramMap.put("signature", sign);
String url = String.valueOf("http://" + ip + ":" + port + "/") + "nccloud/opm/accesstoken";
String mediaType = "application/x-www-form-urlencoded";
String token = doPost(url, paramMap, mediaType, null, "");
return token;
}
private String doPost(String baseUrl, Map<String, String> paramMap, String mediaType, Map<String, String> headers, String json) throws Exception {
HttpURLConnection urlConnection = null;
InputStream in = null;
OutputStream out = null;
BufferedReader bufferedReader = null;
String result = null;
try {
StringBuffer sb = new StringBuffer();
sb.append(baseUrl);
if (paramMap != null) {
sb.append("?");
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
sb.append(String.valueOf(key) + "=" + value).append("&");
}
baseUrl = sb.toString().substring(0, sb.toString().length() - 1);
}
URL urlObj = new URL(baseUrl);
urlConnection = (HttpURLConnection) urlObj.openConnection();
urlConnection.setConnectTimeout(50000);
urlConnection.setRequestMethod("POST");
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
urlConnection.setUseCaches(false);
urlConnection.addRequestProperty("content-type", mediaType);
if (headers != null) {
for (String key : headers.keySet()) {
urlConnection.addRequestProperty(key, headers.get(key));
}
}
out = urlConnection.getOutputStream();
out.write(json.getBytes("UTF-8"));
out.flush();
int resCode = urlConnection.getResponseCode();
if (resCode == 200 || resCode == 201 || resCode == 202) {
in = urlConnection.getInputStream();
} else {
in = urlConnection.getErrorStream();
}
bufferedReader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
StringBuffer temp = new StringBuffer();
String line = bufferedReader.readLine();
while (line != null) {
temp.append(line).append("\r\n");
line = bufferedReader.readLine();
}
String ecod = urlConnection.getContentEncoding();
if (ecod == null) {
ecod = Charset.forName("UTF-8").name();
}
result = new String(temp.toString().getBytes("UTF-8"), ecod);
} catch (Exception e) {
throw e;
} finally {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException e) {
throw e;
}
}
if (out != null) {
try {
out.close();
} catch (IOException e) {
throw e;
}
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
throw e;
}
}
urlConnection.disconnect();
}
return result;
}
// public void init(String ip, String port, String biz_center, String client_id, String client_secret, String pubKey, String user_name, String pwd) {
public void init() {
baseUrl = "http://" + ip + ":" + port + "/";
biz_center = biz_center;
client_id = client_id;
client_secret = client_secret;
pubKey = pubKey;
user_name = user_name;
pwd = pwd;
}
}

View File

@ -0,0 +1,168 @@
package com.hzya.frame.finance.claim.controller;
import cn.hutool.core.lang.Assert;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.claim.entity.ClaimVO;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.finance.claim.service.IClaimService;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created by zydd on 2025-08-25 14:31
* 收付款认领单 接口
*
* 收款单SK资金收款单ZJSK资金付款单ZJFK
*/
@RestController
@RequestMapping("/fe/claim")
public class ClaimController extends DefaultController {
@Autowired
private IClaimService claimService;
@RequestMapping("/queryAll")
public JsonResultEntity queryAll(@RequestBody ClaimVO vo){
try {
List<FeClaimBillHEntity> all = claimService.queryAll(vo);
return getSuccessMessageEntity("请求成功", all);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping("/queryById")
public JsonResultEntity queryById(@RequestBody ClaimVO vo){
try {
FeClaimBillHEntity feClaimBillH = claimService.queryById(vo);
return getSuccessMessageEntity("请求成功",feClaimBillH);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping("/queryPaged")
public JsonResultEntity queryPaged(@RequestBody ClaimVO vo){
try {
PageInfo pageInfo = claimService.queryPaged(vo);
return getSuccessMessageEntity("请求成功",pageInfo);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
//收回认领单 删除认领单修改流水状态
@RequestMapping("/back")
public JsonResultEntity back(@RequestBody ClaimVO vo){
int i=0;
int j=0;
StringBuffer cgsb = new StringBuffer();
StringBuffer sbsb = new StringBuffer();
try {
Assert.notNull(vo.getIds(),"收回认领单时ids不能为空");
String[] split = vo.getIds().split(",");
for (String id : split) {
String a = claimService.back(id);
}
return getSuccessMessageEntity("请求成功",null);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
//推送BIP
@RequestMapping("/push")
public JsonResultEntity push(@RequestBody ClaimVO vo){
int i=0;
int j=0;
StringBuffer cgsb = new StringBuffer();
StringBuffer sbsb = new StringBuffer();
try {
Assert.notNull(vo.getIds(),"确认认领时ids不能为空");
String[] split = vo.getIds().split(",");
for (String id : split) {
try {
String a = claimService.push(id);
j++;
cgsb.append(j).append("、[");
cgsb.append(a).append("];");
//1[认领单号]-->下游系统单号]
}catch (Exception e){
e.printStackTrace();
i++;
sbsb.append(i).append("").append(e.getMessage());
//1[认领单号]失败原因;
}
}
if(i==0){
return getSuccessMessageEntity("确认成功。"+cgsb);
}else {
return getFailureMessageEntity("确认成功:"+j+"条。:"+cgsb+"\n失败"+i+"条,失败原因:"+sbsb);
}
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
//取消BIP
@RequestMapping("/cancel")
public JsonResultEntity cancel(@RequestBody ClaimVO vo){
int i=0;
int j=0;
StringBuffer cgsb = new StringBuffer();
StringBuffer sbsb = new StringBuffer();
try {
Assert.notNull(vo.getIds(),"取消认领时ids不能为空");
String[] split = vo.getIds().split(",");
for (String id : split) {
try {
String a = claimService.cancel(id);
if(a==null){
continue;
}
j++;
cgsb.append(j).append("、[");
cgsb.append(a).append("];");
//1[认领单号]-->下游系统单号]
}catch (Exception e){
e.printStackTrace();
i++;
sbsb.append(i).append("").append(e.getMessage());
//1[认领单号]失败原因;
}
}
if(i==0){
return getSuccessMessageEntity("取消成功。"+cgsb);
}else {
return getFailureMessageEntity("取消成功:"+j+"条。:"+cgsb+"\n失败"+i+"条,取消原因:"+sbsb);
}
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
}

View File

@ -0,0 +1,171 @@
package com.hzya.frame.finance.claim.controller;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.claim.entity.ClaimVO;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.finance.claim.service.IClaimSKService;
import com.hzya.frame.finance.claim.service.IClaimService;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity;
import com.hzya.frame.mdm.entity.MdmViewVo;
import com.hzya.frame.plugin.coco.AutoClaimPlugin;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* Created by zydd on 2025-08-20 17:07
* 认领功能
*/
@RestController
@RequestMapping("/fe/sk/claim")
public class ClaimSKController extends DefaultController {
@Autowired
private IClaimSKService claimSKService;
@Autowired
private IClaimService claimService;
/**
* 流水查询字段
*/
@RequestMapping(value = "/queryFlowFileds", method = RequestMethod.POST)
public JsonResultEntity queryFlowFileds(@RequestBody MdmDBQueryVO entity) {
try {
MdmViewVo mdmViewVo = claimSKService.queryFlowFileds(entity);
return getSuccessMessageEntity("请求成功", mdmViewVo);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 流水查询数据
*/
@RequestMapping(value = "/queryFlowDatePaged", method = RequestMethod.POST)
public JsonResultEntity queryFlowDatePaged(@RequestBody MdmDBQueryVO entity) {
try {
PageInfo pageInfo = claimSKService.queryFlowDatePaged(entity);
return getSuccessMessageEntity("请求成功", pageInfo);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 流水查询数据ids
*/
@RequestMapping(value = "/queryFlowDateIds", method = RequestMethod.POST)
public JsonResultEntity queryFlowDateIds(@RequestBody MdmDBQueryVO entity) {
try {
List<Map<String, Object>> mps = claimSKService.queryFlowDateIds(entity);
return getSuccessMessageEntity("请求成功", mps);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 流水生成认领单
*/
@RequestMapping(value = "/generate", method = RequestMethod.POST)
public JsonResultEntity generate(@RequestBody FeClaimBillHEntity vo) throws Exception {
int i=0;
int j=0;
StringBuffer cgsb = new StringBuffer();
StringBuffer sbsb = new StringBuffer();
try {
String ids = vo.getId();
String[] split = ids.split(",");
for (String s : split) {
try {
vo.setId(s);
claimService.generate(vo);
j++;
cgsb.append(j).append("、流水号:[");
cgsb.append(s).append("];");
}catch (Exception e){
i++;
sbsb.append(i).append("、流水号:[").append(s);
sbsb.append("]失败原因:").append(e.getMessage()).append(";");
}
}
if(i==0){
return getSuccessMessageEntity("生成成功。"+cgsb);
}else {
return getFailureMessageEntity("生成成功:"+j+"条。:"+cgsb+"\n失败"+i+"条,失败原因:"+sbsb);
}
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping(value = "/generateById", method = RequestMethod.POST)
public JsonResultEntity generateById(@RequestBody FeClaimBillHEntity vo) throws Exception {
try {
claimService.generate(vo);
return getSuccessMessageEntity("生成成功");
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询对应客户
*/
@RequestMapping(value = "/queryCustomer", method = RequestMethod.POST)
public JsonResultEntity queryCustomer(@RequestBody MdmDBQueryVO vo) throws Exception {
try {
return getSuccessMessageEntity("请求成功");
}catch (Exception e){
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 自动带出信息
*/
@RequestMapping(value = "/autoCollection", method = RequestMethod.POST)
public JsonResultEntity autoCollection(@RequestBody MdmDBQueryVO entity){
try {
FeClaimBillHEntity claimBillHEntity = claimSKService.autoCollection(entity);
return getSuccessMessageEntity("请求成功",claimBillHEntity);
}catch (Exception e){
return getFailureMessageEntity(e.getMessage());
}
}
@Autowired
private AutoClaimPlugin autoClaimPlugin;
@RequestMapping(value = "/autoClaimPlugin", method = RequestMethod.POST)
public JsonResultEntity autoClaimPlugin(@RequestBody MdmDBQueryVO entity){
try {
autoClaimPlugin.start(entity.getStartTime(),entity.getEndTime());
return getSuccessMessageEntity("请求成功",null);
}catch (Exception e){
return getFailureMessageEntity(e.getMessage());
}
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.finance.claim.dao;
import com.hzya.frame.finance.claim.entity.FeClaimBillBEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 财资事项(finance_event)-付款认领单-b(fe_claim_bill_b: table)表数据库访问层
*
* @author zydd
* @since 2025-08-26 11:20:55
*/
public interface IFeClaimBillBDao extends IBaseDao<FeClaimBillBEntity, String> {
}

View File

@ -0,0 +1,16 @@
package com.hzya.frame.finance.claim.dao;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 财资事项(finance_event)-付款认领单-h(fe_claim_bill_h: table)表数据库访问层
*
* @author zydd
* @since 2025-08-26 11:18:08
*/
public interface IFeClaimBillHDao extends IBaseDao<FeClaimBillHEntity, String> {
void updateBipBillIdAndCodeById(FeClaimBillHEntity feClaimBillHEntity);
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.finance.claim.dao.impl;
import com.hzya.frame.finance.claim.entity.FeClaimBillBEntity;
import com.hzya.frame.finance.claim.dao.IFeClaimBillBDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 财资事项(finance_event)-付款认领单-b(FeClaimBillB)表数据库访问层
*
* @author zydd
* @since 2025-08-26 11:20:55
*/
@Repository
public class FeClaimBillBDaoImpl extends MybatisGenericDao<FeClaimBillBEntity, String> implements IFeClaimBillBDao{
}

View File

@ -0,0 +1,21 @@
package com.hzya.frame.finance.claim.dao.impl;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.finance.claim.dao.IFeClaimBillHDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 财资事项(finance_event)-付款认领单-h(FeClaimBillH)表数据库访问层
*
* @author zydd
* @since 2025-08-26 11:18:08
*/
@Repository
public class FeClaimBillHDaoImpl extends MybatisGenericDao<FeClaimBillHEntity, String> implements IFeClaimBillHDao{
@Override
public void updateBipBillIdAndCodeById(FeClaimBillHEntity feClaimBillHEntity) {
this.update("com.hzya.frame.finance.claim.dao.impl.FeClaimBillHDaoImpl.updateBipBillIdAndCodeById",feClaimBillHEntity);
}
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.finance.claim.entity;
import com.alibaba.druid.sql.visitor.functions.Char;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data;
/**
* Created by zydd on 2025-08-25 14:35
*/
@Data
public class ClaimVO extends BaseEntity {
/** 收款单SK、资金收款单ZJSK、资金付款单ZJFK */
private String billType;
private String claimType;
private String sourceCode;
//认领单查询条件
private String billCode;
private String billDate;
private String billCustomer;
private String isAutoClaim;//自动认领
private String claimUser;
private String claimStatus;//认领状态
private Integer pushStatus;//推送状态
private String ids;
}

View File

@ -0,0 +1,99 @@
package com.hzya.frame.finance.claim.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data;
/**
* 财资事项(finance_event)-付款认领单-b(FeClaimBillB)实体类
*
* @author zydd
* @since 2025-08-26 11:20:55
*/
@Data
public class FeClaimBillBEntity extends BaseEntity {
/**
* 主表id
*/
private Long hId;
/**
* 摘要
*/
private String zy;
/**
* 款项性质
*/
private String nature;
/**
* 款项类别
*/
private String type;
/**
* 币种
*/
private String currencyId;
private String currencyCode;
private String currencyName;
/**
* 金额
*/
private String money;
/**
* 表述说明
*/
private String explain;
private String bssm;
/**
* 外币服务费
*/
private String wbfwf;
/**
* 汇率
*/
private String rate;
/**
* 往来对象
*/
private String wldx;
/**
* 业务类型
*/
private String businessType;
/**
* 款项性质
*/
private String character;
private String kxxz;
/**
* 关联银行流水id
*/
private String sourceFlowBankId;
/**
* 备注
*/
private String remark;
private String def1;
private String def2;
private String def3;
private String def4;
private String def5;
private String def6;
private String def7;
private String def8;
private String def9;
private String def10;
/**
* 创建人
*/
private String createUser;
/**
* 修改人
*/
private String modifyUser;
}

View File

@ -0,0 +1,486 @@
<?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.finance.claim.dao.impl.FeClaimBillBDaoImpl">
<resultMap id="get-FeClaimBillBEntity-result" type="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="hId" column="h_id" jdbcType="INTEGER"/>
<result property="zy" column="zy" jdbcType="VARCHAR"/>
<result property="nature" column="nature" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
<result property="currencyId" column="currency_id" jdbcType="VARCHAR"/>
<result property="currencyCode" column="currency_code" jdbcType="VARCHAR"/>
<result property="currencyName" column="currency_name" jdbcType="VARCHAR"/>
<result property="money" column="money" jdbcType="VARCHAR"/>
<result property="bssm" column="bssm" jdbcType="VARCHAR"/>
<result property="wbfwf" column="wbfwf" jdbcType="VARCHAR"/>
<result property="rate" column="rate" jdbcType="VARCHAR"/>
<result property="wldx" column="wldx" jdbcType="VARCHAR"/>
<result property="businessType" column="business_type" jdbcType="VARCHAR"/>
<result property="kxxz" column="kxxz" jdbcType="VARCHAR"/>
<result property="sourceFlowBankId" column="source_flow_bank_id" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/>
<result property="def4" column="def4" jdbcType="VARCHAR"/>
<result property="def5" column="def5" jdbcType="VARCHAR"/>
<result property="def6" column="def6" jdbcType="VARCHAR"/>
<result property="def7" column="def7" jdbcType="VARCHAR"/>
<result property="def8" column="def8" jdbcType="VARCHAR"/>
<result property="def9" column="def9" jdbcType="VARCHAR"/>
<result property="def10" column="def10" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="modifyUser" column="modify_user" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="FeClaimBillBEntity_Base_Column_List">
id
,h_id
,zy
,nature
,type
,currency_id
,currency_code
,currency_name
,money
,bssm
,wbfwf
,rate
,wldx
,business_type
,kxxz
,source_flow_bank_id
,remark
,def1
,def2
,def3
,def4
,def5
,def6
,def7
,def8
,def9
,def10
,create_time
,create_user
,modify_time
,modify_user
,sts
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-FeClaimBillBEntity-result"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity">
select
<include refid="FeClaimBillBEntity_Base_Column_List"/>
from fe_claim_bill_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="hId != null">and h_id = #{hId}</if>
<if test="zy != null and zy != ''">and zy = #{zy}</if>
<if test="nature != null and nature != ''">and nature = #{nature}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="currencyId != null and currencyId != ''">and currency_id = #{currencyId}</if>
<if test="currencyCode != null and currencyCode != ''">and currency_code = #{currencyCode}</if>
<if test="currencyName != null and currencyName != ''">and currency_name = #{currencyName}</if>
<if test="money != null and money != ''">and money = #{money}</if>
<if test="bssm != null and bssm != ''">and bssm = #{bssm}</if>
<if test="wbfwf != null and wbfwf != ''">and wbfwf = #{wbfwf}</if>
<if test="rate != null and rate != ''">and rate = #{rate}</if>
<if test="wldx != null and wldx != ''">and wldx = #{wldx}</if>
<if test="businessType != null and businessType != ''">and business_type = #{businessType}</if>
<if test="kxxz != null and kxxz != ''">and kxxz = #{kxxz}</if>
<if test="sourceFlowBankId != null and sourceFlowBankId != ''">and source_flow_bank_id =
#{sourceFlowBankId}
</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity">
select count(1) from fe_claim_bill_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="hId != null">and h_id = #{hId}</if>
<if test="zy != null and zy != ''">and zy = #{zy}</if>
<if test="nature != null and nature != ''">and nature = #{nature}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="currencyId != null and currencyId != ''">and currency_id = #{currencyId}</if>
<if test="currencyCode != null and currencyCode != ''">and currency_code = #{currencyCode}</if>
<if test="currencyName != null and currencyName != ''">and currency_name = #{currencyName}</if>
<if test="money != null and money != ''">and money = #{money}</if>
<if test="bssm != null and bssm != ''">and bssm = #{bssm}</if>
<if test="wbfwf != null and wbfwf != ''">and wbfwf = #{wbfwf}</if>
<if test="rate != null and rate != ''">and rate = #{rate}</if>
<if test="wldx != null and wldx != ''">and wldx = #{wldx}</if>
<if test="businessType != null and businessType != ''">and business_type = #{businessType}</if>
<if test="kxxz != null and kxxz != ''">and kxxz = #{kxxz}</if>
<if test="sourceFlowBankId != null and sourceFlowBankId != ''">and source_flow_bank_id =
#{sourceFlowBankId}
</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-FeClaimBillBEntity-result"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity">
select
<include refid="FeClaimBillBEntity_Base_Column_List"/>
from fe_claim_bill_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id like concat('%',#{id},'%')</if>
<if test="hId != null">and h_id like concat('%',#{hId},'%')</if>
<if test="zy != null and zy != ''">and zy like concat('%',#{zy},'%')</if>
<if test="nature != null and nature != ''">and nature like concat('%',#{nature},'%')</if>
<if test="type != null and type != ''">and type like concat('%',#{type},'%')</if>
<if test="currencyId != null and currencyId != ''">and currency_id like concat('%',#{currencyId},'%')</if>
<if test="currencyCode != null and currencyCode != ''">and currency_code like
concat('%',#{currencyCode},'%')
</if>
<if test="currencyName != null and currencyName != ''">and currency_name like
concat('%',#{currencyName},'%')
</if>
<if test="money != null and money != ''">and money like concat('%',#{money},'%')</if>
<if test="bssm != null and bssm != ''">and bssm like concat('%',#{bssm},'%')</if>
<if test="wbfwf != null and wbfwf != ''">and wbfwf like concat('%',#{wbfwf},'%')</if>
<if test="rate != null and rate != ''">and rate like concat('%',#{rate},'%')</if>
<if test="wldx != null and wldx != ''">and wldx like concat('%',#{wldx},'%')</if>
<if test="businessType != null and businessType != ''">and business_type like
concat('%',#{businessType},'%')
</if>
<if test="kxxz != null and kxxz != ''">and kxxz like concat('%',#{kxxz},'%')</if>
<if test="sourceFlowBankId != null and sourceFlowBankId != ''">and source_flow_bank_id like
concat('%',#{sourceFlowBankId},'%')
</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
<if test="def1 != null and def1 != ''">and def1 like concat('%',#{def1},'%')</if>
<if test="def2 != null and def2 != ''">and def2 like concat('%',#{def2},'%')</if>
<if test="def3 != null and def3 != ''">and def3 like concat('%',#{def3},'%')</if>
<if test="def4 != null and def4 != ''">and def4 like concat('%',#{def4},'%')</if>
<if test="def5 != null and def5 != ''">and def5 like concat('%',#{def5},'%')</if>
<if test="def6 != null and def6 != ''">and def6 like concat('%',#{def6},'%')</if>
<if test="def7 != null and def7 != ''">and def7 like concat('%',#{def7},'%')</if>
<if test="def8 != null and def8 != ''">and def8 like concat('%',#{def8},'%')</if>
<if test="def9 != null and def9 != ''">and def9 like concat('%',#{def9},'%')</if>
<if test="def10 != null and def10 != ''">and def10 like concat('%',#{def10},'%')</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="createUser != null and createUser != ''">and create_user like concat('%',#{createUser},'%')</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user like concat('%',#{modifyUser},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
and sts='Y'
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="FeClaimBillBentity_list_or" resultMap="get-FeClaimBillBEntity-result"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity">
select
<include refid="FeClaimBillBEntity_Base_Column_List"/>
from fe_claim_bill_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null">or id = #{id}</if>
<if test="hId != null">or h_id = #{hId}</if>
<if test="zy != null and zy != ''">or zy = #{zy}</if>
<if test="nature != null and nature != ''">or nature = #{nature}</if>
<if test="type != null and type != ''">or type = #{type}</if>
<if test="currencyId != null and currencyId != ''">or currency_id = #{currencyId}</if>
<if test="currencyCode != null and currencyCode != ''">or currency_code = #{currencyCode}</if>
<if test="currencyName != null and currencyName != ''">or currency_name = #{currencyName}</if>
<if test="money != null and money != ''">or money = #{money}</if>
<if test="bssm != null and bssm != ''">or bssm = #{bssm}</if>
<if test="wbfwf != null and wbfwf != ''">or wbfwf = #{wbfwf}</if>
<if test="rate != null and rate != ''">or rate = #{rate}</if>
<if test="wldx != null and wldx != ''">or wldx = #{wldx}</if>
<if test="businessType != null and businessType != ''">or business_type = #{businessType}</if>
<if test="kxxz != null and kxxz != ''">or kxxz = #{kxxz}</if>
<if test="sourceFlowBankId != null and sourceFlowBankId != ''">or source_flow_bank_id =
#{sourceFlowBankId}
</if>
<if test="remark != null and remark != ''">or remark = #{remark}</if>
<if test="def1 != null and def1 != ''">or def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">or def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">or def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">or def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">or def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">or def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">or def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">or def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">or def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">or def10 = #{def10}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">or create_user = #{createUser}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">or modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity" keyProperty="id"
useGeneratedKeys="true">
insert into fe_claim_bill_b(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="hId != null">h_id ,</if>
<if test="zy != null and zy != ''">zy ,</if>
<if test="nature != null and nature != ''">nature ,</if>
<if test="type != null and type != ''">type ,</if>
<if test="currencyId != null and currencyId != ''">currency_id ,</if>
<if test="currencyCode != null and currencyCode != ''">currency_code ,</if>
<if test="currencyName != null and currencyName != ''">currency_name ,</if>
<if test="money != null and money != ''">money ,</if>
<if test="bssm != null and bssm != ''">bssm ,</if>
<if test="wbfwf != null and wbfwf != ''">wbfwf ,</if>
<if test="rate != null and rate != ''">rate ,</if>
<if test="wldx != null and wldx != ''">wldx ,</if>
<if test="businessType != null and businessType != ''">business_type ,</if>
<if test="kxxz != null and kxxz != ''">kxxz ,</if>
<if test="sourceFlowBankId != null and sourceFlowBankId != ''">source_flow_bank_id ,</if>
<if test="remark != null and remark != ''">remark ,</if>
<if test="def1 != null and def1 != ''">def1 ,</if>
<if test="def2 != null and def2 != ''">def2 ,</if>
<if test="def3 != null and def3 != ''">def3 ,</if>
<if test="def4 != null and def4 != ''">def4 ,</if>
<if test="def5 != null and def5 != ''">def5 ,</if>
<if test="def6 != null and def6 != ''">def6 ,</if>
<if test="def7 != null and def7 != ''">def7 ,</if>
<if test="def8 != null and def8 != ''">def8 ,</if>
<if test="def9 != null and def9 != ''">def9 ,</if>
<if test="def10 != null and def10 != ''">def10 ,</if>
<if test="create_time != null">create_time ,</if>
<if test="create_time == null">create_time ,</if>
<if test="createUser != null and createUser != ''">create_user ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="modify_time == null">modify_time ,</if>
<if test="modifyUser != null and modifyUser != ''">modify_user ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="hId != null">#{hId} ,</if>
<if test="zy != null and zy != ''">#{zy} ,</if>
<if test="nature != null and nature != ''">#{nature} ,</if>
<if test="type != null and type != ''">#{type} ,</if>
<if test="currencyId != null and currencyId != ''">#{currencyId} ,</if>
<if test="currencyCode != null and currencyCode != ''">#{currencyCode} ,</if>
<if test="currencyName != null and currencyName != ''">#{currencyName} ,</if>
<if test="money != null and money != ''">#{money} ,</if>
<if test="bssm != null and bssm != ''">#{bssm} ,</if>
<if test="wbfwf != null and wbfwf != ''">#{wbfwf} ,</if>
<if test="rate != null and rate != ''">#{rate} ,</if>
<if test="wldx != null and wldx != ''">#{wldx} ,</if>
<if test="businessType != null and businessType != ''">#{businessType} ,</if>
<if test="kxxz != null and kxxz != ''">#{kxxz} ,</if>
<if test="sourceFlowBankId != null and sourceFlowBankId != ''">#{sourceFlowBankId} ,</if>
<if test="remark != null and remark != ''">#{remark} ,</if>
<if test="def1 != null and def1 != ''">#{def1} ,</if>
<if test="def2 != null and def2 != ''">#{def2} ,</if>
<if test="def3 != null and def3 != ''">#{def3} ,</if>
<if test="def4 != null and def4 != ''">#{def4} ,</if>
<if test="def5 != null and def5 != ''">#{def5} ,</if>
<if test="def6 != null and def6 != ''">#{def6} ,</if>
<if test="def7 != null and def7 != ''">#{def7} ,</if>
<if test="def8 != null and def8 != ''">#{def8} ,</if>
<if test="def9 != null and def9 != ''">#{def9} ,</if>
<if test="def10 != null and def10 != ''">#{def10} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="create_time == null">now() ,</if>
<if test="createUser != null and createUser != ''">#{createUser} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="modify_time == null">now() ,</if>
<if test="modifyUser != null and modifyUser != ''">#{modifyUser} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_claim_bill_b(h_id, zy, nature, type, currency_id, currency_code, currency_name, money, bssm,
rate, wldx, business_type, kxxz, source_flow_bank_id, remark, def1, def2, def3, def4, def5, def6, def7,
def8, def9, def10, create_time, create_user, modify_time, modify_user, sts, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.hId},#{entity.zy},#{entity.nature},#{entity.type},#{entity.currencyId},#{entity.currencyCode},#{entity.currencyName},#{entity.money},#{entity.bssm},#{entity.rate},#{entity.wldx},#{entity.businessType},#{entity.kxxz},#{entity.sourceFlowBankId},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_claim_bill_b(h_id, zy, nature, type, currency_id, currency_code, currency_name, money, bssm,
rate, wldx, business_type, kxxz, source_flow_bank_id, remark, def1, def2, def3, def4, def5, def6, def7,
def8, def9, def10, create_time, create_user, modify_time, modify_user, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.hId},#{entity.zy},#{entity.nature},#{entity.type},#{entity.currencyId},#{entity.currencyCode},#{entity.currencyName},#{entity.money},#{entity.bssm},#{entity.rate},#{entity.wldx},#{entity.businessType},#{entity.kxxz},#{entity.sourceFlowBankId},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts})
</foreach>
on duplicate key update
h_id = values(h_id),
zy = values(zy),
nature = values(nature),
type = values(type),
currency_id = values(currency_id),
currency_code = values(currency_code),
currency_name = values(currency_name),
money = values(money),
bssm = values(bssm),
rate = values(rate),
wldx = values(wldx),
business_type = values(business_type),
kxxz = values(kxxz),
source_flow_bank_id = values(source_flow_bank_id),
remark = values(remark),
def1 = values(def1),
def2 = values(def2),
def3 = values(def3),
def4 = values(def4),
def5 = values(def5),
def6 = values(def6),
def7 = values(def7),
def8 = values(def8),
def9 = values(def9),
def10 = values(def10),
create_time = values(create_time),
create_user = values(create_user),
modify_time = values(modify_time),
modify_user = values(modify_user),
sts = values(sts)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity">
update fe_claim_bill_b set
<trim suffix="" suffixOverrides=",">
<if test="hId != null">h_id = #{hId},</if>
<if test="zy != null and zy != ''">zy = #{zy},</if>
<if test="nature != null and nature != ''">nature = #{nature},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="currencyId != null and currencyId != ''">currency_id = #{currencyId},</if>
<if test="currencyCode != null and currencyCode != ''">currency_code = #{currencyCode},</if>
<if test="currencyName != null and currencyName != ''">currency_name = #{currencyName},</if>
<if test="money != null and money != ''">money = #{money},</if>
<if test="bssm != null and bssm != ''">bssm = #{bssm},</if>
<if test="wbfwf != null and wbfwf != ''">wbfwf = #{wbfwf},</if>
<if test="rate != null and rate != ''">rate = #{rate},</if>
<if test="wldx != null and wldx != ''">wldx = #{wldx},</if>
<if test="businessType != null and businessType != ''">business_type = #{businessType},</if>
<if test="kxxz != null and kxxz != ''">kxxz = #{kxxz},</if>
<if test="sourceFlowBankId != null and sourceFlowBankId != ''">source_flow_bank_id = #{sourceFlowBankId},
</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="def1 != null and def1 != ''">def1 = #{def1},</if>
<if test="def2 != null and def2 != ''">def2 = #{def2},</if>
<if test="def3 != null and def3 != ''">def3 = #{def3},</if>
<if test="def4 != null and def4 != ''">def4 = #{def4},</if>
<if test="def5 != null and def5 != ''">def5 = #{def5},</if>
<if test="def6 != null and def6 != ''">def6 = #{def6},</if>
<if test="def7 != null and def7 != ''">def7 = #{def7},</if>
<if test="def8 != null and def8 != ''">def8 = #{def8},</if>
<if test="def9 != null and def9 != ''">def9 = #{def9},</if>
<if test="def10 != null and def10 != ''">def10 = #{def10},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="createUser != null and createUser != ''">create_user = #{createUser},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="modify_time == null">modify_time = now(),</if>
<if test="modifyUser != null and modifyUser != ''">modify_user = #{modifyUser},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity">
update fe_claim_bill_b
set sts= 'N',
modify_time = now()
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillBEntity">
update fe_claim_bill_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 = #{id}</if>
<if test="hId != null">and h_id = #{hId}</if>
<if test="zy != null and zy != ''">and zy = #{zy}</if>
<if test="nature != null and nature != ''">and nature = #{nature}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="currencyId != null and currencyId != ''">and currency_id = #{currencyId}</if>
<if test="currencyCode != null and currencyCode != ''">and currency_code = #{currencyCode}</if>
<if test="currencyName != null and currencyName != ''">and currency_name = #{currencyName}</if>
<if test="money != null and money != ''">and money = #{money}</if>
<if test="bssm != null and bssm != ''">and bssm = #{bssm}</if>
<if test="wbfwf != null and wbfwf != ''">and wbfwf = #{wbfwf}</if>
<if test="rate != null and rate != ''">and rate = #{rate}</if>
<if test="wldx != null and wldx != ''">and wldx = #{wldx}</if>
<if test="businessType != null and businessType != ''">and business_type = #{businessType}</if>
<if test="kxxz != null and kxxz != ''">and kxxz = #{kxxz}</if>
<if test="sourceFlowBankId != null and sourceFlowBankId != ''">and source_flow_bank_id =
#{sourceFlowBankId}
</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from fe_claim_bill_b
where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,159 @@
package com.hzya.frame.finance.claim.entity;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.type.JdbcType;
/**
* 财资事项(finance_event)-付款认领单-h(FeClaimBillH)实体类
*
* @author zydd
* @since 2025-08-26 11:18:08
*/
@Data
public class FeClaimBillHEntity extends FeClaimBillBEntity {
// private Long id;
/**
* 认领类型SK/FK
*/
private String claimType;
private String claimTypeName;
/**
* 交易类型区分收款/资金收款/资金付款
*/
private String businessType;
/**
* 认领单号
*/
private String billCode;
/**
* 认领日期
*/
private String billData;
/**
* bip单据主键
*/
private String bipBillId;
/**
* bip单号
*/
private String bipBillCode;
/**
* 业务流程
*/
private String businessFlow;
/**
* 客户id
*/
private String customerId;
private String customerCode;
private String customerName;
/**
* 部门id
*/
private String deptId;
private String deptCode;
private String deptName;
/**
* 供应商id
*/
private String supplierId;
private String supplierCode;
private String supplierName;
/**
* 是否自动认领
*/
private String isAutoClaim;
private String isAutoClaimName;
/**
* 认领人id
*/
private String claimUserId;
private String claimUserCode;
private String claimUserName;
/**
* 银行id
*/
private String bankId;
private String bankCode;
private String bankName;
/**
* 收款银行账号
*/
private String bankNum;
/**
* 财务组织id
*/
private String financeOrgId;
private String financeOrgCode;
private String financeOrgName;
/**
* 往来对象id
*/
private String wldxId;
private String wldxCode;
private String wldxName;
/**
* 认领金额
*/
private String claimSum;
/**
* 结算方式
*/
private String jsfs;
/**
* 付款银行账户
*/
private String fkBank;
/**
* 收款银行账户
*/
private String skBank;
/**
* 现金账户
*/
private String xjBank;
/**
* 备注
*/
private String remark;
private String def1;
private String def2;
private String def3;
private String def4;
private String def5;
private String def6;
private String def7;
private String def8;
private String def9;
private String def10;
/**
* 创建人
*/
private String createUser;
/**
* 修改人
*/
private String modifyUser;
List<FeClaimBillBEntity> billBList;
private Integer claimStatus;
private Integer pushStatus;
private String pushStatusName;
private String sourceId;
private String downstreamSystemBillCode;
private String ids;
private List<Map<String,String>> detailList;
}

View File

@ -0,0 +1,772 @@
<?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.finance.claim.dao.impl.FeClaimBillHDaoImpl">
<resultMap id="get-FeClaimBillHEntity-result" type="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="claimType" column="claim_type" jdbcType="VARCHAR"/>
<result property="businessType" column="business_type" jdbcType="VARCHAR"/>
<result property="claimStatus" column="claim_status"/>
<result property="pushStatus" column="push_status"/>
<result property="billCode" column="bill_code" jdbcType="VARCHAR"/>
<result property="billData" column="bill_data" jdbcType="VARCHAR"/>
<result property="sourceId" column="source_id" jdbcType="VARCHAR"/>
<result property="bipBillId" column="bip_bill_id" jdbcType="VARCHAR"/>
<result property="bipBillCode" column="bip_bill_code" jdbcType="VARCHAR"/>
<result property="downstreamSystemBillCode" column="downstream_system_bill_code" jdbcType="VARCHAR"/>
<result property="businessFlow" column="business_flow" jdbcType="VARCHAR"/>
<result property="customerId" column="customer_id" jdbcType="VARCHAR"/>
<result property="customerCode" column="customer_code" jdbcType="VARCHAR"/>
<result property="customerName" column="customer_name" jdbcType="VARCHAR"/>
<result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
<result property="deptCode" column="dept_code" jdbcType="VARCHAR"/>
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
<result property="supplierId" column="supplier_id" jdbcType="VARCHAR"/>
<result property="supplierCode" column="supplier_code" jdbcType="VARCHAR"/>
<result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/>
<result property="isAutoClaim" column="is_auto_claim" jdbcType="VARCHAR"/>
<result property="claimUserId" column="claim_user_id" jdbcType="VARCHAR"/>
<result property="bankId" column="bank_id" jdbcType="VARCHAR"/>
<result property="bankCode" column="bank_code" jdbcType="VARCHAR"/>
<result property="bankName" column="bank_name" jdbcType="VARCHAR"/>
<result property="bankNum" column="bank_num" jdbcType="VARCHAR"/>
<result property="financeOrgId" column="finance_org_id" jdbcType="VARCHAR"/>
<result property="financeOrgCode" column="finance_org_code" jdbcType="VARCHAR"/>
<result property="financeOrgName" column="finance_org_name" jdbcType="VARCHAR"/>
<result property="wldxId" column="wldx_id" jdbcType="VARCHAR"/>
<result property="wldxCode" column="wldx_code" jdbcType="VARCHAR"/>
<result property="wldxName" column="wldx_name" jdbcType="VARCHAR"/>
<result property="claimSum" column="claim_sum" jdbcType="VARCHAR"/>
<result property="jsfs" column="jsfs" jdbcType="VARCHAR"/>
<result property="fkBank" column="fk_bank" jdbcType="VARCHAR"/>
<result property="skBank" column="sk_bank" jdbcType="VARCHAR"/>
<result property="xjBank" column="xj_bank" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/>
<result property="def4" column="def4" jdbcType="VARCHAR"/>
<result property="def5" column="def5" jdbcType="VARCHAR"/>
<result property="def6" column="def6" jdbcType="VARCHAR"/>
<result property="def7" column="def7" jdbcType="VARCHAR"/>
<result property="def8" column="def8" jdbcType="VARCHAR"/>
<result property="def9" column="def9" jdbcType="VARCHAR"/>
<result property="def10" column="def10" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="modifyUser" column="modify_user" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="FeClaimBillHEntity_Base_Column_List">
id
,claim_type
,business_type
,bill_code
,bill_data
,source_id
,bip_bill_id
,bip_bill_code
,business_flow
,customer_id
,customer_code
,customer_name
,dept_id
,dept_code
,dept_name
,supplier_id
,supplier_code
,supplier_name
,is_auto_claim
,claim_user_id
,bank_id
,bank_code
,bank_name
,bank_num
,finance_org_id
,finance_org_code
,finance_org_name
,wldx_id
,wldx_code
,wldx_name
,claim_sum
,jsfs
,fk_bank
,sk_bank
,xj_bank
,remark
,def1
,def2
,def3
,def4
,def5
,def6
,def7
,def8
,def9
,def10
,create_time
,create_user
,modify_time
,modify_user
,sts
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-FeClaimBillHEntity-result"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
select
CASE
WHEN fe_claim_bill_h.bip_bill_id IS NOT NULL THEN '1'
WHEN fe_claim_bill_h.bip_bill_id IS NULL THEN '0'
END AS push_status,
fe_claim_bill_h.bip_bill_code AS downstream_system_bill_code,
fe_claim_bill_h.id,
fe_claim_bill_h.claim_type,
fe_claim_bill_h.business_type,
fe_claim_bill_h.bill_code,
fe_claim_bill_h.bill_data,
fe_claim_bill_h.source_id,
fe_claim_bill_h.bip_bill_id,
fe_claim_bill_h.bip_bill_code,
fe_claim_bill_h.business_flow,
fe_claim_bill_h.customer_id,
fe_claim_bill_h.customer_code,
fe_claim_bill_h.customer_name,
fe_claim_bill_h.dept_id,
fe_claim_bill_h.dept_code,
fe_claim_bill_h.dept_name,
fe_claim_bill_h.supplier_id,
fe_claim_bill_h.supplier_code,
fe_claim_bill_h.supplier_name,
fe_claim_bill_h.is_auto_claim,
fe_claim_bill_h.claim_user_id,
person.person_code as claim_user_code,
person.person_name as claim_user_name,
fe_claim_bill_h.bank_id,
fe_claim_bill_h.bank_code,
fe_claim_bill_h.bank_name,
fe_claim_bill_h.bank_num,
fe_claim_bill_h.finance_org_id,
fe_claim_bill_h.finance_org_code,
fe_claim_bill_h.finance_org_name,
fe_claim_bill_h.wldx_id,
fe_claim_bill_h.wldx_code,
fe_claim_bill_h.wldx_name,
fe_claim_bill_h.claim_sum,
fe_claim_bill_h.jsfs,
fe_claim_bill_h.fk_bank,
fe_claim_bill_h.sk_bank,
fe_claim_bill_h.xj_bank,
fe_claim_bill_h.remark,
fe_claim_bill_h.def1,
fe_claim_bill_h.def2,
fe_claim_bill_h.def3,
fe_claim_bill_h.def4,
fe_claim_bill_h.def5,
fe_claim_bill_h.def6,
fe_claim_bill_h.def7,
fe_claim_bill_h.def8,
fe_claim_bill_h.def9,
fe_claim_bill_h.def10,
fe_claim_bill_h.create_time,
fe_claim_bill_h.create_user,
fe_claim_bill_h.modify_time,
fe_claim_bill_h.modify_user,
fe_claim_bill_h.sts
from fe_claim_bill_h
LEFT JOIN sys_user user ON user.id=fe_claim_bill_h.claim_user_id
LEFT JOIN sys_person person ON person.id=user.person_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and fe_claim_bill_h.id = #{id}</if>
<if test="claimType != null and claimType != ''">and fe_claim_bill_h.claim_type = #{claimType}</if>
<if test="businessType != null and businessType != ''">and fe_claim_bill_h.business_type = #{businessType}</if>
<if test="billCode != null and billCode != ''">and fe_claim_bill_h.bill_code like concat('%',#{billCode},'%')</if>
<if test="billData != null and billData != ''">and fe_claim_bill_h.bill_data = #{billData}</if>
<if test="sourceId != null and sourceId != ''">and fe_claim_bill_h.source_id = #{sourceId}</if>
<if test="bipBillId != null and bipBillId != ''">and fe_claim_bill_h.bip_bill_id = #{bipBillId}</if>
<if test="bipBillCode != null and bipBillCode != ''">and fe_claim_bill_h.bip_bill_code = #{bipBillCode}</if>
<if test="businessFlow != null and businessFlow != ''">and fe_claim_bill_h.business_flow = #{businessFlow}</if>
<if test="customerId != null and customerId != ''">and fe_claim_bill_h.customer_id = #{customerId}</if>
<if test="customerCode != null and customerCode != ''">and fe_claim_bill_h.customer_code = #{customerCode}</if>
<if test="customerName != null and customerName != ''">and fe_claim_bill_h.customer_name = #{customerName}</if>
<if test="deptId != null and deptId != ''">and fe_claim_bill_h.dept_id = #{deptId}</if>
<if test="deptCode != null and deptCode != ''">and fe_claim_bill_h.dept_code = #{deptCode}</if>
<if test="deptName != null and deptName != ''">and fe_claim_bill_h.dept_name = #{deptName}</if>
<if test="supplierId != null and supplierId != ''">and fe_claim_bill_h.supplier_id = #{supplierId}</if>
<if test="supplierCode != null and supplierCode != ''">and fe_claim_bill_h.supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''">and fe_claim_bill_h.supplier_name = #{supplierName}</if>
<if test="isAutoClaim != null and isAutoClaim != ''">and fe_claim_bill_h.is_auto_claim = #{isAutoClaim}</if>
<if test="claimUserId != null and claimUserId != ''">and fe_claim_bill_h.claim_user_id = #{claimUserId}</if>
<if test="bankId != null and bankId != ''">and fe_claim_bill_h.bank_id = #{bankId}</if>
<if test="bankCode != null and bankCode != ''">and fe_claim_bill_h.bank_code = #{bankCode}</if>
<if test="bankName != null and bankName != ''">and fe_claim_bill_h.bank_name = #{bankName}</if>
<if test="bankNum != null and bankNum != ''">and fe_claim_bill_h.bank_num = #{bankNum}</if>
<if test="financeOrgId != null and financeOrgId != ''">and fe_claim_bill_h.finance_org_id = #{financeOrgId}</if>
<if test="financeOrgCode != null and financeOrgCode != ''">and fe_claim_bill_h.finance_org_code = #{financeOrgCode}</if>
<if test="financeOrgName != null and financeOrgName != ''">and fe_claim_bill_h.finance_org_name = #{financeOrgName}</if>
<if test="wldxId != null and wldxId != ''">and fe_claim_bill_h.wldx_id = #{wldxId}</if>
<if test="wldxCode != null and wldxCode != ''">and fe_claim_bill_h.wldx_code = #{wldxCode}</if>
<if test="wldxName != null and wldxName != ''">and fe_claim_bill_h.wldx_name = #{wldxName}</if>
<if test="claimSum != null and claimSum != ''">and fe_claim_bill_h.claim_sum = #{claimSum}</if>
<if test="jsfs != null and jsfs != ''">and fe_claim_bill_h.jsfs = #{jsfs}</if>
<if test="fkBank != null and fkBank != ''">and fe_claim_bill_h.fk_bank = #{fkBank}</if>
<if test="skBank != null and skBank != ''">and fe_claim_bill_h.sk_bank = #{skBank}</if>
<if test="xjBank != null and xjBank != ''">and fe_claim_bill_h.xj_bank = #{xjBank}</if>
<if test="remark != null and remark != ''">and fe_claim_bill_h.remark = #{remark}</if>
<if test="def1 != null and def1 != ''">and fe_claim_bill_h.def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and fe_claim_bill_h.def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and fe_claim_bill_h.def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and fe_claim_bill_h.def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and fe_claim_bill_h.def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and fe_claim_bill_h.def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and fe_claim_bill_h.def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and fe_claim_bill_h.def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and fe_claim_bill_h.def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and fe_claim_bill_h.def10 = #{def10}</if>
<if test="create_time != null">and fe_claim_bill_h.create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and fe_claim_bill_h.create_user = #{createUser}</if>
<if test="modify_time != null">and fe_claim_bill_h.modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and fe_claim_bill_h.modify_user = #{modifyUser}</if>
and fe_claim_bill_h.sts='Y'
</trim>
<if test="pushStatus != null and 1 == pushStatus">AND fe_claim_bill_h.bip_bill_id IS NOT NULL</if>
<if test="pushStatus != null and 0 == pushStatus">AND fe_claim_bill_h.bip_bill_id IS NULL</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
select count(1) from fe_claim_bill_h
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="claimType != null and claimType != ''">and claim_type = #{claimType}</if>
<if test="businessType != null and businessType != ''">and business_type = #{businessType}</if>
<if test="billCode != null and billCode != ''">and bill_code = #{billCode}</if>
<if test="billData != null and billData != ''">and bill_data = #{billData}</if>
<if test="sourceId != null and sourceId != ''">and source_id = #{sourceId}</if>
<if test="bipBillId != null and bipBillId != ''">and bip_bill_id = #{bipBillId}</if>
<if test="bipBillCode != null and bipBillCode != ''">and bip_bill_code = #{bipBillCode}</if>
<if test="businessFlow != null and businessFlow != ''">and business_flow = #{businessFlow}</if>
<if test="customerId != null and customerId != ''">and customer_id = #{customerId}</if>
<if test="customerCode != null and customerCode != ''">and customer_code = #{customerCode}</if>
<if test="customerName != null and customerName != ''">and customer_name = #{customerName}</if>
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
<if test="deptCode != null and deptCode != ''">and dept_code = #{deptCode}</if>
<if test="deptName != null and deptName != ''">and dept_name = #{deptName}</if>
<if test="supplierId != null and supplierId != ''">and supplier_id = #{supplierId}</if>
<if test="supplierCode != null and supplierCode != ''">and supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''">and supplier_name = #{supplierName}</if>
<if test="isAutoClaim != null and isAutoClaim != ''">and is_auto_claim = #{isAutoClaim}</if>
<if test="claimUserId != null and claimUserId != ''">and claim_user_id = #{claimUserId}</if>
<if test="bankId != null and bankId != ''">and bank_id = #{bankId}</if>
<if test="bankCode != null and bankCode != ''">and bank_code = #{bankCode}</if>
<if test="bankName != null and bankName != ''">and bank_name = #{bankName}</if>
<if test="bankNum != null and bankNum != ''">and bank_num = #{bankNum}</if>
<if test="financeOrgId != null and financeOrgId != ''">and finance_org_id = #{financeOrgId}</if>
<if test="financeOrgCode != null and financeOrgCode != ''">and finance_org_code = #{financeOrgCode}</if>
<if test="financeOrgName != null and financeOrgName != ''">and finance_org_name = #{financeOrgName}</if>
<if test="wldxId != null and wldxId != ''">and wldx_id = #{wldxId}</if>
<if test="wldxCode != null and wldxCode != ''">and wldx_code = #{wldxCode}</if>
<if test="wldxName != null and wldxName != ''">and wldx_name = #{wldxName}</if>
<if test="claimSum != null and claimSum != ''">and claim_sum = #{claimSum}</if>
<if test="jsfs != null and jsfs != ''">and jsfs = #{jsfs}</if>
<if test="fkBank != null and fkBank != ''">and fk_bank = #{fkBank}</if>
<if test="skBank != null and skBank != ''">and sk_bank = #{skBank}</if>
<if test="xjBank != null and xjBank != ''">and xj_bank = #{xjBank}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-FeClaimBillHEntity-result"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
select
<include refid="FeClaimBillHEntity_Base_Column_List"/>
from fe_claim_bill_h
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id like concat('%',#{id},'%')</if>
<if test="claimType != null and claimType != ''">and claim_type like concat('%',#{claimType},'%')</if>
<if test="businessType != null and businessType != ''">and business_type like
concat('%',#{businessType},'%')
</if>
<if test="billCode != null and billCode != ''">and bill_code like concat('%',#{billCode},'%')</if>
<if test="billData != null and billData != ''">and bill_data like concat('%',#{billData},'%')</if>
<if test="sourceId != null and sourceId != ''">and source_id like concat('%',#{sourceId},'%')</if>
<if test="bipBillId != null and bipBillId != ''">and bip_bill_id like concat('%',#{bipBillId},'%')</if>
<if test="bipBillCode != null and bipBillCode != ''">and bip_bill_code like concat('%',#{bipBillCode},'%')
</if>
<if test="businessFlow != null and businessFlow != ''">and business_flow like
concat('%',#{businessFlow},'%')
</if>
<if test="customerId != null and customerId != ''">and customer_id like concat('%',#{customerId},'%')</if>
<if test="customerCode != null and customerCode != ''">and customer_code like
concat('%',#{customerCode},'%')
</if>
<if test="customerName != null and customerName != ''">and customer_name like
concat('%',#{customerName},'%')
</if>
<if test="deptId != null and deptId != ''">and dept_id like concat('%',#{deptId},'%')</if>
<if test="deptCode != null and deptCode != ''">and dept_code like concat('%',#{deptCode},'%')</if>
<if test="deptName != null and deptName != ''">and dept_name like concat('%',#{deptName},'%')</if>
<if test="supplierId != null and supplierId != ''">and supplier_id like concat('%',#{supplierId},'%')</if>
<if test="supplierCode != null and supplierCode != ''">and supplier_code like
concat('%',#{supplierCode},'%')
</if>
<if test="supplierName != null and supplierName != ''">and supplier_name like
concat('%',#{supplierName},'%')
</if>
<if test="isAutoClaim != null and isAutoClaim != ''">and is_auto_claim like concat('%',#{isAutoClaim},'%')
</if>
<if test="claimUserId != null and claimUserId != ''">and claim_user_id like concat('%',#{claimUserId},'%')
</if>
<if test="bankId != null and bankId != ''">and bank_id like concat('%',#{bankId},'%')</if>
<if test="bankCode != null and bankCode != ''">and bank_code like concat('%',#{bankCode},'%')</if>
<if test="bankName != null and bankName != ''">and bank_name like concat('%',#{bankName},'%')</if>
<if test="bankNum != null and bankNum != ''">and bank_num like concat('%',#{bankNum},'%')</if>
<if test="financeOrgId != null and financeOrgId != ''">and finance_org_id like
concat('%',#{financeOrgId},'%')
</if>
<if test="financeOrgCode != null and financeOrgCode != ''">and finance_org_code like
concat('%',#{financeOrgCode},'%')
</if>
<if test="financeOrgName != null and financeOrgName != ''">and finance_org_name like
concat('%',#{financeOrgName},'%')
</if>
<if test="wldxId != null and wldxId != ''">and wldx_id like concat('%',#{wldxId},'%')</if>
<if test="wldxCode != null and wldxCode != ''">and wldx_code like concat('%',#{wldxCode},'%')</if>
<if test="wldxName != null and wldxName != ''">and wldx_name like concat('%',#{wldxName},'%')</if>
<if test="claimSum != null and claimSum != ''">and claim_sum like concat('%',#{claimSum},'%')</if>
<if test="jsfs != null and jsfs != ''">and jsfs like concat('%',#{jsfs},'%')</if>
<if test="fkBank != null and fkBank != ''">and fk_bank like concat('%',#{fkBank},'%')</if>
<if test="skBank != null and skBank != ''">and sk_bank like concat('%',#{skBank},'%')</if>
<if test="xjBank != null and xjBank != ''">and xj_bank like concat('%',#{xjBank},'%')</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
<if test="def1 != null and def1 != ''">and def1 like concat('%',#{def1},'%')</if>
<if test="def2 != null and def2 != ''">and def2 like concat('%',#{def2},'%')</if>
<if test="def3 != null and def3 != ''">and def3 like concat('%',#{def3},'%')</if>
<if test="def4 != null and def4 != ''">and def4 like concat('%',#{def4},'%')</if>
<if test="def5 != null and def5 != ''">and def5 like concat('%',#{def5},'%')</if>
<if test="def6 != null and def6 != ''">and def6 like concat('%',#{def6},'%')</if>
<if test="def7 != null and def7 != ''">and def7 like concat('%',#{def7},'%')</if>
<if test="def8 != null and def8 != ''">and def8 like concat('%',#{def8},'%')</if>
<if test="def9 != null and def9 != ''">and def9 like concat('%',#{def9},'%')</if>
<if test="def10 != null and def10 != ''">and def10 like concat('%',#{def10},'%')</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="createUser != null and createUser != ''">and create_user like concat('%',#{createUser},'%')</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user like concat('%',#{modifyUser},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
and sts='Y'
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="FeClaimBillHentity_list_or" resultMap="get-FeClaimBillHEntity-result"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
select
<include refid="FeClaimBillHEntity_Base_Column_List"/>
from fe_claim_bill_h
<trim prefix="where" prefixOverrides="and">
<if test="id != null">or id = #{id}</if>
<if test="claimType != null and claimType != ''">or claim_type = #{claimType}</if>
<if test="businessType != null and businessType != ''">or business_type = #{businessType}</if>
<if test="billCode != null and billCode != ''">or bill_code = #{billCode}</if>
<if test="billData != null and billData != ''">or bill_data = #{billData}</if>
<if test="sourceId != null and sourceId != ''">or source_id = #{sourceId}</if>
<if test="bipBillId != null and bipBillId != ''">or bip_bill_id = #{bipBillId}</if>
<if test="bipBillCode != null and bipBillCode != ''">or bip_bill_code = #{bipBillCode}</if>
<if test="businessFlow != null and businessFlow != ''">or business_flow = #{businessFlow}</if>
<if test="customerId != null and customerId != ''">or customer_id = #{customerId}</if>
<if test="customerCode != null and customerCode != ''">or customer_code = #{customerCode}</if>
<if test="customerName != null and customerName != ''">or customer_name = #{customerName}</if>
<if test="deptId != null and deptId != ''">or dept_id = #{deptId}</if>
<if test="deptCode != null and deptCode != ''">or dept_code = #{deptCode}</if>
<if test="deptName != null and deptName != ''">or dept_name = #{deptName}</if>
<if test="supplierId != null and supplierId != ''">or supplier_id = #{supplierId}</if>
<if test="supplierCode != null and supplierCode != ''">or supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''">or supplier_name = #{supplierName}</if>
<if test="isAutoClaim != null and isAutoClaim != ''">or is_auto_claim = #{isAutoClaim}</if>
<if test="claimUserId != null and claimUserId != ''">or claim_user_id = #{claimUserId}</if>
<if test="bankId != null and bankId != ''">or bank_id = #{bankId}</if>
<if test="bankCode != null and bankCode != ''">or bank_code = #{bankCode}</if>
<if test="bankName != null and bankName != ''">or bank_name = #{bankName}</if>
<if test="bankNum != null and bankNum != ''">or bank_num = #{bankNum}</if>
<if test="financeOrgId != null and financeOrgId != ''">or finance_org_id = #{financeOrgId}</if>
<if test="financeOrgCode != null and financeOrgCode != ''">or finance_org_code = #{financeOrgCode}</if>
<if test="financeOrgName != null and financeOrgName != ''">or finance_org_name = #{financeOrgName}</if>
<if test="wldxId != null and wldxId != ''">or wldx_id = #{wldxId}</if>
<if test="wldxCode != null and wldxCode != ''">or wldx_code = #{wldxCode}</if>
<if test="wldxName != null and wldxName != ''">or wldx_name = #{wldxName}</if>
<if test="claimSum != null and claimSum != ''">or claim_sum = #{claimSum}</if>
<if test="jsfs != null and jsfs != ''">or jsfs = #{jsfs}</if>
<if test="fkBank != null and fkBank != ''">or fk_bank = #{fkBank}</if>
<if test="skBank != null and skBank != ''">or sk_bank = #{skBank}</if>
<if test="xjBank != null and xjBank != ''">or xj_bank = #{xjBank}</if>
<if test="remark != null and remark != ''">or remark = #{remark}</if>
<if test="def1 != null and def1 != ''">or def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">or def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">or def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">or def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">or def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">or def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">or def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">or def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">or def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">or def10 = #{def10}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">or create_user = #{createUser}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">or modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity" keyProperty="id"
useGeneratedKeys="true">
insert into fe_claim_bill_h(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="claimType != null and claimType != ''">claim_type ,</if>
<if test="businessType != null and businessType != ''">business_type ,</if>
<if test="billCode != null and billCode != ''">bill_code ,</if>
<if test="billData != null and billData != ''">bill_data ,</if>
<if test="sourceId != null and sourceId != ''">source_id ,</if>
<if test="bipBillId != null and bipBillId != ''">bip_bill_id ,</if>
<if test="bipBillCode != null and bipBillCode != ''">bip_bill_code ,</if>
<if test="businessFlow != null and businessFlow != ''">business_flow ,</if>
<if test="customerId != null and customerId != ''">customer_id ,</if>
<if test="customerCode != null and customerCode != ''">customer_code ,</if>
<if test="customerName != null and customerName != ''">customer_name ,</if>
<if test="deptId != null and deptId != ''">dept_id ,</if>
<if test="deptCode != null and deptCode != ''">dept_code ,</if>
<if test="deptName != null and deptName != ''">dept_name ,</if>
<if test="supplierId != null and supplierId != ''">supplier_id ,</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code ,</if>
<if test="supplierName != null and supplierName != ''">supplier_name ,</if>
<if test="isAutoClaim != null and isAutoClaim != ''">is_auto_claim ,</if>
<if test="claimUserId != null and claimUserId != ''">claim_user_id ,</if>
<if test="bankId != null and bankId != ''">bank_id ,</if>
<if test="bankCode != null and bankCode != ''">bank_code ,</if>
<if test="bankName != null and bankName != ''">bank_name ,</if>
<if test="bankNum != null and bankNum != ''">bank_num ,</if>
<if test="financeOrgId != null and financeOrgId != ''">finance_org_id ,</if>
<if test="financeOrgCode != null and financeOrgCode != ''">finance_org_code ,</if>
<if test="financeOrgName != null and financeOrgName != ''">finance_org_name ,</if>
<if test="wldxId != null and wldxId != ''">wldx_id ,</if>
<if test="wldxCode != null and wldxCode != ''">wldx_code ,</if>
<if test="wldxName != null and wldxName != ''">wldx_name ,</if>
<if test="claimSum != null and claimSum != ''">claim_sum ,</if>
<if test="jsfs != null and jsfs != ''">jsfs ,</if>
<if test="fkBank != null and fkBank != ''">fk_bank ,</if>
<if test="skBank != null and skBank != ''">sk_bank ,</if>
<if test="xjBank != null and xjBank != ''">xj_bank ,</if>
<if test="remark != null and remark != ''">remark ,</if>
<if test="def1 != null and def1 != ''">def1 ,</if>
<if test="def2 != null and def2 != ''">def2 ,</if>
<if test="def3 != null and def3 != ''">def3 ,</if>
<if test="def4 != null and def4 != ''">def4 ,</if>
<if test="def5 != null and def5 != ''">def5 ,</if>
<if test="def6 != null and def6 != ''">def6 ,</if>
<if test="def7 != null and def7 != ''">def7 ,</if>
<if test="def8 != null and def8 != ''">def8 ,</if>
<if test="def9 != null and def9 != ''">def9 ,</if>
<if test="def10 != null and def10 != ''">def10 ,</if>
<if test="create_time != null">create_time ,</if>
<if test="create_time == null">create_time ,</if>
<if test="createUser != null and createUser != ''">create_user ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="modify_time == null">modify_time ,</if>
<if test="modifyUser != null and modifyUser != ''">modify_user ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="claimType != null and claimType != ''">#{claimType} ,</if>
<if test="businessType != null and businessType != ''">#{businessType} ,</if>
<if test="billCode != null and billCode != ''">#{billCode} ,</if>
<if test="billData != null and billData != ''">#{billData} ,</if>
<if test="sourceId != null and sourceId != ''">#{sourceId} ,</if>
<if test="bipBillId != null and bipBillId != ''">#{bipBillId} ,</if>
<if test="bipBillCode != null and bipBillCode != ''">#{bipBillCode} ,</if>
<if test="businessFlow != null and businessFlow != ''">#{businessFlow} ,</if>
<if test="customerId != null and customerId != ''">#{customerId} ,</if>
<if test="customerCode != null and customerCode != ''">#{customerCode} ,</if>
<if test="customerName != null and customerName != ''">#{customerName} ,</if>
<if test="deptId != null and deptId != ''">#{deptId} ,</if>
<if test="deptCode != null and deptCode != ''">#{deptCode} ,</if>
<if test="deptName != null and deptName != ''">#{deptName} ,</if>
<if test="supplierId != null and supplierId != ''">#{supplierId} ,</if>
<if test="supplierCode != null and supplierCode != ''">#{supplierCode} ,</if>
<if test="supplierName != null and supplierName != ''">#{supplierName} ,</if>
<if test="isAutoClaim != null and isAutoClaim != ''">#{isAutoClaim} ,</if>
<if test="claimUserId != null and claimUserId != ''">#{claimUserId} ,</if>
<if test="bankId != null and bankId != ''">#{bankId} ,</if>
<if test="bankCode != null and bankCode != ''">#{bankCode} ,</if>
<if test="bankName != null and bankName != ''">#{bankName} ,</if>
<if test="bankNum != null and bankNum != ''">#{bankNum} ,</if>
<if test="financeOrgId != null and financeOrgId != ''">#{financeOrgId} ,</if>
<if test="financeOrgCode != null and financeOrgCode != ''">#{financeOrgCode} ,</if>
<if test="financeOrgName != null and financeOrgName != ''">#{financeOrgName} ,</if>
<if test="wldxId != null and wldxId != ''">#{wldxId} ,</if>
<if test="wldxCode != null and wldxCode != ''">#{wldxCode} ,</if>
<if test="wldxName != null and wldxName != ''">#{wldxName} ,</if>
<if test="claimSum != null and claimSum != ''">#{claimSum} ,</if>
<if test="jsfs != null and jsfs != ''">#{jsfs} ,</if>
<if test="fkBank != null and fkBank != ''">#{fkBank} ,</if>
<if test="skBank != null and skBank != ''">#{skBank} ,</if>
<if test="xjBank != null and xjBank != ''">#{xjBank} ,</if>
<if test="remark != null and remark != ''">#{remark} ,</if>
<if test="def1 != null and def1 != ''">#{def1} ,</if>
<if test="def2 != null and def2 != ''">#{def2} ,</if>
<if test="def3 != null and def3 != ''">#{def3} ,</if>
<if test="def4 != null and def4 != ''">#{def4} ,</if>
<if test="def5 != null and def5 != ''">#{def5} ,</if>
<if test="def6 != null and def6 != ''">#{def6} ,</if>
<if test="def7 != null and def7 != ''">#{def7} ,</if>
<if test="def8 != null and def8 != ''">#{def8} ,</if>
<if test="def9 != null and def9 != ''">#{def9} ,</if>
<if test="def10 != null and def10 != ''">#{def10} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="create_time == null">now() ,</if>
<if test="createUser != null and createUser != ''">#{createUser} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="modify_time == null">now() ,</if>
<if test="modifyUser != null and modifyUser != ''">#{modifyUser} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_claim_bill_h(claim_type, business_type, bill_code, bill_data, bip_bill_id, bip_bill_code,
business_flow, customer_id, customer_code, customer_name, dept_id, dept_code, dept_name, supplier_id,
supplier_code, supplier_name, is_auto_claim, claim_user_id, bank_id, bank_code, bank_name, bank_num,
finance_org_id, finance_org_code, finance_org_name, wldx_id, wldx_code, wldx_name, claim_sum, jsfs, fk_bank,
sk_bank, xj_bank, remark, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, create_time, create_user,
modify_time, modify_user, sts, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.claimType},#{entity.businessType},#{entity.billCode},#{entity.billData},#{entity.bipBillId},#{entity.bipBillCode},#{entity.businessFlow},#{entity.customerId},#{entity.customerCode},#{entity.customerName},#{entity.deptId},#{entity.deptCode},#{entity.deptName},#{entity.supplierId},#{entity.supplierCode},#{entity.supplierName},#{entity.isAutoClaim},#{entity.claimUserId},#{entity.bankId},#{entity.bankCode},#{entity.bankName},#{entity.bankNum},#{entity.financeOrgId},#{entity.financeOrgCode},#{entity.financeOrgName},#{entity.wldxId},#{entity.wldxCode},#{entity.wldxName},#{entity.claimSum},#{entity.jsfs},#{entity.fkBank},#{entity.skBank},#{entity.xjBank},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_claim_bill_h(claim_type, business_type, bill_code, bill_data, bip_bill_id, bip_bill_code,
business_flow, customer_id, customer_code, customer_name, dept_id, dept_code, dept_name, supplier_id,
supplier_code, supplier_name, is_auto_claim, claim_user_id, bank_id, bank_code, bank_name, bank_num,
finance_org_id, finance_org_code, finance_org_name, wldx_id, wldx_code, wldx_name, claim_sum, jsfs, fk_bank,
sk_bank, xj_bank, remark, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, create_time, create_user,
modify_time, modify_user, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.claimType},#{entity.businessType},#{entity.billCode},#{entity.billData},#{entity.bipBillId},#{entity.bipBillCode},#{entity.businessFlow},#{entity.customerId},#{entity.customerCode},#{entity.customerName},#{entity.deptId},#{entity.deptCode},#{entity.deptName},#{entity.supplierId},#{entity.supplierCode},#{entity.supplierName},#{entity.isAutoClaim},#{entity.claimUserId},#{entity.bankId},#{entity.bankCode},#{entity.bankName},#{entity.bankNum},#{entity.financeOrgId},#{entity.financeOrgCode},#{entity.financeOrgName},#{entity.wldxId},#{entity.wldxCode},#{entity.wldxName},#{entity.claimSum},#{entity.jsfs},#{entity.fkBank},#{entity.skBank},#{entity.xjBank},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts})
</foreach>
on duplicate key update
claim_type = values(claim_type),
business_type = values(business_type),
bill_code = values(bill_code),
bill_data = values(bill_data),
bip_bill_id = values(bip_bill_id),
bip_bill_code = values(bip_bill_code),
business_flow = values(business_flow),
customer_id = values(customer_id),
customer_code = values(customer_code),
customer_name = values(customer_name),
dept_id = values(dept_id),
dept_code = values(dept_code),
dept_name = values(dept_name),
supplier_id = values(supplier_id),
supplier_code = values(supplier_code),
supplier_name = values(supplier_name),
is_auto_claim = values(is_auto_claim),
claim_user_id = values(claim_user_id),
bank_id = values(bank_id),
bank_code = values(bank_code),
bank_name = values(bank_name),
bank_num = values(bank_num),
finance_org_id = values(finance_org_id),
finance_org_code = values(finance_org_code),
finance_org_name = values(finance_org_name),
wldx_id = values(wldx_id),
wldx_code = values(wldx_code),
wldx_name = values(wldx_name),
claim_sum = values(claim_sum),
jsfs = values(jsfs),
fk_bank = values(fk_bank),
sk_bank = values(sk_bank),
xj_bank = values(xj_bank),
remark = values(remark),
def1 = values(def1),
def2 = values(def2),
def3 = values(def3),
def4 = values(def4),
def5 = values(def5),
def6 = values(def6),
def7 = values(def7),
def8 = values(def8),
def9 = values(def9),
def10 = values(def10),
create_time = values(create_time),
create_user = values(create_user),
modify_time = values(modify_time),
modify_user = values(modify_user),
sts = values(sts)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
update fe_claim_bill_h set
<trim suffix="" suffixOverrides=",">
<if test="claimType != null and claimType != ''">claim_type = #{claimType},</if>
<if test="businessType != null and businessType != ''">business_type = #{businessType},</if>
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
<if test="billData != null and billData != ''">bill_data = #{billData},</if>
<if test="sourceId != null and sourceId != ''">source_id = #{sourceId},</if>
<if test="bipBillId != null and bipBillId != ''">bip_bill_id = #{bipBillId},</if>
<if test="bipBillCode != null and bipBillCode != ''">bip_bill_code = #{bipBillCode},</if>
<if test="businessFlow != null and businessFlow != ''">business_flow = #{businessFlow},</if>
<if test="customerId != null and customerId != ''">customer_id = #{customerId},</if>
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
<if test="deptCode != null and deptCode != ''">dept_code = #{deptCode},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="supplierId != null and supplierId != ''">supplier_id = #{supplierId},</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
<if test="isAutoClaim != null and isAutoClaim != ''">is_auto_claim = #{isAutoClaim},</if>
<if test="claimUserId != null and claimUserId != ''">claim_user_id = #{claimUserId},</if>
<if test="bankId != null and bankId != ''">bank_id = #{bankId},</if>
<if test="bankCode != null and bankCode != ''">bank_code = #{bankCode},</if>
<if test="bankName != null and bankName != ''">bank_name = #{bankName},</if>
<if test="bankNum != null and bankNum != ''">bank_num = #{bankNum},</if>
<if test="financeOrgId != null and financeOrgId != ''">finance_org_id = #{financeOrgId},</if>
<if test="financeOrgCode != null and financeOrgCode != ''">finance_org_code = #{financeOrgCode},</if>
<if test="financeOrgName != null and financeOrgName != ''">finance_org_name = #{financeOrgName},</if>
<if test="wldxId != null and wldxId != ''">wldx_id = #{wldxId},</if>
<if test="wldxCode != null and wldxCode != ''">wldx_code = #{wldxCode},</if>
<if test="wldxName != null and wldxName != ''">wldx_name = #{wldxName},</if>
<if test="claimSum != null and claimSum != ''">claim_sum = #{claimSum},</if>
<if test="jsfs != null and jsfs != ''">jsfs = #{jsfs},</if>
<if test="fkBank != null and fkBank != ''">fk_bank = #{fkBank},</if>
<if test="skBank != null and skBank != ''">sk_bank = #{skBank},</if>
<if test="xjBank != null and xjBank != ''">xj_bank = #{xjBank},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="def1 != null and def1 != ''">def1 = #{def1},</if>
<if test="def2 != null and def2 != ''">def2 = #{def2},</if>
<if test="def3 != null and def3 != ''">def3 = #{def3},</if>
<if test="def4 != null and def4 != ''">def4 = #{def4},</if>
<if test="def5 != null and def5 != ''">def5 = #{def5},</if>
<if test="def6 != null and def6 != ''">def6 = #{def6},</if>
<if test="def7 != null and def7 != ''">def7 = #{def7},</if>
<if test="def8 != null and def8 != ''">def8 = #{def8},</if>
<if test="def9 != null and def9 != ''">def9 = #{def9},</if>
<if test="def10 != null and def10 != ''">def10 = #{def10},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="createUser != null and createUser != ''">create_user = #{createUser},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="modify_time == null">modify_time = now(),</if>
<if test="modifyUser != null and modifyUser != ''">modify_user = #{modifyUser},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
update fe_claim_bill_h
set sts= 'N',
modify_time = now()
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
update fe_claim_bill_h set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="claimType != null and claimType != ''">and claim_type = #{claimType}</if>
<if test="businessType != null and businessType != ''">and business_type = #{businessType}</if>
<if test="billCode != null and billCode != ''">and bill_code = #{billCode}</if>
<if test="billData != null and billData != ''">and bill_data = #{billData}</if>
<if test="sourceId != null and sourceId != ''">and source_id = #{sourceId}</if>
<if test="bipBillId != null and bipBillId != ''">and bip_bill_id = #{bipBillId}</if>
<if test="bipBillCode != null and bipBillCode != ''">and bip_bill_code = #{bipBillCode}</if>
<if test="businessFlow != null and businessFlow != ''">and business_flow = #{businessFlow}</if>
<if test="customerId != null and customerId != ''">and customer_id = #{customerId}</if>
<if test="customerCode != null and customerCode != ''">and customer_code = #{customerCode}</if>
<if test="customerName != null and customerName != ''">and customer_name = #{customerName}</if>
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
<if test="deptCode != null and deptCode != ''">and dept_code = #{deptCode}</if>
<if test="deptName != null and deptName != ''">and dept_name = #{deptName}</if>
<if test="supplierId != null and supplierId != ''">and supplier_id = #{supplierId}</if>
<if test="supplierCode != null and supplierCode != ''">and supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''">and supplier_name = #{supplierName}</if>
<if test="isAutoClaim != null and isAutoClaim != ''">and is_auto_claim = #{isAutoClaim}</if>
<if test="claimUserId != null and claimUserId != ''">and claim_user_id = #{claimUserId}</if>
<if test="bankId != null and bankId != ''">and bank_id = #{bankId}</if>
<if test="bankCode != null and bankCode != ''">and bank_code = #{bankCode}</if>
<if test="bankName != null and bankName != ''">and bank_name = #{bankName}</if>
<if test="bankNum != null and bankNum != ''">and bank_num = #{bankNum}</if>
<if test="financeOrgId != null and financeOrgId != ''">and finance_org_id = #{financeOrgId}</if>
<if test="financeOrgCode != null and financeOrgCode != ''">and finance_org_code = #{financeOrgCode}</if>
<if test="financeOrgName != null and financeOrgName != ''">and finance_org_name = #{financeOrgName}</if>
<if test="wldxId != null and wldxId != ''">and wldx_id = #{wldxId}</if>
<if test="wldxCode != null and wldxCode != ''">and wldx_code = #{wldxCode}</if>
<if test="wldxName != null and wldxName != ''">and wldx_name = #{wldxName}</if>
<if test="claimSum != null and claimSum != ''">and claim_sum = #{claimSum}</if>
<if test="jsfs != null and jsfs != ''">and jsfs = #{jsfs}</if>
<if test="fkBank != null and fkBank != ''">and fk_bank = #{fkBank}</if>
<if test="skBank != null and skBank != ''">and sk_bank = #{skBank}</if>
<if test="xjBank != null and xjBank != ''">and xj_bank = #{xjBank}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from fe_claim_bill_h
where id = #{id}
</delete>
<update id="updateBipBillIdAndCodeById" parameterType="com.hzya.frame.finance.claim.entity.FeClaimBillHEntity">
update fe_claim_bill_h set bip_bill_id = null, bip_bill_code = null where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,26 @@
package com.hzya.frame.finance.claim.service;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.mdm.entity.MdmViewVo;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import java.util.List;
import java.util.Map;
/**
* Created by zydd on 2025-08-20 17:20
*/
public interface IClaimSKService {
PageInfo queryDataMapPagedByMdmId(MdmDBQueryVO entity);
MdmViewVo queryFlowFileds(MdmDBQueryVO entity);
PageInfo queryFlowDatePaged(MdmDBQueryVO entity);
List<Map<String, Object>> queryFlowDateIds(MdmDBQueryVO entity);
FeClaimBillHEntity autoCollection(MdmDBQueryVO entity);
List<Map<String, Object>> queryFlowDataByDate(MdmDBQueryVO mdmDBQueryVO);
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.finance.claim.service;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.claim.entity.ClaimVO;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import java.util.List;
/**
* Created by zydd on 2025-08-25 14:32
*/
public interface IClaimService {
List<FeClaimBillHEntity> queryAll(ClaimVO vo);
FeClaimBillHEntity queryById(ClaimVO vo);
PageInfo queryPaged(ClaimVO vo);
FeClaimBillHEntity generate(FeClaimBillHEntity vo);
String back(String id);
String push(String id);
String cancel(String id);
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.finance.claim.service;
import com.hzya.frame.finance.claim.entity.FeClaimBillBEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* 财资事项(finance_event)-付款认领单-b(FeClaimBillB)表服务接口
*
* @author zydd
* @since 2025-08-26 11:20:55
*/
public interface IFeClaimBillBService extends IBaseService<FeClaimBillBEntity, String>{
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.finance.claim.service;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* 财资事项(finance_event)-付款认领单-h(FeClaimBillH)表服务接口
*
* @author zydd
* @since 2025-08-26 11:18:08
*/
public interface IFeClaimBillHService extends IBaseService<FeClaimBillHEntity, String>{
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.finance.claim.service.impl;
import com.hzya.frame.finance.claim.entity.FeClaimBillBEntity;
import com.hzya.frame.finance.claim.dao.IFeClaimBillBDao;
import com.hzya.frame.finance.claim.service.IFeClaimBillBService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* 财资事项(finance_event)-付款认领单-b(FeClaimBillB)表服务实现类
*
* @author zydd
* @since 2025-08-26 11:20:55
*/
@Service
public class FeClaimBillBServiceImpl extends BaseService<FeClaimBillBEntity, String> implements IFeClaimBillBService {
private IFeClaimBillBDao feClaimBillBDao;
@Autowired
public void setFeClaimBillBDao(IFeClaimBillBDao dao) {
this.feClaimBillBDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.finance.claim.service.impl;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.finance.claim.dao.IFeClaimBillHDao;
import com.hzya.frame.finance.claim.service.IFeClaimBillHService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* 财资事项(finance_event)-付款认领单-h(FeClaimBillH)表服务实现类
*
* @author zydd
* @since 2025-08-26 11:18:08
*/
@Service
public class FeClaimBillHServiceImpl extends BaseService<FeClaimBillHEntity, String> implements IFeClaimBillHService {
private IFeClaimBillHDao feClaimBillHDao;
@Autowired
public void setFeClaimBillHDao(IFeClaimBillHDao dao) {
this.feClaimBillHDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,348 @@
package com.hzya.frame.finance.claim.service.impl;
import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.lang.Assert;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.finance.claim.service.IClaimSKService;
import com.hzya.frame.finance.flow.dao.IMdmKkBankflowGtsDao;
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
import com.hzya.frame.mdm.entity.MdmViewVo;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
import com.hzya.frame.sysnew.person.dao.ISysPersonDao;
import com.hzya.frame.sysnew.person.entity.SysPersonEntity;
import com.hzya.frame.sysnew.user.dao.ISysUserDao;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO;
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDbFiledVODAO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import com.hzya.frame.voucher.ae.comf.subject.dao.IAeConfSubjectContrastBDao;
import com.hzya.frame.voucher.ae.comf.subject.dao.IAeConfSubjectContrastDao;
import com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity;
import com.hzya.frame.voucher.ae.generate.core.vo.CreateVoucherVO;
import com.hzya.frame.voucher.ae.push.service.IAePushVoucherLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by zydd on 2025-08-26 10:51
*/
@Service
public class IClaimSKServiceImpl implements IClaimSKService {
public static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@Autowired
private IMdmModuleDao mdmModuleDao;
@Autowired
private IMdmModuleDbDao mdmModuleDbDao;
@Autowired
private IMdmDBQueryVODAO mdmDBQueryVODAO;
@Autowired
private IMdmDbFiledVODAO mdmDbFiledVODAO;
@Autowired
private IAePushVoucherLogService aePushVoucherLogService;
@Autowired
private IMdmKkBankflowGtsDao kkBankflowGtsDao;
@Autowired
private ISysUserDao sysUserDao;
@Autowired
private ISysPersonDao sysPersonDao;
@Autowired
private IAeConfSubjectContrastDao contrastDao;
@Autowired
private IAeConfSubjectContrastBDao contrastBDao;
/**
* 目前写死 银行流水表 db_name:mdm_kk_bankflow_ccb
* 目前写死 银行流水表 mdm_id:60d0374c9fa743019b0c1488a4eac1fe
* @param entity
* @return
*/
@Override
public PageInfo queryDataMapPagedByMdmId(MdmDBQueryVO entity) {
List<Map<String, Object>> maps= mdmDBQueryVODAO.queryMdmDateBySK(entity);
return null;
}
@Override
public MdmViewVo queryFlowFileds(MdmDBQueryVO entity) {
CreateVoucherVO createVoucherVO = new CreateVoucherVO();
createVoucherVO.setMdmId("266e61002d7a4b0cadaf89fbcf30c7fd");
MdmViewVo mdmViewVo = aePushVoucherLogService.queryBillFileds(createVoucherVO);
return mdmViewVo;
}
@Override
public PageInfo queryFlowDatePaged(MdmDBQueryVO entity) {
entity.setTablename("mdm_kk_bankflow_gts");
if(entity.getBillstatus()!=null){
entity.setClaimstatus(entity.getBillstatus());
}
// prop1 对方账户 cnteracctno
if (entity.getPropValue1() != null && !"".equals(entity.getPropValue1().trim())) {
entity.setProp1("cnteracctno");
entity.setPropValue1(entity.getPropValue1().trim());
}
// prop2 对方户名 cnteracctname
if (entity.getPropValue2() != null && !"".equals(entity.getPropValue2().trim())) {
entity.setProp2("cnteracctname");
entity.setPropValue2(entity.getPropValue2().trim()); // 注意这里修正为 setPropValue2
}
// prop3 对方开户行 opnbnkinfo
if (entity.getPropValue3() != null && !"".equals(entity.getPropValue3().trim())) {
entity.setProp3("opnbnkinfo");
entity.setPropValue3(entity.getPropValue3().trim());
}
// prop4 交易时间 trantimep
// if (entity.getPropValue4() != null && !"".equals(entity.getPropValue4().trim())) {
// String[] split = entity.getPropValue4().split(",");
// entity.setProp4("trantimep");
// entity.setStartTime(split[0]);
// entity.setEndTime(split[1]);
// }
// prop5 交易金额 tranamt
if (entity.getPropValue5() != null && !"".equals(entity.getPropValue5().trim())) {
entity.setProp5("tranamt");
entity.setPropValue5(entity.getPropValue5().trim());
}
// prop6 用途 yt
if (entity.getPropValue6() != null && !"".equals(entity.getPropValue6().trim())) {
entity.setProp6("yt");
entity.setPropValue6(entity.getPropValue6().trim());
}
// prop7 附言 postscript
if (entity.getPropValue7() != null && !"".equals(entity.getPropValue7().trim())) {
entity.setProp7("postscript");
entity.setPropValue7(entity.getPropValue7().trim());
}
// prop8 摘要 zy
if (entity.getPropValue8() != null && !"".equals(entity.getPropValue8().trim())) {
entity.setProp8("zy");
entity.setPropValue8(entity.getPropValue8().trim());
}
// prop9 备注 remark
if (entity.getPropValue9() != null && !"".equals(entity.getPropValue9().trim())) {
entity.setProp9("remark");
entity.setPropValue9(entity.getPropValue9().trim());
}
//收款付款 outFlag=D/C
if(entity.getOutFlag()!=null&& !"".equals(entity.getOutFlag())){
entity.setOutFlag(entity.getOutFlag());
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<Map<String, Object>> maps= mdmDBQueryVODAO.queryMdmDateBySK(entity);
System.out.println(maps);
for (Map<String, Object> map : maps) {
String outflag = map.get("outflag").toString();
if("C".equals(outflag)){
map.put("outflagName","付款");
}
if("D".equals(outflag)){
map.put("outflagName","收款");
}
String claimstatus = map.get("claimstatus").toString();
if("Y".equals(claimstatus)){
map.put("claimstatusName","已认领");
}
if("N".equals(claimstatus)){
map.put("claimstatusName","未认领");
}
}
PageInfo pageInfo = new PageInfo(maps);
return pageInfo;
}
@Override
public List<Map<String, Object>> queryFlowDateIds(MdmDBQueryVO entity) {
entity.setTablename("mdm_kk_bankflow_gts");
List<Map<String, Object>> maps= mdmDBQueryVODAO.queryMdmDateBySK(entity);
return maps;
}
/**
* 自动归集
* 1根据对照表SK/FK 收款付款对照选择 收付款模板
* 2根据模板字段选择方案或者具体数值
* 3组装认领单
*/
@Override
public FeClaimBillHEntity autoCollection(MdmDBQueryVO vo) {
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
try {
//查询流水
String id = vo.getIds();
MdmKkBankflowGtsEntity mdmKkBankflowGtsEntity = new MdmKkBankflowGtsEntity();
mdmKkBankflowGtsEntity.setId(id);
List<MdmKkBankflowGtsEntity> bankflowGtsList = kkBankflowGtsDao.query(mdmKkBankflowGtsEntity);
if (bankflowGtsList.size() == 0) {
Assert.state(false, "根据流水id[{}],未查询到流水信息。", id);
}
MdmKkBankflowGtsEntity kkBankflow = bankflowGtsList.get(0);
System.out.println(kkBankflow);
if ("Y".equals(kkBankflow.getClaimstatus())) {
Assert.state(false, "自动归集失败流水已认领流水id{}。", id);
}
//根据对照表SK/FK 收款付款对照选择 收付款模板
//认领类型 SK/FK D-C- 转入/转出标志
String outflag = kkBankflow.getOutflag();
if ("D".equals(outflag)) {
feClaimBillHEntity.setClaimType("SK");
} else if ("C".equals(outflag)) {
feClaimBillHEntity.setClaimType("FK");
}
AeConfSubjectContrastEntity aeConfSubjectContrastEntity = new AeConfSubjectContrastEntity();
aeConfSubjectContrastEntity.setCode("SK/FK");
aeConfSubjectContrastEntity.setName("收款付款对照");
List<AeConfSubjectContrastEntity> contrastEntityList = contrastDao.query(aeConfSubjectContrastEntity);
System.out.println(contrastEntityList);
if(contrastEntityList.size()==0){
Assert.state(false,"根据编码:{},名称:{},未查到收付款模板","SK/FK","收款付款对照");
}
String contrastId = contrastEntityList.get(0).getId();
//认领日期
LocalDateTime now = LocalDateTime.now();
String billDate = now.format(formatter);
feClaimBillHEntity.setBillData(billDate);
//客户
String cnteracctname = kkBankflow.getCnteracctname();
feClaimBillHEntity.setCustomerName(cnteracctname);
//认领人
// SaTokenInfo tokenInfo = StpUtil.getTokenInfo();
// String token = tokenInfo.getTokenValue();
// Object loginIdByToken = StpUtil.getLoginIdByToken(token);
// System.out.println(loginIdByToken);
// SysUserEntity sysUserEntity = new SysUserEntity();
// sysUserEntity.setId(String.valueOf(loginIdByToken));
// List<SysUserEntity> userEntityList = sysUserDao.query(sysUserEntity);
// if(userEntityList.size()==0){
// Assert.state(false,"登录过期,请重新登录");
// }
// String personId = userEntityList.get(0).getPersonId();
// SysPersonEntity sysPersonEntity = new SysPersonEntity();
// sysPersonEntity.setId(personId);
// List<SysPersonEntity> personEntityList = sysPersonDao.query(sysPersonEntity);
// System.out.println(personEntityList.get(0).getMobilePhone());
// feClaimBillHEntity.setClaimUserId(personId);
// feClaimBillHEntity.setClaimUserCode(personEntityList.get(0).getPersonCode());
// feClaimBillHEntity.setClaimUserName(personEntityList.get(0).getPersonName());
feClaimBillHEntity.setClaimUserId("1");
feClaimBillHEntity.setClaimUserCode("admin");
feClaimBillHEntity.setClaimUserName("系统管理员");
//收款银行
feClaimBillHEntity.setBankName(kkBankflow.getOpnbnkinfo());
//收款银行账号
feClaimBillHEntity.setBankNum(kkBankflow.getCnteracctno());
//财务组织
//往来对象--
feClaimBillHEntity.setWldxName("客商");
//认领金额
feClaimBillHEntity.setClaimSum(kkBankflow.getTranamt());
List<Map<String,String>> dateList=new ArrayList<>();
Map<String,String> map=new HashMap<>();
dateList.add(map);
feClaimBillHEntity.setDetailList(dateList);
//摘要
feClaimBillHEntity.setZy(kkBankflow.getZy());
map.put("zy",kkBankflow.getZy());
//款项性质
map.put("nature",null);
//款项类别
map.put("type",null);
//币种
feClaimBillHEntity.setCurrencyName(kkBankflow.getCcy());
map.put("currencyName",kkBankflow.getCcy());
//金额
feClaimBillHEntity.setMoney(kkBankflow.getTranamt());
map.put("money",kkBankflow.getTranamt());
//描述说明
map.put("explain",null);
//来源单据号
String transeqno1 = kkBankflow.getTranseqno1();
feClaimBillHEntity.setSourceFlowBankId(transeqno1);
feClaimBillHEntity.setSourceId(kkBankflow.getId());
//流水交易时间
String trandate = kkBankflow.getTrandate();
String trantimep = kkBankflow.getTrantimep();
feClaimBillHEntity.setDef1(trandate + " " + trantimep);
//自动认领
feClaimBillHEntity.setIsAutoClaim("N");
if("N".equals(feClaimBillHEntity.getIsAutoClaim())){
feClaimBillHEntity.setIsAutoClaimName("");
}
}catch (Exception e){
e.printStackTrace();
Assert.state(false,"自动归集失败,失败原因:{}",e.getMessage());
}
return feClaimBillHEntity;
}
@Override
public List<Map<String, Object>> queryFlowDataByDate(MdmDBQueryVO vo) {
vo.setTablename("mdm_kk_bankflow_gts");
List<Map<String, Object>> maps= mdmDBQueryVODAO.queryFlowDataByDate(vo);
return maps;
}
}

View File

@ -0,0 +1,357 @@
package com.hzya.frame.finance.claim.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.lang.Assert;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.claim.dao.IFeClaimBillBDao;
import com.hzya.frame.finance.claim.dao.IFeClaimBillHDao;
import com.hzya.frame.finance.claim.entity.ClaimVO;
import com.hzya.frame.finance.claim.entity.FeClaimBillBEntity;
import com.hzya.frame.finance.claim.entity.FeClaimBillHEntity;
import com.hzya.frame.finance.claim.service.IClaimService;
import com.hzya.frame.finance.conf.billcode.dao.IFeConfBillcodeRuleDao;
import com.hzya.frame.finance.flow.dao.IMdmKkBankflowGtsDao;
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
import com.hzya.frame.finance.utils.ClaimBillCodeUtil;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
/**
* Created by zydd on 2025-08-25 14:32
* 认领单
*/
@Service
public class IClaimServiceImpl implements IClaimService {
@Autowired
private IFeClaimBillHDao claimBillHDao;
@Autowired
private IFeClaimBillBDao claimBillBDao;
@Autowired
private IMdmKkBankflowGtsDao kkBankflowGtsDao;
@Autowired
private ClaimBillCodeUtil claimBillCodeUtil;
@Override
public List<FeClaimBillHEntity> queryAll(ClaimVO vo) {
try {
Assert.notNull(vo.getBillType(), "查询全部认领单时:请传入单据类型。");
String billType = vo.getBillType();
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
feClaimBillHEntity.setClaimType(billType);
List<FeClaimBillHEntity> claimBillHEntityList = claimBillHDao.query(feClaimBillHEntity);
for (FeClaimBillHEntity claimBillHEntity : claimBillHEntityList) {
FeClaimBillBEntity feClaimBillBEntity = new FeClaimBillBEntity();
feClaimBillBEntity.setHId(Long.valueOf(claimBillHEntity.getId()));
List<FeClaimBillBEntity> claimBillBEntityList = claimBillBDao.query(feClaimBillBEntity);
claimBillHEntity.setBillBList(claimBillBEntityList);
}
return claimBillHEntityList;
} catch (Exception e) {
e.printStackTrace();
Assert.state(false, "查询全部认领单失败,失败原因:{}", e.getMessage());
}
return null;
}
@Override
public FeClaimBillHEntity queryById(ClaimVO vo) {
Assert.notNull(vo.getId(), "查询认领单时请传入单据id。");
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
feClaimBillHEntity.setId(vo.getId());
List<FeClaimBillHEntity> claimBillHEntityList = claimBillHDao.query(feClaimBillHEntity);
if (claimBillHEntityList.size() == 0) {
Assert.state(false, "根据id[{}],未查询到认领单信息。", vo.getId());
}
FeClaimBillHEntity feClaimBillH = claimBillHEntityList.get(0);
//明细
String Hid = feClaimBillH.getId();
FeClaimBillBEntity feClaimBillBEntity = new FeClaimBillBEntity();
feClaimBillBEntity.setHId(Long.valueOf(Hid));
List<FeClaimBillBEntity> feClaimBillBEntityList = claimBillBDao.query(feClaimBillBEntity);
if (feClaimBillBEntityList.size() == 0) {
return feClaimBillH;
}
FeClaimBillBEntity feClaimBillB = feClaimBillBEntityList.get(0);
List<Map<String, String>> dateList = new ArrayList<>();
Map<String, String> map = new HashMap<>();
dateList.add(map);
feClaimBillH.setDetailList(dateList);
//摘要
map.put("zy", feClaimBillB.getZy());
//款项性质
map.put("nature", feClaimBillB.getNature());
map.put("kxxz", feClaimBillB.getKxxz());
//款项类别
map.put("type", feClaimBillB.getType());
//币种
map.put("currencyName", feClaimBillB.getCurrencyName());
//金额
map.put("money", feClaimBillB.getMoney());
//描述说明
map.put("explain", feClaimBillB.getExplain());
map.put("bssm", feClaimBillB.getBssm());
map.put("wbfwf", feClaimBillB.getWbfwf());
return feClaimBillH;
}
@Override
public PageInfo queryPaged(ClaimVO vo) {
try {
// Assert.notNull(vo.getClaimType(), "查询全部认领单时:请传入单据类型。");
// String billType = vo.getBillType();
String claimType = vo.getClaimType();
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
feClaimBillHEntity.setPageNum(vo.getPageNum());
feClaimBillHEntity.setPageSize(vo.getPageSize());
feClaimBillHEntity.setClaimType(claimType);
String claimStatus = vo.getClaimStatus();
Integer pushStatus = vo.getPushStatus();
feClaimBillHEntity.setIsAutoClaim(vo.getIsAutoClaim());
feClaimBillHEntity.setPushStatus(pushStatus);
PageHelper.startPage(feClaimBillHEntity.getPageNum(), feClaimBillHEntity.getPageSize());
List<FeClaimBillHEntity> claimBillHEntityList = claimBillHDao.query(feClaimBillHEntity);
for (FeClaimBillHEntity claimBillHEntity : claimBillHEntityList) {
if (1 == claimBillHEntity.getPushStatus()) {
claimBillHEntity.setPushStatusName("已推送");
}
if (0 == claimBillHEntity.getPushStatus()) {
claimBillHEntity.setPushStatusName("未推送");
}
if ("SK".equals(claimBillHEntity.getClaimType())) {
claimBillHEntity.setClaimTypeName("收款");
}
if ("FK".equals(claimBillHEntity.getClaimType())) {
claimBillHEntity.setClaimTypeName("付款");
}
}
PageInfo pageInfo = new PageInfo(claimBillHEntityList);
return pageInfo;
} catch (Exception e) {
e.printStackTrace();
Assert.state(false, "分页查询全部认领单失败,失败原因:{}", e.getMessage());
}
return null;
}
/**
* 流水生成 - 生成认领单
* 1保存单号 流水单号-认领单号
* 2回写流水数据中的认领单号
* 3保存认领单
*/
@Override
public FeClaimBillHEntity generate(FeClaimBillHEntity feClaimBillHEntity) {
try {
System.out.println(feClaimBillHEntity);
// String id = vo.getId();
MdmKkBankflowGtsEntity mdmKkBankflowGtsEntity = new MdmKkBankflowGtsEntity();
mdmKkBankflowGtsEntity.setId(feClaimBillHEntity.getSourceId());
List<MdmKkBankflowGtsEntity> bankflowGtsList = kkBankflowGtsDao.query(mdmKkBankflowGtsEntity);
if (bankflowGtsList.size() == 0) {
Assert.state(false, "根据流水id[{}],未查询到流水信息。", feClaimBillHEntity.getSourceId());
}
MdmKkBankflowGtsEntity kkBankflow = bankflowGtsList.get(0);
System.out.println(kkBankflow);
//
if ("Y".equals(kkBankflow.getClaimstatus())) {
Assert.state(false, "流水已认领流水id{}。", feClaimBillHEntity.getSourceId());
}
//获取认领单单号
String claimBillCode = claimBillCodeUtil.saveBillCodeByTypeAndSourceCode(feClaimBillHEntity.getClaimType(), feClaimBillHEntity.getSourceId());
feClaimBillHEntity.setBillCode(claimBillCode);
feClaimBillHEntity.setIsAutoClaim("N");
//解析dataList
List<Map<String, String>> detailList = feClaimBillHEntity.getDetailList();
Map<String, String> map = detailList.get(0);
String zy = map.get("zy");//摘要
feClaimBillHEntity.setZy(zy);
String kxxz = map.get("kxxz");//款项性质
feClaimBillHEntity.setKxxz(kxxz);
String type = map.get("type");//款项类别
feClaimBillHEntity.setType(type);
String currencyName = map.get("currencyName");//币种
feClaimBillHEntity.setCurrencyName(currencyName);
String money = map.get("money");//金额
feClaimBillHEntity.setMoney(money);
String bssm = map.get("bssm");//描述说明
feClaimBillHEntity.setBssm(bssm);
String wbfwf = map.get("wbfwf");//外币服务费
feClaimBillHEntity.setWbfwf(wbfwf);
//保存认领单
FeClaimBillHEntity saveH = claimBillHDao.save(feClaimBillHEntity);
String Hid = saveH.getId();
//保存子表
FeClaimBillBEntity feClaimBillBEntity = new FeClaimBillBEntity();
feClaimBillBEntity.setHId(Long.valueOf(Hid));
feClaimBillBEntity.setZy(zy);
feClaimBillBEntity.setKxxz(kxxz);
feClaimBillBEntity.setType(type);
feClaimBillBEntity.setCurrencyName(currencyName);
feClaimBillBEntity.setMoney(money);
feClaimBillBEntity.setBssm(bssm);
feClaimBillBEntity.setWbfwf(wbfwf);
claimBillBDao.save(feClaimBillBEntity);
//更新流水认领单号以及认领状态
mdmKkBankflowGtsEntity.setClaimbillcode(claimBillCode);
mdmKkBankflowGtsEntity.setClaimstatus("Y");
kkBankflowGtsDao.update(mdmKkBankflowGtsEntity);
} catch (Exception e) {
e.printStackTrace();
Assert.state(false, "生成认领单失败,失败原因:{}", e.getMessage());
}
return feClaimBillHEntity;
}
@Override
public String back(String id) {
String claim_bill_code = null;
String str = null;
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
feClaimBillHEntity.setId(id);
List<FeClaimBillHEntity> query = claimBillHDao.query(feClaimBillHEntity);
try {
if (query.size() == 0) {
claim_bill_code = id;
Assert.state(false, "根据id{},查询认领单失败");
}
FeClaimBillHEntity feClaimBillH = query.get(0);
claim_bill_code = feClaimBillH.getBillCode();
if (feClaimBillH.getBipBillId() != null) {
Assert.state(false, "该认领单已推送,请先收回后再取消认领");
}
//删除
claimBillHDao.logicRemove(feClaimBillHEntity);
//更新流水状态
MdmKkBankflowGtsEntity mdmKkBankflowGtsEntity = new MdmKkBankflowGtsEntity();
mdmKkBankflowGtsEntity.setId(feClaimBillH.getSourceId());
mdmKkBankflowGtsEntity.setClaimstatus("N");
kkBankflowGtsDao.updateStatus(mdmKkBankflowGtsEntity);
} catch (Exception e) {
e.printStackTrace();
Assert.state(false, "[{}]失败原因:{}", claim_bill_code, e.getMessage());
}
return null;
}
@Override
public String push(String id) {
String claim_bill_code = null;
String str = null;
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
feClaimBillHEntity.setId(id);
List<FeClaimBillHEntity> query = claimBillHDao.query(feClaimBillHEntity);
try {
if (query.size() == 0) {
claim_bill_code = id;
Assert.state(false, "根据id{},查询认领单失败");
}
claim_bill_code = id;
FeClaimBillHEntity feClaimBillH = query.get(0);
if (feClaimBillH.getBipBillId() != null && !"".equals(feClaimBillH.getBipBillId())) {
Assert.state(false, "已确认认领,请勿重复确认认领");
}
claim_bill_code = feClaimBillH.getBillCode();
//推送BIP
String uuid = UUID.randomUUID().toString();
//1[认领单号]-->下游系统单号]
str = "[" + claim_bill_code + "]-->《" + uuid + "";
//更新
feClaimBillHEntity.setBipBillId(uuid);
feClaimBillHEntity.setBipBillCode(uuid);
feClaimBillHEntity.setDownstreamSystemBillCode(uuid);
claimBillHDao.update(feClaimBillHEntity);
} catch (Exception e) {
e.printStackTrace();
//1[认领单号]失败原因;
Assert.state(false, "[{}]失败原因:{}", claim_bill_code, e.getMessage());
}
return str;
}
@Override
public String cancel(String id) {
String claim_bill_code = null;
String str = null;
FeClaimBillHEntity feClaimBillHEntity = new FeClaimBillHEntity();
feClaimBillHEntity.setId(id);
List<FeClaimBillHEntity> query = claimBillHDao.query(feClaimBillHEntity);
try {
if (query.size() == 0) {
claim_bill_code = id;
Assert.state(false, "根据id{},查询认领单失败");
}
FeClaimBillHEntity feClaimBillH = query.get(0);
if (feClaimBillH.getBipBillId() == null || "".equals(feClaimBillH.getBipBillId())) {
return null;
}
//推送BIP
String uuid = UUID.randomUUID().toString();
//置空
claimBillHDao.updateBipBillIdAndCodeById(feClaimBillHEntity);
//1[认领单号]-->下游系统单号]
str = "[" + feClaimBillH.getBillCode() + "]-->《" + uuid + "";
} catch (Exception e) {
e.printStackTrace();
//1[认领单号]失败原因;
Assert.state(false, "[{}]失败原因:{}", claim_bill_code, e.getMessage());
}
return str;
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.finance.conf.billcode.dao;
import com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 财资事项(finance_event)-配置-编码规则(fe_conf_billcode_rule: table)表数据库访问层
*
* @author zydd
* @since 2025-08-25 15:06:03
*/
public interface IFeConfBillcodeRuleDao extends IBaseDao<FeConfBillcodeRuleEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.finance.conf.billcode.dao.impl;
import com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity;
import com.hzya.frame.finance.conf.billcode.dao.IFeConfBillcodeRuleDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 财资事项(finance_event)-配置-编码规则(FeConfBillcodeRule)表数据库访问层
*
* @author zydd
* @since 2025-08-25 15:06:03
*/
@Repository
public class FeConfBillcodeRuleDaoImpl extends MybatisGenericDao<FeConfBillcodeRuleEntity, String> implements IFeConfBillcodeRuleDao{
}

View File

@ -0,0 +1,28 @@
package com.hzya.frame.finance.conf.billcode.entity;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data;
/**
* 财资事项(finance_event)-配置-编码规则(FeConfBillcodeRule)实体类
*
* @author zydd
* @since 2025-08-25 15:06:03
*/
@Data
public class FeConfBillcodeRuleEntity extends BaseEntity {
/** 年 */
private String year;
/** 月 */
private String month;
/** 日 */
private String day;
/** 单据类型 */
private String type;
/** 当前编码 */
private String currentcode;
/** 来源单号 */
private String sourcecode;
}

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.finance.conf.billcode.dao.impl.FeConfBillcodeRuleDaoImpl">
<resultMap id="get-FeConfBillcodeRuleEntity-result"
type="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="year" column="year" jdbcType="VARCHAR"/>
<result property="month" column="month" jdbcType="VARCHAR"/>
<result property="day" column="day" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
<result property="currentcode" column="currentcode" jdbcType="VARCHAR"/>
<result property="sourcecode" column="sourcecode" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="FeConfBillcodeRuleEntity_Base_Column_List">
id
,year
,month
,day
,type
,currentcode
,sourcecode
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-FeConfBillcodeRuleEntity-result"
parameterType="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity">
select
<include refid="FeConfBillcodeRuleEntity_Base_Column_List"/>
from fe_conf_billcode_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="year != null and year != ''">and year = #{year}</if>
<if test="month != null and month != ''">and month = #{month}</if>
<if test="day != null and day != ''">and day = #{day}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="currentcode != null and currentcode != ''">and currentcode = #{currentcode}</if>
<if test="sourcecode != null and sourcecode != ''">and sourcecode = #{sourcecode}</if>
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity">
select count(1) from fe_conf_billcode_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="year != null and year != ''">and year = #{year}</if>
<if test="month != null and month != ''">and month = #{month}</if>
<if test="day != null and day != ''">and day = #{day}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="currentcode != null and currentcode != ''">and currentcode = #{currentcode}</if>
<if test="sourcecode != null and sourcecode != ''">and sourcecode = #{sourcecode}</if>
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-FeConfBillcodeRuleEntity-result"
parameterType="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity">
select
<include refid="FeConfBillcodeRuleEntity_Base_Column_List"/>
from fe_conf_billcode_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id like concat('%',#{id},'%')</if>
<if test="year != null and year != ''">and year like concat('%',#{year},'%')</if>
<if test="month != null and month != ''">and month like concat('%',#{month},'%')</if>
<if test="day != null and day != ''">and day like concat('%',#{day},'%')</if>
<if test="type != null and type != ''">and type like concat('%',#{type},'%')</if>
<if test="currentcode != null and currentcode != ''">and currentcode like concat('%',#{currentcode},'%')
</if>
<if test="sourcecode != null and sourcecode != ''">and sourcecode like concat('%',#{sourcecode},'%')</if>
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="FeConfBillcodeRuleentity_list_or" resultMap="get-FeConfBillcodeRuleEntity-result"
parameterType="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity">
select
<include refid="FeConfBillcodeRuleEntity_Base_Column_List"/>
from fe_conf_billcode_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null">or id = #{id}</if>
<if test="year != null and year != ''">or year = #{year}</if>
<if test="month != null and month != ''">or month = #{month}</if>
<if test="day != null and day != ''">or day = #{day}</if>
<if test="type != null and type != ''">or type = #{type}</if>
<if test="currentcode != null and currentcode != ''">or currentcode = #{currentcode}</if>
<if test="sourcecode != null and sourcecode != ''">or sourcecode = #{sourcecode}</if>
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity"
keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_billcode_rule(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="year != null and year != ''">year ,</if>
<if test="month != null and month != ''">month ,</if>
<if test="day != null and day != ''">day ,</if>
<if test="type != null and type != ''">type ,</if>
<if test="currentcode != null and currentcode != ''">currentcode ,</if>
<if test="sourcecode != null and sourcecode != ''">sourcecode ,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="year != null and year != ''">#{year} ,</if>
<if test="month != null and month != ''">#{month} ,</if>
<if test="day != null and day != ''">#{day} ,</if>
<if test="type != null and type != ''">#{type} ,</if>
<if test="currentcode != null and currentcode != ''">#{currentcode} ,</if>
<if test="sourcecode != null and sourcecode != ''">#{sourcecode} ,</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_billcode_rule(year, month, day, type, currentcode, sourcecode)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.year},#{entity.month},#{entity.day},#{entity.type},#{entity.currentcode},#{entity.sourcecode})
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_billcode_rule(year, month, day, type, currentcode, sourcecode)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.year},#{entity.month},#{entity.day},#{entity.type},#{entity.currentcode},#{entity.sourcecode})
</foreach>
on duplicate key update
year = values(year),
month = values(month),
day = values(day),
type = values(type),
currentcode = values(currentcode),
sourcecode = values(sourcecode)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity">
update fe_conf_billcode_rule set
<trim suffix="" suffixOverrides=",">
<if test="year != null and year != ''">year = #{year},</if>
<if test="month != null and month != ''">month = #{month},</if>
<if test="day != null and day != ''">day = #{day},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="currentcode != null and currentcode != ''">currentcode = #{currentcode},</if>
<if test="sourcecode != null and sourcecode != ''">sourcecode = #{sourcecode},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete"
parameterType="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity">
update fe_conf_billcode_rule
set modify_time = #{modify_time},
modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity">
update fe_conf_billcode_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 = #{id}</if>
<if test="year != null and year != ''">and year = #{year}</if>
<if test="month != null and month != ''">and month = #{month}</if>
<if test="day != null and day != ''">and day = #{day}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="currentcode != null and currentcode != ''">and currentcode = #{currentcode}</if>
<if test="sourcecode != null and sourcecode != ''">and sourcecode = #{sourcecode}</if>
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from fe_conf_billcode_rule
where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,71 @@
package com.hzya.frame.finance.conf.billtemplate.controller;
import com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity;
import com.hzya.frame.finance.conf.billtemplate.service.IFeConfBillTemplateService;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created by zydd on 2025-08-29 17:48
* 收付款单据模板
*/
@RestController
@RequestMapping("/fe/conf/billtemplate")
public class BillTemplate extends DefaultController {
@Autowired
private IFeConfBillTemplateService billTemplateService;
@RequestMapping("/queryAll")
public JsonResultEntity queryAll(@RequestBody FeConfBillTemplateEntity billTemplateEntity){
try {
List<FeConfBillTemplateEntity> all = billTemplateService.queryAll(billTemplateEntity);
return getSuccessMessageEntity("你太棒了!",all);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping("/save")
public JsonResultEntity save(@RequestBody FeConfBillTemplateEntity billTemplateEntity){
try {
FeConfBillTemplateEntity entity = billTemplateService.saveEntity(billTemplateEntity);
return getSuccessMessageEntity("你太棒了!",entity);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping("/update")
public JsonResultEntity update(@RequestBody FeConfBillTemplateEntity billTemplateEntity){
try {
FeConfBillTemplateEntity entity = billTemplateService.updateEntity(billTemplateEntity);
return getSuccessMessageEntity("你太棒了!",entity);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping("/delete")
public JsonResultEntity delete(@RequestBody FeConfBillTemplateEntity billTemplateEntity){
try {
billTemplateService.deleteEntity(billTemplateEntity);
return getSuccessMessageEntity("你太棒了!",null);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.finance.conf.billtemplate.dao;
import com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (fe_conf_bill_template: table)表数据库访问层
*
* @author zydd
* @since 2025-08-29 17:44:59
*/
public interface IFeConfBillTemplateDao extends IBaseDao<FeConfBillTemplateEntity, String> {
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.finance.conf.billtemplate.dao.impl;
import com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity;
import com.hzya.frame.finance.conf.billtemplate.dao.IFeConfBillTemplateDao;
import lombok.Data;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (FeConfBillTemplate)表数据库访问层
*
* @author zydd
* @since 2025-08-29 17:44:59
*/
@Repository
public class FeConfBillTemplateDaoImpl extends MybatisGenericDao<FeConfBillTemplateEntity, String> implements IFeConfBillTemplateDao{
}

View File

@ -0,0 +1,670 @@
package com.hzya.frame.finance.conf.billtemplate.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data;
/**
* (FeConfBillTemplate)实体类
*
* @author zydd
* @since 2025-08-29 17:44:59
*/
public class FeConfBillTemplateEntity extends BaseEntity {
private String name;
/**
* 财务组织取值
*/
private String hOrgStr;
private String hOrgName;
/**
* 单据日期
*/
private String hBillDateStr;
private String hBillDateName;
/**
* 往来对象标识
*/
private String hWldxStr;
private String hWldxName;
/**
* 客户
*/
private String hUserStr;
private String hUserName;
/**
* 供应商
*/
private String hSupplierStr;
private String hSupplierName;
/**
* 部门
*/
private String hDeptStr;
private String hDeptName;
/**
* 客户
*/
private String hCustomerStr;
private String hCustomerName;
/**
* 币种
*/
private String hCurrenvyStr;
private String hCurrenvyName;
/**
* 备注
*/
private String hRemarkStr;
private String hRemarkName;
/**
* 结算方式
*/
private String hClearingFormStr;
private String hClearingFormName;
private String hDef1;
private String hDef2;
private String hDef3;
private String hDef4;
private String hDef5;
private String hDef6;
private String hDef7;
private String hDef8;
private String hDef9;
private String hDef10;
/**
* 款项性质
*/
private String bKxxzStr;
private String bKxxzName;
/**
* 业务类型
*/
private String bYwlxStr;
private String bYwlxName;
/**
* 币种
*/
private String bCurrencyStr;
private String bCurrencyName;
/**
* 税率
*/
private String bRateStr;
private String bRateName;
/**
* 原币金额
*/
private String bYbjeStr;
private String bYbjeName;
/**
* 本币金额
*/
private String bBbjeStr;
private String bBbjeName;
/**
* 收支项目
*/
private String bZsxmStr;
private String bZsxmName;
/**
* 摘要
*/
private String bZyStr;
private String bZyName;
/**
* 汇率
*/
private String bExchangeStr;
private String bExchangeRate;
private String bExchangeName;
/**
* 银行账号
*/
private String bBankStr;
private String bBankNum;
private String bBankName;
private String bDef1;
private String bDef2;
private String bDef3;
private String bDef4;
private String bDef5;
private String bDef6;
private String bDef7;
private String bDef8;
private String bDef9;
private String bDef10;
/**
* 创建人
*/
private String createUser;
/**
* 修改人
*/
private String modifyUser;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String gethOrgStr() {
return hOrgStr;
}
public void sethOrgStr(String hOrgStr) {
this.hOrgStr = hOrgStr;
}
public String gethOrgName() {
return hOrgName;
}
public void sethOrgName(String hOrgName) {
this.hOrgName = hOrgName;
}
public String gethBillDateStr() {
return hBillDateStr;
}
public void sethBillDateStr(String hBillDateStr) {
this.hBillDateStr = hBillDateStr;
}
public String gethBillDateName() {
return hBillDateName;
}
public void sethBillDateName(String hBillDateName) {
this.hBillDateName = hBillDateName;
}
public String gethWldxStr() {
return hWldxStr;
}
public void sethWldxStr(String hWldxStr) {
this.hWldxStr = hWldxStr;
}
public String gethWldxName() {
return hWldxName;
}
public void sethWldxName(String hWldxName) {
this.hWldxName = hWldxName;
}
public String gethUserStr() {
return hUserStr;
}
public void sethUserStr(String hUserStr) {
this.hUserStr = hUserStr;
}
public String gethUserName() {
return hUserName;
}
public void sethUserName(String hUserName) {
this.hUserName = hUserName;
}
public String gethSupplierStr() {
return hSupplierStr;
}
public void sethSupplierStr(String hSupplierStr) {
this.hSupplierStr = hSupplierStr;
}
public String gethSupplierName() {
return hSupplierName;
}
public void sethSupplierName(String hSupplierName) {
this.hSupplierName = hSupplierName;
}
public String gethDeptStr() {
return hDeptStr;
}
public void sethDeptStr(String hDeptStr) {
this.hDeptStr = hDeptStr;
}
public String gethDeptName() {
return hDeptName;
}
public void sethDeptName(String hDeptName) {
this.hDeptName = hDeptName;
}
public String gethCustomerStr() {
return hCustomerStr;
}
public void sethCustomerStr(String hCustomerStr) {
this.hCustomerStr = hCustomerStr;
}
public String gethCustomerName() {
return hCustomerName;
}
public void sethCustomerName(String hCustomerName) {
this.hCustomerName = hCustomerName;
}
public String gethCurrenvyStr() {
return hCurrenvyStr;
}
public void sethCurrenvyStr(String hCurrenvyStr) {
this.hCurrenvyStr = hCurrenvyStr;
}
public String gethCurrenvyName() {
return hCurrenvyName;
}
public void sethCurrenvyName(String hCurrenvyName) {
this.hCurrenvyName = hCurrenvyName;
}
public String gethRemarkStr() {
return hRemarkStr;
}
public void sethRemarkStr(String hRemarkStr) {
this.hRemarkStr = hRemarkStr;
}
public String gethRemarkName() {
return hRemarkName;
}
public void sethRemarkName(String hRemarkName) {
this.hRemarkName = hRemarkName;
}
public String gethClearingFormStr() {
return hClearingFormStr;
}
public void sethClearingFormStr(String hClearingFormStr) {
this.hClearingFormStr = hClearingFormStr;
}
public String gethClearingFormName() {
return hClearingFormName;
}
public void sethClearingFormName(String hClearingFormName) {
this.hClearingFormName = hClearingFormName;
}
public String gethDef1() {
return hDef1;
}
public void sethDef1(String hDef1) {
this.hDef1 = hDef1;
}
public String gethDef2() {
return hDef2;
}
public void sethDef2(String hDef2) {
this.hDef2 = hDef2;
}
public String gethDef3() {
return hDef3;
}
public void sethDef3(String hDef3) {
this.hDef3 = hDef3;
}
public String gethDef4() {
return hDef4;
}
public void sethDef4(String hDef4) {
this.hDef4 = hDef4;
}
public String gethDef5() {
return hDef5;
}
public void sethDef5(String hDef5) {
this.hDef5 = hDef5;
}
public String gethDef6() {
return hDef6;
}
public void sethDef6(String hDef6) {
this.hDef6 = hDef6;
}
public String gethDef7() {
return hDef7;
}
public void sethDef7(String hDef7) {
this.hDef7 = hDef7;
}
public String gethDef8() {
return hDef8;
}
public void sethDef8(String hDef8) {
this.hDef8 = hDef8;
}
public String gethDef9() {
return hDef9;
}
public void sethDef9(String hDef9) {
this.hDef9 = hDef9;
}
public String gethDef10() {
return hDef10;
}
public void sethDef10(String hDef10) {
this.hDef10 = hDef10;
}
public String getbKxxzStr() {
return bKxxzStr;
}
public void setbKxxzStr(String bKxxzStr) {
this.bKxxzStr = bKxxzStr;
}
public String getbKxxzName() {
return bKxxzName;
}
public void setbKxxzName(String bKxxzName) {
this.bKxxzName = bKxxzName;
}
public String getbYwlxStr() {
return bYwlxStr;
}
public void setbYwlxStr(String bYwlxStr) {
this.bYwlxStr = bYwlxStr;
}
public String getbYwlxName() {
return bYwlxName;
}
public void setbYwlxName(String bYwlxName) {
this.bYwlxName = bYwlxName;
}
public String getbCurrencyStr() {
return bCurrencyStr;
}
public void setbCurrencyStr(String bCurrencyStr) {
this.bCurrencyStr = bCurrencyStr;
}
public String getbCurrencyName() {
return bCurrencyName;
}
public void setbCurrencyName(String bCurrencyName) {
this.bCurrencyName = bCurrencyName;
}
public String getbRateStr() {
return bRateStr;
}
public void setbRateStr(String bRateStr) {
this.bRateStr = bRateStr;
}
public String getbRateName() {
return bRateName;
}
public void setbRateName(String bRateName) {
this.bRateName = bRateName;
}
public String getbYbjeStr() {
return bYbjeStr;
}
public void setbYbjeStr(String bYbjeStr) {
this.bYbjeStr = bYbjeStr;
}
public String getbYbjeName() {
return bYbjeName;
}
public void setbYbjeName(String bYbjeName) {
this.bYbjeName = bYbjeName;
}
public String getbBbjeStr() {
return bBbjeStr;
}
public void setbBbjeStr(String bBbjeStr) {
this.bBbjeStr = bBbjeStr;
}
public String getbBbjeName() {
return bBbjeName;
}
public void setbBbjeName(String bBbjeName) {
this.bBbjeName = bBbjeName;
}
public String getbZsxmStr() {
return bZsxmStr;
}
public void setbZsxmStr(String bZsxmStr) {
this.bZsxmStr = bZsxmStr;
}
public String getbZsxmName() {
return bZsxmName;
}
public void setbZsxmName(String bZsxmName) {
this.bZsxmName = bZsxmName;
}
public String getbZyStr() {
return bZyStr;
}
public void setbZyStr(String bZyStr) {
this.bZyStr = bZyStr;
}
public String getbZyName() {
return bZyName;
}
public void setbZyName(String bZyName) {
this.bZyName = bZyName;
}
public String getbExchangeStr() {
return bExchangeStr;
}
public void setbExchangeStr(String bExchangeStr) {
this.bExchangeStr = bExchangeStr;
}
public String getbExchangeRate() {
return bExchangeRate;
}
public void setbExchangeRate(String bExchangeRate) {
this.bExchangeRate = bExchangeRate;
}
public String getbExchangeName() {
return bExchangeName;
}
public void setbExchangeName(String bExchangeName) {
this.bExchangeName = bExchangeName;
}
public String getbBankStr() {
return bBankStr;
}
public void setbBankStr(String bBankStr) {
this.bBankStr = bBankStr;
}
public String getbBankNum() {
return bBankNum;
}
public void setbBankNum(String bBankNum) {
this.bBankNum = bBankNum;
}
public String getbBankName() {
return bBankName;
}
public void setbBankName(String bBankName) {
this.bBankName = bBankName;
}
public String getbDef1() {
return bDef1;
}
public void setbDef1(String bDef1) {
this.bDef1 = bDef1;
}
public String getbDef2() {
return bDef2;
}
public void setbDef2(String bDef2) {
this.bDef2 = bDef2;
}
public String getbDef3() {
return bDef3;
}
public void setbDef3(String bDef3) {
this.bDef3 = bDef3;
}
public String getbDef4() {
return bDef4;
}
public void setbDef4(String bDef4) {
this.bDef4 = bDef4;
}
public String getbDef5() {
return bDef5;
}
public void setbDef5(String bDef5) {
this.bDef5 = bDef5;
}
public String getbDef6() {
return bDef6;
}
public void setbDef6(String bDef6) {
this.bDef6 = bDef6;
}
public String getbDef7() {
return bDef7;
}
public void setbDef7(String bDef7) {
this.bDef7 = bDef7;
}
public String getbDef8() {
return bDef8;
}
public void setbDef8(String bDef8) {
this.bDef8 = bDef8;
}
public String getbDef9() {
return bDef9;
}
public void setbDef9(String bDef9) {
this.bDef9 = bDef9;
}
public String getbDef10() {
return bDef10;
}
public void setbDef10(String bDef10) {
this.bDef10 = bDef10;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
}

View File

@ -0,0 +1,663 @@
<?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.finance.conf.billtemplate.dao.impl.FeConfBillTemplateDaoImpl">
<resultMap id="get-FeConfBillTemplateEntity-result"
type="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="hOrgStr" column="h_org_str" jdbcType="VARCHAR"/>
<result property="hBillDateStr" column="h_bill_date_str" jdbcType="VARCHAR"/>
<result property="hWldxStr" column="h_wldx_str" jdbcType="VARCHAR"/>
<result property="hUserStr" column="h_user_str" jdbcType="VARCHAR"/>
<result property="hCustomerStr" column="h_customer_str" jdbcType="VARCHAR"/>
<result property="hSupplierStr" column="h_supplier_str" jdbcType="VARCHAR"/>
<result property="hDeptStr" column="h_dept_str" jdbcType="VARCHAR"/>
<result property="hCurrenvyStr" column="h_currenvy_str" jdbcType="VARCHAR"/>
<result property="hRemarkStr" column="h_remark_str" jdbcType="VARCHAR"/>
<result property="hClearingFormStr" column="h_clearing_form_str" jdbcType="VARCHAR"/>
<result property="hDef1" column="h_def1" jdbcType="VARCHAR"/>
<result property="hDef2" column="h_def2" jdbcType="VARCHAR"/>
<result property="hDef3" column="h_def3" jdbcType="VARCHAR"/>
<result property="hDef4" column="h_def4" jdbcType="VARCHAR"/>
<result property="hDef5" column="h_def5" jdbcType="VARCHAR"/>
<result property="hDef6" column="h_def6" jdbcType="VARCHAR"/>
<result property="hDef7" column="h_def7" jdbcType="VARCHAR"/>
<result property="hDef8" column="h_def8" jdbcType="VARCHAR"/>
<result property="hDef9" column="h_def9" jdbcType="VARCHAR"/>
<result property="hDef10" column="h_def10" jdbcType="VARCHAR"/>
<result property="bKxxzStr" column="b_kxxz_str" jdbcType="VARCHAR"/>
<result property="bYwlxStr" column="b_ywlx_str" jdbcType="VARCHAR"/>
<result property="bCurrencyStr" column="b_currency_str" jdbcType="VARCHAR"/>
<result property="bRateStr" column="b_rate_str" jdbcType="VARCHAR"/>
<result property="bYbjeStr" column="b_ybje_str" jdbcType="VARCHAR"/>
<result property="bBbjeStr" column="b_bbje_str" jdbcType="VARCHAR"/>
<result property="bZsxmStr" column="b_zsxm_str" jdbcType="VARCHAR"/>
<result property="bZyStr" column="b_zy_str" jdbcType="VARCHAR"/>
<result property="bExchangeRate" column="b_exchange_rate" jdbcType="VARCHAR"/>
<result property="bBankNum" column="b_bank_num" jdbcType="VARCHAR"/>
<result property="bDef1" column="b_def1" jdbcType="VARCHAR"/>
<result property="bDef2" column="b_def2" jdbcType="VARCHAR"/>
<result property="bDef3" column="b_def3" jdbcType="VARCHAR"/>
<result property="bDef4" column="b_def4" jdbcType="VARCHAR"/>
<result property="bDef5" column="b_def5" jdbcType="VARCHAR"/>
<result property="bDef6" column="b_def6" jdbcType="VARCHAR"/>
<result property="bDef7" column="b_def7" jdbcType="VARCHAR"/>
<result property="bDef8" column="b_def8" jdbcType="VARCHAR"/>
<result property="bDef9" column="b_def9" jdbcType="VARCHAR"/>
<result property="bDef10" column="b_def10" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="modifyUser" column="modify_user" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="FeConfBillTemplateEntity_Base_Column_List">
id
,name
,h_org_str
,h_bill_date_str
,h_wldx_str
,h_user_str
,h_customer_str
,h_supplier_str
,h_dept_str
,h_currenvy_str
,h_remark_str
,h_clearing_form_str
,h_def1
,h_def2
,h_def3
,h_def4
,h_def5
,h_def6
,h_def7
,h_def8
,h_def9
,h_def10
,b_kxxz_str
,b_ywlx_str
,b_currency_str
,b_rate_str
,b_ybje_str
,b_bbje_str
,b_zsxm_str
,b_zy_str
,b_exchange_rate
,b_bank_num
,b_def1
,b_def2
,b_def3
,b_def4
,b_def5
,b_def6
,b_def7
,b_def8
,b_def9
,b_def10
,create_time
,create_user
,modify_time
,modify_user
,sts
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-FeConfBillTemplateEntity-result"
parameterType="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity">
select
<include refid="FeConfBillTemplateEntity_Base_Column_List"/>
from fe_conf_bill_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="hOrgStr != null and hOrgStr != ''">and h_org_str = #{hOrgStr}</if>
<if test="hBillDateStr != null and hBillDateStr != ''">and h_bill_date_str = #{hBillDateStr}</if>
<if test="hWldxStr != null and hWldxStr != ''">and h_wldx_str = #{hWldxStr}</if>
<if test="hUserStr != null and hUserStr != ''">and h_user_str = #{hUserStr}</if>
<if test="hCustomerStr != null and hCustomerStr != ''">and h_customer_str = #{hCustomerStr}</if>
<if test="hSupplierStr != null and hSupplierStr != ''">and h_supplier_str = #{hSupplierStr}</if>
<if test="hDeptStr != null and hDeptStr != ''">and h_dept_str = #{hDeptStr}</if>
<if test="hCurrenvyStr != null and hCurrenvyStr != ''">and h_currenvy_str = #{hCurrenvyStr}</if>
<if test="hRemarkStr != null and hRemarkStr != ''">and h_remark_str = #{hRemarkStr}</if>
<if test="hClearingFormStr != null and hClearingFormStr != ''">and h_clearing_form_str =
#{hClearingFormStr}
</if>
<if test="hDef1 != null and hDef1 != ''">and h_def1 = #{hDef1}</if>
<if test="hDef2 != null and hDef2 != ''">and h_def2 = #{hDef2}</if>
<if test="hDef3 != null and hDef3 != ''">and h_def3 = #{hDef3}</if>
<if test="hDef4 != null and hDef4 != ''">and h_def4 = #{hDef4}</if>
<if test="hDef5 != null and hDef5 != ''">and h_def5 = #{hDef5}</if>
<if test="hDef6 != null and hDef6 != ''">and h_def6 = #{hDef6}</if>
<if test="hDef7 != null and hDef7 != ''">and h_def7 = #{hDef7}</if>
<if test="hDef8 != null and hDef8 != ''">and h_def8 = #{hDef8}</if>
<if test="hDef9 != null and hDef9 != ''">and h_def9 = #{hDef9}</if>
<if test="hDef10 != null and hDef10 != ''">and h_def10 = #{hDef10}</if>
<if test="bKxxzStr != null and bKxxzStr != ''">and b_kxxz_str = #{bKxxzStr}</if>
<if test="bYwlxStr != null and bYwlxStr != ''">and b_ywlx_str = #{bYwlxStr}</if>
<if test="bCurrencyStr != null and bCurrencyStr != ''">and b_currency_str = #{bCurrencyStr}</if>
<if test="bRateStr != null and bRateStr != ''">and b_rate_str = #{bRateStr}</if>
<if test="bYbjeStr != null and bYbjeStr != ''">and b_ybje_str = #{bYbjeStr}</if>
<if test="bBbjeStr != null and bBbjeStr != ''">and b_bbje_str = #{bBbjeStr}</if>
<if test="bZsxmStr != null and bZsxmStr != ''">and b_zsxm_str = #{bZsxmStr}</if>
<if test="bZyStr != null and bZyStr != ''">and b_zy_str = #{bZyStr}</if>
<if test="bExchangeRate != null and bExchangeRate != ''">and b_exchange_rate = #{bExchangeRate}</if>
<if test="bBankNum != null and bBankNum != ''">and b_bank_num = #{bBankNum}</if>
<if test="bDef1 != null and bDef1 != ''">and b_def1 = #{bDef1}</if>
<if test="bDef2 != null and bDef2 != ''">and b_def2 = #{bDef2}</if>
<if test="bDef3 != null and bDef3 != ''">and b_def3 = #{bDef3}</if>
<if test="bDef4 != null and bDef4 != ''">and b_def4 = #{bDef4}</if>
<if test="bDef5 != null and bDef5 != ''">and b_def5 = #{bDef5}</if>
<if test="bDef6 != null and bDef6 != ''">and b_def6 = #{bDef6}</if>
<if test="bDef7 != null and bDef7 != ''">and b_def7 = #{bDef7}</if>
<if test="bDef8 != null and bDef8 != ''">and b_def8 = #{bDef8}</if>
<if test="bDef9 != null and bDef9 != ''">and b_def9 = #{bDef9}</if>
<if test="bDef10 != null and bDef10 != ''">and b_def10 = #{bDef10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity">
select count(1) from fe_conf_bill_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="hOrgStr != null and hOrgStr != ''">and h_org_str = #{hOrgStr}</if>
<if test="hBillDateStr != null and hBillDateStr != ''">and h_bill_date_str = #{hBillDateStr}</if>
<if test="hWldxStr != null and hWldxStr != ''">and h_wldx_str = #{hWldxStr}</if>
<if test="hUserStr != null and hUserStr != ''">and h_user_str = #{hUserStr}</if>
<if test="hCustomerStr != null and hCustomerStr != ''">and h_customer_str = #{hCustomerStr}</if>
<if test="hSupplierStr != null and hSupplierStr != ''">and h_supplier_str = #{hSupplierStr}</if>
<if test="hDeptStr != null and hDeptStr != ''">and h_dept_str = #{hDeptStr}</if>
<if test="hCurrenvyStr != null and hCurrenvyStr != ''">and h_currenvy_str = #{hCurrenvyStr}</if>
<if test="hRemarkStr != null and hRemarkStr != ''">and h_remark_str = #{hRemarkStr}</if>
<if test="hClearingFormStr != null and hClearingFormStr != ''">and h_clearing_form_str =
#{hClearingFormStr}
</if>
<if test="hDef1 != null and hDef1 != ''">and h_def1 = #{hDef1}</if>
<if test="hDef2 != null and hDef2 != ''">and h_def2 = #{hDef2}</if>
<if test="hDef3 != null and hDef3 != ''">and h_def3 = #{hDef3}</if>
<if test="hDef4 != null and hDef4 != ''">and h_def4 = #{hDef4}</if>
<if test="hDef5 != null and hDef5 != ''">and h_def5 = #{hDef5}</if>
<if test="hDef6 != null and hDef6 != ''">and h_def6 = #{hDef6}</if>
<if test="hDef7 != null and hDef7 != ''">and h_def7 = #{hDef7}</if>
<if test="hDef8 != null and hDef8 != ''">and h_def8 = #{hDef8}</if>
<if test="hDef9 != null and hDef9 != ''">and h_def9 = #{hDef9}</if>
<if test="hDef10 != null and hDef10 != ''">and h_def10 = #{hDef10}</if>
<if test="bKxxzStr != null and bKxxzStr != ''">and b_kxxz_str = #{bKxxzStr}</if>
<if test="bYwlxStr != null and bYwlxStr != ''">and b_ywlx_str = #{bYwlxStr}</if>
<if test="bCurrencyStr != null and bCurrencyStr != ''">and b_currency_str = #{bCurrencyStr}</if>
<if test="bRateStr != null and bRateStr != ''">and b_rate_str = #{bRateStr}</if>
<if test="bYbjeStr != null and bYbjeStr != ''">and b_ybje_str = #{bYbjeStr}</if>
<if test="bBbjeStr != null and bBbjeStr != ''">and b_bbje_str = #{bBbjeStr}</if>
<if test="bZsxmStr != null and bZsxmStr != ''">and b_zsxm_str = #{bZsxmStr}</if>
<if test="bZyStr != null and bZyStr != ''">and b_zy_str = #{bZyStr}</if>
<if test="bExchangeRate != null and bExchangeRate != ''">and b_exchange_rate = #{bExchangeRate}</if>
<if test="bBankNum != null and bBankNum != ''">and b_bank_num = #{bBankNum}</if>
<if test="bDef1 != null and bDef1 != ''">and b_def1 = #{bDef1}</if>
<if test="bDef2 != null and bDef2 != ''">and b_def2 = #{bDef2}</if>
<if test="bDef3 != null and bDef3 != ''">and b_def3 = #{bDef3}</if>
<if test="bDef4 != null and bDef4 != ''">and b_def4 = #{bDef4}</if>
<if test="bDef5 != null and bDef5 != ''">and b_def5 = #{bDef5}</if>
<if test="bDef6 != null and bDef6 != ''">and b_def6 = #{bDef6}</if>
<if test="bDef7 != null and bDef7 != ''">and b_def7 = #{bDef7}</if>
<if test="bDef8 != null and bDef8 != ''">and b_def8 = #{bDef8}</if>
<if test="bDef9 != null and bDef9 != ''">and b_def9 = #{bDef9}</if>
<if test="bDef10 != null and bDef10 != ''">and b_def10 = #{bDef10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-FeConfBillTemplateEntity-result"
parameterType="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity">
select
<include refid="FeConfBillTemplateEntity_Base_Column_List"/>
from fe_conf_bill_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id like concat('%',#{id},'%')</if>
<if test="name != null and name != ''">and name like concat('%',#{name},'%')</if>
<if test="hOrgStr != null and hOrgStr != ''">and h_org_str like concat('%',#{hOrgStr},'%')</if>
<if test="hBillDateStr != null and hBillDateStr != ''">and h_bill_date_str like
concat('%',#{hBillDateStr},'%')
</if>
<if test="hWldxStr != null and hWldxStr != ''">and h_wldx_str like concat('%',#{hWldxStr},'%')</if>
<if test="hUserStr != null and hUserStr != ''">and h_user_str like concat('%',#{hUserStr},'%')</if>
<if test="hCustomerStr != null and hCustomerStr != ''">and h_customer_str like
concat('%',#{hCustomerStr},'%')
</if>
<if test="hSupplierStr != null and hSupplierStr != ''">and h_supplier_str like
concat('%',#{hSupplierStr},'%')
</if>
<if test="hDeptStr != null and hDeptStr != ''">and h_dept_str like concat('%',#{hDeptStr},'%')</if>
<if test="hCurrenvyStr != null and hCurrenvyStr != ''">and h_currenvy_str like
concat('%',#{hCurrenvyStr},'%')
</if>
<if test="hRemarkStr != null and hRemarkStr != ''">and h_remark_str like concat('%',#{hRemarkStr},'%')</if>
<if test="hClearingFormStr != null and hClearingFormStr != ''">and h_clearing_form_str like
concat('%',#{hClearingFormStr},'%')
</if>
<if test="hDef1 != null and hDef1 != ''">and h_def1 like concat('%',#{hDef1},'%')</if>
<if test="hDef2 != null and hDef2 != ''">and h_def2 like concat('%',#{hDef2},'%')</if>
<if test="hDef3 != null and hDef3 != ''">and h_def3 like concat('%',#{hDef3},'%')</if>
<if test="hDef4 != null and hDef4 != ''">and h_def4 like concat('%',#{hDef4},'%')</if>
<if test="hDef5 != null and hDef5 != ''">and h_def5 like concat('%',#{hDef5},'%')</if>
<if test="hDef6 != null and hDef6 != ''">and h_def6 like concat('%',#{hDef6},'%')</if>
<if test="hDef7 != null and hDef7 != ''">and h_def7 like concat('%',#{hDef7},'%')</if>
<if test="hDef8 != null and hDef8 != ''">and h_def8 like concat('%',#{hDef8},'%')</if>
<if test="hDef9 != null and hDef9 != ''">and h_def9 like concat('%',#{hDef9},'%')</if>
<if test="hDef10 != null and hDef10 != ''">and h_def10 like concat('%',#{hDef10},'%')</if>
<if test="bKxxzStr != null and bKxxzStr != ''">and b_kxxz_str like concat('%',#{bKxxzStr},'%')</if>
<if test="bYwlxStr != null and bYwlxStr != ''">and b_ywlx_str like concat('%',#{bYwlxStr},'%')</if>
<if test="bCurrencyStr != null and bCurrencyStr != ''">and b_currency_str like
concat('%',#{bCurrencyStr},'%')
</if>
<if test="bRateStr != null and bRateStr != ''">and b_rate_str like concat('%',#{bRateStr},'%')</if>
<if test="bYbjeStr != null and bYbjeStr != ''">and b_ybje_str like concat('%',#{bYbjeStr},'%')</if>
<if test="bBbjeStr != null and bBbjeStr != ''">and b_bbje_str like concat('%',#{bBbjeStr},'%')</if>
<if test="bZsxmStr != null and bZsxmStr != ''">and b_zsxm_str like concat('%',#{bZsxmStr},'%')</if>
<if test="bZyStr != null and bZyStr != ''">and b_zy_str like concat('%',#{bZyStr},'%')</if>
<if test="bExchangeRate != null and bExchangeRate != ''">and b_exchange_rate like
concat('%',#{bExchangeRate},'%')
</if>
<if test="bBankNum != null and bBankNum != ''">and b_bank_num like concat('%',#{bBankNum},'%')</if>
<if test="bDef1 != null and bDef1 != ''">and b_def1 like concat('%',#{bDef1},'%')</if>
<if test="bDef2 != null and bDef2 != ''">and b_def2 like concat('%',#{bDef2},'%')</if>
<if test="bDef3 != null and bDef3 != ''">and b_def3 like concat('%',#{bDef3},'%')</if>
<if test="bDef4 != null and bDef4 != ''">and b_def4 like concat('%',#{bDef4},'%')</if>
<if test="bDef5 != null and bDef5 != ''">and b_def5 like concat('%',#{bDef5},'%')</if>
<if test="bDef6 != null and bDef6 != ''">and b_def6 like concat('%',#{bDef6},'%')</if>
<if test="bDef7 != null and bDef7 != ''">and b_def7 like concat('%',#{bDef7},'%')</if>
<if test="bDef8 != null and bDef8 != ''">and b_def8 like concat('%',#{bDef8},'%')</if>
<if test="bDef9 != null and bDef9 != ''">and b_def9 like concat('%',#{bDef9},'%')</if>
<if test="bDef10 != null and bDef10 != ''">and b_def10 like concat('%',#{bDef10},'%')</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="createUser != null and createUser != ''">and create_user like concat('%',#{createUser},'%')</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user like concat('%',#{modifyUser},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
and sts='Y'
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="FeConfBillTemplateentity_list_or" resultMap="get-FeConfBillTemplateEntity-result"
parameterType="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity">
select
<include refid="FeConfBillTemplateEntity_Base_Column_List"/>
from fe_conf_bill_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null">or id = #{id}</if>
<if test="name != null and name != ''">or name = #{name}</if>
<if test="hOrgStr != null and hOrgStr != ''">or h_org_str = #{hOrgStr}</if>
<if test="hBillDateStr != null and hBillDateStr != ''">or h_bill_date_str = #{hBillDateStr}</if>
<if test="hWldxStr != null and hWldxStr != ''">or h_wldx_str = #{hWldxStr}</if>
<if test="hUserStr != null and hUserStr != ''">or h_user_str = #{hUserStr}</if>
<if test="hCustomerStr != null and hCustomerStr != ''">or h_customer_str = #{hCustomerStr}</if>
<if test="hSupplierStr != null and hSupplierStr != ''">or h_supplier_str = #{hSupplierStr}</if>
<if test="hDeptStr != null and hDeptStr != ''">or h_dept_str = #{hDeptStr}</if>
<if test="hCurrenvyStr != null and hCurrenvyStr != ''">or h_currenvy_str = #{hCurrenvyStr}</if>
<if test="hRemarkStr != null and hRemarkStr != ''">or h_remark_str = #{hRemarkStr}</if>
<if test="hClearingFormStr != null and hClearingFormStr != ''">or h_clearing_form_str =
#{hClearingFormStr}
</if>
<if test="hDef1 != null and hDef1 != ''">or h_def1 = #{hDef1}</if>
<if test="hDef2 != null and hDef2 != ''">or h_def2 = #{hDef2}</if>
<if test="hDef3 != null and hDef3 != ''">or h_def3 = #{hDef3}</if>
<if test="hDef4 != null and hDef4 != ''">or h_def4 = #{hDef4}</if>
<if test="hDef5 != null and hDef5 != ''">or h_def5 = #{hDef5}</if>
<if test="hDef6 != null and hDef6 != ''">or h_def6 = #{hDef6}</if>
<if test="hDef7 != null and hDef7 != ''">or h_def7 = #{hDef7}</if>
<if test="hDef8 != null and hDef8 != ''">or h_def8 = #{hDef8}</if>
<if test="hDef9 != null and hDef9 != ''">or h_def9 = #{hDef9}</if>
<if test="hDef10 != null and hDef10 != ''">or h_def10 = #{hDef10}</if>
<if test="bKxxzStr != null and bKxxzStr != ''">or b_kxxz_str = #{bKxxzStr}</if>
<if test="bYwlxStr != null and bYwlxStr != ''">or b_ywlx_str = #{bYwlxStr}</if>
<if test="bCurrencyStr != null and bCurrencyStr != ''">or b_currency_str = #{bCurrencyStr}</if>
<if test="bRateStr != null and bRateStr != ''">or b_rate_str = #{bRateStr}</if>
<if test="bYbjeStr != null and bYbjeStr != ''">or b_ybje_str = #{bYbjeStr}</if>
<if test="bBbjeStr != null and bBbjeStr != ''">or b_bbje_str = #{bBbjeStr}</if>
<if test="bZsxmStr != null and bZsxmStr != ''">or b_zsxm_str = #{bZsxmStr}</if>
<if test="bZyStr != null and bZyStr != ''">or b_zy_str = #{bZyStr}</if>
<if test="bExchangeRate != null and bExchangeRate != ''">or b_exchange_rate = #{bExchangeRate}</if>
<if test="bBankNum != null and bBankNum != ''">or b_bank_num = #{bBankNum}</if>
<if test="bDef1 != null and bDef1 != ''">or b_def1 = #{bDef1}</if>
<if test="bDef2 != null and bDef2 != ''">or b_def2 = #{bDef2}</if>
<if test="bDef3 != null and bDef3 != ''">or b_def3 = #{bDef3}</if>
<if test="bDef4 != null and bDef4 != ''">or b_def4 = #{bDef4}</if>
<if test="bDef5 != null and bDef5 != ''">or b_def5 = #{bDef5}</if>
<if test="bDef6 != null and bDef6 != ''">or b_def6 = #{bDef6}</if>
<if test="bDef7 != null and bDef7 != ''">or b_def7 = #{bDef7}</if>
<if test="bDef8 != null and bDef8 != ''">or b_def8 = #{bDef8}</if>
<if test="bDef9 != null and bDef9 != ''">or b_def9 = #{bDef9}</if>
<if test="bDef10 != null and bDef10 != ''">or b_def10 = #{bDef10}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">or create_user = #{createUser}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">or modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity"
keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_bill_template(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="name != null and name != ''">name ,</if>
<if test="hOrgStr != null and hOrgStr != ''">h_org_str ,</if>
<if test="hBillDateStr != null and hBillDateStr != ''">h_bill_date_str ,</if>
<if test="hWldxStr != null and hWldxStr != ''">h_wldx_str ,</if>
<if test="hUserStr != null and hUserStr != ''">h_user_str ,</if>
<if test="hCustomerStr != null and hCustomerStr != ''">h_customer_str ,</if>
<if test="hSupplierStr != null and hSupplierStr != ''">h_supplier_str ,</if>
<if test="hDeptStr != null and hDeptStr != ''">h_dept_str ,</if>
<if test="hCurrenvyStr != null and hCurrenvyStr != ''">h_currenvy_str ,</if>
<if test="hRemarkStr != null and hRemarkStr != ''">h_remark_str ,</if>
<if test="hClearingFormStr != null and hClearingFormStr != ''">h_clearing_form_str ,</if>
<if test="hDef1 != null and hDef1 != ''">h_def1 ,</if>
<if test="hDef2 != null and hDef2 != ''">h_def2 ,</if>
<if test="hDef3 != null and hDef3 != ''">h_def3 ,</if>
<if test="hDef4 != null and hDef4 != ''">h_def4 ,</if>
<if test="hDef5 != null and hDef5 != ''">h_def5 ,</if>
<if test="hDef6 != null and hDef6 != ''">h_def6 ,</if>
<if test="hDef7 != null and hDef7 != ''">h_def7 ,</if>
<if test="hDef8 != null and hDef8 != ''">h_def8 ,</if>
<if test="hDef9 != null and hDef9 != ''">h_def9 ,</if>
<if test="hDef10 != null and hDef10 != ''">h_def10 ,</if>
<if test="bKxxzStr != null and bKxxzStr != ''">b_kxxz_str ,</if>
<if test="bYwlxStr != null and bYwlxStr != ''">b_ywlx_str ,</if>
<if test="bCurrencyStr != null and bCurrencyStr != ''">b_currency_str ,</if>
<if test="bRateStr != null and bRateStr != ''">b_rate_str ,</if>
<if test="bYbjeStr != null and bYbjeStr != ''">b_ybje_str ,</if>
<if test="bBbjeStr != null and bBbjeStr != ''">b_bbje_str ,</if>
<if test="bZsxmStr != null and bZsxmStr != ''">b_zsxm_str ,</if>
<if test="bZyStr != null and bZyStr != ''">b_zy_str ,</if>
<if test="bExchangeRate != null and bExchangeRate != ''">b_exchange_rate ,</if>
<if test="bBankNum != null and bBankNum != ''">b_bank_num ,</if>
<if test="bDef1 != null and bDef1 != ''">b_def1 ,</if>
<if test="bDef2 != null and bDef2 != ''">b_def2 ,</if>
<if test="bDef3 != null and bDef3 != ''">b_def3 ,</if>
<if test="bDef4 != null and bDef4 != ''">b_def4 ,</if>
<if test="bDef5 != null and bDef5 != ''">b_def5 ,</if>
<if test="bDef6 != null and bDef6 != ''">b_def6 ,</if>
<if test="bDef7 != null and bDef7 != ''">b_def7 ,</if>
<if test="bDef8 != null and bDef8 != ''">b_def8 ,</if>
<if test="bDef9 != null and bDef9 != ''">b_def9 ,</if>
<if test="bDef10 != null and bDef10 != ''">b_def10 ,</if>
<if test="create_time != null">create_time ,</if>
<if test="create_time == null">create_time ,</if>
<if test="createUser != null and createUser != ''">create_user ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="modify_time == null">modify_time ,</if>
<if test="modifyUser != null and modifyUser != ''">modify_user ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="name != null and name != ''">#{name} ,</if>
<if test="hOrgStr != null and hOrgStr != ''">#{hOrgStr} ,</if>
<if test="hBillDateStr != null and hBillDateStr != ''">#{hBillDateStr} ,</if>
<if test="hWldxStr != null and hWldxStr != ''">#{hWldxStr} ,</if>
<if test="hUserStr != null and hUserStr != ''">#{hUserStr} ,</if>
<if test="hCustomerStr != null and hCustomerStr != ''">#{hCustomerStr} ,</if>
<if test="hSupplierStr != null and hSupplierStr != ''">#{hSupplierStr} ,</if>
<if test="hDeptStr != null and hDeptStr != ''">#{hDeptStr} ,</if>
<if test="hCurrenvyStr != null and hCurrenvyStr != ''">#{hCurrenvyStr} ,</if>
<if test="hRemarkStr != null and hRemarkStr != ''">#{hRemarkStr} ,</if>
<if test="hClearingFormStr != null and hClearingFormStr != ''">#{hClearingFormStr} ,</if>
<if test="hDef1 != null and hDef1 != ''">#{hDef1} ,</if>
<if test="hDef2 != null and hDef2 != ''">#{hDef2} ,</if>
<if test="hDef3 != null and hDef3 != ''">#{hDef3} ,</if>
<if test="hDef4 != null and hDef4 != ''">#{hDef4} ,</if>
<if test="hDef5 != null and hDef5 != ''">#{hDef5} ,</if>
<if test="hDef6 != null and hDef6 != ''">#{hDef6} ,</if>
<if test="hDef7 != null and hDef7 != ''">#{hDef7} ,</if>
<if test="hDef8 != null and hDef8 != ''">#{hDef8} ,</if>
<if test="hDef9 != null and hDef9 != ''">#{hDef9} ,</if>
<if test="hDef10 != null and hDef10 != ''">#{hDef10} ,</if>
<if test="bKxxzStr != null and bKxxzStr != ''">#{bKxxzStr} ,</if>
<if test="bYwlxStr != null and bYwlxStr != ''">#{bYwlxStr} ,</if>
<if test="bCurrencyStr != null and bCurrencyStr != ''">#{bCurrencyStr} ,</if>
<if test="bRateStr != null and bRateStr != ''">#{bRateStr} ,</if>
<if test="bYbjeStr != null and bYbjeStr != ''">#{bYbjeStr} ,</if>
<if test="bBbjeStr != null and bBbjeStr != ''">#{bBbjeStr} ,</if>
<if test="bZsxmStr != null and bZsxmStr != ''">#{bZsxmStr} ,</if>
<if test="bZyStr != null and bZyStr != ''">#{bZyStr} ,</if>
<if test="bExchangeRate != null and bExchangeRate != ''">#{bExchangeRate} ,</if>
<if test="bBankNum != null and bBankNum != ''">#{bBankNum} ,</if>
<if test="bDef1 != null and bDef1 != ''">#{bDef1} ,</if>
<if test="bDef2 != null and bDef2 != ''">#{bDef2} ,</if>
<if test="bDef3 != null and bDef3 != ''">#{bDef3} ,</if>
<if test="bDef4 != null and bDef4 != ''">#{bDef4} ,</if>
<if test="bDef5 != null and bDef5 != ''">#{bDef5} ,</if>
<if test="bDef6 != null and bDef6 != ''">#{bDef6} ,</if>
<if test="bDef7 != null and bDef7 != ''">#{bDef7} ,</if>
<if test="bDef8 != null and bDef8 != ''">#{bDef8} ,</if>
<if test="bDef9 != null and bDef9 != ''">#{bDef9} ,</if>
<if test="bDef10 != null and bDef10 != ''">#{bDef10} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="create_time == null">now() ,</if>
<if test="createUser != null and createUser != ''">#{createUser} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="modify_time == null">now() ,</if>
<if test="modifyUser != null and modifyUser != ''">#{modifyUser} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_bill_template(name, h_org_str, h_bill_date_str, h_wldx_str, h_customer_str, h_supplier_str,
h_dept_str, h_currenvy_str, h_remark_str, h_clearing_form_str, h_def1, h_def2, h_def3, h_def4, h_def5, h_def6,
h_def7, h_def8, h_def9, h_def10, b_kxxz_str, b_ywlx_str, b_currency_str, b_rate_str, b_ybje_str, b_bbje_str,
b_zsxm_str, b_zy_str, b_exchange_rate, b_bank_num, b_def1, b_def2, b_def3, b_def4, b_def5, b_def6, b_def7,
b_def8, b_def9, b_def10, create_time, create_user, modify_time, modify_user, sts, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.name},#{entity.hOrgStr},#{entity.hBillDateStr},#{entity.hWldxStr},#{entity.hCustomerStr},#{entity.hSupplierStr},#{entity.hDeptStr},#{entity.hCurrenvyStr},#{entity.hRemarkStr},#{entity.hClearingFormStr},#{entity.hDef1},#{entity.hDef2},#{entity.hDef3},#{entity.hDef4},#{entity.hDef5},#{entity.hDef6},#{entity.hDef7},#{entity.hDef8},#{entity.hDef9},#{entity.hDef10},#{entity.bKxxzStr},#{entity.bYwlxStr},#{entity.bCurrencyStr},#{entity.bRateStr},#{entity.bYbjeStr},#{entity.bBbjeStr},#{entity.bZsxmStr},#{entity.bZyStr},#{entity.bExchangeRate},#{entity.bBankNum},#{entity.bDef1},#{entity.bDef2},#{entity.bDef3},#{entity.bDef4},#{entity.bDef5},#{entity.bDef6},#{entity.bDef7},#{entity.bDef8},#{entity.bDef9},#{entity.bDef10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_bill_template(name, h_org_str, h_bill_date_str, h_wldx_str, h_customer_str, h_supplier_str,
h_dept_str, h_currenvy_str, h_remark_str, h_clearing_form_str, h_def1, h_def2, h_def3, h_def4, h_def5, h_def6,
h_def7, h_def8, h_def9, h_def10, b_kxxz_str, b_ywlx_str, b_currency_str, b_rate_str, b_ybje_str, b_bbje_str,
b_zsxm_str, b_zy_str, b_exchange_rate, b_bank_num, b_def1, b_def2, b_def3, b_def4, b_def5, b_def6, b_def7,
b_def8, b_def9, b_def10, create_time, create_user, modify_time, modify_user, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.name},#{entity.hOrgStr},#{entity.hBillDateStr},#{entity.hWldxStr},#{entity.hCustomerStr},#{entity.hSupplierStr},#{entity.hDeptStr},#{entity.hCurrenvyStr},#{entity.hRemarkStr},#{entity.hClearingFormStr},#{entity.hDef1},#{entity.hDef2},#{entity.hDef3},#{entity.hDef4},#{entity.hDef5},#{entity.hDef6},#{entity.hDef7},#{entity.hDef8},#{entity.hDef9},#{entity.hDef10},#{entity.bKxxzStr},#{entity.bYwlxStr},#{entity.bCurrencyStr},#{entity.bRateStr},#{entity.bYbjeStr},#{entity.bBbjeStr},#{entity.bZsxmStr},#{entity.bZyStr},#{entity.bExchangeRate},#{entity.bBankNum},#{entity.bDef1},#{entity.bDef2},#{entity.bDef3},#{entity.bDef4},#{entity.bDef5},#{entity.bDef6},#{entity.bDef7},#{entity.bDef8},#{entity.bDef9},#{entity.bDef10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts})
</foreach>
on duplicate key update
name = values(name),
h_org_str = values(h_org_str),
h_bill_date_str = values(h_bill_date_str),
h_wldx_str = values(h_wldx_str),
h_customer_str = values(h_customer_str),
h_supplier_str = values(h_supplier_str),
h_dept_str = values(h_dept_str),
h_currenvy_str = values(h_currenvy_str),
h_remark_str = values(h_remark_str),
h_clearing_form_str = values(h_clearing_form_str),
h_def1 = values(h_def1),
h_def2 = values(h_def2),
h_def3 = values(h_def3),
h_def4 = values(h_def4),
h_def5 = values(h_def5),
h_def6 = values(h_def6),
h_def7 = values(h_def7),
h_def8 = values(h_def8),
h_def9 = values(h_def9),
h_def10 = values(h_def10),
b_kxxz_str = values(b_kxxz_str),
b_ywlx_str = values(b_ywlx_str),
b_currency_str = values(b_currency_str),
b_rate_str = values(b_rate_str),
b_ybje_str = values(b_ybje_str),
b_bbje_str = values(b_bbje_str),
b_zsxm_str = values(b_zsxm_str),
b_zy_str = values(b_zy_str),
b_exchange_rate = values(b_exchange_rate),
b_bank_num = values(b_bank_num),
b_def1 = values(b_def1),
b_def2 = values(b_def2),
b_def3 = values(b_def3),
b_def4 = values(b_def4),
b_def5 = values(b_def5),
b_def6 = values(b_def6),
b_def7 = values(b_def7),
b_def8 = values(b_def8),
b_def9 = values(b_def9),
b_def10 = values(b_def10),
create_time = values(create_time),
create_user = values(create_user),
modify_time = values(modify_time),
modify_user = values(modify_user),
sts = values(sts)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity">
update fe_conf_bill_template set
<trim suffix="" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="hOrgStr != null and hOrgStr != ''">h_org_str = #{hOrgStr},</if>
<if test="hBillDateStr != null and hBillDateStr != ''">h_bill_date_str = #{hBillDateStr},</if>
<if test="hWldxStr != null and hWldxStr != ''">h_wldx_str = #{hWldxStr},</if>
<if test="hUserStr != null and hUserStr != ''">h_user_str = #{hUserStr},</if>
<if test="hCustomerStr != null and hCustomerStr != ''">h_customer_str = #{hCustomerStr},</if>
<if test="hSupplierStr != null and hSupplierStr != ''">h_supplier_str = #{hSupplierStr},</if>
<if test="hDeptStr != null and hDeptStr != ''">h_dept_str = #{hDeptStr},</if>
<if test="hCurrenvyStr != null and hCurrenvyStr != ''">h_currenvy_str = #{hCurrenvyStr},</if>
<if test="hRemarkStr != null and hRemarkStr != ''">h_remark_str = #{hRemarkStr},</if>
<if test="hClearingFormStr != null and hClearingFormStr != ''">h_clearing_form_str = #{hClearingFormStr},
</if>
<if test="hDef1 != null and hDef1 != ''">h_def1 = #{hDef1},</if>
<if test="hDef2 != null and hDef2 != ''">h_def2 = #{hDef2},</if>
<if test="hDef3 != null and hDef3 != ''">h_def3 = #{hDef3},</if>
<if test="hDef4 != null and hDef4 != ''">h_def4 = #{hDef4},</if>
<if test="hDef5 != null and hDef5 != ''">h_def5 = #{hDef5},</if>
<if test="hDef6 != null and hDef6 != ''">h_def6 = #{hDef6},</if>
<if test="hDef7 != null and hDef7 != ''">h_def7 = #{hDef7},</if>
<if test="hDef8 != null and hDef8 != ''">h_def8 = #{hDef8},</if>
<if test="hDef9 != null and hDef9 != ''">h_def9 = #{hDef9},</if>
<if test="hDef10 != null and hDef10 != ''">h_def10 = #{hDef10},</if>
<if test="bKxxzStr != null and bKxxzStr != ''">b_kxxz_str = #{bKxxzStr},</if>
<if test="bYwlxStr != null and bYwlxStr != ''">b_ywlx_str = #{bYwlxStr},</if>
<if test="bCurrencyStr != null and bCurrencyStr != ''">b_currency_str = #{bCurrencyStr},</if>
<if test="bRateStr != null and bRateStr != ''">b_rate_str = #{bRateStr},</if>
<if test="bYbjeStr != null and bYbjeStr != ''">b_ybje_str = #{bYbjeStr},</if>
<if test="bBbjeStr != null and bBbjeStr != ''">b_bbje_str = #{bBbjeStr},</if>
<if test="bZsxmStr != null and bZsxmStr != ''">b_zsxm_str = #{bZsxmStr},</if>
<if test="bZyStr != null and bZyStr != ''">b_zy_str = #{bZyStr},</if>
<if test="bExchangeRate != null and bExchangeRate != ''">b_exchange_rate = #{bExchangeRate},</if>
<if test="bBankNum != null and bBankNum != ''">b_bank_num = #{bBankNum},</if>
<if test="bDef1 != null and bDef1 != ''">b_def1 = #{bDef1},</if>
<if test="bDef2 != null and bDef2 != ''">b_def2 = #{bDef2},</if>
<if test="bDef3 != null and bDef3 != ''">b_def3 = #{bDef3},</if>
<if test="bDef4 != null and bDef4 != ''">b_def4 = #{bDef4},</if>
<if test="bDef5 != null and bDef5 != ''">b_def5 = #{bDef5},</if>
<if test="bDef6 != null and bDef6 != ''">b_def6 = #{bDef6},</if>
<if test="bDef7 != null and bDef7 != ''">b_def7 = #{bDef7},</if>
<if test="bDef8 != null and bDef8 != ''">b_def8 = #{bDef8},</if>
<if test="bDef9 != null and bDef9 != ''">b_def9 = #{bDef9},</if>
<if test="bDef10 != null and bDef10 != ''">b_def10 = #{bDef10},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="createUser != null and createUser != ''">create_user = #{createUser},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="modify_time == null">modify_time = now(),</if>
<if test="modifyUser != null and modifyUser != ''">modify_user = #{modifyUser},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete"
parameterType="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity">
update fe_conf_bill_template
set sts= 'N',
modify_time = now()
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity">
update fe_conf_bill_template set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="hOrgStr != null and hOrgStr != ''">and h_org_str = #{hOrgStr}</if>
<if test="hBillDateStr != null and hBillDateStr != ''">and h_bill_date_str = #{hBillDateStr}</if>
<if test="hWldxStr != null and hWldxStr != ''">and h_wldx_str = #{hWldxStr}</if>
<if test="hUserStr != null and hUserStr != ''">and h_user_str = #{hUserStr}</if>
<if test="hCustomerStr != null and hCustomerStr != ''">and h_customer_str = #{hCustomerStr}</if>
<if test="hSupplierStr != null and hSupplierStr != ''">and h_supplier_str = #{hSupplierStr}</if>
<if test="hDeptStr != null and hDeptStr != ''">and h_dept_str = #{hDeptStr}</if>
<if test="hCurrenvyStr != null and hCurrenvyStr != ''">and h_currenvy_str = #{hCurrenvyStr}</if>
<if test="hRemarkStr != null and hRemarkStr != ''">and h_remark_str = #{hRemarkStr}</if>
<if test="hClearingFormStr != null and hClearingFormStr != ''">and h_clearing_form_str =
#{hClearingFormStr}
</if>
<if test="hDef1 != null and hDef1 != ''">and h_def1 = #{hDef1}</if>
<if test="hDef2 != null and hDef2 != ''">and h_def2 = #{hDef2}</if>
<if test="hDef3 != null and hDef3 != ''">and h_def3 = #{hDef3}</if>
<if test="hDef4 != null and hDef4 != ''">and h_def4 = #{hDef4}</if>
<if test="hDef5 != null and hDef5 != ''">and h_def5 = #{hDef5}</if>
<if test="hDef6 != null and hDef6 != ''">and h_def6 = #{hDef6}</if>
<if test="hDef7 != null and hDef7 != ''">and h_def7 = #{hDef7}</if>
<if test="hDef8 != null and hDef8 != ''">and h_def8 = #{hDef8}</if>
<if test="hDef9 != null and hDef9 != ''">and h_def9 = #{hDef9}</if>
<if test="hDef10 != null and hDef10 != ''">and h_def10 = #{hDef10}</if>
<if test="bKxxzStr != null and bKxxzStr != ''">and b_kxxz_str = #{bKxxzStr}</if>
<if test="bYwlxStr != null and bYwlxStr != ''">and b_ywlx_str = #{bYwlxStr}</if>
<if test="bCurrencyStr != null and bCurrencyStr != ''">and b_currency_str = #{bCurrencyStr}</if>
<if test="bRateStr != null and bRateStr != ''">and b_rate_str = #{bRateStr}</if>
<if test="bYbjeStr != null and bYbjeStr != ''">and b_ybje_str = #{bYbjeStr}</if>
<if test="bBbjeStr != null and bBbjeStr != ''">and b_bbje_str = #{bBbjeStr}</if>
<if test="bZsxmStr != null and bZsxmStr != ''">and b_zsxm_str = #{bZsxmStr}</if>
<if test="bZyStr != null and bZyStr != ''">and b_zy_str = #{bZyStr}</if>
<if test="bExchangeRate != null and bExchangeRate != ''">and b_exchange_rate = #{bExchangeRate}</if>
<if test="bBankNum != null and bBankNum != ''">and b_bank_num = #{bBankNum}</if>
<if test="bDef1 != null and bDef1 != ''">and b_def1 = #{bDef1}</if>
<if test="bDef2 != null and bDef2 != ''">and b_def2 = #{bDef2}</if>
<if test="bDef3 != null and bDef3 != ''">and b_def3 = #{bDef3}</if>
<if test="bDef4 != null and bDef4 != ''">and b_def4 = #{bDef4}</if>
<if test="bDef5 != null and bDef5 != ''">and b_def5 = #{bDef5}</if>
<if test="bDef6 != null and bDef6 != ''">and b_def6 = #{bDef6}</if>
<if test="bDef7 != null and bDef7 != ''">and b_def7 = #{bDef7}</if>
<if test="bDef8 != null and bDef8 != ''">and b_def8 = #{bDef8}</if>
<if test="bDef9 != null and bDef9 != ''">and b_def9 = #{bDef9}</if>
<if test="bDef10 != null and bDef10 != ''">and b_def10 = #{bDef10}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from fe_conf_bill_template
where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,22 @@
package com.hzya.frame.finance.conf.billtemplate.service;
import com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
/**
* (FeConfBillTemplate)表服务接口
*
* @author zydd
* @since 2025-08-29 17:44:59
*/
public interface IFeConfBillTemplateService extends IBaseService<FeConfBillTemplateEntity, String>{
List<FeConfBillTemplateEntity> queryAll(FeConfBillTemplateEntity billTemplateEntity);
FeConfBillTemplateEntity saveEntity(FeConfBillTemplateEntity billTemplateEntity);
FeConfBillTemplateEntity updateEntity(FeConfBillTemplateEntity billTemplateEntity);
void deleteEntity(FeConfBillTemplateEntity billTemplateEntity);
}

View File

@ -0,0 +1,170 @@
package com.hzya.frame.finance.conf.billtemplate.service.impl;
import cn.hutool.core.lang.Assert;
import com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity;
import com.hzya.frame.finance.conf.billtemplate.dao.IFeConfBillTemplateDao;
import com.hzya.frame.finance.conf.billtemplate.service.IFeConfBillTemplateService;
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectClassificationEntity;
import com.hzya.frame.voucher.ae.comf.subject.service.IAeConfSubjectClassificationService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* (FeConfBillTemplate)表服务实现类
*
* @author zydd
* @since 2025-08-29 17:44:59
*/
@Service
public class FeConfBillTemplateServiceImpl extends BaseService<FeConfBillTemplateEntity, String> implements IFeConfBillTemplateService {
private IFeConfBillTemplateDao feConfBillTemplateDao;
@Autowired
public void setFeConfBillTemplateDao(IFeConfBillTemplateDao dao) {
this.feConfBillTemplateDao = dao;
this.dao = dao;
}
@Autowired
private IAeConfSubjectClassificationService classificationService;
@Autowired
private IMdmDBQueryVODAO mdmDBQueryVODAO;
@Override
public List<FeConfBillTemplateEntity> queryAll(FeConfBillTemplateEntity billTemplateEntity) {
//查询认领方案
AeConfSubjectClassificationEntity aeConfSubjectClassificationEntity = new AeConfSubjectClassificationEntity();
List<AeConfSubjectClassificationEntity> classificationEntities = classificationService.queryAll(aeConfSubjectClassificationEntity);
Map<String,String> classificationMap =new HashMap<>();
// for (AeConfSubjectClassificationEntity classificationEntity : classificationEntities) {
// classificationMap.put(classificationEntity.getId(),classificationEntity.getName());
// }
classificationEntities.forEach(index->{
classificationMap.put(index.getId(),index.getName());
});
List<FeConfBillTemplateEntity> all = feConfBillTemplateDao.query(billTemplateEntity);
for (FeConfBillTemplateEntity feConfBillTemplateEntity : all) {
//hOrgName 财务组织取值
feConfBillTemplateEntity.sethOrgName(classificationMap.get(feConfBillTemplateEntity.gethOrgStr()));
//hBillDateName 单据日期
feConfBillTemplateEntity.sethBillDateName(classificationMap.get(feConfBillTemplateEntity.gethBillDateStr()));
// hWldxName 往来对象标识
feConfBillTemplateEntity.sethWldxName(classificationMap.get(feConfBillTemplateEntity.gethWldxStr()));
// hUserName 人员
feConfBillTemplateEntity.sethUserName(classificationMap.get(feConfBillTemplateEntity.gethUserStr()));
// hSupplierName 供应商
feConfBillTemplateEntity.sethSupplierName(classificationMap.get(feConfBillTemplateEntity.gethSupplierStr()));
// hDeptName 部门
feConfBillTemplateEntity.sethDeptName(classificationMap.get(feConfBillTemplateEntity.gethDeptStr()));
// hCustomerName 客户
feConfBillTemplateEntity.sethCustomerName(classificationMap.get(feConfBillTemplateEntity.gethCustomerStr()));
// hCurrenvyName 币种
feConfBillTemplateEntity.sethCurrenvyName(classificationMap.get(feConfBillTemplateEntity.gethCurrenvyStr()));
// hRemarkName 备注
feConfBillTemplateEntity.sethRemarkName(classificationMap.get(feConfBillTemplateEntity.gethRemarkStr()));
// hClearingFormName 结算方式
feConfBillTemplateEntity.sethClearingFormName(classificationMap.get(feConfBillTemplateEntity.gethClearingFormStr()));
// bKxxzName 款项性质
feConfBillTemplateEntity.setbKxxzName(classificationMap.get(feConfBillTemplateEntity.getbKxxzStr()));
// bYwlxName 业务类型
feConfBillTemplateEntity.setbYwlxName(classificationMap.get(feConfBillTemplateEntity.getbYwlxStr()));
// bCurrencyName 币种明细行
feConfBillTemplateEntity.setbCurrencyName(classificationMap.get(feConfBillTemplateEntity.getbCurrencyStr()));
// bRateName 税率
feConfBillTemplateEntity.setbRateName(classificationMap.get(feConfBillTemplateEntity.getbRateStr()));
// bYbjeName 原币金额
feConfBillTemplateEntity.setbYbjeName(classificationMap.get(feConfBillTemplateEntity.getbYbjeStr()));
// bBbjeName 本币金额
feConfBillTemplateEntity.setbBbjeName(classificationMap.get(feConfBillTemplateEntity.getbBbjeStr()));
// bZsxmName 收支项目
feConfBillTemplateEntity.setbZsxmName(classificationMap.get(feConfBillTemplateEntity.getbZsxmStr()));
// bZyName 摘要
feConfBillTemplateEntity.setbZyName(classificationMap.get(feConfBillTemplateEntity.getbZyStr()));
// bExchangeName 汇率
feConfBillTemplateEntity.setbExchangeName(classificationMap.get(feConfBillTemplateEntity.getbExchangeStr()));
// bBankName 银行账号
feConfBillTemplateEntity.setbBankName(classificationMap.get(feConfBillTemplateEntity.getbBankStr()));
}
return all;
}
@Override
public FeConfBillTemplateEntity saveEntity(FeConfBillTemplateEntity billTemplateEntity) {
checkAssistNull("saveEntity",billTemplateEntity);
FeConfBillTemplateEntity save = feConfBillTemplateDao.save(billTemplateEntity);
//新增数据--mdm_bf_sfdj code name
MdmDBQueryVO mdmDBQueryVO = new MdmDBQueryVO();
mdmDBQueryVO.setTablename("mdm_bf_sfdj");
mdmDBQueryVO.setProp1("name");
mdmDBQueryVO.setPropValue1(billTemplateEntity.getName());
mdmDBQueryVO.setProp2("code");
mdmDBQueryVO.setPropValue2(save.getId());
mdmDBQueryVODAO.inserDataVO(mdmDBQueryVO);
return save;
}
@Override
public FeConfBillTemplateEntity updateEntity(FeConfBillTemplateEntity billTemplateEntity) {
checkAssistNull("updateEntity",billTemplateEntity);
feConfBillTemplateDao.update(billTemplateEntity);
MdmDBQueryVO mdmDBQueryVO = new MdmDBQueryVO();
mdmDBQueryVO.setTablename("mdm_bf_sfdj");
mdmDBQueryVO.setProp2("code");
mdmDBQueryVO.setPropValue2(billTemplateEntity.getId());
mdmDBQueryVODAO.deleteDataVO(mdmDBQueryVO);
mdmDBQueryVO.setProp1("name");
mdmDBQueryVO.setPropValue1(billTemplateEntity.getName());
mdmDBQueryVODAO.inserDataVO(mdmDBQueryVO);
return billTemplateEntity;
}
@Override
public void deleteEntity(FeConfBillTemplateEntity billTemplateEntity) {
checkAssistNull("deleteEntity",billTemplateEntity);
feConfBillTemplateDao.logicRemove(billTemplateEntity);
MdmDBQueryVO mdmDBQueryVO = new MdmDBQueryVO();
mdmDBQueryVO.setTablename("mdm_bf_sfdj");
mdmDBQueryVO.setProp1("name");
mdmDBQueryVO.setPropValue1(billTemplateEntity.getName());
mdmDBQueryVO.setProp2("code");
mdmDBQueryVODAO.deleteDataVO(mdmDBQueryVO);
}
public void checkAssistNull(String type, FeConfBillTemplateEntity entity) {
switch (type) {
case "saveEntity":
Assert.notNull(entity.getName(),"收付款单据配置保存时,名称不能为空");
break;
case "updateEntity":
Assert.notNull(entity.getId(),"收付款单据配置更新时id不能为空");
Assert.notNull(entity.getName(),"收付款单据配置更新时,名称不能为空");
break;
case "deleteEntity":
Assert.notNull(entity.getId(),"收付款单据配置删除时id不能为空");
break;
}
}
}

View File

@ -0,0 +1,28 @@
package com.hzya.frame.finance.conf.fileeigen.controller;
import com.hzya.frame.finance.conf.fileeigen.service.IFeConfModuleService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
@RestController
@RequestMapping("/excel")
public class ExcelController {
@Autowired
private IFeConfModuleService feConfModuleService;
/**
* 导入数据模版
*/
@PostMapping("/importDataTemplate")
public JsonResultEntity importExcel(@RequestParam("file") MultipartFile file, @RequestParam("mdmCode") Long mdmCode, @RequestParam("dbName")String dbName) throws IOException {
feConfModuleService.importDataTemplateBatch(file,mdmCode,dbName);
return new JsonResultEntity("导入模版成功",true,200);
}
}

View File

@ -0,0 +1,166 @@
package com.hzya.frame.finance.conf.fileeigen.controller;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity;
import com.hzya.frame.finance.conf.fileeigen.service.IFeConfFileEigenService;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* Created by zydd on 2025-08-19 15:15
* 档案特征
*/
@RestController
@RequestMapping("/fe/conf/fileeigen")
public class FileEigenController extends DefaultController {
@Autowired
private IFeConfFileEigenService fileEigenService;
@RequestMapping(value = "/queryAll", method = RequestMethod.POST)
public JsonResultEntity queryAll(@RequestBody FeConfFileEigenEntity entity) {
try {
List<FeConfFileEigenEntity> all = fileEigenService.queryAll(entity);
return getSuccessMessageEntity("请求成功", all);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
public JsonResultEntity saveEntity(@RequestBody List<FeConfFileEigenEntity> list) {
try {
String save = fileEigenService.saveEntity(list);
if(save.contains("失败")){
return getFailureMessageEntity(save);
}
return getSuccessMessageEntity("请求成功", save);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
public JsonResultEntity updateEntity(@RequestBody List<FeConfFileEigenEntity> list) {
try {
String update = fileEigenService.updateEntity(list);
if(update.contains("失败")){
return getFailureMessageEntity(update);
}
return getSuccessMessageEntity("请求成功", update);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public JsonResultEntity deleteEntity(@RequestBody List<FeConfFileEigenEntity> list) {
try {
fileEigenService.deleteEntity(list);
return getSuccessMessageEntity("请求成功");
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询有档案特征的mdm
*/
@RequestMapping(value = "/queryMdmAll", method = RequestMethod.POST)
public JsonResultEntity queryMdmAll(@RequestBody FeConfFileEigenEntity entity) {
try {
List<FeConfFileEigenEntity> queryMdmAll = fileEigenService.queryMdmAll(entity);
return getSuccessMessageEntity("请求成功", queryMdmAll);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 根据mdmID查询数据
*/
@RequestMapping(value = "/queryDataMapByMdmId", method = RequestMethod.POST)
public JsonResultEntity queryDataMapByMdmId(@RequestBody FeConfFileEigenEntity entity) {
try {
List<Map<String, Object>> dataMapList = fileEigenService.queryDataMapByMdmId(entity);
return getSuccessMessageEntity("请求成功", dataMapList);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 根据mdmID查询数据
*/
@RequestMapping(value = "/queryDataMapPagedByMdmId", method = RequestMethod.POST)
public JsonResultEntity queryDataMapPagedByMdmId(@RequestBody FeConfFileEigenEntity entity) {
try {
PageInfo pageInfo = fileEigenService.queryDataMapPagedByMdmId(entity);
return getSuccessMessageEntity("请求成功", pageInfo);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 自动生成特征
*/
@RequestMapping(value = "/autoExecute", method = RequestMethod.POST)
public JsonResultEntity autoXxecute(@RequestBody FeConfFileEigenEntity entity) {
try {
List<FeConfFileEigenEntity> autoExecute = fileEigenService.autoExecute(entity);
return getSuccessMessageEntity("请求成功", autoExecute);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 档案搜索
*/
@RequestMapping(value = "/searchFile", method = RequestMethod.POST)
public JsonResultEntity searchFile(@RequestBody FeConfFileEigenEntity entity) {
try {
List<Map<String, Object>> autoExecute = fileEigenService.searchFile(entity);
return getSuccessMessageEntity("请求成功", autoExecute);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 特征值搜索
*/
@RequestMapping(value = "/searchName", method = RequestMethod.POST)
public JsonResultEntity searchName(@RequestBody FeConfFileEigenEntity entity) {
try {
List<FeConfFileEigenEntity> autoExecute = fileEigenService.searchName(entity);
return getSuccessMessageEntity("请求成功", autoExecute);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
}

View File

@ -0,0 +1,119 @@
package com.hzya.frame.finance.conf.fileeigen.controller;
import cn.hutool.core.lang.Assert;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity;
import com.hzya.frame.finance.conf.fileeigen.service.IFeConfModuleService;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created by zydd on 2025-08-20 10:05
* 档案特征-业务模块
*/
@RestController("fileeigenMdmModuleController")
@RequestMapping("/fe/conf/fileeigenmodule")
public class ModuleController extends DefaultController {
@Autowired
private IFeConfModuleService feConfModuleService;
@Autowired
private IMdmModuleDao mdmModuleDao;
@RequestMapping(value = "/queryMdm1", method = RequestMethod.POST)
public JsonResultEntity queryMdm1(@RequestBody FeConfModuleEntity entity) {
try {
MdmModuleEntity mdmModuleEntity = new MdmModuleEntity();
mdmModuleEntity.setMdmType("1");
List<MdmModuleEntity> query = mdmModuleDao.query(mdmModuleEntity);
return getSuccessMessageEntity("请求成功", query);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping(value = "/queryAll", method = RequestMethod.POST)
public JsonResultEntity queryAll(@RequestBody FeConfModuleEntity entity) {
try {
List<FeConfModuleEntity> all = feConfModuleService.query(entity);
for (FeConfModuleEntity feConfModuleEntity : all) {
String id = feConfModuleEntity.getMdmId();
MdmModuleEntity mdmModuleEntity = new MdmModuleEntity();
mdmModuleEntity.setId(id);
List<MdmModuleEntity> query = mdmModuleDao.query(mdmModuleEntity);
if (query.size() == 0) {
return getSuccessMessageEntity("请求成功", all);
}
MdmModuleEntity mdmModuleEntity1 = query.get(0);
feConfModuleEntity.setMdmCode(String.valueOf(mdmModuleEntity1.getMdmCode()));
feConfModuleEntity.setMdmName(mdmModuleEntity1.getMdmName());
}
return getSuccessMessageEntity("请求成功", all);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
public JsonResultEntity save(@RequestBody FeConfModuleEntity entity) {
try {
Assert.notNull(entity.getMdmId());
List<FeConfModuleEntity> query1 = feConfModuleService.query(entity);
if (query1.size() > 0) {
Assert.state(false, "该模块已存在,请勿重复添加");
}
FeConfModuleEntity all = feConfModuleService.save(entity);
String mdmId = entity.getMdmId();
MdmModuleEntity mdmModuleEntity = new MdmModuleEntity();
mdmModuleEntity.setId(mdmId);
List<MdmModuleEntity> query = mdmModuleDao.query(mdmModuleEntity);
MdmModuleEntity mdmModuleEntity1 = query.get(0);
all.setMdmCode(String.valueOf(mdmModuleEntity1.getMdmCode()));
all.setMdmName(mdmModuleEntity1.getMdmName());
return getSuccessMessageEntity("请求成功", all);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
public JsonResultEntity update(@RequestBody FeConfModuleEntity entity) {
try {
Assert.notNull(entity.getMdmId());
Assert.notNull(entity.getId());
feConfModuleService.update(entity);
return getSuccessMessageEntity("请求成功", entity);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public JsonResultEntity delete(@RequestBody FeConfModuleEntity entity) {
try {
Assert.notNull(entity.getId());
feConfModuleService.logicRemove(entity);
return getSuccessMessageEntity("请求成功");
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.finance.conf.fileeigen.dao;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* 财资事项(finance_event)-配置-档案特征(fe_conf_file_eigen: table)表数据库访问层
*
* @author zydd
* @since 2025-08-19 15:12:04
*/
public interface IFeConfFileEigenDao extends IBaseDao<FeConfFileEigenEntity, String> {
List<FeConfFileEigenEntity> queryMdmAll(FeConfFileEigenEntity entity);
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.finance.conf.fileeigen.dao;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 财资事项(finance_event)-配置-档案特征-模块(fe_conf_module: table)表数据库访问层
*
* @author zydd
* @since 2025-08-20 10:00:30
*/
public interface IFeConfModuleDao extends IBaseDao<FeConfModuleEntity, String> {
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.finance.conf.fileeigen.dao.impl;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity;
import com.hzya.frame.finance.conf.fileeigen.dao.IFeConfFileEigenDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 财资事项(finance_event)-配置-档案特征(FeConfFileEigen)表数据库访问层
*
* @author zydd
* @since 2025-08-19 15:12:04
*/
@Repository
public class FeConfFileEigenDaoImpl extends MybatisGenericDao<FeConfFileEigenEntity, String> implements IFeConfFileEigenDao{
@Override
public List<FeConfFileEigenEntity> queryMdmAll(FeConfFileEigenEntity entity) {
List<FeConfFileEigenEntity> queryMdmAll = (List<FeConfFileEigenEntity>)selectList("com.hzya.frame.finance.conf.fileeigen.dao.impl.FeConfFileEigenDaoImpl.queryMdmAll", entity);
return queryMdmAll;
}
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.finance.conf.fileeigen.dao.impl;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity;
import com.hzya.frame.finance.conf.fileeigen.dao.IFeConfModuleDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 财资事项(finance_event)-配置-档案特征-模块(FeConfModule)表数据库访问层
*
* @author zydd
* @since 2025-08-20 10:00:30
*/
@Repository
public class FeConfModuleDaoImpl extends MybatisGenericDao<FeConfModuleEntity, String> implements IFeConfModuleDao{
}

View File

@ -0,0 +1,56 @@
package com.hzya.frame.finance.conf.fileeigen.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data;
/**
* 财资事项(finance_event)-配置-档案特征(FeConfFileEigen)实体类
*
* @author zydd
* @since 2025-08-19 15:12:04
*/
@Data
public class FeConfFileEigenEntity extends BaseEntity {
private String splitName;
/**
* 主数据ID
*/
private String mdmId;
private String mdmCode;
private String mdmName;
/**
* 数据ID
*/
private String mdmDataId;
private String mdmDataCode;
private String mdmDataName;
/**
* 特征值
*/
private String name;
private String def1;
private String def2;
private String def3;
private String def4;
private String def5;
private String def6;
private String def7;
private String def8;
private String def9;
private String def10;
/**
* 创建人
*/
private String createUser;
/**
* 修改人
*/
private String modifyUser;
}

View File

@ -0,0 +1,338 @@
<?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.finance.conf.fileeigen.dao.impl.FeConfFileEigenDaoImpl">
<resultMap id="get-FeConfFileEigenEntity-result"
type="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="mdmCode" column="mdm_code" jdbcType="VARCHAR"/>
<result property="mdmName" column="mdm_name" jdbcType="VARCHAR"/>
<result property="mdmDataId" column="mdm_data_id" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/>
<result property="def4" column="def4" jdbcType="VARCHAR"/>
<result property="def5" column="def5" jdbcType="VARCHAR"/>
<result property="def6" column="def6" jdbcType="VARCHAR"/>
<result property="def7" column="def7" jdbcType="VARCHAR"/>
<result property="def8" column="def8" jdbcType="VARCHAR"/>
<result property="def9" column="def9" jdbcType="VARCHAR"/>
<result property="def10" column="def10" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="modifyUser" column="modify_user" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="FeConfFileEigenEntity_Base_Column_List">
id
,mdm_id
,mdm_data_id
,name
,def1
,def2
,def3
,def4
,def5
,def6
,def7
,def8
,def9
,def10
,create_time
,create_user
,modify_time
,modify_user
,sts
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-FeConfFileEigenEntity-result"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
select
<include refid="FeConfFileEigenEntity_Base_Column_List"/>
from fe_conf_file_eigen
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="mdmDataId != null and mdmDataId != ''">and mdm_data_id = #{mdmDataId}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
select count(1) from fe_conf_file_eigen
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="mdmDataId != null and mdmDataId != ''">and mdm_data_id = #{mdmDataId}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-FeConfFileEigenEntity-result"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
select
<include refid="FeConfFileEigenEntity_Base_Column_List"/>
from fe_conf_file_eigen
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id like concat('%',#{id},'%')</if>
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
<if test="mdmDataId != null and mdmDataId != ''">and mdm_data_id like concat('%',#{mdmDataId},'%')</if>
<if test="name != null and name != ''">and name like concat('%',#{name},'%')</if>
<if test="def1 != null and def1 != ''">and def1 like concat('%',#{def1},'%')</if>
<if test="def2 != null and def2 != ''">and def2 like concat('%',#{def2},'%')</if>
<if test="def3 != null and def3 != ''">and def3 like concat('%',#{def3},'%')</if>
<if test="def4 != null and def4 != ''">and def4 like concat('%',#{def4},'%')</if>
<if test="def5 != null and def5 != ''">and def5 like concat('%',#{def5},'%')</if>
<if test="def6 != null and def6 != ''">and def6 like concat('%',#{def6},'%')</if>
<if test="def7 != null and def7 != ''">and def7 like concat('%',#{def7},'%')</if>
<if test="def8 != null and def8 != ''">and def8 like concat('%',#{def8},'%')</if>
<if test="def9 != null and def9 != ''">and def9 like concat('%',#{def9},'%')</if>
<if test="def10 != null and def10 != ''">and def10 like concat('%',#{def10},'%')</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="createUser != null and createUser != ''">and create_user like concat('%',#{createUser},'%')</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user like concat('%',#{modifyUser},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
and sts='Y'
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="FeConfFileEigenentity_list_or" resultMap="get-FeConfFileEigenEntity-result"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
select
<include refid="FeConfFileEigenEntity_Base_Column_List"/>
from fe_conf_file_eigen
<trim prefix="where" prefixOverrides="and">
<if test="id != null">or id = #{id}</if>
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
<if test="mdmDataId != null and mdmDataId != ''">or mdm_data_id = #{mdmDataId}</if>
<if test="name != null and name != ''">or name = #{name}</if>
<if test="def1 != null and def1 != ''">or def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">or def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">or def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">or def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">or def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">or def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">or def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">or def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">or def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">or def10 = #{def10}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">or create_user = #{createUser}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">or modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity"
keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_file_eigen(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
<if test="mdmDataId != null and mdmDataId != ''">mdm_data_id ,</if>
<if test="name != null and name != ''">name ,</if>
<if test="def1 != null and def1 != ''">def1 ,</if>
<if test="def2 != null and def2 != ''">def2 ,</if>
<if test="def3 != null and def3 != ''">def3 ,</if>
<if test="def4 != null and def4 != ''">def4 ,</if>
<if test="def5 != null and def5 != ''">def5 ,</if>
<if test="def6 != null and def6 != ''">def6 ,</if>
<if test="def7 != null and def7 != ''">def7 ,</if>
<if test="def8 != null and def8 != ''">def8 ,</if>
<if test="def9 != null and def9 != ''">def9 ,</if>
<if test="def10 != null and def10 != ''">def10 ,</if>
<if test="create_time != null">create_time ,</if>
<if test="create_time == null">create_time ,</if>
<if test="createUser != null and createUser != ''">create_user ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="modify_time == null">modify_time ,</if>
<if test="modifyUser != null and modifyUser != ''">modify_user ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
<if test="mdmDataId != null and mdmDataId != ''">#{mdmDataId} ,</if>
<if test="name != null and name != ''">#{name} ,</if>
<if test="def1 != null and def1 != ''">#{def1} ,</if>
<if test="def2 != null and def2 != ''">#{def2} ,</if>
<if test="def3 != null and def3 != ''">#{def3} ,</if>
<if test="def4 != null and def4 != ''">#{def4} ,</if>
<if test="def5 != null and def5 != ''">#{def5} ,</if>
<if test="def6 != null and def6 != ''">#{def6} ,</if>
<if test="def7 != null and def7 != ''">#{def7} ,</if>
<if test="def8 != null and def8 != ''">#{def8} ,</if>
<if test="def9 != null and def9 != ''">#{def9} ,</if>
<if test="def10 != null and def10 != ''">#{def10} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="create_time == null">now() ,</if>
<if test="createUser != null and createUser != ''">#{createUser} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="modify_time == null">now() ,</if>
<if test="modifyUser != null and modifyUser != ''">#{modifyUser} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_file_eigen(mdm_id, mdm_data_id, name, def1, def2, def3, def4, def5, def6, def7, def8, def9,
def10, create_time, create_user, modify_time, modify_user, sts, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.mdmDataId},#{entity.name},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_file_eigen(mdm_id, mdm_data_id, name, def1, def2, def3, def4, def5, def6, def7, def8, def9,
def10, create_time, create_user, modify_time, modify_user, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.mdmDataId},#{entity.name},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
mdm_data_id = values(mdm_data_id),
name = values(name),
def1 = values(def1),
def2 = values(def2),
def3 = values(def3),
def4 = values(def4),
def5 = values(def5),
def6 = values(def6),
def7 = values(def7),
def8 = values(def8),
def9 = values(def9),
def10 = values(def10),
create_time = values(create_time),
create_user = values(create_user),
modify_time = values(modify_time),
modify_user = values(modify_user),
sts = values(sts)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
update fe_conf_file_eigen set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
<if test="mdmDataId != null and mdmDataId != ''">mdm_data_id = #{mdmDataId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="def1 != null and def1 != ''">def1 = #{def1},</if>
<if test="def2 != null and def2 != ''">def2 = #{def2},</if>
<if test="def3 != null and def3 != ''">def3 = #{def3},</if>
<if test="def4 != null and def4 != ''">def4 = #{def4},</if>
<if test="def5 != null and def5 != ''">def5 = #{def5},</if>
<if test="def6 != null and def6 != ''">def6 = #{def6},</if>
<if test="def7 != null and def7 != ''">def7 = #{def7},</if>
<if test="def8 != null and def8 != ''">def8 = #{def8},</if>
<if test="def9 != null and def9 != ''">def9 = #{def9},</if>
<if test="def10 != null and def10 != ''">def10 = #{def10},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="modify_time == null">modify_time = now(),</if>
<if test="modifyUser != null and modifyUser != ''">modify_user = #{modifyUser},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
update fe_conf_file_eigen
set sts= 'N',
modify_time = now()
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
update fe_conf_file_eigen set sts= 'N' ,modify_time = now()
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="mdmDataId != null and mdmDataId != ''">and mdm_data_id = #{mdmDataId}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from fe_conf_file_eigen
where id = #{id}
</delete>
<select id="queryMdmAll" resultType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity">
SELECT DISTINCT
fe_conf_file_eigen.mdm_id,
mdm_module.mdm_code,
mdm_module.mdm_name
FROM
fe_conf_file_eigen
LEFT JOIN mdm_module ON mdm_module.id = fe_conf_file_eigen.mdm_id COLLATE utf8mb4_general_ci
WHERE
fe_conf_file_eigen.sts = 'Y'
</select>
</mapper>

View File

@ -0,0 +1,44 @@
package com.hzya.frame.finance.conf.fileeigen.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data;
/**
* 财资事项(finance_event)-配置-档案特征-模块(FeConfModule)实体类
*
* @author zydd
* @since 2025-08-20 10:00:30
*/
@Data
public class FeConfModuleEntity extends BaseEntity {
/**
* 模块id
*/
private String mdmId;
private String mdmCode;
private String mdmName;
private String def1;
private String def2;
private String def3;
private String def4;
private String def5;
private String def6;
private String def7;
private String def8;
private String def9;
private String def10;
/**
* 创建人
*/
private String createUser;
/**
* 修改人
*/
private String modifyUser;
}

View File

@ -0,0 +1,306 @@
<?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.finance.conf.fileeigen.dao.impl.FeConfModuleDaoImpl">
<resultMap id="get-FeConfModuleEntity-result"
type="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="mdmCode" column="mdm_coe" jdbcType="VARCHAR"/>
<result property="mdmName" column="mdm_name" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/>
<result property="def4" column="def4" jdbcType="VARCHAR"/>
<result property="def5" column="def5" jdbcType="VARCHAR"/>
<result property="def6" column="def6" jdbcType="VARCHAR"/>
<result property="def7" column="def7" jdbcType="VARCHAR"/>
<result property="def8" column="def8" jdbcType="VARCHAR"/>
<result property="def9" column="def9" jdbcType="VARCHAR"/>
<result property="def10" column="def10" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="modifyUser" column="modify_user" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="FeConfModuleEntity_Base_Column_List">
id
,mdm_id
,def1
,def2
,def3
,def4
,def5
,def6
,def7
,def8
,def9
,def10
,create_time
,create_user
,modify_time
,modify_user
,sts
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-FeConfModuleEntity-result"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity">
select
<include refid="FeConfModuleEntity_Base_Column_List"/>
from fe_conf_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity">
select count(1) from fe_conf_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-FeConfModuleEntity-result"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity">
select
<include refid="FeConfModuleEntity_Base_Column_List"/>
from fe_conf_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id like concat('%',#{id},'%')</if>
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
<if test="def1 != null and def1 != ''">and def1 like concat('%',#{def1},'%')</if>
<if test="def2 != null and def2 != ''">and def2 like concat('%',#{def2},'%')</if>
<if test="def3 != null and def3 != ''">and def3 like concat('%',#{def3},'%')</if>
<if test="def4 != null and def4 != ''">and def4 like concat('%',#{def4},'%')</if>
<if test="def5 != null and def5 != ''">and def5 like concat('%',#{def5},'%')</if>
<if test="def6 != null and def6 != ''">and def6 like concat('%',#{def6},'%')</if>
<if test="def7 != null and def7 != ''">and def7 like concat('%',#{def7},'%')</if>
<if test="def8 != null and def8 != ''">and def8 like concat('%',#{def8},'%')</if>
<if test="def9 != null and def9 != ''">and def9 like concat('%',#{def9},'%')</if>
<if test="def10 != null and def10 != ''">and def10 like concat('%',#{def10},'%')</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="createUser != null and createUser != ''">and create_user like concat('%',#{createUser},'%')</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user like concat('%',#{modifyUser},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
and sts='Y'
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="FeConfModuleentity_list_or" resultMap="get-FeConfModuleEntity-result"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity">
select
<include refid="FeConfModuleEntity_Base_Column_List"/>
from fe_conf_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null">or id = #{id}</if>
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
<if test="def1 != null and def1 != ''">or def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">or def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">or def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">or def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">or def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">or def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">or def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">or def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">or def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">or def10 = #{def10}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">or create_user = #{createUser}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">or modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity"
keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_module(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
<if test="def1 != null and def1 != ''">def1 ,</if>
<if test="def2 != null and def2 != ''">def2 ,</if>
<if test="def3 != null and def3 != ''">def3 ,</if>
<if test="def4 != null and def4 != ''">def4 ,</if>
<if test="def5 != null and def5 != ''">def5 ,</if>
<if test="def6 != null and def6 != ''">def6 ,</if>
<if test="def7 != null and def7 != ''">def7 ,</if>
<if test="def8 != null and def8 != ''">def8 ,</if>
<if test="def9 != null and def9 != ''">def9 ,</if>
<if test="def10 != null and def10 != ''">def10 ,</if>
<if test="create_time != null">create_time ,</if>
<if test="create_time == null">create_time ,</if>
<if test="createUser != null and createUser != ''">create_user ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="modify_time == null">modify_time ,</if>
<if test="modifyUser != null and modifyUser != ''">modify_user ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
<if test="def1 != null and def1 != ''">#{def1} ,</if>
<if test="def2 != null and def2 != ''">#{def2} ,</if>
<if test="def3 != null and def3 != ''">#{def3} ,</if>
<if test="def4 != null and def4 != ''">#{def4} ,</if>
<if test="def5 != null and def5 != ''">#{def5} ,</if>
<if test="def6 != null and def6 != ''">#{def6} ,</if>
<if test="def7 != null and def7 != ''">#{def7} ,</if>
<if test="def8 != null and def8 != ''">#{def8} ,</if>
<if test="def9 != null and def9 != ''">#{def9} ,</if>
<if test="def10 != null and def10 != ''">#{def10} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="create_time == null">now() ,</if>
<if test="createUser != null and createUser != ''">#{createUser} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="modify_time == null">now() ,</if>
<if test="modifyUser != null and modifyUser != ''">#{modifyUser} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_module(mdm_id, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, create_time,
create_user, modify_time, modify_user, sts, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_module(mdm_id, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, create_time,
create_user, modify_time, modify_user, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
def1 = values(def1),
def2 = values(def2),
def3 = values(def3),
def4 = values(def4),
def5 = values(def5),
def6 = values(def6),
def7 = values(def7),
def8 = values(def8),
def9 = values(def9),
def10 = values(def10),
create_time = values(create_time),
create_user = values(create_user),
modify_time = values(modify_time),
modify_user = values(modify_user),
sts = values(sts)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity">
update fe_conf_module set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
<if test="def1 != null and def1 != ''">def1 = #{def1},</if>
<if test="def2 != null and def2 != ''">def2 = #{def2},</if>
<if test="def3 != null and def3 != ''">def3 = #{def3},</if>
<if test="def4 != null and def4 != ''">def4 = #{def4},</if>
<if test="def5 != null and def5 != ''">def5 = #{def5},</if>
<if test="def6 != null and def6 != ''">def6 = #{def6},</if>
<if test="def7 != null and def7 != ''">def7 = #{def7},</if>
<if test="def8 != null and def8 != ''">def8 = #{def8},</if>
<if test="def9 != null and def9 != ''">def9 = #{def9},</if>
<if test="def10 != null and def10 != ''">def10 = #{def10},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="createUser != null and createUser != ''">create_user = #{createUser},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="modify_time == null">modify_time = now(),</if>
<if test="modifyUser != null and modifyUser != ''">modify_user = #{modifyUser},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity">
update fe_conf_module
set sts= 'N',
modify_time = now()
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity">
update fe_conf_module set sts= 'N' ,modify_time = now()
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from fe_conf_module
where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,36 @@
package com.hzya.frame.finance.conf.fileeigen.service;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
import java.util.Map;
/**
* 财资事项(finance_event)-配置-档案特征(FeConfFileEigen)表服务接口
*
* @author zydd
* @since 2025-08-19 15:12:04
*/
public interface IFeConfFileEigenService extends IBaseService<FeConfFileEigenEntity, String>{
List<FeConfFileEigenEntity> queryAll(FeConfFileEigenEntity entity);
String saveEntity(List<FeConfFileEigenEntity> entity);
String updateEntity(List<FeConfFileEigenEntity> list);
void deleteEntity(List<FeConfFileEigenEntity> list);
List<Map<String, Object>> queryDataMapByMdmId(FeConfFileEigenEntity entity);
List<FeConfFileEigenEntity> queryMdmAll(FeConfFileEigenEntity entity);
List<FeConfFileEigenEntity> autoExecute(FeConfFileEigenEntity entity);
List<Map<String, Object>> searchFile(FeConfFileEigenEntity entity);
List<FeConfFileEigenEntity> searchName(FeConfFileEigenEntity entity);
PageInfo queryDataMapPagedByMdmId(FeConfFileEigenEntity entity);
}

View File

@ -0,0 +1,21 @@
package com.hzya.frame.finance.conf.fileeigen.service;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity;
import com.hzya.frame.basedao.service.IBaseService;
import org.springframework.web.multipart.MultipartFile;
/**
* 财资事项(finance_event)-配置-档案特征-模块(FeConfModule)表服务接口
*
* @author zydd
* @since 2025-08-20 10:00:30
*/
public interface IFeConfModuleService extends IBaseService<FeConfModuleEntity, String>{
/**
* 导入数据模板
* @param file
* @param mdmCode
* @param dbName
*/
void importDataTemplateBatch(MultipartFile file, Long mdmCode, String dbName);
}

View File

@ -0,0 +1,386 @@
package com.hzya.frame.finance.conf.fileeigen.service.impl;
import cn.hutool.core.lang.Assert;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfFileEigenEntity;
import com.hzya.frame.finance.conf.fileeigen.dao.IFeConfFileEigenDao;
import com.hzya.frame.finance.conf.fileeigen.service.IFeConfFileEigenService;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO;
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDbFiledVODAO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDbFiledVO;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 财资事项(finance_event)-配置-档案特征(FeConfFileEigen)表服务实现类
*
* @author zydd
* @since 2025-08-19 15:12:04
*/
@Service
public class FeConfFileEigenServiceImpl extends BaseService<FeConfFileEigenEntity, String> implements IFeConfFileEigenService {
private IFeConfFileEigenDao feConfFileEigenDao;
@Autowired
public void setFeConfFileEigenDao(IFeConfFileEigenDao dao) {
this.feConfFileEigenDao = dao;
this.dao = dao;
}
@Autowired
private IMdmModuleDao mdmModuleDao;
@Autowired
private IMdmModuleDbDao mdmModuleDbDao;
@Autowired
private IMdmDBQueryVODAO mdmDBQueryVODAO;
@Autowired
private IMdmDbFiledVODAO mdmDbFiledVODAO;
@Override
public List<FeConfFileEigenEntity> queryAll(FeConfFileEigenEntity entity) {
checkAssistNull("queryAll", entity);
List<FeConfFileEigenEntity> query = feConfFileEigenDao.queryByLike(entity);
return query;
}
@Override
public String saveEntity(List<FeConfFileEigenEntity> list) {
StringBuffer cg = new StringBuffer();
StringBuffer sb = new StringBuffer();
int i = 0;
int j = 0;
for (FeConfFileEigenEntity feConfFileEigenEntity : list) {
try {
checkAssistNull("saveEntity", feConfFileEigenEntity);
FeConfFileEigenEntity feConfFileEigenEntity1 = new FeConfFileEigenEntity();
feConfFileEigenEntity1.setName(feConfFileEigenEntity.getName());
List<FeConfFileEigenEntity> query = feConfFileEigenDao.query(feConfFileEigenEntity1);
if (query.size() != 0) {
Assert.state(false, "特征值:[{}],重复", feConfFileEigenEntity.getName());
}
FeConfFileEigenEntity save = feConfFileEigenDao.save(feConfFileEigenEntity);
i++;
cg.append(save.getName()).append(";");
} catch (Exception e) {
e.printStackTrace();
j++;
sb.append(e.getMessage()).append(";");
}
}
if (i == 0 && j != 0) {
return "失败:" + j + "条:" + sb;
}
if (i != 0 && j == 0) {
return "成功:" + i + "条:" + cg + "";
}
return "成功:" + i + "条:" + cg + "。失败:" + j + "条:" + sb;
}
@Override
public String updateEntity(List<FeConfFileEigenEntity> list) {
StringBuffer cg = new StringBuffer();
StringBuffer sb = new StringBuffer();
int i = 0;
int j = 0;
for (FeConfFileEigenEntity feConfFileEigenEntity : list) {
try {
if (feConfFileEigenEntity.getId() == null) {
checkAssistNull("saveEntity", feConfFileEigenEntity);
FeConfFileEigenEntity feConfFileEigenEntity1 = new FeConfFileEigenEntity();
feConfFileEigenEntity1.setName(feConfFileEigenEntity.getName());
List<FeConfFileEigenEntity> query = feConfFileEigenDao.query(feConfFileEigenEntity1);
if (query.size() != 0) {
Assert.state(false, "特征值:[{}],重复", feConfFileEigenEntity.getName());
}
feConfFileEigenDao.save(feConfFileEigenEntity);
i++;
cg.append(feConfFileEigenEntity.getName()).append(";");
}
FeConfFileEigenEntity feConfFileEigenEntity1 = new FeConfFileEigenEntity();
feConfFileEigenEntity1.setName(feConfFileEigenEntity.getName());
List<FeConfFileEigenEntity> query = feConfFileEigenDao.query(feConfFileEigenEntity1);
if (query.size() != 0) {
Assert.state(false, "特征值:[{}],重复", feConfFileEigenEntity.getName());
}
feConfFileEigenDao.update(feConfFileEigenEntity);
i++;
cg.append(feConfFileEigenEntity.getName()).append(";");
} catch (Exception e) {
e.printStackTrace();
j++;
sb.append(e.getMessage()).append(";");
}
}
if (i == 0 && j != 0) {
return "失败:" + j + "条:" + sb;
}
if (i != 0 && j == 0) {
return "成功:" + i + "条:" + cg + "";
}
return "成功:" + i + "条:" + cg + "。失败:" + j + "条:" + sb;
}
@Override
public void deleteEntity(List<FeConfFileEigenEntity> list) {
for (FeConfFileEigenEntity feConfFileEigenEntity : list) {
checkAssistNull("deleteEntity", feConfFileEigenEntity);
feConfFileEigenDao.logicRemove(feConfFileEigenEntity);
}
}
@Override
public List<FeConfFileEigenEntity> queryMdmAll(FeConfFileEigenEntity entity) {
List<FeConfFileEigenEntity> queryMdmAll = feConfFileEigenDao.queryMdmAll(entity);
return queryMdmAll;
}
@Override
public List<FeConfFileEigenEntity> autoExecute(FeConfFileEigenEntity entity) {
checkAssistNull("autoExecute", entity);
String mdmId = entity.getMdmId();
MdmDbFiledVO mdmDbFiledVO = new MdmDbFiledVO();
mdmDbFiledVO.setMdmId(mdmId);
List<MdmDbFiledVO> mdmDbFiledVOList = mdmDbFiledVODAO.queryMdmDbFiledVOByMdmID(mdmDbFiledVO);
if(mdmDbFiledVOList==null||mdmDbFiledVOList.size()==0){
Assert.state(false,"根据mdmId{},查询字段明细失败",mdmId);
}
MdmDbFiledVO mdmDbFiled = mdmDbFiledVOList.get(0);
String fieldName = mdmDbFiled.getNamefieldname();
if(fieldName==null){
Assert.state(false,"根据mdmId{},查询名称字段明细失败。",mdmId);
}
List<FeConfFileEigenEntity> all = new ArrayList<>();
int i=0;
List<Map<String, Object>> maps = queryDataByMdmId(mdmId);
for (Map<String, Object> map : maps) {
Object OId = map.get("id");
Object OName = map.get(fieldName);
if(OName==null){
continue;
}
if(OId==null){
continue;
}
String stringName = OName.toString();
String stringId = OId.toString();
// String[] split = stringName.split("有限公司");
String[] split = stringName.split(entity.getSplitName());
String s = split[0];
FeConfFileEigenEntity feConfFileEigenEntity = new FeConfFileEigenEntity();
feConfFileEigenEntity.setName(s);
List<FeConfFileEigenEntity> query = feConfFileEigenDao.query(feConfFileEigenEntity);
if (query.size() != 0) {
continue;
}
feConfFileEigenEntity.setMdmId(mdmId);
feConfFileEigenEntity.setMdmDataId(stringId);
feConfFileEigenDao.save(feConfFileEigenEntity);
i++;
}
System.out.println("===========================>"+i);
return all;
}
@Override
public List<Map<String, Object>> queryDataMapByMdmId(FeConfFileEigenEntity entity) {
checkAssistNull("queryDataMapByMdmId", entity);
String mdmId = entity.getMdmId();
List<Map<String, Object>> maps = queryDataByMdmId(mdmId);
if(maps==null){
Assert.state(false,"查询数据失败。queryDataMapByMdmId请检查");
}
return maps;
}
@Override
public List<Map<String, Object>> searchFile(FeConfFileEigenEntity entity) {
checkAssistNull("searchFile", entity);
String mdmId = entity.getMdmId();
String mdmDataName = entity.getMdmDataName();
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
mdmModuleDbEntity.setMdmId(mdmId);
mdmModuleDbEntity.setDbType("1");
List<MdmModuleDbEntity> query = mdmModuleDbDao.query(mdmModuleDbEntity);
if(query.size()==0){
Assert.state(false,"根据mdmId{},查询数据表细失败",mdmId);
}
String dbName = query.get(0).getDbName();
MdmDbFiledVO mdmDbFiledVO = new MdmDbFiledVO();
mdmDbFiledVO.setMdmId(mdmId);
List<MdmDbFiledVO> mdmDbFiledVOList = mdmDbFiledVODAO.queryMdmDbFiledVOByMdmID(mdmDbFiledVO);
if(mdmDbFiledVOList==null||mdmDbFiledVOList.size()==0){
Assert.state(false,"根据mdmId{},查询字段名细失败",mdmId);
}
MdmDbFiledVO mdmDbFiled = mdmDbFiledVOList.get(0);
String fieldName = mdmDbFiled.getNamefieldname();
if(fieldName==null){
Assert.state(false,"根据mdmId{},查询名称字段名细失败。",mdmId);
}
System.out.println(fieldName);
MdmDBQueryVO queryueryVO=new MdmDBQueryVO();
queryueryVO.setTablename(dbName);
queryueryVO.setProp1(fieldName);
queryueryVO.setPropValue1(mdmDataName);
List<Map<String, Object>> maps = mdmDBQueryVODAO.queryMdmDb(queryueryVO);
return maps;
}
@Override
public List<FeConfFileEigenEntity> searchName(FeConfFileEigenEntity entity) {
checkAssistNull("searchName", entity);
List<FeConfFileEigenEntity> query = feConfFileEigenDao.queryByLike(entity);
return query;
}
@Override
public PageInfo queryDataMapPagedByMdmId(FeConfFileEigenEntity entity) {
checkAssistNull("queryDataMapByMdmId", entity);
String mdmId = entity.getMdmId();
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
mdmModuleDbEntity.setMdmId(mdmId);
mdmModuleDbEntity.setDbType("1");
List<MdmModuleDbEntity> mdmModuleEntityDbList = mdmModuleDbDao.query(mdmModuleDbEntity);
if (mdmModuleEntityDbList.size() == 0 || mdmModuleEntityDbList.size() > 1) {
Assert.state(false, "根据mdmId{},未查询到数据表或数据表不唯一。");
}
MdmModuleDbEntity mdmModuleDb = mdmModuleEntityDbList.get(0);
String dbName = mdmModuleDb.getDbName();
MdmDBQueryVO mdmDBQueryVO = new MdmDBQueryVO();
mdmDBQueryVO.setTablename(dbName);
mdmDBQueryVO.setPageNum(entity.getPageNum());
mdmDBQueryVO.setPageSize(entity.getPageSize());
MdmDbFiledVO mdmDbFiledVO = new MdmDbFiledVO();
mdmDbFiledVO.setMdmId(mdmId);
List<MdmDbFiledVO> mdmDbFiledVOList = mdmDbFiledVODAO.queryMdmDbFiledVOByMdmID(mdmDbFiledVO);
if(mdmDbFiledVOList==null||mdmDbFiledVOList.size()==0){
Assert.state(false,"根据mdmId{},查询字段名细失败",mdmId);
}
MdmDbFiledVO mdmDbFiled = mdmDbFiledVOList.get(0);
String fieldName = mdmDbFiled.getNamefieldname();
if(fieldName==null){
Assert.state(false,"根据mdmId{},查询名称字段名细失败。",mdmId);
}
String mdmDataName = entity.getMdmDataName();
if(mdmDataName!=null){
mdmDBQueryVO.setProp1(fieldName);
mdmDBQueryVO.setPropValue1(mdmDataName);
}
PageHelper.startPage(mdmDBQueryVO.getPageNum(), mdmDBQueryVO.getPageSize());
List<Map<String, Object>> dataMapList = mdmDBQueryVODAO.queryMdmDb(mdmDBQueryVO);
PageInfo pageInfo = new PageInfo(dataMapList);
return pageInfo;
}
public void checkAssistNull(String type, FeConfFileEigenEntity entity) {
switch (type) {
case "queryAll":
Assert.notNull(entity.getMdmId(), "查询档案特征时mdmId不能为空");
Assert.notNull(entity.getMdmDataId(), "查询档案特征时mdmDataId不能为空");
break;
case "saveEntity":
Assert.notNull(entity.getMdmId(), "新增档案特征时mdmId不能为空");
Assert.notNull(entity.getMdmDataId(), "新增档案特征时mdmDataId不能为空");
Assert.notNull(entity.getName(), "新增档案特征时name不能为空");
break;
case "deleteEntity":
Assert.notNull(entity.getId(), "删除档案特征时id不能为空");
break;
case "queryDataMapByMdmId":
Assert.notNull(entity.getMdmId(), "查询档案数据时mdmId不能为空");
break;
case "autoExecute":
Assert.notNull(entity.getMdmId(), "自动生成时mdmId不能为空");
Assert.notNull(entity.getSplitName(), "自动生成时splitName不能为空");
break;
case "searchFile":
Assert.notNull(entity.getMdmId(), "搜索档案内容时mdmId不能为空");
Assert.notNull(entity.getMdmDataName(), "搜索档案内容时mdmDataName不能为空");
break;
case "searchName":
Assert.notNull(entity.getMdmId(), "搜错特征值时mdmId不能为空");
Assert.notNull(entity.getName(), "搜错特征值时name不能为空");
break;
}
}
/**
* 根据mdmId查询数据
*/
public List<Map<String, Object>> queryDataByMdmId(String mdmId){
try {
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
mdmModuleDbEntity.setMdmId(mdmId);
mdmModuleDbEntity.setDbType("1");
List<MdmModuleDbEntity> mdmModuleEntityDbList = mdmModuleDbDao.query(mdmModuleDbEntity);
if (mdmModuleEntityDbList.size() == 0 || mdmModuleEntityDbList.size() > 1) {
Assert.state(false, "根据mdmId{},未查询到数据表或数据表不唯一。");
}
MdmModuleDbEntity mdmModuleDb = mdmModuleEntityDbList.get(0);
String dbName = mdmModuleDb.getDbName();
//查询数据
MdmDBQueryVO mdmDBQueryVO = new MdmDBQueryVO();
mdmDBQueryVO.setTablename(dbName);
List<Map<String, Object>> dataMapList = mdmDBQueryVODAO.queryMdmDb(mdmDBQueryVO);
return dataMapList;
}catch (Exception e){
Assert.state(false, "查询数据失败。失败原因:{}", e.getMessage());
}
return null;
}
}

View File

@ -0,0 +1,224 @@
package com.hzya.frame.finance.conf.fileeigen.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.finance.conf.fileeigen.entity.FeConfModuleEntity;
import com.hzya.frame.finance.conf.fileeigen.dao.IFeConfModuleDao;
import com.hzya.frame.finance.conf.fileeigen.service.IFeConfModuleService;
import com.hzya.frame.mdm.service.IMdmService;
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO;
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDbFiledVODAO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDbFiledVO;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 财资事项(finance_event)-配置-档案特征-模块(FeConfModule)表服务实现类
*
* @author zydd
* @since 2025-08-20 10:00:30
*/
@Service
public class FeConfModuleServiceImpl extends BaseService<FeConfModuleEntity, String> implements IFeConfModuleService {
private IFeConfModuleDao feConfModuleDao;
@Autowired
private IMdmDBQueryVODAO mdmDBQueryVODAO;
@Autowired
private IMdmDbFiledVODAO mdmDbFiledVODAO;
@Autowired
private IMdmService iMdmService;
@Autowired
public void setFeConfModuleDao(IFeConfModuleDao dao) {
this.feConfModuleDao = dao;
this.dao = dao;
}
/**
* 导入数据模板
* @param file
* @param mdmCode
* @param dbName
*/
@Override
public void importDataTemplateBatch(MultipartFile file, Long mdmCode, String dbName) {
// 校验文件合法性
if (file == null || file.isEmpty()) {
throw new IllegalArgumentException("导入文件不能为空");
}
// 校验文件格式
String fileName = file.getOriginalFilename();
if (fileName == null || (!fileName.endsWith(".xlsx") && !fileName.endsWith(".xls"))) {
throw new IllegalArgumentException("请上传Excel格式文件.xlsx或.xls");
}
// 存储动态表头信息
List<String> dynamicHeaders = new ArrayList<>();
// 批量数据缓存
List<Map<String, Object>> batchDataList = new ArrayList<>();
try (InputStream inputStream = file.getInputStream()) {
EasyExcel.read(inputStream)
.sheet(0) // 读取第一个sheet
.headRowNumber(1) // 表头所在行从1开始
.autoTrim(true) // 自动去除空格
.registerReadListener(new AnalysisEventListener<Map<Integer, Object>>() {
// 存储表头索引与字段名的映射关系
private Map<Integer, String> headerIndexMap;
/**
* 处理表头信息
*/
@Override
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
this.headerIndexMap = headMap;
// 转换为有序的表头列表
if (!headMap.isEmpty()) {
int maxIndex = headMap.keySet().stream()
.mapToInt(Integer::intValue)
.max()
.orElse(-1);
for (int i = 0; i <= maxIndex; i++) {
String headerName = headMap.getOrDefault(i, "").trim();
dynamicHeaders.add(headerName);
}
}
}
/**
* 处理每行数据
*/
@Override
public void invoke(Map<Integer, Object> rowData, AnalysisContext context) {
int rowNum = context.readRowHolder().getRowIndex() + 1; // 行号从1开始
try {
// 将索引映射的行数据转换为表头字段映射的Map
Map<String, Object> dataMap = convertRowData(rowData, rowNum);
Boolean aBoolean = checkDuplicate(dataMap, dbName);
if (aBoolean) {
batchDataList.add(dataMap);
}
} catch (Exception e) {
throw new RuntimeException("处理第" + rowNum + "行数据失败:" + e.getMessage(), e);
}
}
/**
* 所有数据解析完成后
*/
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
if (!batchDataList.isEmpty()) {
// 所有数据读取完成后统一处理
int totalRows = batchDataList.size();
int startRow = 2; // 表头行是第1行数据行从第2行开始
int endRow = startRow + totalRows - 1;
processBatchData(batchDataList, mdmCode, dbName, startRow, endRow);
batchDataList.clear();
}
}
/**
* 转换行数据为字段映射Map
*/
private Map<String, Object> convertRowData(Map<Integer, Object> rowData, int rowNum) {
Map<String, Object> dataMap = new HashMap<>(16);
rowData.forEach((index, value) -> {
String name = headerIndexMap.getOrDefault(index, "");
String headerName = name.contains("/")
? name.substring(name.lastIndexOf("/") + 1).trim()
: name.trim();
String cellValue = convertCellValue(value);
dataMap.put(headerName, cellValue);
});
return dataMap;
}
})
.doRead();
} catch (IOException e) {
throw new RuntimeException("文件读取失败:" + e.getMessage(), e);
}
}
/**
* 校验重复
* @param dataMap
* @param dbName
* @return
*/
private Boolean checkDuplicate(Map<String, Object> dataMap, String dbName) {
MdmDbFiledVO mdmDbFiledVO = new MdmDbFiledVO();
mdmDbFiledVO.setTablename(dbName);
List<MdmDbFiledVO> mdmDbFiledVOList = mdmDbFiledVODAO.queryMdmDbFiledVO(mdmDbFiledVO);
// 同时判断集合不为null且不为空
if(mdmDbFiledVOList != null && !mdmDbFiledVOList.isEmpty()) {
String tablepkname = mdmDbFiledVOList.get(0).getTablepkname();// 主键字段
Object object = dataMap.get(tablepkname);
MdmDBQueryVO vo = new MdmDBQueryVO();
vo.setTablename(dbName);
vo.setProp1(tablepkname);
vo.setPropValue1(object.toString());
// 检查查询结果是否存在且不为空
List<Map<String, Object>> maps = mdmDBQueryVODAO.queryMdmDb(vo);
return maps == null && maps.isEmpty();
} else {
// 集合为null或空时的处理
return true;
}
}
private void processBatchData(List<Map<String, Object>> batchDataList, Long mdmCode, String dbName, int i, int rowNum) {
List<JSONObject> list = batchDataList.stream()
.map(dataMap -> {
JSONObject dataObject = new JSONObject();
dataObject.put(dbName, dataMap);
JSONObject result = new JSONObject();
result.put("mdmCode", mdmCode);
result.put("data", dataObject);
return getStrObj("jsonStr", result);
})
.collect(Collectors.toList());
for (JSONObject jsonObject : list) {
iMdmService.saveMdmShowDetailsData(jsonObject);
}
}
private JSONObject getStrObj(String key, Object value) {
JSONObject json = new JSONObject();
json.put(key, value);
return json;
}
/**
* 转换单元格值为字符串
*/
private String convertCellValue(Object value) {
if (value == null) {
return null;
}
if (value instanceof Date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format((Date) value);
} else if (value instanceof Boolean) {
return ((Boolean) value) ? "Y" : "N";
} else if (value instanceof Number) {
return new BigDecimal(value.toString()).toPlainString();
} else {
return value.toString().trim();
}
}
}

View File

@ -0,0 +1,111 @@
package com.hzya.frame.finance.conf.message.controller;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.finance.conf.message.service.IFeConfMessageTemplateService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.hzya.frame.web.entity.JsonResultEntity;
import java.util.List;
import static com.hzya.frame.web.entity.BaseResult.getSuccessMessageEntity;
@RestController
@RequestMapping("/fe/conf/message")
public class MessageController {
@Autowired
private IFeConfMessageTemplateService iFeConfMessageTemplateService;
/**
* 分页查询模板
*
*/
@RequestMapping(value = "/queryPaged", method = RequestMethod.POST)
public JsonResultEntity query(@RequestBody FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
PageInfo pageInfo = iFeConfMessageTemplateService.queryMessagePaged(feConfMessageTemplateEntity);
return new JsonResultEntity("查询成功",true,pageInfo);
}
/**
* 查询消息模板
*/
@RequestMapping(value = "/queryAll", method = RequestMethod.POST)
public JsonResultEntity queryAll(@RequestBody FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
List<FeConfMessageTemplateEntity> feConfMessageTemplateEntities = iFeConfMessageTemplateService.queryAll(feConfMessageTemplateEntity);
return getSuccessMessageEntity("查询成功",feConfMessageTemplateEntities);
}
/**
* 新增消息模板
*/
@RequestMapping(value = "/add", method = RequestMethod.POST)
public JsonResultEntity add(@RequestBody FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception {
if(feConfMessageTemplateEntity == null){
throw new Exception("参数不能为空");
}
if(feConfMessageTemplateEntity.getCode() == null){
throw new Exception("编码不能为空");
}
if(feConfMessageTemplateEntity.getName() == null){
throw new Exception("名称不能为空");
}
if(feConfMessageTemplateEntity.getTitle() == null){
throw new Exception("标题不能为空");
}
FeConfMessageTemplateEntity save = iFeConfMessageTemplateService.saveEntity(feConfMessageTemplateEntity);
return getSuccessMessageEntity("新增成功",save);
}
/**
* 修改消息模板
*/
@RequestMapping(value = "/update", method = RequestMethod.POST)
public JsonResultEntity update(@RequestBody FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception {
if(feConfMessageTemplateEntity == null){
throw new Exception("参数不能为空");
}
FeConfMessageTemplateEntity update = iFeConfMessageTemplateService.update(feConfMessageTemplateEntity);
return getSuccessMessageEntity("修改成功",update);
}
/**
* 启用停用状态
*/
@RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
public JsonResultEntity updateStatus(@RequestBody FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception {
FeConfMessageTemplateEntity update = iFeConfMessageTemplateService.updateStatus(feConfMessageTemplateEntity);
return getSuccessMessageEntity("修改成功",update);
}
/**
* 删除消息模板
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public JsonResultEntity delete(@RequestBody FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception {
iFeConfMessageTemplateService.logicRemove(feConfMessageTemplateEntity);
return getSuccessMessageEntity("删除成功",null);
}
/**
* 根据mdm_id和mdm_name查询消息模板
*/
@PostMapping("/queryTemplate")
public JsonResultEntity queryTemplate(@RequestBody FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception {
PageInfo pageInfo = iFeConfMessageTemplateService.queryTemplate(feConfMessageTemplateEntity);
return getSuccessMessageEntity("查询成功",pageInfo);
}
/**
* 根据模板id查询详情
*/
@PostMapping("/queryTemplateDetail")
public JsonResultEntity queryTemplateDetail(@RequestBody FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception {
FeConfMessageTemplateEntity templateEntity = iFeConfMessageTemplateService.queryTemplateDetail(feConfMessageTemplateEntity);
return getSuccessMessageEntity("查询成功",templateEntity);
}
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.finance.conf.message.dao;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* 消息模板表(fe_conf_message_template: table)表数据库访问层
*
* @author lixinyu
* @since 2025-08-26 09:14:02
*/
public interface IFeConfMessageTemplateDao extends IBaseDao<FeConfMessageTemplateEntity, String> {
FeConfMessageTemplateEntity updateStatus(FeConfMessageTemplateEntity feConfMessageTemplateEntity);
List<FeConfMessageTemplateEntity> page(FeConfMessageTemplateEntity feConfMessageTemplateEntity);
List<FeConfMessageTemplateEntity> queryTemplate(String mdmId, String mdmName);
}

View File

@ -0,0 +1,51 @@
package com.hzya.frame.finance.conf.message.dao.impl;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.finance.conf.message.dao.IFeConfMessageTemplateDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 消息模板表(FeConfMessageTemplate)表数据库访问层
*
* @author lixinyu
* @since 2025-08-26 09:14:02
*/
@Repository
public class FeConfMessageTemplateDaoImpl extends MybatisGenericDao<FeConfMessageTemplateEntity, String> implements IFeConfMessageTemplateDao{
@Override
public FeConfMessageTemplateEntity updateStatus(FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
int update = this.update("com.hzya.frame.finance.conf.message.dao.impl.FeConfMessageTemplateDaoImpl.update_status", feConfMessageTemplateEntity);
if(update > 0){
return feConfMessageTemplateEntity;
}else{
throw new RuntimeException("更新状态失败");
}
}
@Override
public List<FeConfMessageTemplateEntity> page(FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
List<FeConfMessageTemplateEntity> objects = (List<FeConfMessageTemplateEntity>) this.selectList("com.hzya.frame.finance.conf.message.dao.impl.FeConfMessageTemplateDaoImpl.page", feConfMessageTemplateEntity);
return objects;
}
@Override
public List<FeConfMessageTemplateEntity> queryTemplate(String mdmId, String mdmName) {
FeConfMessageTemplateEntity feConfMessageTemplateEntity = new FeConfMessageTemplateEntity();
feConfMessageTemplateEntity.setMdmId(mdmId);
feConfMessageTemplateEntity.setMdmName(mdmName);
List<FeConfMessageTemplateEntity> objects = (List<FeConfMessageTemplateEntity>) this.selectList("com.hzya.frame.finance.conf.message.dao.impl.FeConfMessageTemplateDaoImpl.queryTemplate", feConfMessageTemplateEntity);
return objects;
}
}

View File

@ -0,0 +1,207 @@
package com.hzya.frame.finance.conf.message.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 消息模板表(FeConfMessageTemplate)实体类
*
* @author lixinyu
* @since 2025-08-26 09:14:02
*/
public class FeConfMessageTemplateEntity extends BaseEntity {
/** 消息模板编码 */
private String code;
/** 消息模板名称 */
private String name;
/** 消息标题 */
private String title;
/** 启用状态 Y:启用 N:停用 */
private String enablestate;
/** 备注 */
private String remark;
/** 自定义项1 */
private String def1;
/** 自定义项2 */
private String def2;
/** 自定义项3 */
private String def3;
/** 自定义项4 */
private String def4;
/** 自定义项5 */
private String def5;
/** 自定义项6 */
private String def6;
/** 自定义项7 */
private String def7;
/** 自定义项8 */
private String def8;
/** 自定义项9 */
private String def9;
/** 自定义项10 */
private String def10;
/** 创建人 */
private String createUser;
/** 修改人 */
private String modifyUser;
/** 业务类型
*/
private String mdmId;
/** 业务类型名称 */
private String mdmName;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getEnablestate() {
return enablestate;
}
public void setEnablestate(String enablestate) {
this.enablestate = enablestate;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getDef1() {
return def1;
}
public void setDef1(String def1) {
this.def1 = def1;
}
public String getDef2() {
return def2;
}
public void setDef2(String def2) {
this.def2 = def2;
}
public String getDef3() {
return def3;
}
public void setDef3(String def3) {
this.def3 = def3;
}
public String getDef4() {
return def4;
}
public void setDef4(String def4) {
this.def4 = def4;
}
public String getDef5() {
return def5;
}
public void setDef5(String def5) {
this.def5 = def5;
}
public String getDef6() {
return def6;
}
public void setDef6(String def6) {
this.def6 = def6;
}
public String getDef7() {
return def7;
}
public void setDef7(String def7) {
this.def7 = def7;
}
public String getDef8() {
return def8;
}
public void setDef8(String def8) {
this.def8 = def8;
}
public String getDef9() {
return def9;
}
public void setDef9(String def9) {
this.def9 = def9;
}
public String getDef10() {
return def10;
}
public void setDef10(String def10) {
this.def10 = def10;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public String getMdmId() {
return mdmId;
}
public void setMdmId(String mdmId) {
this.mdmId = mdmId;
}
public String getMdmName() {
return mdmName;
}
public void setMdmName(String mdmName) {
this.mdmName = mdmName;
}
}

View File

@ -0,0 +1,402 @@
<?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.finance.conf.message.dao.impl.FeConfMessageTemplateDaoImpl">
<resultMap id="get-FeConfMessageTemplateEntity-result" type="com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity" >
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="enablestate" column="enablestate" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/>
<result property="def4" column="def4" jdbcType="VARCHAR"/>
<result property="def5" column="def5" jdbcType="VARCHAR"/>
<result property="def6" column="def6" jdbcType="VARCHAR"/>
<result property="def7" column="def7" jdbcType="VARCHAR"/>
<result property="def8" column="def8" jdbcType="VARCHAR"/>
<result property="def9" column="def9" jdbcType="VARCHAR"/>
<result property="def10" column="def10" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="modifyUser" column="modify_user" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="mdmName" column="mdm_name" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "FeConfMessageTemplateEntity_Base_Column_List">
id
,code
,name
,title
,enablestate
,remark
,def1
,def2
,def3
,def4
,def5
,def6
,def7
,def8
,def9
,def10
,create_time
,create_user
,modify_time
,modify_user
,sts
,mdm_id
,mdm_name
</sql>
<select id="queryTemplate" resultMap="get-FeConfMessageTemplateEntity-result" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
select *
from fe_conf_message_template
where mdm_id = #{mdmId}
and mdm_name = #{mdmName}
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-FeConfMessageTemplateEntity-result" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
select
<include refid="FeConfMessageTemplateEntity_Base_Column_List" />
from fe_conf_message_template fe_conf_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="name != null and name != ''"> and name = #{name}</if>
<if test="title != null and title != ''"> and title = #{title} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
<if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
<if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
<if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
<if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
<if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="createUser != null and createUser != ''"> and create_user = #{createUser} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user = #{modifyUser} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
and sts='Y'
</trim>
</select>
<select id="page" resultMap="get-FeConfMessageTemplateEntity-result" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
select
<include refid="FeConfMessageTemplateEntity_Base_Column_List" />
from fe_conf_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id like concat('%',#{id},'%') </if>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
<if test="enablestate != null and enablestate != ''"> and enablestate like concat('%',#{enablestate},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
<if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
<if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
<if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
<if test="def4 != null and def4 != ''"> and def4 like concat('%',#{def4},'%') </if>
<if test="def5 != null and def5 != ''"> and def5 like concat('%',#{def5},'%') </if>
<if test="def6 != null and def6 != ''"> and def6 like concat('%',#{def6},'%') </if>
<if test="def7 != null and def7 != ''"> and def7 like concat('%',#{def7},'%') </if>
<if test="def8 != null and def8 != ''"> and def8 like concat('%',#{def8},'%') </if>
<if test="def9 != null and def9 != ''"> and def9 like concat('%',#{def9},'%') </if>
<if test="def10 != null and def10 != ''"> and def10 like concat('%',#{def10},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="createUser != null and createUser != ''"> and create_user like concat('%',#{createUser},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user like concat('%',#{modifyUser},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name like concat('%',#{mdmName},'%') </if>
and sts='Y'
</trim>
</select>
<!-- 修改启用停用状态 -->
<update id="update_status" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
update fe_conf_message_template
set enablestate = #{enablestate}
where id = #{id}
</update>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
select count(1) from fe_conf_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="title != null and title != ''"> and title = #{title} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
<if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
<if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
<if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
<if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
<if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="createUser != null and createUser != ''"> and create_user = #{createUser} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user = #{modifyUser} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-FeConfMessageTemplateEntity-result" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
select
<include refid="FeConfMessageTemplateEntity_Base_Column_List" />
from fe_conf_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id like concat('%',#{id},'%') </if>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
<if test="enablestate != null and enablestate != ''"> and enablestate like concat('%',#{enablestate},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
<if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
<if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
<if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
<if test="def4 != null and def4 != ''"> and def4 like concat('%',#{def4},'%') </if>
<if test="def5 != null and def5 != ''"> and def5 like concat('%',#{def5},'%') </if>
<if test="def6 != null and def6 != ''"> and def6 like concat('%',#{def6},'%') </if>
<if test="def7 != null and def7 != ''"> and def7 like concat('%',#{def7},'%') </if>
<if test="def8 != null and def8 != ''"> and def8 like concat('%',#{def8},'%') </if>
<if test="def9 != null and def9 != ''"> and def9 like concat('%',#{def9},'%') </if>
<if test="def10 != null and def10 != ''"> and def10 like concat('%',#{def10},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="createUser != null and createUser != ''"> and create_user like concat('%',#{createUser},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user like concat('%',#{modifyUser},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name like concat('%',#{mdmName},'%') </if>
and sts='Y'
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="FeConfMessageTemplateentity_list_or" resultMap="get-FeConfMessageTemplateEntity-result" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
select
<include refid="FeConfMessageTemplateEntity_Base_Column_List" />
from fe_conf_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> or id = #{id} </if>
<if test="code != null and code != ''"> or code = #{code} </if>
<if test="name != null and name != ''"> or name = #{name} </if>
<if test="title != null and title != ''"> or title = #{title} </if>
<if test="enablestate != null and enablestate != ''"> or enablestate = #{enablestate} </if>
<if test="remark != null and remark != ''"> or remark = #{remark} </if>
<if test="def1 != null and def1 != ''"> or def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> or def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> or def3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> or def4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> or def5 = #{def5} </if>
<if test="def6 != null and def6 != ''"> or def6 = #{def6} </if>
<if test="def7 != null and def7 != ''"> or def7 = #{def7} </if>
<if test="def8 != null and def8 != ''"> or def8 = #{def8} </if>
<if test="def9 != null and def9 != ''"> or def9 = #{def9} </if>
<if test="def10 != null and def10 != ''"> or def10 = #{def10} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="createUser != null and createUser != ''"> or create_user = #{createUser} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="modifyUser != null and modifyUser != ''"> or modify_user = #{modifyUser} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
<if test="mdmName != null and mdmName != ''"> or mdm_name = #{mdmName} </if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_message_template(
<trim suffix="" suffixOverrides=",">
<if test="id != null"> id , </if>
<if test="code != null and code != ''"> code , </if>
<if test="name != null and name != ''"> name , </if>
<if test="title != null and title != ''"> title , </if>
<if test="enablestate != null and enablestate != ''"> enablestate , </if>
<if test="remark != null and remark != ''"> remark , </if>
<if test="def1 != null and def1 != ''"> def1 , </if>
<if test="def2 != null and def2 != ''"> def2 , </if>
<if test="def3 != null and def3 != ''"> def3 , </if>
<if test="def4 != null and def4 != ''"> def4 , </if>
<if test="def5 != null and def5 != ''"> def5 , </if>
<if test="def6 != null and def6 != ''"> def6 , </if>
<if test="def7 != null and def7 != ''"> def7 , </if>
<if test="def8 != null and def8 != ''"> def8 , </if>
<if test="def9 != null and def9 != ''"> def9 , </if>
<if test="def10 != null and def10 != ''"> def10 , </if>
<if test="create_time != null"> create_time , </if>
<if test="createUser != null and createUser != ''"> create_user , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="modifyUser != null and modifyUser != ''"> modify_user , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
<if test="mdmName != null and mdmName != ''"> mdm_name , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null"> #{id} ,</if>
<if test="code != null and code != ''"> #{code} ,</if>
<if test="name != null and name != ''"> #{name} ,</if>
<if test="title != null and title != ''"> #{title} ,</if>
<if test="enablestate != null and enablestate != ''"> #{enablestate} ,</if>
<if test="remark != null and remark != ''"> #{remark} ,</if>
<if test="def1 != null and def1 != ''"> #{def1} ,</if>
<if test="def2 != null and def2 != ''"> #{def2} ,</if>
<if test="def3 != null and def3 != ''"> #{def3} ,</if>
<if test="def4 != null and def4 != ''"> #{def4} ,</if>
<if test="def5 != null and def5 != ''"> #{def5} ,</if>
<if test="def6 != null and def6 != ''"> #{def6} ,</if>
<if test="def7 != null and def7 != ''"> #{def7} ,</if>
<if test="def8 != null and def8 != ''"> #{def8} ,</if>
<if test="def9 != null and def9 != ''"> #{def9} ,</if>
<if test="def10 != null and def10 != ''"> #{def10} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="createUser != null and createUser != ''"> #{createUser} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="modifyUser != null and modifyUser != ''"> #{modifyUser} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
<if test="mdmName != null and mdmName != ''"> #{mdmName} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_message_template(code, name, title, enablestate, remark, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, create_time, create_user, modify_time, modify_user, sts, mdm_id, mdm_name, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.name},#{entity.title},#{entity.enablestate},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts},#{entity.mdmId},#{entity.mdmName}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_message_template(code, name, title, enablestate, remark, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, create_time, create_user, modify_time, modify_user, sts, mdm_id, mdm_name)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.name},#{entity.title},#{entity.enablestate},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts},#{entity.mdmId},#{entity.mdmName})
</foreach>
on duplicate key update
code = values(code),
name = values(name),
title = values(title),
enablestate = values(enablestate),
remark = values(remark),
def1 = values(def1),
def2 = values(def2),
def3 = values(def3),
def4 = values(def4),
def5 = values(def5),
def6 = values(def6),
def7 = values(def7),
def8 = values(def8),
def9 = values(def9),
def10 = values(def10),
create_time = values(create_time),
create_user = values(create_user),
modify_time = values(modify_time),
modify_user = values(modify_user),
sts = values(sts),
mdm_id = values(mdm_id),
mdm_name = values(mdm_name)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity" >
update fe_conf_message_template set
<trim suffix="" suffixOverrides=",">
<if test="code != null and code != ''"> code = #{code},</if>
<if test="name != null and name != ''"> name = #{name},</if>
<if test="title != null and title != ''"> title = #{title},</if>
<if test="enablestate != null and enablestate != ''"> enablestate = #{enablestate},</if>
<if test="remark != null and remark != ''"> remark = #{remark},</if>
<if test="def1 != null and def1 != ''"> def1 = #{def1},</if>
<if test="def2 != null and def2 != ''"> def2 = #{def2},</if>
<if test="def3 != null and def3 != ''"> def3 = #{def3},</if>
<if test="def4 != null and def4 != ''"> def4 = #{def4},</if>
<if test="def5 != null and def5 != ''"> def5 = #{def5},</if>
<if test="def6 != null and def6 != ''"> def6 = #{def6},</if>
<if test="def7 != null and def7 != ''"> def7 = #{def7},</if>
<if test="def8 != null and def8 != ''"> def8 = #{def8},</if>
<if test="def9 != null and def9 != ''"> def9 = #{def9},</if>
<if test="def10 != null and def10 != ''"> def10 = #{def10},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="createUser != null and createUser != ''"> create_user = #{createUser},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="modifyUser != null and modifyUser != ''"> modify_user = #{modifyUser},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
<if test="mdmName != null and mdmName != ''"> mdm_name = #{mdmName},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity" >
update fe_conf_message_template 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.finance.conf.message.entity.FeConfMessageTemplateEntity" >
update fe_conf_message_template set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="title != null and title != ''"> and title = #{title} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
<if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
<if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
<if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
<if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
<if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
<if test="createUser != null and createUser != ''"> and create_user = #{createUser} </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user = #{modifyUser} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from fe_conf_message_template where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,31 @@
package com.hzya.frame.finance.conf.message.service;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
/**
* 消息模板表(FeConfMessageTemplate)表服务接口
*
* @author lixinyu
* @since 2025-08-26 09:14:02
*/
public interface IFeConfMessageTemplateService extends IBaseService<FeConfMessageTemplateEntity, String>{
List<FeConfMessageTemplateEntity> queryAll(FeConfMessageTemplateEntity feConfMessageTemplateEntity);
FeConfMessageTemplateEntity updateStatus(FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception;
void delete(FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception;
PageInfo queryMessagePaged(FeConfMessageTemplateEntity feConfMessageTemplateEntity);
PageInfo queryTemplate(FeConfMessageTemplateEntity feConfMessageTemplateEntity);
FeConfMessageTemplateEntity queryTemplateDetail(FeConfMessageTemplateEntity feConfMessageTemplateEntity);
FeConfMessageTemplateEntity saveEntity(FeConfMessageTemplateEntity feConfMessageTemplateEntity);
}

View File

@ -0,0 +1,112 @@
package com.hzya.frame.finance.conf.message.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.finance.conf.message.dao.IFeConfMessageTemplateDao;
import com.hzya.frame.finance.conf.message.service.IFeConfMessageTemplateService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 消息模板表(FeConfMessageTemplate)表服务实现类
*
* @author lixinyu
* @since 2025-08-26 09:14:02
*/
@Service
public class FeConfMessageTemplateServiceImpl extends BaseService<FeConfMessageTemplateEntity, String> implements IFeConfMessageTemplateService {
private IFeConfMessageTemplateDao feConfMessageTemplateDao;
@Autowired
public void setFeConfMessageTemplateDao(IFeConfMessageTemplateDao dao) {
this.feConfMessageTemplateDao = dao;
this.dao = dao;
}
/**
* 查询全部消息模板信息
* @param feConfMessageTemplateEntity
* @return
*/
@Override
public List<FeConfMessageTemplateEntity> queryAll(FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
List<FeConfMessageTemplateEntity> query = feConfMessageTemplateDao.queryByLike(feConfMessageTemplateEntity);
return query;
}
/**
* 修改消息模板
* @param feConfMessageTemplateEntity
* @return
* @throws Exception
*/
@Override
public FeConfMessageTemplateEntity updateStatus(FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception {
if(feConfMessageTemplateEntity.getId() == null){
throw new Exception("id不能为空");
}
List<FeConfMessageTemplateEntity> feConfMessageTemplate = feConfMessageTemplateDao.query(feConfMessageTemplateEntity);
if(feConfMessageTemplate == null){
throw new Exception("该记录不存在");
}
FeConfMessageTemplateEntity update = feConfMessageTemplateDao.updateStatus(feConfMessageTemplateEntity);
List<FeConfMessageTemplateEntity> query = feConfMessageTemplateDao.query(update);
return query.get(0);
}
/**
* 删除消息模板
* @param feConfMessageTemplateEntity
* @throws Exception
*/
@Override
public void delete(FeConfMessageTemplateEntity feConfMessageTemplateEntity) throws Exception {
if(feConfMessageTemplateEntity == null){
throw new Exception("参数不能为空");
}
if(feConfMessageTemplateEntity.getId() == null){
throw new Exception("id不能为空");
}
feConfMessageTemplateDao.logicRemove(feConfMessageTemplateEntity);
}
/**
* 分页查询消息模板
* @param feConfMessageTemplateEntity
* @return
*/
@Override
public PageInfo queryMessagePaged(FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
PageHelper.startPage(feConfMessageTemplateEntity.getPageNum(), feConfMessageTemplateEntity.getPageSize());
List<FeConfMessageTemplateEntity> query = feConfMessageTemplateDao.page(feConfMessageTemplateEntity);
return new PageInfo(query);
}
@Override
public PageInfo queryTemplate(FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
PageHelper.startPage(feConfMessageTemplateEntity.getPageNum(), feConfMessageTemplateEntity.getPageSize());
List<FeConfMessageTemplateEntity> query = feConfMessageTemplateDao.page(feConfMessageTemplateEntity);
return new PageInfo(query);
}
@Override
public FeConfMessageTemplateEntity queryTemplateDetail(FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
return feConfMessageTemplateDao.queryOne(feConfMessageTemplateEntity);
}
@Override
public FeConfMessageTemplateEntity saveEntity(FeConfMessageTemplateEntity feConfMessageTemplateEntity) {
if (feConfMessageTemplateEntity.getEnablestate() == null || feConfMessageTemplateEntity.getEnablestate().equals("")) {
feConfMessageTemplateEntity.setEnablestate("Y");
}
FeConfMessageTemplateEntity save = feConfMessageTemplateDao.save(feConfMessageTemplateEntity);
return save;
}
}

View File

@ -0,0 +1,116 @@
package com.hzya.frame.finance.conf.notificationRules.controller;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.billtemplate.entity.FeConfBillTemplateEntity;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl;
import com.hzya.frame.finance.conf.notificationRules.entity.BillTypeVO;
import com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity;
import com.hzya.frame.finance.conf.notificationRules.service.IFeConfNotificationRulesService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.hzya.frame.web.entity.BaseResult.getSuccessMessageEntity;
@RestController
@RequestMapping("/fe/conf/notificationRules")
public class NotificationRulesController {
@Autowired
private IFeConfNotificationRulesService iFeConfNotificationRulesService;
/**
* 分页查询通知规则
*/
@PostMapping("/queryPaged")
public JsonResultEntity queryPaged(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity){
PageInfo pageInfo = iFeConfNotificationRulesService.queryNotificationRulesPaged(feConfNotificationRulesEntity);
return getSuccessMessageEntity("查询成功",pageInfo);
}
/**
* 条件查询通知规则
*/
@PostMapping("/queryAll")
public JsonResultEntity queryAll(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity){
List<FeConfNotificationRulesEntity> list = iFeConfNotificationRulesService.queryByLike(feConfNotificationRulesEntity);
return getSuccessMessageEntity("查询成功",list);
}
/**
* 新增通知规则
*/
@PostMapping("/add")
public JsonResultEntity add(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity){
FeConfNotificationRulesEntity feConfNotificationRulesEntity1 = iFeConfNotificationRulesService.insert(feConfNotificationRulesEntity);
return getSuccessMessageEntity("新增成功",feConfNotificationRulesEntity1);
}
/**
* 启用停用状态
*/
@PostMapping("/updateStatus")
public JsonResultEntity updateStatus(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity){
FeConfNotificationRulesEntity feConfNotificationRulesEntity1 = iFeConfNotificationRulesService.updateStatus(feConfNotificationRulesEntity);
return getSuccessMessageEntity("更新成功",feConfNotificationRulesEntity1);
}
/**
* 修改通知规则
*/
@PostMapping("/update")
public JsonResultEntity update(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity) throws Exception {
FeConfNotificationRulesEntity feConfNotificationRulesEntity1 = iFeConfNotificationRulesService.updateFeConfNotificationRulesEntity(feConfNotificationRulesEntity);
return getSuccessMessageEntity("修改成功",feConfNotificationRulesEntity1);
}
/**
* 删除通知规则
*/
@PostMapping("/delete")
public JsonResultEntity delete(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity) throws Exception {
iFeConfNotificationRulesService.logicRemove(feConfNotificationRulesEntity);
return getSuccessMessageEntity("删除成功",null);
}
/**
* 根据mdm_id和mdm_name查询通知规则
*/
@PostMapping("/query")
public JsonResultEntity query(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
PageInfo pageInfo = iFeConfNotificationRulesService.queryFeConfNotificationRulesEntity(feConfNotificationRulesEntity);
return getSuccessMessageEntity("查询成功",pageInfo);
}
/**
* 查询单据类型列表
*/
@PostMapping("/queryBillType")
public JsonResultEntity queryBillType() {
List<BillTypeVO> billTypeVOS = iFeConfNotificationRulesService.queryFeConfBillTypeEntity();
return getSuccessMessageEntity("查询成功",billTypeVOS);
}
/**
* 根据id查询详情
*/
@PostMapping("/queryById")
public JsonResultEntity queryById(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
FeConfNotificationRulesEntity feConfNotificationRulesEntity1 = iFeConfNotificationRulesService.queryFeConfNotificationRulesEntityById(feConfNotificationRulesEntity);
return getSuccessMessageEntity("查询成功",feConfNotificationRulesEntity1);
}
/**
* 根据业务类型id查询消息模板
*/
@PostMapping("/queryTemplateByMdmId")
public JsonResultEntity queryTemplateByBusinessId(@RequestBody FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
List<FeConfMessageTemplateEntity> feConfMessageTemplateEntities = iFeConfNotificationRulesService.queryFeConfNotificationRulesEntityByMdmId(feConfNotificationRulesEntity);
return getSuccessMessageEntity("查询成功",feConfMessageTemplateEntities);
}
}

View File

@ -0,0 +1,34 @@
package com.hzya.frame.finance.conf.notificationRules.dao;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.finance.conf.notificationRules.entity.BillTypeVO;
import com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* 通知规则表(fe_conf_notification_rules: table)表数据库访问层
*
* @author lixinyu
* @since 2025-08-28 14:41:42
*/
public interface IFeConfNotificationRulesDao extends IBaseDao<FeConfNotificationRulesEntity, String> {
List<FeConfNotificationRulesEntity> queryNotificationRulesPaged(FeConfNotificationRulesEntity feConfNotificationRulesEntity);
FeConfNotificationRulesEntity queryById(String id);
int updateStatus(FeConfNotificationRulesEntity feConfNotificationRulesEntity);
List<FeConfNotificationRulesEntity> queryFeConfNotificationRulesEntity(String mdmId, String mdmName);
List<BillTypeVO> queryFeConfBillTypeEntity();
BillTypeVO queryBillTypeEntity(String pkBilltypeid);
FeConfMessageTemplateEntity queryMessageTemplate(Long messageTemplateid);
List<FeConfMessageTemplateEntity> queryMessageTemplateEntityByMdmId(String mdmId);
}

View File

@ -0,0 +1,74 @@
package com.hzya.frame.finance.conf.notificationRules.dao.impl;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.finance.conf.notificationRules.entity.BillTypeVO;
import com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity;
import com.hzya.frame.finance.conf.notificationRules.dao.IFeConfNotificationRulesDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 通知规则表(FeConfNotificationRules)表数据库访问层
*
* @author lixinyu
* @since 2025-08-28 14:41:42
*/
@Repository
public class FeConfNotificationRulesDaoImpl extends MybatisGenericDao<FeConfNotificationRulesEntity, String> implements IFeConfNotificationRulesDao{
@Override
public List<FeConfNotificationRulesEntity> queryNotificationRulesPaged(FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
List<FeConfNotificationRulesEntity> objects = (List<FeConfNotificationRulesEntity>) this.selectList("com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl.page", feConfNotificationRulesEntity);
return objects;
}
@Override
public FeConfNotificationRulesEntity queryById(String id) {
FeConfNotificationRulesEntity feConfNotificationRulesEntity = (FeConfNotificationRulesEntity) this.selectOne("com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl.queryById", id);
return feConfNotificationRulesEntity;
}
@Override
public int updateStatus(FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
int update = this.update("com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl.update_status", feConfNotificationRulesEntity);
return update;
}
@Override
public List<FeConfNotificationRulesEntity> queryFeConfNotificationRulesEntity(String mdmId, String mdmName) {
FeConfNotificationRulesEntity feConfNotificationRulesEntity = new FeConfNotificationRulesEntity();
feConfNotificationRulesEntity.setMdmId(mdmId);
feConfNotificationRulesEntity.setMdmName(mdmName);
List<FeConfNotificationRulesEntity> feConfNotificationRulesEntities = (List<FeConfNotificationRulesEntity>) this.selectList("com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl.queryFeConfNotificationRulesEntity", feConfNotificationRulesEntity);
return feConfNotificationRulesEntities;
}
@Override
public List<BillTypeVO> queryFeConfBillTypeEntity() {
List<BillTypeVO> billTypeVOs = (List<BillTypeVO>) this.selectList("com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl.queryBillType",null);
return billTypeVOs;
}
@Override
public BillTypeVO queryBillTypeEntity(String pkBilltypeid) {
BillTypeVO billTypeVO = (BillTypeVO) this.selectOne("com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl.queryBillTypeEntity", pkBilltypeid);
return billTypeVO;
}
@Override
public FeConfMessageTemplateEntity queryMessageTemplate(Long messageTemplateid) {
FeConfMessageTemplateEntity feConfMessageTemplateEntity = (FeConfMessageTemplateEntity) this.selectOne("com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl.queryMessageTemplate", messageTemplateid);
return feConfMessageTemplateEntity;
}
@Override
public List<FeConfMessageTemplateEntity> queryMessageTemplateEntityByMdmId(String mdmId) {
List<FeConfMessageTemplateEntity> feConfMessageTemplateEntitys = (List<FeConfMessageTemplateEntity>) this.selectList("com.hzya.frame.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl.queryMessageTemplateEntityByMdmId", mdmId);
return feConfMessageTemplateEntitys;
}
}

View File

@ -0,0 +1,14 @@
package com.hzya.frame.finance.conf.notificationRules.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BillTypeVO {
private String pkBilltypeid;
private String pkBilltypecode;
private String pkBilltypename;
}

View File

@ -0,0 +1,326 @@
package com.hzya.frame.finance.conf.notificationRules.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 通知规则表(FeConfNotificationRules)实体类
*
* @author lixinyu
* @since 2025-08-28 14:41:42
*/
public class FeConfNotificationRulesEntity extends BaseEntity {
/** 编码 */
private String code;
/** 名称 */
private String name;
/** 业务类型id */
private String mdmId;
/** 业务类型名称 */
private String mdmName;
/** 单据类型ID */
private String pkBilltypeid;
/** 单据类型编码 */
private String pkBilltypecode;
/** 单据类型名称 */
private String pkBilltypename;
/** 通知方式Id */
private String notificationMethodid;
/** 通知方式编码 */
private String notificationMethodcode;
/** 通知方式名称 */
private String notificationMethodname;
/** 通知策略(cron表达式) */
private String notificationStrategy;
/** 通知对象id */
private String notificationTargetid;
/** 通知对象编码 */
private String notificationTargetcode;
/** 通知对象名称 */
private String notificationTargetname;
/** 消息模板id */
private Long messageTemplateid;
/** 消息模板编码 */
private String messageTemplatecode;
/** 消息模板名称 */
private String messageTemplatename;
/** 启用状态 Y:启用 N:停用 */
private String enablestate;
/** 备注 */
private String remark;
/** 自定义项1 */
private String def1;
/** 自定义项2 */
private String def2;
/** 自定义项3 */
private String def3;
/** 自定义项4 */
private String def4;
/** 自定义项5 */
private String def5;
/** 自定义项6 */
private String def6;
/** 自定义项7 */
private String def7;
/** 自定义项8 */
private String def8;
/** 自定义项9 */
private String def9;
/** 自定义项10 */
private String def10;
/** 创建人 */
private String createUser;
/** 修改人 */
private String modifyUser;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMdmId() {
return mdmId;
}
public void setMdmId(String mdmId) {
this.mdmId = mdmId;
}
public String getMdmName() {
return mdmName;
}
public void setMdmName(String mdmName) {
this.mdmName = mdmName;
}
public String getPkBilltypeid() {
return pkBilltypeid;
}
public void setPkBilltypeid(String pkBilltypeid) {
this.pkBilltypeid = pkBilltypeid;
}
public String getPkBilltypecode() {
return pkBilltypecode;
}
public void setPkBilltypecode(String pkBilltypecode) {
this.pkBilltypecode = pkBilltypecode;
}
public String getPkBilltypename() {
return pkBilltypename;
}
public void setPkBilltypename(String pkBilltypename) {
this.pkBilltypename = pkBilltypename;
}
public String getNotificationMethodid() {
return notificationMethodid;
}
public void setNotificationMethodid(String notificationMethodid) {
this.notificationMethodid = notificationMethodid;
}
public String getNotificationMethodcode() {
return notificationMethodcode;
}
public void setNotificationMethodcode(String notificationMethodcode) {
this.notificationMethodcode = notificationMethodcode;
}
public String getNotificationMethodname() {
return notificationMethodname;
}
public void setNotificationMethodname(String notificationMethodname) {
this.notificationMethodname = notificationMethodname;
}
public String getNotificationStrategy() {
return notificationStrategy;
}
public void setNotificationStrategy(String notificationStrategy) {
this.notificationStrategy = notificationStrategy;
}
public String getNotificationTargetid() {
return notificationTargetid;
}
public void setNotificationTargetid(String notificationTargetid) {
this.notificationTargetid = notificationTargetid;
}
public String getNotificationTargetcode() {
return notificationTargetcode;
}
public void setNotificationTargetcode(String notificationTargetcode) {
this.notificationTargetcode = notificationTargetcode;
}
public String getNotificationTargetname() {
return notificationTargetname;
}
public void setNotificationTargetname(String notificationTargetname) {
this.notificationTargetname = notificationTargetname;
}
public Long getMessageTemplateid() {
return messageTemplateid;
}
public void setMessageTemplateid(Long messageTemplateid) {
this.messageTemplateid = messageTemplateid;
}
public String getMessageTemplatecode() {
return messageTemplatecode;
}
public void setMessageTemplatecode(String messageTemplatecode) {
this.messageTemplatecode = messageTemplatecode;
}
public String getMessageTemplatename() {
return messageTemplatename;
}
public void setMessageTemplatename(String messageTemplatename) {
this.messageTemplatename = messageTemplatename;
}
public String getEnablestate() {
return enablestate;
}
public void setEnablestate(String enablestate) {
this.enablestate = enablestate;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getDef1() {
return def1;
}
public void setDef1(String def1) {
this.def1 = def1;
}
public String getDef2() {
return def2;
}
public void setDef2(String def2) {
this.def2 = def2;
}
public String getDef3() {
return def3;
}
public void setDef3(String def3) {
this.def3 = def3;
}
public String getDef4() {
return def4;
}
public void setDef4(String def4) {
this.def4 = def4;
}
public String getDef5() {
return def5;
}
public void setDef5(String def5) {
this.def5 = def5;
}
public String getDef6() {
return def6;
}
public void setDef6(String def6) {
this.def6 = def6;
}
public String getDef7() {
return def7;
}
public void setDef7(String def7) {
this.def7 = def7;
}
public String getDef8() {
return def8;
}
public void setDef8(String def8) {
this.def8 = def8;
}
public String getDef9() {
return def9;
}
public void setDef9(String def9) {
this.def9 = def9;
}
public String getDef10() {
return def10;
}
public void setDef10(String def10) {
this.def10 = def10;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
}

View File

@ -0,0 +1,580 @@
<?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.finance.conf.notificationRules.dao.impl.FeConfNotificationRulesDaoImpl">
<resultMap id="get-FeConfNotificationRulesEntity-result" type="com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity" >
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="mdmName" column="mdm_name" jdbcType="VARCHAR"/>
<result property="pkBilltypeid" column="pk_billtypeid" jdbcType="VARCHAR"/>
<result property="pkBilltypecode" column="pk_billtypecode" jdbcType="VARCHAR"/>
<result property="pkBilltypename" column="pk_billtypename" jdbcType="VARCHAR"/>
<result property="notificationMethodid" column="notification_methodid" jdbcType="VARCHAR"/>
<result property="notificationMethodcode" column="notification_methodcode" jdbcType="VARCHAR"/>
<result property="notificationMethodname" column="notification_methodname" jdbcType="VARCHAR"/>
<result property="notificationStrategy" column="notification_strategy" jdbcType="VARCHAR"/>
<result property="notificationTargetid" column="notification_targetid" jdbcType="VARCHAR"/>
<result property="notificationTargetcode" column="notification_targetcode" jdbcType="VARCHAR"/>
<result property="notificationTargetname" column="notification_targetname" jdbcType="VARCHAR"/>
<result property="messageTemplateid" column="message_templateid" jdbcType="INTEGER"/>
<result property="messageTemplatecode" column="message_templatecode" jdbcType="VARCHAR"/>
<result property="messageTemplatename" column="message_templatename" jdbcType="VARCHAR"/>
<result property="enablestate" column="enablestate" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="def2" column="def2" jdbcType="VARCHAR"/>
<result property="def3" column="def3" jdbcType="VARCHAR"/>
<result property="def4" column="def4" jdbcType="VARCHAR"/>
<result property="def5" column="def5" jdbcType="VARCHAR"/>
<result property="def6" column="def6" jdbcType="VARCHAR"/>
<result property="def7" column="def7" jdbcType="VARCHAR"/>
<result property="def8" column="def8" jdbcType="VARCHAR"/>
<result property="def9" column="def9" jdbcType="VARCHAR"/>
<result property="def10" column="def10" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="modifyUser" column="modify_user" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "FeConfNotificationRulesEntity_Base_Column_List">
id
,code
,name
,mdm_id
,mdm_name
,pk_billtypeid
,pk_billtypecode
,pk_billtypename
,notification_methodid
,notification_methodcode
,notification_methodname
,notification_strategy
,notification_targetid
,notification_targetcode
,notification_targetname
,message_templateid
,message_templatecode
,message_templatename
,enablestate
,remark
,def1
,def2
,def3
,def4
,def5
,def6
,def7
,def8
,def9
,def10
,create_time
,create_user
,modify_time
,modify_user
,sts
</sql>
<select id="queryById" resultMap="get-FeConfNotificationRulesEntity-result" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity">
select *
from fe_conf_notification_rules
where id = #{id}
</select>
<update id="update_status" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity">
update fe_conf_notification_rules
set enablestate = #{enablestate}
where id = #{id}
</update>
<!-- 分页查询条件 -->
<select id="page" resultMap="get-FeConfNotificationRulesEntity-result" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity">
select
<include refid="FeConfNotificationRulesEntity_Base_Column_List" />
from fe_conf_notification_rules
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id like concat('%',#{id},'%') </if>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name like concat('%',#{mdmName},'%') </if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> and pk_billtypeid like concat('%',#{pkBilltypeid},'%') </if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> and pk_billtypecode like concat('%',#{pkBilltypecode},'%') </if>
<if test="pkBilltypename != null and pkBilltypename != ''"> and pk_billtypename like concat('%',#{pkBilltypename},'%') </if>
<if test="notificationMethodid != null and notificationMethodid != ''"> and notification_methodid like concat('%',#{notificationMethodid},'%') </if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> and notification_methodcode like concat('%',#{notificationMethodcode},'%') </if>
<if test="notificationMethodname != null and notificationMethodname != ''"> and notification_methodname like concat('%',#{notificationMethodname},'%') </if>
<if test="notificationStrategy != null and notificationStrategy != ''"> and notification_strategy like concat('%',#{notificationStrategy},'%') </if>
<if test="notificationTargetid != null and notificationTargetid != ''"> and notification_targetid like concat('%',#{notificationTargetid},'%') </if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> and notification_targetcode like concat('%',#{notificationTargetcode},'%') </if>
<if test="notificationTargetname != null and notificationTargetname != ''"> and notification_targetname like concat('%',#{notificationTargetname},'%') </if>
<if test="messageTemplateid != null"> and message_templateid like concat('%',#{messageTemplateid},'%') </if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> and message_templatecode like concat('%',#{messageTemplatecode},'%') </if>
<if test="messageTemplatename != null and messageTemplatename != ''"> and message_templatename like concat('%',#{messageTemplatename},'%') </if>
<if test="enablestate != null and enablestate != ''"> and enablestate like concat('%',#{enablestate},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
<if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
<if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
<if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
<if test="def4 != null and def4 != ''"> and def4 like concat('%',#{def4},'%') </if>
<if test="def5 != null and def5 != ''"> and def5 like concat('%',#{def5},'%') </if>
<if test="def6 != null and def6 != ''"> and def6 like concat('%',#{def6},'%') </if>
<if test="def7 != null and def7 != ''"> and def7 like concat('%',#{def7},'%') </if>
<if test="def8 != null and def8 != ''"> and def8 like concat('%',#{def8},'%') </if>
<if test="def9 != null and def9 != ''"> and def9 like concat('%',#{def9},'%') </if>
<if test="def10 != null and def10 != ''"> and def10 like concat('%',#{def10},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="createUser != null and createUser != ''"> and create_user like concat('%',#{createUser},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user like concat('%',#{modifyUser},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
and sts='Y'
</trim>
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-FeConfNotificationRulesEntity-result" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity">
select
<include refid="FeConfNotificationRulesEntity_Base_Column_List" />
from fe_conf_notification_rules
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> and pk_billtypeid = #{pkBilltypeid} </if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> and pk_billtypecode = #{pkBilltypecode} </if>
<if test="pkBilltypename != null and pkBilltypename != ''"> and pk_billtypename = #{pkBilltypename} </if>
<if test="notificationMethodid != null and notificationMethodid != ''"> and notification_methodid = #{notificationMethodid} </if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> and notification_methodcode = #{notificationMethodcode} </if>
<if test="notificationMethodname != null and notificationMethodname != ''"> and notification_methodname = #{notificationMethodname} </if>
<if test="notificationStrategy != null and notificationStrategy != ''"> and notification_strategy = #{notificationStrategy} </if>
<if test="notificationTargetid != null and notificationTargetid != ''"> and notification_targetid = #{notificationTargetid} </if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> and notification_targetcode = #{notificationTargetcode} </if>
<if test="notificationTargetname != null and notificationTargetname != ''"> and notification_targetname = #{notificationTargetname} </if>
<if test="messageTemplateid != null"> and message_templateid = #{messageTemplateid} </if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> and message_templatecode = #{messageTemplatecode} </if>
<if test="messageTemplatename != null and messageTemplatename != ''"> and message_templatename = #{messageTemplatename} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
<if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
<if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
<if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
<if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
<if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="createUser != null and createUser != ''"> and create_user = #{createUser} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user = #{modifyUser} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
and sts='Y'
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity">
select count(1) from fe_conf_notification_rules
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> and pk_billtypeid = #{pkBilltypeid} </if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> and pk_billtypecode = #{pkBilltypecode} </if>
<if test="pkBilltypename != null and pkBilltypename != ''"> and pk_billtypename = #{pkBilltypename} </if>
<if test="notificationMethodid != null and notificationMethodid != ''"> and notification_methodid = #{notificationMethodid} </if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> and notification_methodcode = #{notificationMethodcode} </if>
<if test="notificationMethodname != null and notificationMethodname != ''"> and notification_methodname = #{notificationMethodname} </if>
<if test="notificationStrategy != null and notificationStrategy != ''"> and notification_strategy = #{notificationStrategy} </if>
<if test="notificationTargetid != null and notificationTargetid != ''"> and notification_targetid = #{notificationTargetid} </if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> and notification_targetcode = #{notificationTargetcode} </if>
<if test="notificationTargetname != null and notificationTargetname != ''"> and notification_targetname = #{notificationTargetname} </if>
<if test="messageTemplateid != null"> and message_templateid = #{messageTemplateid} </if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> and message_templatecode = #{messageTemplatecode} </if>
<if test="messageTemplatename != null and messageTemplatename != ''"> and message_templatename = #{messageTemplatename} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
<if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
<if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
<if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
<if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
<if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="createUser != null and createUser != ''"> and create_user = #{createUser} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user = #{modifyUser} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-FeConfNotificationRulesEntity-result" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity">
select
<include refid="FeConfNotificationRulesEntity_Base_Column_List" />
from fe_conf_notification_rules
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id like concat('%',#{id},'%') </if>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name like concat('%',#{mdmName},'%') </if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> and pk_billtypeid like concat('%',#{pkBilltypeid},'%') </if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> and pk_billtypecode like concat('%',#{pkBilltypecode},'%') </if>
<if test="pkBilltypename != null and pkBilltypename != ''"> and pk_billtypename like concat('%',#{pkBilltypename},'%') </if>
<if test="notificationMethodid != null and notificationMethodid != ''"> and notification_methodid like concat('%',#{notificationMethodid},'%') </if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> and notification_methodcode like concat('%',#{notificationMethodcode},'%') </if>
<if test="notificationMethodname != null and notificationMethodname != ''"> and notification_methodname like concat('%',#{notificationMethodname},'%') </if>
<if test="notificationStrategy != null and notificationStrategy != ''"> and notification_strategy like concat('%',#{notificationStrategy},'%') </if>
<if test="notificationTargetid != null and notificationTargetid != ''"> and notification_targetid like concat('%',#{notificationTargetid},'%') </if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> and notification_targetcode like concat('%',#{notificationTargetcode},'%') </if>
<if test="notificationTargetname != null and notificationTargetname != ''"> and notification_targetname like concat('%',#{notificationTargetname},'%') </if>
<if test="messageTemplateid != null"> and message_templateid like concat('%',#{messageTemplateid},'%') </if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> and message_templatecode like concat('%',#{messageTemplatecode},'%') </if>
<if test="messageTemplatename != null and messageTemplatename != ''"> and message_templatename like concat('%',#{messageTemplatename},'%') </if>
<if test="enablestate != null and enablestate != ''"> and enablestate like concat('%',#{enablestate},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
<if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
<if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
<if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
<if test="def4 != null and def4 != ''"> and def4 like concat('%',#{def4},'%') </if>
<if test="def5 != null and def5 != ''"> and def5 like concat('%',#{def5},'%') </if>
<if test="def6 != null and def6 != ''"> and def6 like concat('%',#{def6},'%') </if>
<if test="def7 != null and def7 != ''"> and def7 like concat('%',#{def7},'%') </if>
<if test="def8 != null and def8 != ''"> and def8 like concat('%',#{def8},'%') </if>
<if test="def9 != null and def9 != ''"> and def9 like concat('%',#{def9},'%') </if>
<if test="def10 != null and def10 != ''"> and def10 like concat('%',#{def10},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="createUser != null and createUser != ''"> and create_user like concat('%',#{createUser},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user like concat('%',#{modifyUser},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
and sts='Y'
</trim>
</select>
<select id="queryFeConfNotificationRulesEntity" resultMap="get-FeConfNotificationRulesEntity-result" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity">
select *
from fe_conf_notification_rules
where mdm_id = #{mdmId} and mdm_name = #{mdmName}
</select>
<select id="queryBillTypeEntity" resultType="com.hzya.frame.finance.conf.notificationRules.entity.BillTypeVO">
select
pk_billtypeid as pkBilltypeid,
pk_billtypecode as pkBilltypecode,
billtypename as pkBilltypename
from mdm_bd_bd_billtype
where pk_billtypeid = #{pkBilltypeid}
</select>
<select id="queryBillType" resultType="com.hzya.frame.finance.conf.notificationRules.entity.BillTypeVO">
SELECT
pk_billtypeid AS pkBilltypeid,
pk_billtypecode AS pkBilltypecode,
billtypename AS pkBilltypename
FROM
mdm_bd_bd_billtype
WHERE
parentbilltype IN ( 'F2', 'F4', 'F3', 'F5' )
AND pk_group = '0001D910000000000YQR'
</select>
<select id="queryMessageTemplate" resultType="com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
select id,code,`name`
from fe_conf_message_template
where id = #{messageTemplateid}
</select>
<select id="queryMessageTemplateEntityByMdmId" resultType="com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity">
select
id,code,name,title,enablestate,remark,def1,def2,def3,def4,def5,def6,def7,def8,def9,def10,create_time,create_user,modify_time,modify_user,sts,mdm_id,mdm_name
from fe_conf_message_template
where mdm_id = #{mdmId} and sts = 'Y' and enablestate = 'Y'
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="FeConfNotificationRulesentity_list_or" resultMap="get-FeConfNotificationRulesEntity-result" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity">
select
<include refid="FeConfNotificationRulesEntity_Base_Column_List" />
from fe_conf_notification_rules
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> or id = #{id} </if>
<if test="code != null and code != ''"> or code = #{code} </if>
<if test="name != null and name != ''"> or name = #{name} </if>
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
<if test="mdmName != null and mdmName != ''"> or mdm_name = #{mdmName} </if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> or pk_billtypeid = #{pkBilltypeid} </if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> or pk_billtypecode = #{pkBilltypecode} </if>
<if test="pkBilltypename != null and pkBilltypename != ''"> or pk_billtypename = #{pkBilltypename} </if>
<if test="notificationMethodid != null and notificationMethodid != ''"> or notification_methodid = #{notificationMethodid} </if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> or notification_methodcode = #{notificationMethodcode} </if>
<if test="notificationMethodname != null and notificationMethodname != ''"> or notification_methodname = #{notificationMethodname} </if>
<if test="notificationStrategy != null and notificationStrategy != ''"> or notification_strategy = #{notificationStrategy} </if>
<if test="notificationTargetid != null and notificationTargetid != ''"> or notification_targetid = #{notificationTargetid} </if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> or notification_targetcode = #{notificationTargetcode} </if>
<if test="notificationTargetname != null and notificationTargetname != ''"> or notification_targetname = #{notificationTargetname} </if>
<if test="messageTemplateid != null"> or message_templateid = #{messageTemplateid} </if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> or message_templatecode = #{messageTemplatecode} </if>
<if test="messageTemplatename != null and messageTemplatename != ''"> or message_templatename = #{messageTemplatename} </if>
<if test="enablestate != null and enablestate != ''"> or enablestate = #{enablestate} </if>
<if test="remark != null and remark != ''"> or remark = #{remark} </if>
<if test="def1 != null and def1 != ''"> or def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> or def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> or def3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> or def4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> or def5 = #{def5} </if>
<if test="def6 != null and def6 != ''"> or def6 = #{def6} </if>
<if test="def7 != null and def7 != ''"> or def7 = #{def7} </if>
<if test="def8 != null and def8 != ''"> or def8 = #{def8} </if>
<if test="def9 != null and def9 != ''"> or def9 = #{def9} </if>
<if test="def10 != null and def10 != ''"> or def10 = #{def10} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="createUser != null and createUser != ''"> or create_user = #{createUser} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="modifyUser != null and modifyUser != ''"> or modify_user = #{modifyUser} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_notification_rules(
<trim suffix="" suffixOverrides=",">
<if test="id != null"> id , </if>
<if test="code != null and code != ''"> code , </if>
<if test="name != null and name != ''"> name , </if>
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
<if test="mdmName != null and mdmName != ''"> mdm_name , </if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> pk_billtypeid , </if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> pk_billtypecode , </if>
<if test="pkBilltypename != null and pkBilltypename != ''"> pk_billtypename , </if>
<if test="notificationMethodid != null and notificationMethodid != ''"> notification_methodid , </if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> notification_methodcode , </if>
<if test="notificationMethodname != null and notificationMethodname != ''"> notification_methodname , </if>
<if test="notificationStrategy != null and notificationStrategy != ''"> notification_strategy , </if>
<if test="notificationTargetid != null and notificationTargetid != ''"> notification_targetid , </if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> notification_targetcode , </if>
<if test="notificationTargetname != null and notificationTargetname != ''"> notification_targetname , </if>
<if test="messageTemplateid != null"> message_templateid , </if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> message_templatecode , </if>
<if test="messageTemplatename != null and messageTemplatename != ''"> message_templatename , </if>
<if test="enablestate != null and enablestate != ''"> enablestate , </if>
<if test="remark != null and remark != ''"> remark , </if>
<if test="def1 != null and def1 != ''"> def1 , </if>
<if test="def2 != null and def2 != ''"> def2 , </if>
<if test="def3 != null and def3 != ''"> def3 , </if>
<if test="def4 != null and def4 != ''"> def4 , </if>
<if test="def5 != null and def5 != ''"> def5 , </if>
<if test="def6 != null and def6 != ''"> def6 , </if>
<if test="def7 != null and def7 != ''"> def7 , </if>
<if test="def8 != null and def8 != ''"> def8 , </if>
<if test="def9 != null and def9 != ''"> def9 , </if>
<if test="def10 != null and def10 != ''"> def10 , </if>
<if test="create_time != null"> create_time , </if>
<if test="createUser != null and createUser != ''"> create_user , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="modifyUser != null and modifyUser != ''"> modify_user , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null"> #{id} ,</if>
<if test="code != null and code != ''"> #{code} ,</if>
<if test="name != null and name != ''"> #{name} ,</if>
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
<if test="mdmName != null and mdmName != ''"> #{mdmName} ,</if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> #{pkBilltypeid} ,</if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> #{pkBilltypecode} ,</if>
<if test="pkBilltypename != null and pkBilltypename != ''"> #{pkBilltypename} ,</if>
<if test="notificationMethodid != null and notificationMethodid != ''"> #{notificationMethodid} ,</if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> #{notificationMethodcode} ,</if>
<if test="notificationMethodname != null and notificationMethodname != ''"> #{notificationMethodname} ,</if>
<if test="notificationStrategy != null and notificationStrategy != ''"> #{notificationStrategy} ,</if>
<if test="notificationTargetid != null and notificationTargetid != ''"> #{notificationTargetid} ,</if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> #{notificationTargetcode} ,</if>
<if test="notificationTargetname != null and notificationTargetname != ''"> #{notificationTargetname} ,</if>
<if test="messageTemplateid != null"> #{messageTemplateid} ,</if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> #{messageTemplatecode} ,</if>
<if test="messageTemplatename != null and messageTemplatename != ''"> #{messageTemplatename} ,</if>
<if test="enablestate != null and enablestate != ''"> #{enablestate} ,</if>
<if test="remark != null and remark != ''"> #{remark} ,</if>
<if test="def1 != null and def1 != ''"> #{def1} ,</if>
<if test="def2 != null and def2 != ''"> #{def2} ,</if>
<if test="def3 != null and def3 != ''"> #{def3} ,</if>
<if test="def4 != null and def4 != ''"> #{def4} ,</if>
<if test="def5 != null and def5 != ''"> #{def5} ,</if>
<if test="def6 != null and def6 != ''"> #{def6} ,</if>
<if test="def7 != null and def7 != ''"> #{def7} ,</if>
<if test="def8 != null and def8 != ''"> #{def8} ,</if>
<if test="def9 != null and def9 != ''"> #{def9} ,</if>
<if test="def10 != null and def10 != ''"> #{def10} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="createUser != null and createUser != ''"> #{createUser} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="modifyUser != null and modifyUser != ''"> #{modifyUser} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_notification_rules(code, name, mdm_id, mdm_name, pk_billtypeid, pk_billtypecode, pk_billtypename, notification_methodid, notification_methodcode, notification_methodname, notification_strategy, notification_targetid, notification_targetcode, notification_targetname, message_templateid, message_templatecode, message_templatename, enablestate, remark, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, create_time, create_user, modify_time, modify_user, sts, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.name},#{entity.mdmId},#{entity.mdmName},#{entity.pkBilltypeid},#{entity.pkBilltypecode},#{entity.pkBilltypename},#{entity.notificationMethodid},#{entity.notificationMethodcode},#{entity.notificationMethodname},#{entity.notificationStrategy},#{entity.notificationTargetid},#{entity.notificationTargetcode},#{entity.notificationTargetname},#{entity.messageTemplateid},#{entity.messageTemplatecode},#{entity.messageTemplatename},#{entity.enablestate},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into fe_conf_notification_rules(code, name, mdm_id, mdm_name, pk_billtypeid, pk_billtypecode, pk_billtypename, notification_methodid, notification_methodcode, notification_methodname, notification_strategy, notification_targetid, notification_targetcode, notification_targetname, message_templateid, message_templatecode, message_templatename, enablestate, remark, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, create_time, create_user, modify_time, modify_user, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.name},#{entity.mdmId},#{entity.mdmName},#{entity.pkBilltypeid},#{entity.pkBilltypecode},#{entity.pkBilltypename},#{entity.notificationMethodid},#{entity.notificationMethodcode},#{entity.notificationMethodname},#{entity.notificationStrategy},#{entity.notificationTargetid},#{entity.notificationTargetcode},#{entity.notificationTargetname},#{entity.messageTemplateid},#{entity.messageTemplatecode},#{entity.messageTemplatename},#{entity.enablestate},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts})
</foreach>
on duplicate key update
code = values(code),
name = values(name),
mdm_id = values(mdm_id),
mdm_name = values(mdm_name),
pk_billtypeid = values(pk_billtypeid),
pk_billtypecode = values(pk_billtypecode),
pk_billtypename = values(pk_billtypename),
notification_methodid = values(notification_methodid),
notification_methodcode = values(notification_methodcode),
notification_methodname = values(notification_methodname),
notification_strategy = values(notification_strategy),
notification_targetid = values(notification_targetid),
notification_targetcode = values(notification_targetcode),
notification_targetname = values(notification_targetname),
message_templateid = values(message_templateid),
message_templatecode = values(message_templatecode),
message_templatename = values(message_templatename),
enablestate = values(enablestate),
remark = values(remark),
def1 = values(def1),
def2 = values(def2),
def3 = values(def3),
def4 = values(def4),
def5 = values(def5),
def6 = values(def6),
def7 = values(def7),
def8 = values(def8),
def9 = values(def9),
def10 = values(def10),
create_time = values(create_time),
create_user = values(create_user),
modify_time = values(modify_time),
modify_user = values(modify_user),
sts = values(sts)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity" >
update fe_conf_notification_rules set
<trim suffix="" suffixOverrides=",">
<if test="code != null and code != ''"> code = #{code},</if>
<if test="name != null and name != ''"> name = #{name},</if>
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
<if test="mdmName != null and mdmName != ''"> mdm_name = #{mdmName},</if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> pk_billtypeid = #{pkBilltypeid},</if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> pk_billtypecode = #{pkBilltypecode},</if>
<if test="pkBilltypename != null and pkBilltypename != ''"> pk_billtypename = #{pkBilltypename},</if>
<if test="notificationMethodid != null and notificationMethodid != ''"> notification_methodid = #{notificationMethodid},</if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> notification_methodcode = #{notificationMethodcode},</if>
<if test="notificationMethodname != null and notificationMethodname != ''"> notification_methodname = #{notificationMethodname},</if>
<if test="notificationStrategy != null and notificationStrategy != ''"> notification_strategy = #{notificationStrategy},</if>
<if test="notificationTargetid != null and notificationTargetid != ''"> notification_targetid = #{notificationTargetid},</if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> notification_targetcode = #{notificationTargetcode},</if>
<if test="notificationTargetname != null and notificationTargetname != ''"> notification_targetname = #{notificationTargetname},</if>
<if test="messageTemplateid != null"> message_templateid = #{messageTemplateid},</if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> message_templatecode = #{messageTemplatecode},</if>
<if test="messageTemplatename != null and messageTemplatename != ''"> message_templatename = #{messageTemplatename},</if>
<if test="enablestate != null and enablestate != ''"> enablestate = #{enablestate},</if>
<if test="remark != null and remark != ''"> remark = #{remark},</if>
<if test="def1 != null and def1 != ''"> def1 = #{def1},</if>
<if test="def2 != null and def2 != ''"> def2 = #{def2},</if>
<if test="def3 != null and def3 != ''"> def3 = #{def3},</if>
<if test="def4 != null and def4 != ''"> def4 = #{def4},</if>
<if test="def5 != null and def5 != ''"> def5 = #{def5},</if>
<if test="def6 != null and def6 != ''"> def6 = #{def6},</if>
<if test="def7 != null and def7 != ''"> def7 = #{def7},</if>
<if test="def8 != null and def8 != ''"> def8 = #{def8},</if>
<if test="def9 != null and def9 != ''"> def9 = #{def9},</if>
<if test="def10 != null and def10 != ''"> def10 = #{def10},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="createUser != null and createUser != ''"> create_user = #{createUser},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="modifyUser != null and modifyUser != ''"> modify_user = #{modifyUser},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity" >
update fe_conf_notification_rules 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.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity" >
update fe_conf_notification_rules set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
<if test="pkBilltypeid != null and pkBilltypeid != ''"> and pk_billtypeid = #{pkBilltypeid} </if>
<if test="pkBilltypecode != null and pkBilltypecode != ''"> and pk_billtypecode = #{pkBilltypecode} </if>
<if test="pkBilltypename != null and pkBilltypename != ''"> and pk_billtypename = #{pkBilltypename} </if>
<if test="notificationMethodid != null and notificationMethodid != ''"> and notification_methodid = #{notificationMethodid} </if>
<if test="notificationMethodcode != null and notificationMethodcode != ''"> and notification_methodcode = #{notificationMethodcode} </if>
<if test="notificationMethodname != null and notificationMethodname != ''"> and notification_methodname = #{notificationMethodname} </if>
<if test="notificationStrategy != null and notificationStrategy != ''"> and notification_strategy = #{notificationStrategy} </if>
<if test="notificationTargetid != null and notificationTargetid != ''"> and notification_targetid = #{notificationTargetid} </if>
<if test="notificationTargetcode != null and notificationTargetcode != ''"> and notification_targetcode = #{notificationTargetcode} </if>
<if test="notificationTargetname != null and notificationTargetname != ''"> and notification_targetname = #{notificationTargetname} </if>
<if test="messageTemplateid != null"> and message_templateid = #{messageTemplateid} </if>
<if test="messageTemplatecode != null and messageTemplatecode != ''"> and message_templatecode = #{messageTemplatecode} </if>
<if test="messageTemplatename != null and messageTemplatename != ''"> and message_templatename = #{messageTemplatename} </if>
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
<if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
<if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
<if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
<if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
<if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
<if test="createUser != null and createUser != ''"> and create_user = #{createUser} </if>
<if test="modifyUser != null and modifyUser != ''"> and modify_user = #{modifyUser} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from fe_conf_notification_rules where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,33 @@
package com.hzya.frame.finance.conf.notificationRules.service;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.finance.conf.notificationRules.entity.BillTypeVO;
import com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
/**
* 通知规则表(FeConfNotificationRules)表服务接口
*
* @author lixinyu
* @since 2025-08-28 14:41:42
*/
public interface IFeConfNotificationRulesService extends IBaseService<FeConfNotificationRulesEntity, String>{
PageInfo queryNotificationRulesPaged(FeConfNotificationRulesEntity feConfNotificationRulesEntity);
FeConfNotificationRulesEntity insert(FeConfNotificationRulesEntity feConfNotificationRulesEntity);
FeConfNotificationRulesEntity updateStatus(FeConfNotificationRulesEntity feConfNotificationRulesEntity);
FeConfNotificationRulesEntity updateFeConfNotificationRulesEntity(FeConfNotificationRulesEntity feConfNotificationRulesEntity) throws Exception;
PageInfo queryFeConfNotificationRulesEntity(FeConfNotificationRulesEntity feConfBillTemplateEntity);
List<BillTypeVO> queryFeConfBillTypeEntity();
FeConfNotificationRulesEntity queryFeConfNotificationRulesEntityById(FeConfNotificationRulesEntity feConfNotificationRulesEntity);
List<FeConfMessageTemplateEntity> queryFeConfNotificationRulesEntityByMdmId(FeConfNotificationRulesEntity feConfNotificationRulesEntity);
}

View File

@ -0,0 +1,152 @@
package com.hzya.frame.finance.conf.notificationRules.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.finance.conf.message.entity.FeConfMessageTemplateEntity;
import com.hzya.frame.finance.conf.notificationRules.entity.BillTypeVO;
import com.hzya.frame.finance.conf.notificationRules.entity.FeConfNotificationRulesEntity;
import com.hzya.frame.finance.conf.notificationRules.dao.IFeConfNotificationRulesDao;
import com.hzya.frame.finance.conf.notificationRules.service.IFeConfNotificationRulesService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 通知规则表(FeConfNotificationRules)表服务实现类
*
* @author lixinyu
* @since 2025-08-28 14:41:42
*/
@Service
public class FeConfNotificationRulesServiceImpl extends BaseService<FeConfNotificationRulesEntity, String> implements IFeConfNotificationRulesService {
private IFeConfNotificationRulesDao feConfNotificationRulesDao;
@Autowired
public void setFeConfNotificationRulesDao(IFeConfNotificationRulesDao dao) {
this.feConfNotificationRulesDao = dao;
this.dao = dao;
}
/**
* 分页查询通知规则
* @param feConfNotificationRulesEntity
* @return
*/
@Override
public PageInfo queryNotificationRulesPaged(FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
PageHelper.startPage(feConfNotificationRulesEntity.getPageNum(), feConfNotificationRulesEntity.getPageSize());
List<FeConfNotificationRulesEntity> list = feConfNotificationRulesDao.queryNotificationRulesPaged(feConfNotificationRulesEntity);
return new PageInfo(list);
}
/**
* 新增通知规则
* @param feConfNotificationRulesEntity
* @return
*/
@Override
public FeConfNotificationRulesEntity insert(FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
if(feConfNotificationRulesEntity.getPkBilltypeid() == null || "".equals(feConfNotificationRulesEntity.getPkBilltypeid())){
throw new RuntimeException("单据类型不能为空");
}
if(feConfNotificationRulesEntity.getNotificationStrategy() == null || "".equals(feConfNotificationRulesEntity.getNotificationStrategy())){
throw new RuntimeException("通知策略不能为空");
}
if(feConfNotificationRulesEntity.getNotificationTargetid() == null || "".equals(feConfNotificationRulesEntity.getNotificationTargetid())){
throw new RuntimeException("通知对象不能为空");
}
if(feConfNotificationRulesEntity.getMessageTemplateid() == null || "".equals(feConfNotificationRulesEntity.getMessageTemplateid())){
throw new RuntimeException("消息模板不能为空");
}
// 查询单据类型
BillTypeVO billTypeVO = feConfNotificationRulesDao.queryBillTypeEntity(feConfNotificationRulesEntity.getPkBilltypeid());
feConfNotificationRulesEntity.setPkBilltypecode(billTypeVO.getPkBilltypecode());
feConfNotificationRulesEntity.setPkBilltypename(billTypeVO.getPkBilltypename());
// 查询消息模板
FeConfMessageTemplateEntity feConfMessageTemplateEntity = feConfNotificationRulesDao.queryMessageTemplate(feConfNotificationRulesEntity.getMessageTemplateid());
feConfNotificationRulesEntity.setMessageTemplatecode(feConfMessageTemplateEntity.getCode());
feConfNotificationRulesEntity.setMessageTemplatename(feConfMessageTemplateEntity.getName());
if(feConfNotificationRulesEntity.getEnablestate() == null || "".equals(feConfNotificationRulesEntity.getEnablestate())){
feConfNotificationRulesEntity.setEnablestate("Y");
}
FeConfNotificationRulesEntity save = feConfNotificationRulesDao.save(feConfNotificationRulesEntity);
FeConfNotificationRulesEntity feConfNotificationRulesEntity1 = feConfNotificationRulesDao.queryById(save.getId());
return feConfNotificationRulesEntity1;
}
/**
* 启用停用
* @param feConfNotificationRulesEntity
* @return
*/
@Override
public FeConfNotificationRulesEntity updateStatus(FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
if(feConfNotificationRulesEntity.getId() == null){
throw new RuntimeException("id不能为空");
}
int update = feConfNotificationRulesDao.updateStatus(feConfNotificationRulesEntity);
if(update >0){
return feConfNotificationRulesDao.queryById(feConfNotificationRulesEntity.getId());
}else{
throw new RuntimeException("更新失败");
}
}
/**
* 修改通知规则
* @param feConfNotificationRulesEntity
* @return
*/
@Override
public FeConfNotificationRulesEntity updateFeConfNotificationRulesEntity(FeConfNotificationRulesEntity feConfNotificationRulesEntity) throws Exception {
FeConfNotificationRulesEntity update = feConfNotificationRulesDao.update(feConfNotificationRulesEntity);
return update;
}
/**
* 根据mdm_id和mdm_name查询通知规则
* @param
* @return
*/
@Override
public PageInfo queryFeConfNotificationRulesEntity(FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
PageHelper.startPage(feConfNotificationRulesEntity.getPageNum(), feConfNotificationRulesEntity.getPageSize());
List<FeConfNotificationRulesEntity> list = feConfNotificationRulesDao.queryNotificationRulesPaged(feConfNotificationRulesEntity);
return new PageInfo(list);
}
/**
* 查询单据类型
* @return
*/
@Override
public List<BillTypeVO> queryFeConfBillTypeEntity() {
return feConfNotificationRulesDao.queryFeConfBillTypeEntity();
}
/**
* 根据id查询通知规则详情
* @param feConfNotificationRulesEntity
* @return
*/
@Override
public FeConfNotificationRulesEntity queryFeConfNotificationRulesEntityById(FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
FeConfNotificationRulesEntity feConfNotificationRulesEntity1 = feConfNotificationRulesDao.queryOne(feConfNotificationRulesEntity);
return feConfNotificationRulesEntity1;
}
/**
* 根据业务类型id查询消息模板
* @param feConfNotificationRulesEntity
* @return
*/
@Override
public List<FeConfMessageTemplateEntity> queryFeConfNotificationRulesEntityByMdmId(FeConfNotificationRulesEntity feConfNotificationRulesEntity) {
String mdmId = feConfNotificationRulesEntity.getMdmId();
List<FeConfMessageTemplateEntity> feConfMessageTemplateEntities = feConfNotificationRulesDao.queryMessageTemplateEntityByMdmId(mdmId);
return feConfMessageTemplateEntities;
}
}

View File

@ -0,0 +1,62 @@
package com.hzya.frame.finance.flow.controller;
import com.hzya.frame.finance.claim.entity.ClaimVO;
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
import com.hzya.frame.finance.flow.entity.PuFaBankFlowGtsRequestVO;
import com.hzya.frame.finance.flow.entity.PuFaBankFlowGtsResponseVO;
import com.hzya.frame.finance.flow.service.IMdmKkBankflowGtsService;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.UUID;
/**
* Created by zydd on 2025-08-22 09:41
*/
@RestController
@RequestMapping("/fe/flow/gts")
public class GTSController extends DefaultController {
@Autowired
private IMdmKkBankflowGtsService bankflowGtsService;
// @RequestMapping(value = "/insert", method = RequestMethod.POST)
// public void insert(@RequestBody MdmKkBankflowGtsEntity entity) throws Exception {
// for (int i = 0; i < 4000; i++) {
// MdmKkBankflowGtsEntity mdmKkBankflowGtsEntity = new MdmKkBankflowGtsEntity();
// mdmKkBankflowGtsEntity.setId(UUID.randomUUID().toString());
// bankflowGtsService.save(mdmKkBankflowGtsEntity);
// }
// }
//流水生成认领单
// @RequestMapping(value = "/generate", method = RequestMethod.POST)
// public JsonResultEntity generate(@RequestBody ClaimVO vo) throws Exception {
// try {
// return getSuccessMessageEntity(null);
// }catch (Exception e){
// e.printStackTrace();
// return getFailureMessageEntity(e.getMessage());
// }
//
// }
@RequestMapping("queryGts")
public JsonResultEntity queryGts(@RequestBody PuFaBankFlowGtsRequestVO vo){
try {
PuFaBankFlowGtsResponseVO responseVO = bankflowGtsService.queryGts(vo);
return getSuccessMessageEntity("请求成功",responseVO);
}catch (Exception e){
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
}

View File

@ -0,0 +1,16 @@
package com.hzya.frame.finance.flow.dao;
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 账户明细查询GTS(mdm_kk_bankflow_gts: table)表数据库访问层
*
* @author zydd
* @since 2025-08-22 09:36:27
*/
public interface IMdmKkBankflowGtsDao extends IBaseDao<MdmKkBankflowGtsEntity, String> {
void updateStatus(MdmKkBankflowGtsEntity entity);
}

View File

@ -0,0 +1,21 @@
package com.hzya.frame.finance.flow.dao.impl;
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
import com.hzya.frame.finance.flow.dao.IMdmKkBankflowGtsDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 账户明细查询GTS(MdmKkBankflowGts)表数据库访问层
*
* @author zydd
* @since 2025-08-22 09:36:27
*/
@Repository
public class MdmKkBankflowGtsDaoImpl extends MybatisGenericDao<MdmKkBankflowGtsEntity, String> implements IMdmKkBankflowGtsDao{
@Override
public void updateStatus(MdmKkBankflowGtsEntity entity) {
this.update("com.hzya.frame.finance.flow.dao.impl.MdmKkBankflowGtsDaoImpl.updateStatus",entity);
}
}

View File

@ -0,0 +1,112 @@
package com.hzya.frame.finance.flow.entity;
import java.util.Date;
import com.alibaba.fastjson.annotation.JSONField;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 账户明细查询GTS(MdmKkBankflowGts)实体类
*
* @author zydd
* @since 2025-08-22 09:36:27
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MdmKkBankflowGtsEntity extends BaseEntity {
/** 单据规则 */
private String documentRule;
/** 单据规则流水号 */
private Long documentRuleNum;
/** 数据状态 Y正常 N删除 F修改 */
private String dataStatus;
/** 新增数据状态 0待下发 1已下发 */
private String addStatus;
/** 修改数据状态 0待下发 1已下发 */
private String updateStatus;
/** 删除数据状态 0待下发 1已下发 */
private String deleteStatus;
/** 公司id */
private String companyId;
/** data_id */
private String dataId;
/** mdm_up_id */
private String mdmUpId;
/** 交易流水号 */
@JSONField(name = "tranSeqNo1")
private String transeqno1;
/** 对方户名 */
@JSONField(name = "cnterAcctName")
private String cnteracctname;
/** 对方账户 */
@JSONField(name = "cnterAcctNo")
private String cnteracctno;
/** 对方开户行 */
@JSONField(name = "opnBnkInfo")
private String opnbnkinfo;
/** 交易金额 */
@JSONField(name = "tranAmt")
private String tranamt;
/** 转入金额 */
@JSONField(name = "inAmtLot")
private String inamtlot;
/** 转出金额 */
@JSONField(name = "tfrOutAmt")
private String tfroutamt;
/** 币种 */
@JSONField(name = "ccy")
private String ccy;
/** 余额 */
@JSONField(name = "balance")
private String balance;
/** 转入/转出标志 */
@JSONField(name = "outFlag")
private String outflag;
/** 企业流水 */
@JSONField(name = "bussSeqNo")
private String bussseqno;
/** 银行流水 */
@JSONField(name = "bnkPrchSeqNo")
private String bnkprchseqno;
/** 交易日期 */
@JSONField(name = "tranDate")
private String trandate;
/** 交易时间 */
@JSONField(name = "tranTimep")
private String trantimep;
/** 用途 */
@JSONField(name = "usage")
private String yt;
/** 单据号 */
@JSONField(name = "depRecptId")
private String deprecptid;
/** 交易类型 */
@JSONField(name = "tranTpCdSet")
private String trantpcdset;
/** 保留 */
@JSONField(name = "kpDmn")
private String kpdmn;
/** 摘要 */
@JSONField(name = "abstract")
private String zy;
/** 备注 */
@JSONField(name = "remark")
private String remark;
/** 附言 */
@JSONField(name = "postscript")
private String postscript;
/** 流水类型 */
@JSONField(name = "rsrvFldNm")
private String rsrvfldnm;
/** 认领状态 */
private String claimstatus;
/** 认领单号 */
private String claimbillcode;
}

View File

@ -0,0 +1,604 @@
<?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.finance.flow.dao.impl.MdmKkBankflowGtsDaoImpl">
<resultMap id="get-MdmKkBankflowGtsEntity-result" type="com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="documentRule" column="document_rule" jdbcType="VARCHAR"/>
<result property="documentRuleNum" column="document_rule_num" jdbcType="INTEGER"/>
<result property="dataStatus" column="data_status" jdbcType="VARCHAR"/>
<result property="addStatus" column="add_status" jdbcType="VARCHAR"/>
<result property="updateStatus" column="update_status" jdbcType="VARCHAR"/>
<result property="deleteStatus" column="delete_status" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="dataId" column="data_id" jdbcType="VARCHAR"/>
<result property="mdmUpId" column="mdm_up_id" jdbcType="VARCHAR"/>
<result property="transeqno1" column="transeqno1" jdbcType="VARCHAR"/>
<result property="cnteracctname" column="cnteracctname" jdbcType="VARCHAR"/>
<result property="cnteracctno" column="cnteracctno" jdbcType="VARCHAR"/>
<result property="opnbnkinfo" column="opnbnkinfo" jdbcType="VARCHAR"/>
<result property="tranamt" column="tranamt" jdbcType="VARCHAR"/>
<result property="inamtlot" column="inamtlot" jdbcType="VARCHAR"/>
<result property="tfroutamt" column="tfroutamt" jdbcType="VARCHAR"/>
<result property="ccy" column="ccy" jdbcType="VARCHAR"/>
<result property="balance" column="balance" jdbcType="VARCHAR"/>
<result property="outflag" column="outflag" jdbcType="VARCHAR"/>
<result property="bussseqno" column="bussseqno" jdbcType="VARCHAR"/>
<result property="bnkprchseqno" column="bnkprchseqno" jdbcType="VARCHAR"/>
<result property="trandate" column="trandate" jdbcType="VARCHAR"/>
<result property="trantimep" column="trantimep" jdbcType="VARCHAR"/>
<result property="yt" column="yt" jdbcType="VARCHAR"/>
<result property="deprecptid" column="deprecptid" jdbcType="VARCHAR"/>
<result property="trantpcdset" column="trantpcdset" jdbcType="VARCHAR"/>
<result property="kpdmn" column="kpdmn" jdbcType="VARCHAR"/>
<result property="zy" column="zy" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="postscript" column="postscript" jdbcType="VARCHAR"/>
<result property="rsrvfldnm" column="rsrvfldnm" jdbcType="VARCHAR"/>
<result property="claimstatus" column="claimstatus" jdbcType="VARCHAR"/>
<result property="claimbillcode" column="claimbillcode" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="MdmKkBankflowGtsEntity_Base_Column_List">
id
,document_rule
,document_rule_num
,data_status
,add_status
,update_status
,delete_status
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,data_id
,mdm_up_id
,transeqno1
,cnteracctname
,cnteracctno
,opnbnkinfo
,tranamt
-- ,inamtlot
-- ,tfroutamt
,ccy
-- ,balance
,outflag
-- ,bussseqno
-- ,bnkprchseqno
,trandate
,trantimep
,yt
-- ,deprecptid
,trantpcdset
,kpdmn
,zy
,remark
,postscript
,rsrvfldnm
,claimstatus
,claimbillcode
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmKkBankflowGtsEntity-result"
parameterType="com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity">
select
<include refid="MdmKkBankflowGtsEntity_Base_Column_List"/>
from mdm_kk_bankflow_gts
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="documentRule != null and documentRule != ''">and document_rule = #{documentRule}</if>
<if test="documentRuleNum != null">and document_rule_num = #{documentRuleNum}</if>
<if test="dataStatus != null and dataStatus != ''">and data_status = #{dataStatus}</if>
<if test="addStatus != null and addStatus != ''">and add_status = #{addStatus}</if>
<if test="updateStatus != null and updateStatus != ''">and update_status = #{updateStatus}</if>
<if test="deleteStatus != null and deleteStatus != ''">and delete_status = #{deleteStatus}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="dataId != null and dataId != ''">and data_id = #{dataId}</if>
<if test="mdmUpId != null and mdmUpId != ''">and mdm_up_id = #{mdmUpId}</if>
<if test="transeqno1 != null and transeqno1 != ''">and transeqno1 = #{transeqno1}</if>
<if test="cnteracctname != null and cnteracctname != ''">and cnteracctname = #{cnteracctname}</if>
<if test="cnteracctno != null and cnteracctno != ''">and cnteracctno = #{cnteracctno}</if>
<if test="opnbnkinfo != null and opnbnkinfo != ''">and opnbnkinfo = #{opnbnkinfo}</if>
<if test="tranamt != null and tranamt != ''">and tranamt = #{tranamt}</if>
<if test="inamtlot != null and inamtlot != ''">and inamtlot = #{inamtlot}</if>
<if test="tfroutamt != null and tfroutamt != ''">and tfroutamt = #{tfroutamt}</if>
<if test="ccy != null and ccy != ''">and ccy = #{ccy}</if>
<if test="balance != null and balance != ''">and balance = #{balance}</if>
<if test="outflag != null and outflag != ''">and outflag = #{outflag}</if>
<if test="bussseqno != null and bussseqno != ''">and bussseqno = #{bussseqno}</if>
<if test="bnkprchseqno != null and bnkprchseqno != ''">and bnkprchseqno = #{bnkprchseqno}</if>
<if test="trandate != null and trandate != ''">and trandate = #{trandate}</if>
<if test="trantimep != null and trantimep != ''">and trantimep = #{trantimep}</if>
<if test="yt != null and yt != ''">and yt = #{yt}</if>
<if test="deprecptid != null and deprecptid != ''">and deprecptid = #{deprecptid}</if>
<if test="trantpcdset != null and trantpcdset != ''">and trantpcdset = #{trantpcdset}</if>
<if test="kpdmn != null and kpdmn != ''">and kpdmn = #{kpdmn}</if>
<if test="zy != null and zy != ''">and zy = #{zy}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="postscript != null and postscript != ''">and postscript = #{postscript}</if>
<if test="rsrvfldnm != null and rsrvfldnm != ''">and rsrvfldnm = #{rsrvfldnm}</if>
<if test="claimstatus != null and claimstatus != ''">and claimstatus = #{claimstatus}</if>
<if test="claimbillcode != null and claimbillcode != ''">and claimbillcode = #{claimbillcode}</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.finance.flow.entity.MdmKkBankflowGtsEntity">
select count(1) from mdm_kk_bankflow_gts
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="documentRule != null and documentRule != ''">and document_rule = #{documentRule}</if>
<if test="documentRuleNum != null">and document_rule_num = #{documentRuleNum}</if>
<if test="dataStatus != null and dataStatus != ''">and data_status = #{dataStatus}</if>
<if test="addStatus != null and addStatus != ''">and add_status = #{addStatus}</if>
<if test="updateStatus != null and updateStatus != ''">and update_status = #{updateStatus}</if>
<if test="deleteStatus != null and deleteStatus != ''">and delete_status = #{deleteStatus}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="dataId != null and dataId != ''">and data_id = #{dataId}</if>
<if test="mdmUpId != null and mdmUpId != ''">and mdm_up_id = #{mdmUpId}</if>
<if test="transeqno1 != null and transeqno1 != ''">and transeqno1 = #{transeqno1}</if>
<if test="cnteracctname != null and cnteracctname != ''">and cnteracctname = #{cnteracctname}</if>
<if test="cnteracctno != null and cnteracctno != ''">and cnteracctno = #{cnteracctno}</if>
<if test="opnbnkinfo != null and opnbnkinfo != ''">and opnbnkinfo = #{opnbnkinfo}</if>
<if test="tranamt != null and tranamt != ''">and tranamt = #{tranamt}</if>
<if test="inamtlot != null and inamtlot != ''">and inamtlot = #{inamtlot}</if>
<if test="tfroutamt != null and tfroutamt != ''">and tfroutamt = #{tfroutamt}</if>
<if test="ccy != null and ccy != ''">and ccy = #{ccy}</if>
<if test="balance != null and balance != ''">and balance = #{balance}</if>
<if test="outflag != null and outflag != ''">and outflag = #{outflag}</if>
<if test="bussseqno != null and bussseqno != ''">and bussseqno = #{bussseqno}</if>
<if test="bnkprchseqno != null and bnkprchseqno != ''">and bnkprchseqno = #{bnkprchseqno}</if>
<if test="trandate != null and trandate != ''">and trandate = #{trandate}</if>
<if test="trantimep != null and trantimep != ''">and trantimep = #{trantimep}</if>
<if test="yt != null and yt != ''">and yt = #{yt}</if>
<if test="deprecptid != null and deprecptid != ''">and deprecptid = #{deprecptid}</if>
<if test="trantpcdset != null and trantpcdset != ''">and trantpcdset = #{trantpcdset}</if>
<if test="kpdmn != null and kpdmn != ''">and kpdmn = #{kpdmn}</if>
<if test="zy != null and zy != ''">and zy = #{zy}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="postscript != null and postscript != ''">and postscript = #{postscript}</if>
<if test="rsrvfldnm != null and rsrvfldnm != ''">and rsrvfldnm = #{rsrvfldnm}</if>
<if test="claimstatus != null and claimstatus != ''">and claimstatus = #{claimstatus}</if>
<if test="claimbillcode != null and claimbillcode != ''">and claimbillcode = #{claimbillcode}</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-MdmKkBankflowGtsEntity-result"
parameterType="com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity">
select
<include refid="MdmKkBankflowGtsEntity_Base_Column_List"/>
from mdm_kk_bankflow_gts
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="documentRule != null and documentRule != ''">and document_rule like
concat('%',#{documentRule},'%')
</if>
<if test="documentRuleNum != null">and document_rule_num like concat('%',#{documentRuleNum},'%')</if>
<if test="dataStatus != null and dataStatus != ''">and data_status like concat('%',#{dataStatus},'%')</if>
<if test="addStatus != null and addStatus != ''">and add_status like concat('%',#{addStatus},'%')</if>
<if test="updateStatus != null and updateStatus != ''">and update_status like
concat('%',#{updateStatus},'%')
</if>
<if test="deleteStatus != null and deleteStatus != ''">and delete_status like
concat('%',#{deleteStatus},'%')
</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
<if test="dataId != null and dataId != ''">and data_id like concat('%',#{dataId},'%')</if>
<if test="mdmUpId != null and mdmUpId != ''">and mdm_up_id like concat('%',#{mdmUpId},'%')</if>
<if test="transeqno1 != null and transeqno1 != ''">and transeqno1 like concat('%',#{transeqno1},'%')</if>
<if test="cnteracctname != null and cnteracctname != ''">and cnteracctname like
concat('%',#{cnteracctname},'%')
</if>
<if test="cnteracctno != null and cnteracctno != ''">and cnteracctno like concat('%',#{cnteracctno},'%')
</if>
<if test="opnbnkinfo != null and opnbnkinfo != ''">and opnbnkinfo like concat('%',#{opnbnkinfo},'%')</if>
<if test="tranamt != null and tranamt != ''">and tranamt like concat('%',#{tranamt},'%')</if>
<if test="inamtlot != null and inamtlot != ''">and inamtlot like concat('%',#{inamtlot},'%')</if>
<if test="tfroutamt != null and tfroutamt != ''">and tfroutamt like concat('%',#{tfroutamt},'%')</if>
<if test="ccy != null and ccy != ''">and ccy like concat('%',#{ccy},'%')</if>
<if test="balance != null and balance != ''">and balance like concat('%',#{balance},'%')</if>
<if test="outflag != null and outflag != ''">and outflag like concat('%',#{outflag},'%')</if>
<if test="bussseqno != null and bussseqno != ''">and bussseqno like concat('%',#{bussseqno},'%')</if>
<if test="bnkprchseqno != null and bnkprchseqno != ''">and bnkprchseqno like
concat('%',#{bnkprchseqno},'%')
</if>
<if test="trandate != null and trandate != ''">and trandate like concat('%',#{trandate},'%')</if>
<if test="trantimep != null and trantimep != ''">and trantimep like concat('%',#{trantimep},'%')</if>
<if test="yt != null and yt != ''">and yt like concat('%',#{yt},'%')</if>
<if test="deprecptid != null and deprecptid != ''">and deprecptid like concat('%',#{deprecptid},'%')</if>
<if test="trantpcdset != null and trantpcdset != ''">and trantpcdset like concat('%',#{trantpcdset},'%')
</if>
<if test="kpdmn != null and kpdmn != ''">and kpdmn like concat('%',#{kpdmn},'%')</if>
<if test="zy != null and zy != ''">and zy like concat('%',#{zy},'%')</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
<if test="postscript != null and postscript != ''">and postscript like concat('%',#{postscript},'%')</if>
<if test="rsrvfldnm != null and rsrvfldnm != ''">and rsrvfldnm like concat('%',#{rsrvfldnm},'%')</if>
<if test="claimstatus != null and claimstatus != ''">and claimstatus like concat('%',#{claimstatus},'%')
</if>
<if test="claimbillcode != null and claimbillcode != ''">and claimbillcode like
concat('%',#{claimbillcode},'%')
</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="MdmKkBankflowGtsentity_list_or" resultMap="get-MdmKkBankflowGtsEntity-result"
parameterType="com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity">
select
<include refid="MdmKkBankflowGtsEntity_Base_Column_List"/>
from mdm_kk_bankflow_gts
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="documentRule != null and documentRule != ''">or document_rule = #{documentRule}</if>
<if test="documentRuleNum != null">or document_rule_num = #{documentRuleNum}</if>
<if test="dataStatus != null and dataStatus != ''">or data_status = #{dataStatus}</if>
<if test="addStatus != null and addStatus != ''">or add_status = #{addStatus}</if>
<if test="updateStatus != null and updateStatus != ''">or update_status = #{updateStatus}</if>
<if test="deleteStatus != null and deleteStatus != ''">or delete_status = #{deleteStatus}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
<if test="dataId != null and dataId != ''">or data_id = #{dataId}</if>
<if test="mdmUpId != null and mdmUpId != ''">or mdm_up_id = #{mdmUpId}</if>
<if test="transeqno1 != null and transeqno1 != ''">or transeqno1 = #{transeqno1}</if>
<if test="cnteracctname != null and cnteracctname != ''">or cnteracctname = #{cnteracctname}</if>
<if test="cnteracctno != null and cnteracctno != ''">or cnteracctno = #{cnteracctno}</if>
<if test="opnbnkinfo != null and opnbnkinfo != ''">or opnbnkinfo = #{opnbnkinfo}</if>
<if test="tranamt != null and tranamt != ''">or tranamt = #{tranamt}</if>
<if test="inamtlot != null and inamtlot != ''">or inamtlot = #{inamtlot}</if>
<if test="tfroutamt != null and tfroutamt != ''">or tfroutamt = #{tfroutamt}</if>
<if test="ccy != null and ccy != ''">or ccy = #{ccy}</if>
<if test="balance != null and balance != ''">or balance = #{balance}</if>
<if test="outflag != null and outflag != ''">or outflag = #{outflag}</if>
<if test="bussseqno != null and bussseqno != ''">or bussseqno = #{bussseqno}</if>
<if test="bnkprchseqno != null and bnkprchseqno != ''">or bnkprchseqno = #{bnkprchseqno}</if>
<if test="trandate != null and trandate != ''">or trandate = #{trandate}</if>
<if test="trantimep != null and trantimep != ''">or trantimep = #{trantimep}</if>
<if test="yt != null and yt != ''">or yt = #{yt}</if>
<if test="deprecptid != null and deprecptid != ''">or deprecptid = #{deprecptid}</if>
<if test="trantpcdset != null and trantpcdset != ''">or trantpcdset = #{trantpcdset}</if>
<if test="kpdmn != null and kpdmn != ''">or kpdmn = #{kpdmn}</if>
<if test="zy != null and zy != ''">or zy = #{zy}</if>
<if test="remark != null and remark != ''">or remark = #{remark}</if>
<if test="postscript != null and postscript != ''">or postscript = #{postscript}</if>
<if test="rsrvfldnm != null and rsrvfldnm != ''">or rsrvfldnm = #{rsrvfldnm}</if>
<if test="claimstatus != null and claimstatus != ''">or claimstatus = #{claimstatus}</if>
<if test="claimbillcode != null and claimbillcode != ''">or claimbillcode = #{claimbillcode}</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.finance.flow.entity.MdmKkBankflowGtsEntity"
keyProperty="id" useGeneratedKeys="true">
insert into mdm_kk_bankflow_gts(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="documentRule != null and documentRule != ''">document_rule ,</if>
<if test="documentRuleNum != null">document_rule_num ,</if>
<if test="dataStatus != null and dataStatus != ''">data_status ,</if>
<if test="addStatus != null and addStatus != ''">add_status ,</if>
<if test="updateStatus != null and updateStatus != ''">update_status ,</if>
<if test="deleteStatus != null and deleteStatus != ''">delete_status ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="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="modify_time == null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="dataId != null and dataId != ''">data_id ,</if>
<if test="mdmUpId != null and mdmUpId != ''">mdm_up_id ,</if>
<if test="transeqno1 != null and transeqno1 != ''">transeqno1 ,</if>
<if test="cnteracctname != null and cnteracctname != ''">cnteracctname ,</if>
<if test="cnteracctno != null and cnteracctno != ''">cnteracctno ,</if>
<if test="opnbnkinfo != null and opnbnkinfo != ''">opnbnkinfo ,</if>
<if test="tranamt != null and tranamt != ''">tranamt ,</if>
<if test="inamtlot != null and inamtlot != ''">inamtlot ,</if>
<if test="tfroutamt != null and tfroutamt != ''">tfroutamt ,</if>
<if test="ccy != null and ccy != ''">ccy ,</if>
<if test="balance != null and balance != ''">balance ,</if>
<if test="outflag != null and outflag != ''">outflag ,</if>
<if test="bussseqno != null and bussseqno != ''">bussseqno ,</if>
<if test="bnkprchseqno != null and bnkprchseqno != ''">bnkprchseqno ,</if>
<if test="trandate != null and trandate != ''">trandate ,</if>
<if test="trantimep != null and trantimep != ''">trantimep ,</if>
<if test="yt != null and yt != ''">yt ,</if>
<if test="deprecptid != null and deprecptid != ''">deprecptid ,</if>
<if test="trantpcdset != null and trantpcdset != ''">trantpcdset ,</if>
<if test="kpdmn != null and kpdmn != ''">kpdmn ,</if>
<if test="zy != null and zy != ''">zy ,</if>
<if test="remark != null and remark != ''">remark ,</if>
<if test="postscript != null and postscript != ''">postscript ,</if>
<if test="rsrvfldnm != null and rsrvfldnm != ''">rsrvfldnm ,</if>
<if test="claimstatus != null and claimstatus != ''">claimstatus ,</if>
<if test="claimbillcode != null and claimbillcode != ''">claimbillcode ,</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="documentRule != null and documentRule != ''">#{documentRule} ,</if>
<if test="documentRuleNum != null">#{documentRuleNum} ,</if>
<if test="dataStatus != null and dataStatus != ''">#{dataStatus} ,</if>
<if test="addStatus != null and addStatus != ''">#{addStatus} ,</if>
<if test="updateStatus != null and updateStatus != ''">#{updateStatus} ,</if>
<if test="deleteStatus != null and deleteStatus != ''">#{deleteStatus} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="create_time == null">now() ,</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="modify_time == null">now() ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="dataId != null and dataId != ''">#{dataId} ,</if>
<if test="mdmUpId != null and mdmUpId != ''">#{mdmUpId} ,</if>
<if test="transeqno1 != null and transeqno1 != ''">#{transeqno1} ,</if>
<if test="cnteracctname != null and cnteracctname != ''">#{cnteracctname} ,</if>
<if test="cnteracctno != null and cnteracctno != ''">#{cnteracctno} ,</if>
<if test="opnbnkinfo != null and opnbnkinfo != ''">#{opnbnkinfo} ,</if>
<if test="tranamt != null and tranamt != ''">#{tranamt} ,</if>
<if test="inamtlot != null and inamtlot != ''">#{inamtlot} ,</if>
<if test="tfroutamt != null and tfroutamt != ''">#{tfroutamt} ,</if>
<if test="ccy != null and ccy != ''">#{ccy} ,</if>
<if test="balance != null and balance != ''">#{balance} ,</if>
<if test="outflag != null and outflag != ''">#{outflag} ,</if>
<if test="bussseqno != null and bussseqno != ''">#{bussseqno} ,</if>
<if test="bnkprchseqno != null and bnkprchseqno != ''">#{bnkprchseqno} ,</if>
<if test="trandate != null and trandate != ''">#{trandate} ,</if>
<if test="trantimep != null and trantimep != ''">#{trantimep} ,</if>
<if test="yt != null and yt != ''">#{yt} ,</if>
<if test="deprecptid != null and deprecptid != ''">#{deprecptid} ,</if>
<if test="trantpcdset != null and trantpcdset != ''">#{trantpcdset} ,</if>
<if test="kpdmn != null and kpdmn != ''">#{kpdmn} ,</if>
<if test="zy != null and zy != ''">#{zy} ,</if>
<if test="remark != null and remark != ''">#{remark} ,</if>
<if test="postscript != null and postscript != ''">#{postscript} ,</if>
<if test="rsrvfldnm != null and rsrvfldnm != ''">#{rsrvfldnm} ,</if>
<if test="claimstatus != null and claimstatus != ''">#{claimstatus} ,</if>
<if test="claimbillcode != null and claimbillcode != ''">#{claimbillcode} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_kk_bankflow_gts a WHERE
a.sts = 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into mdm_kk_bankflow_gts(document_rule, document_rule_num, data_status, add_status, update_status,
delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, data_id,
mdm_up_id, transeqno1, cnteracctname, cnteracctno, opnbnkinfo, tranamt, inamtlot, tfroutamt, ccy, balance,
outflag, bussseqno, bnkprchseqno, trandate, trantimep, yt, deprecptid, trantpcdset, kpdmn, zy, remark,
postscript, rsrvfldnm, claimstatus, claimbillcode, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.dataId},#{entity.mdmUpId},#{entity.transeqno1},#{entity.cnteracctname},#{entity.cnteracctno},#{entity.opnbnkinfo},#{entity.tranamt},#{entity.inamtlot},#{entity.tfroutamt},#{entity.ccy},#{entity.balance},#{entity.outflag},#{entity.bussseqno},#{entity.bnkprchseqno},#{entity.trandate},#{entity.trantimep},#{entity.yt},#{entity.deprecptid},#{entity.trantpcdset},#{entity.kpdmn},#{entity.zy},#{entity.remark},#{entity.postscript},#{entity.rsrvfldnm},#{entity.claimstatus},#{entity.claimbillcode},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into mdm_kk_bankflow_gts(document_rule, document_rule_num, data_status, add_status, update_status,
delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, data_id,
mdm_up_id, transeqno1, cnteracctname, cnteracctno, opnbnkinfo, tranamt, inamtlot, tfroutamt, ccy, balance,
outflag, bussseqno, bnkprchseqno, trandate, trantimep, yt, deprecptid, trantpcdset, kpdmn, zy, remark,
postscript, rsrvfldnm, claimstatus, claimbillcode)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.dataId},#{entity.mdmUpId},#{entity.transeqno1},#{entity.cnteracctname},#{entity.cnteracctno},#{entity.opnbnkinfo},#{entity.tranamt},#{entity.inamtlot},#{entity.tfroutamt},#{entity.ccy},#{entity.balance},#{entity.outflag},#{entity.bussseqno},#{entity.bnkprchseqno},#{entity.trandate},#{entity.trantimep},#{entity.yt},#{entity.deprecptid},#{entity.trantpcdset},#{entity.kpdmn},#{entity.zy},#{entity.remark},#{entity.postscript},#{entity.rsrvfldnm},#{entity.claimstatus},#{entity.claimbillcode})
</foreach>
on duplicate key update
document_rule = values(document_rule),
document_rule_num = values(document_rule_num),
data_status = values(data_status),
add_status = values(add_status),
update_status = values(update_status),
delete_status = values(delete_status),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id),
data_id = values(data_id),
mdm_up_id = values(mdm_up_id),
transeqno1 = values(transeqno1),
cnteracctname = values(cnteracctname),
cnteracctno = values(cnteracctno),
opnbnkinfo = values(opnbnkinfo),
tranamt = values(tranamt),
inamtlot = values(inamtlot),
tfroutamt = values(tfroutamt),
ccy = values(ccy),
balance = values(balance),
outflag = values(outflag),
bussseqno = values(bussseqno),
bnkprchseqno = values(bnkprchseqno),
trandate = values(trandate),
trantimep = values(trantimep),
yt = values(yt),
deprecptid = values(deprecptid),
trantpcdset = values(trantpcdset),
kpdmn = values(kpdmn),
zy = values(zy),
remark = values(remark),
postscript = values(postscript),
rsrvfldnm = values(rsrvfldnm),
claimstatus = values(claimstatus),
claimbillcode = values(claimbillcode)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity">
update mdm_kk_bankflow_gts set
<trim suffix="" suffixOverrides=",">
<if test="documentRule != null and documentRule != ''">document_rule = #{documentRule},</if>
<if test="documentRuleNum != null">document_rule_num = #{documentRuleNum},</if>
<if test="dataStatus != null and dataStatus != ''">data_status = #{dataStatus},</if>
<if test="addStatus != null and addStatus != ''">add_status = #{addStatus},</if>
<if test="updateStatus != null and updateStatus != ''">update_status = #{updateStatus},</if>
<if test="deleteStatus != null and deleteStatus != ''">delete_status = #{deleteStatus},</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="modify_time == null">modify_time = now(),</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
<if test="dataId != null and dataId != ''">data_id = #{dataId},</if>
<if test="mdmUpId != null and mdmUpId != ''">mdm_up_id = #{mdmUpId},</if>
<if test="transeqno1 != null and transeqno1 != ''">transeqno1 = #{transeqno1},</if>
<if test="cnteracctname != null and cnteracctname != ''">cnteracctname = #{cnteracctname},</if>
<if test="cnteracctno != null and cnteracctno != ''">cnteracctno = #{cnteracctno},</if>
<if test="opnbnkinfo != null and opnbnkinfo != ''">opnbnkinfo = #{opnbnkinfo},</if>
<if test="tranamt != null and tranamt != ''">tranamt = #{tranamt},</if>
<if test="inamtlot != null and inamtlot != ''">inamtlot = #{inamtlot},</if>
<if test="tfroutamt != null and tfroutamt != ''">tfroutamt = #{tfroutamt},</if>
<if test="ccy != null and ccy != ''">ccy = #{ccy},</if>
<if test="balance != null and balance != ''">balance = #{balance},</if>
<if test="outflag != null and outflag != ''">outflag = #{outflag},</if>
<if test="bussseqno != null and bussseqno != ''">bussseqno = #{bussseqno},</if>
<if test="bnkprchseqno != null and bnkprchseqno != ''">bnkprchseqno = #{bnkprchseqno},</if>
<if test="trandate != null and trandate != ''">trandate = #{trandate},</if>
<if test="trantimep != null and trantimep != ''">trantimep = #{trantimep},</if>
<if test="yt != null and yt != ''">yt = #{yt},</if>
<if test="deprecptid != null and deprecptid != ''">deprecptid = #{deprecptid},</if>
<if test="trantpcdset != null and trantpcdset != ''">trantpcdset = #{trantpcdset},</if>
<if test="kpdmn != null and kpdmn != ''">kpdmn = #{kpdmn},</if>
<if test="zy != null and zy != ''">zy = #{zy},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="postscript != null and postscript != ''">postscript = #{postscript},</if>
<if test="rsrvfldnm != null and rsrvfldnm != ''">rsrvfldnm = #{rsrvfldnm},</if>
<if test="claimstatus != null and claimstatus != ''">claimstatus = #{claimstatus},</if>
<if test="claimbillcode != null and claimbillcode != ''">claimbillcode = #{claimbillcode},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity">
update mdm_kk_bankflow_gts
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.finance.flow.entity.MdmKkBankflowGtsEntity">
update mdm_kk_bankflow_gts set sts= 'N' ,modify_time =now()
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="documentRule != null and documentRule != ''">and document_rule = #{documentRule}</if>
<if test="documentRuleNum != null">and document_rule_num = #{documentRuleNum}</if>
<if test="dataStatus != null and dataStatus != ''">and data_status = #{dataStatus}</if>
<if test="addStatus != null and addStatus != ''">and add_status = #{addStatus}</if>
<if test="updateStatus != null and updateStatus != ''">and update_status = #{updateStatus}</if>
<if test="deleteStatus != null and deleteStatus != ''">and delete_status = #{deleteStatus}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="dataId != null and dataId != ''">and data_id = #{dataId}</if>
<if test="mdmUpId != null and mdmUpId != ''">and mdm_up_id = #{mdmUpId}</if>
<if test="transeqno1 != null and transeqno1 != ''">and transeqno1 = #{transeqno1}</if>
<if test="cnteracctname != null and cnteracctname != ''">and cnteracctname = #{cnteracctname}</if>
<if test="cnteracctno != null and cnteracctno != ''">and cnteracctno = #{cnteracctno}</if>
<if test="opnbnkinfo != null and opnbnkinfo != ''">and opnbnkinfo = #{opnbnkinfo}</if>
<if test="tranamt != null and tranamt != ''">and tranamt = #{tranamt}</if>
<if test="inamtlot != null and inamtlot != ''">and inamtlot = #{inamtlot}</if>
<if test="tfroutamt != null and tfroutamt != ''">and tfroutamt = #{tfroutamt}</if>
<if test="ccy != null and ccy != ''">and ccy = #{ccy}</if>
<if test="balance != null and balance != ''">and balance = #{balance}</if>
<if test="outflag != null and outflag != ''">and outflag = #{outflag}</if>
<if test="bussseqno != null and bussseqno != ''">and bussseqno = #{bussseqno}</if>
<if test="bnkprchseqno != null and bnkprchseqno != ''">and bnkprchseqno = #{bnkprchseqno}</if>
<if test="trandate != null and trandate != ''">and trandate = #{trandate}</if>
<if test="trantimep != null and trantimep != ''">and trantimep = #{trantimep}</if>
<if test="yt != null and yt != ''">and yt = #{yt}</if>
<if test="deprecptid != null and deprecptid != ''">and deprecptid = #{deprecptid}</if>
<if test="trantpcdset != null and trantpcdset != ''">and trantpcdset = #{trantpcdset}</if>
<if test="kpdmn != null and kpdmn != ''">and kpdmn = #{kpdmn}</if>
<if test="zy != null and zy != ''">and zy = #{zy}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="postscript != null and postscript != ''">and postscript = #{postscript}</if>
<if test="rsrvfldnm != null and rsrvfldnm != ''">and rsrvfldnm = #{rsrvfldnm}</if>
<if test="claimstatus != null and claimstatus != ''">and claimstatus = #{claimstatus}</if>
<if test="claimbillcode != null and claimbillcode != ''">and claimbillcode = #{claimbillcode}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from mdm_kk_bankflow_gts
where id = #{id}
</delete>
<update id="updateStatus" parameterType="com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity">
update mdm_kk_bankflow_gts set claimstatus = #{claimstatus},claimbillcode = null where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,18 @@
package com.hzya.frame.finance.flow.entity;
import lombok.Data;
/**
* Created by zydd on 2025-08-30 11:02
* 浦发银行流水明细请求VO
*/
@Data
public class PuFaBankFlowGtsRequestVO {
private String clientNo;
private String pyAcctNo;
private String startDate;//yyyyMMdd
private String endDate;//yyyyMMdd
private String acptNum;//
private String queryNum;//
}

View File

@ -0,0 +1,20 @@
package com.hzya.frame.finance.flow.entity;
import lombok.Data;
import java.util.List;
/**
* Created by zydd on 2025-08-30 11:13
* 浦发银行流水明细返回VO
*/
@Data
public class PuFaBankFlowGtsResponseVO {
private String statusCode;
private String transNo;
private String returnCode;
private String returnInfo;
private String qryRsltNum;
private String totalNum;
private List<MdmKkBankflowGtsEntity> acctDtlInfo;
}

View File

@ -0,0 +1,16 @@
package com.hzya.frame.finance.flow.service;
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.finance.flow.entity.PuFaBankFlowGtsRequestVO;
import com.hzya.frame.finance.flow.entity.PuFaBankFlowGtsResponseVO;
/**
* 账户明细查询GTS(MdmKkBankflowGts)表服务接口
*
* @author zydd
* @since 2025-08-22 09:36:27
*/
public interface IMdmKkBankflowGtsService extends IBaseService<MdmKkBankflowGtsEntity, String>{
PuFaBankFlowGtsResponseVO queryGts(PuFaBankFlowGtsRequestVO vo);
}

View File

@ -0,0 +1,195 @@
package com.hzya.frame.finance.flow.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.hzya.frame.finance.flow.entity.MdmKkBankflowGtsEntity;
import com.hzya.frame.finance.flow.dao.IMdmKkBankflowGtsDao;
import com.hzya.frame.finance.flow.entity.PuFaBankFlowGtsRequestVO;
import com.hzya.frame.finance.flow.entity.PuFaBankFlowGtsResponseVO;
import com.hzya.frame.finance.flow.service.IMdmKkBankflowGtsService;
import com.hzya.frame.finance.utils.pufabank.SM2Cryptor;
import com.hzya.frame.finance.utils.pufabank.SM2Sign;
import com.hzya.frame.finance.utils.pufabank.SM2SignVerify;
import okhttp3.*;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import javax.xml.bind.DatatypeConverter;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* 账户明细查询GTS(MdmKkBankflowGts)表服务实现类
*
* @author zydd
* @since 2025-08-22 09:36:27
*/
@Service
public class MdmKkBankflowGtsServiceImpl extends BaseService<MdmKkBankflowGtsEntity, String> implements IMdmKkBankflowGtsService {
@Value("${bank_flow_gts_url}")
private String gtsUrl;
private static final String secret = "NmZkMC00ZDMpLWFyYzgtN2JwN2ZmY2J1NmF4MC40NzQ0ODA5MzA2MzE4OTg2NzAu";
private static final String charset = "UTF-8";
private static final String privatekey = "ae14b3717d6b44b55e500a807248aab425e1d1677df1718410c453f3fe257541";
private static final String contentType = "application/json;charset=utf-8";
private static final String clientId = "f42d86e9-debd-4423-84af-74549a51c7c2";
private IMdmKkBankflowGtsDao mdmKkBankflowGtsDao;
private static final OkHttpClient client = new OkHttpClient.Builder()
.connectionPool(new ConnectionPool(500, 5, TimeUnit.MINUTES)).connectTimeout(10000, TimeUnit.MILLISECONDS)
.readTimeout(60000, TimeUnit.MILLISECONDS).build();
@Autowired
public void setMdmKkBankflowGtsDao(IMdmKkBankflowGtsDao dao) {
this.mdmKkBankflowGtsDao = dao;
this.dao = dao;
}
/**
* 存在分页请注意
*/
@Override
public PuFaBankFlowGtsResponseVO queryGts(PuFaBankFlowGtsRequestVO vo) {
PuFaBankFlowGtsResponseVO responseVO = new PuFaBankFlowGtsResponseVO();
try {
int page = Integer.valueOf(vo.getAcptNum());
int size = Integer.valueOf(vo.getQueryNum());
//请求
System.out.println(JSONUtil.toJsonStr(vo));
PuFaBankFlowGtsResponseVO response = queryData(vo);
return response;
} catch (Exception e) {
e.printStackTrace();
Assert.state(false, "获取流水数据失败,失败原因:{}", e.getMessage());
}
return null;
}
/**
* 请求浦发
*/
public PuFaBankFlowGtsResponseVO queryData(PuFaBankFlowGtsRequestVO vo) throws Exception {
PuFaBankFlowGtsResponseVO res = new PuFaBankFlowGtsResponseVO();
String data = JSONUtil.toJsonStr(vo);
String newBodyData = getNonceParam(false, data);
byte[] dataBytes = newBodyData.getBytes(charset);
SM2Sign sign = SM2SignVerify.sign(ByteUtils.fromHexString(privatekey), dataBytes);
byte[] signBytes = sign.getSm2_sign().getBytes(charset);
String signature = DatatypeConverter.printBase64Binary(signBytes);
Request request = createRequest("GET", gtsUrl, data, signature);
Response response = client.newCall(request).execute();
String resBody = new String(response.body().bytes(), "UTF-8");
String decryptBody = SM2Cryptor.decrypt(secret, resBody);
PuFaBankFlowGtsResponseVO responseVO = JSON.parseObject(decryptBody, PuFaBankFlowGtsResponseVO.class);
res = responseVO;
List<MdmKkBankflowGtsEntity> all = new ArrayList<>();
all.addAll(responseVO.getAcctDtlInfo());
Integer acptNum = Integer.valueOf(vo.getAcptNum());//开始笔数
Integer queryNum = Integer.valueOf(vo.getQueryNum());//每次笔数
Integer totalNum = Integer.valueOf(responseVO.getTotalNum());//总笔数
int allPage = (totalNum / queryNum) + 1;
for (int i = 1; i <allPage; i++) {
int start = i*queryNum+1;
vo.setAcptNum(String.valueOf(start));
String data1 = JSONUtil.toJsonStr(vo);
String newBodyData1 = getNonceParam(false, data1);
byte[] dataBytes1 = newBodyData1.getBytes(charset);
SM2Sign sign1 = SM2SignVerify.sign(ByteUtils.fromHexString(privatekey), dataBytes1);
byte[] signBytes1 = sign1.getSm2_sign().getBytes(charset);
String signature1 = DatatypeConverter.printBase64Binary(signBytes1);
Request request1 = createRequest("GET", gtsUrl, data1, signature1);
Response response1 = client.newCall(request1).execute();
String resBody1 = new String(response1.body().bytes(), "UTF-8");
String decryptBody1 = SM2Cryptor.decrypt(secret, resBody1);
PuFaBankFlowGtsResponseVO responseVO1 = JSON.parseObject(decryptBody1, PuFaBankFlowGtsResponseVO.class);
List<MdmKkBankflowGtsEntity> acctDtlInfo = responseVO1.getAcctDtlInfo();
all.addAll(acctDtlInfo);
}
res.setAcctDtlInfo(all);
return res;
}
public static String getNonceParam( boolean forbidden ,String data){
//防重放参数毫秒级的时间戳与浦发服务器北京时间时间误差不能超过15分钟样例1543461367533
long timestamp = 0L;
//防重放参数X-SPDB-Nonce为交易序号需保证唯一样例TRANS10145581
String nonce = "";
/*
* 防重放参数
* 如需使用防重放参数需要对时间戳防重放参数加签
*/
String newBodyData = data;
if (forbidden) {//如需使用防重放参数
//对应请求报文头参数 X-SPDB-Timestamp
timestamp = System.currentTimeMillis();// X-SPDB-Timestamp
//对应请求报文头参数 X-SPDB-Nonce
nonce = "TRAN10145581";// X-SPDB-Nonce
//注意签名原文需要拼接防重放参数 {"name":"zhangshan"}1591077686410TRAN10145581
newBodyData = data + timestamp + nonce;
System.out.println("签名原文:" + newBodyData);
}
return newBodyData;
}
public static Request createRequest(String requestMethod,String url,String data,String signature){
Request request =null;
String encrypted = SM2Cryptor.encrypt(secret, data);
if("GET".equals(requestMethod) || "get".equals(requestMethod)){
url = url + "?encryptBody=" + encrypted;
request = new Request.Builder().url(url).get()
.addHeader("Content-Type", contentType) //Content-Type
.addHeader("X-SPDB-Client-ID", clientId) //Client-ID
.addHeader("X-SPDB-SIGNATURE", signature) //签名结果
.addHeader("X-SPDB-SM", "true") //使用国密
.addHeader("X-SPDB-Encryption", "true") //使用全报文加密
.build();
}else if("POST".equals(requestMethod) || "post".equals(requestMethod)){
//发送HTTP请求
MediaType mediaType = MediaType.parse(contentType);
// 数据加密-使用国密SM2算法加密 注意加密数据不添加防重放参数
RequestBody body = RequestBody.create(mediaType, encrypted);
request = new Request.Builder().url(url).post(body)
.addHeader("Content-Type", contentType) //Content-Type
.addHeader("X-SPDB-Client-ID", clientId) //Client-ID
.addHeader("X-SPDB-SIGNATURE", signature) //签名结果
.addHeader("X-SPDB-SM", "true") //使用国密
.addHeader("X-SPDB-Encryption", "true") //使用全报文加密
.build();
}
return request;
}
}

View File

@ -0,0 +1,31 @@
package com.hzya.frame.finance.login.controller;
import com.hzya.frame.finance.login.entity.LoginVO;
import com.hzya.frame.sysnew.login.ILoginService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import static com.hzya.frame.web.entity.BaseResult.getFailureMessageEntity;
import static com.hzya.frame.web.entity.BaseResult.getSuccessMessageEntity;
@RestController
@RequestMapping("/sso/login")
public class SSOController {
@Autowired
private ILoginService iLoginService;
/**
* 单点登录验证
* @return
*/
@PostMapping("/check")
public JsonResultEntity checkLogin(@RequestBody LoginVO loginVO){
String token = iLoginService.checkLogin(loginVO.getWxUserId());
if(token == null){
return getFailureMessageEntity("校验失败","500",token);
}
return getSuccessMessageEntity("校验成功",token);
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.finance.login.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginVO {
private String wxUserId;
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.finance.utils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* U8C返回参数
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Attribute {
private String status;
private String taskNumber;
private String data;
private String errorcode;
private String errormsg;
}

View File

@ -0,0 +1,29 @@
package com.hzya.frame.finance.utils;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import java.io.IOException;
/**
* Base64<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public class Base64Util {
/**
* Base64<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public static String encryptBASE64(byte[] key) {
return (new BASE64Encoder()).encodeBuffer(key);
}
/**
* Base64<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @throws IOException
*/
public static byte[] decryptBASE64(String key) throws IOException {
return (new BASE64Decoder()).decodeBuffer(key);
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.finance.utils;
public class CipherConstant {
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>AES<EFBFBD>ԳƼ<EFBFBD><EFBFBD><EFBFBD>
public static final String AES = "AES";
// public static final String AES_ALGORITHM = "AES";
public static final String AES_ALGORITHM = "AES/CTR/NoPadding";
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RSA<EFBFBD>ǶԳƼ<EFBFBD><EFBFBD><EFBFBD>
public static final String RSA = "RSA";
// public static final String RSA_ALGORITHM = "RSA";
public static final String RSA_ALGORITHM = "RSA/ECB/OAEPWithSHA-256AndMGF1Padding";
}

View File

@ -0,0 +1,77 @@
package com.hzya.frame.finance.utils;
import cn.hutool.core.lang.Assert;
import com.hzya.frame.finance.conf.billcode.dao.IFeConfBillcodeRuleDao;
import com.hzya.frame.finance.conf.billcode.entity.FeConfBillcodeRuleEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.time.LocalDate;
import java.time.Month;
import java.util.List;
/**
* Created by zydd on 2025-08-25 14:52
* 认领单 单号 工具类
*/
@Repository
public class ClaimBillCodeUtil {
@Autowired
private IFeConfBillcodeRuleDao billcodeRuleDao;
public String queryMaxBillCodeByType(String billType){
Assert.notNull(billType,"获取最大单据号时:单据类型不能为空");
//获取当前年月日
LocalDate now = LocalDate.now();
String year = now.toString().substring(0, 4);
String month = now.toString().substring(5, 7);
String day = now.toString().substring(8, 10);
FeConfBillcodeRuleEntity feConfBillcodeRuleEntity = new FeConfBillcodeRuleEntity();
feConfBillcodeRuleEntity.setType(billType);
feConfBillcodeRuleEntity.setYear(year);
feConfBillcodeRuleEntity.setMonth(month);
feConfBillcodeRuleEntity.setDay(day);
List<FeConfBillcodeRuleEntity> query = billcodeRuleDao.query(feConfBillcodeRuleEntity);
if(query.size()==0){
return "000000";
}
int size = query.size();
String result = String.format("%06d", size);
return result;
}
public String saveBillCodeByTypeAndSourceCode(String billType,String sourceCode){
//获取当前年月日
LocalDate now = LocalDate.now();
String year = now.toString().substring(0, 4);
String month = now.toString().substring(5, 7);
String day = now.toString().substring(8, 10);
FeConfBillcodeRuleEntity feConfBillcodeRuleEntity = new FeConfBillcodeRuleEntity();
feConfBillcodeRuleEntity.setType(billType);
feConfBillcodeRuleEntity.setYear(year);
feConfBillcodeRuleEntity.setMonth(month);
feConfBillcodeRuleEntity.setDay(day);
List<FeConfBillcodeRuleEntity> query = billcodeRuleDao.query(feConfBillcodeRuleEntity);
if(query.size()==0){
//新增单号
String billCode= billType+year+month+day+"000001";
feConfBillcodeRuleEntity.setSourcecode(sourceCode);
feConfBillcodeRuleEntity.setCurrentcode("000001");
billcodeRuleDao.save(feConfBillcodeRuleEntity);
return billCode;
}
//获取个数+1
int size = query.size();
size+=1;
String result = String.format("%06d", size);
System.out.println(result);
String billCode= billType+year+month+day+result;
feConfBillcodeRuleEntity.setCurrentcode(result);
feConfBillcodeRuleEntity.setSourcecode(sourceCode);
billcodeRuleDao.save(feConfBillcodeRuleEntity);
return billCode;
}
}

View File

@ -0,0 +1,158 @@
package com.hzya.frame.finance.utils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.zip.*;
/**
* ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public class CompressUtil {
private static int buffSize = 1024;
/**
* deflaterCompress Ĭ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>
*
* @param source ԭ<EFBFBD><EFBFBD>
* @return
* @throws IOException
* @throws Exception
*/
public static String deflaterCompress(String source) throws Exception {
String value = null;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Deflater compressor = new Deflater();
try {
byte[] input = source.getBytes(StandardCharsets.UTF_8);
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>
compressor.setLevel(Deflater.DEFAULT_COMPRESSION);
compressor.setInput(input);
compressor.finish();
final byte[] buf = new byte[buffSize];
while (!compressor.finished()) {
int count = compressor.deflate(buf);
bos.write(buf, 0, count);
}
value = Base64Util.encryptBASE64(bos.toByteArray());
} finally {
bos.close();
compressor.end();
}
return value;
}
/**
* deflaterDecompress Ĭ<EFBFBD>Ͻ<EFBFBD>ѹ
*
* @param source ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
* @return
* @throws IOException
* @throws @throws Exception
*/
public static String deflaterDecompress(String source) throws Exception {
String value = null;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Inflater decompressor = new Inflater();
try {
byte[] input = Base64Util.decryptBASE64(source);
decompressor.setInput(input);
final byte[] buf = new byte[buffSize];
while (!decompressor.finished()) {
int count = decompressor.inflate(buf);
bos.write(buf, 0, count);
}
value = new String(bos.toByteArray(), StandardCharsets.UTF_8);
} catch (IOException | DataFormatException e) {
throw new Exception("<EFBFBD><EFBFBD>ѹ<EFBFBD>" + e.getMessage());
} finally {
bos.close();
decompressor.end();
}
return value;
}
/**
* gzipCompress <EFBFBD><EFBFBD><EFBFBD><EFBFBD>gzipѹ<EFBFBD><EFBFBD>
*
* @param source ԭ<EFBFBD><EFBFBD>
* @return
* @throws IOException
* @throws Exception
*/
public static String gzipCompress(String source) throws Exception {
String value = null;
ByteArrayOutputStream out = null;
try {
out = new ByteArrayOutputStream();
GZIPOutputStream gzip = new GZIPOutputStream(out);
byte[] input = source.getBytes(StandardCharsets.UTF_8);
gzip.write(input);
gzip.close();
value = Base64Util.encryptBASE64(out.toByteArray());
} catch (IOException e) {
throw new Exception("ѹ<EFBFBD><EFBFBD><EFBFBD>" + e.getMessage());
} finally {
if (out != null) {
out.close();
}
}
return value;
}
/**
* gzipDecompress gzip<EFBFBD><EFBFBD>ѹ
*
* @param source ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
* @return
* @throws Exception
*/
public static String gzipDecompress(String source) throws Exception {
String value = null;
ByteArrayOutputStream out = null;
ByteArrayInputStream in = null;
try {
byte[] input = Base64Util.decryptBASE64(source);
out = new ByteArrayOutputStream();
in = new ByteArrayInputStream(input);
GZIPInputStream ungzip = new GZIPInputStream(in);
byte[] buffer = new byte[buffSize];
int n;
while ((n = ungzip.read(buffer)) >= 0) {
out.write(buffer, 0, n);
}
ungzip.close();
value = new String(out.toByteArray(), StandardCharsets.UTF_8);
} catch (IOException e) {
throw new Exception("ѹ<EFBFBD><EFBFBD><EFBFBD>" + e.getMessage());
} finally {
if (in != null) {
in.close();
}
if (out != null) {
out.close();
}
}
return value;
}
}

View File

@ -0,0 +1,99 @@
package com.hzya.frame.finance.utils;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.OAEPParameterSpec;
import javax.crypto.spec.PSource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.spec.MGF1ParameterSpec;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public class Decryption {
// RSA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С
private static final int MAX_DECRYPT_BLOCK = 256;
/**
* symDecrypt <EFBFBD>Գƽ<EFBFBD><EFBFBD><EFBFBD>
*
* @param strkey <EFBFBD>Գ<EFBFBD><EFBFBD><EFBFBD>Կ
* @param src <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return ԭ<EFBFBD><EFBFBD>
* @throws IOException
* @throws Exception
*/
public static String symDecrypt(String strkey, String src) throws Exception {
String target = null;
try {
Key key = KeysFactory.getSymKey(strkey);
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Cipher cipher = Cipher.getInstance(CipherConstant.AES_ALGORITHM);
IvParameterSpec iv = new IvParameterSpec(strkey.substring(0, 16).getBytes());
cipher.init(Cipher.DECRYPT_MODE, key, iv);
byte[] decodeResult = cipher.doFinal(Base64Util.decryptBASE64(src));
target = new String(decodeResult, StandardCharsets.UTF_8);
} catch (NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException | InvalidKeyException e) {
throw new Exception("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>" + e.getMessage());
}
return target;
}
/**
* priDecrypt ˽Կ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @param priKey ˽Կ
* @param src <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return ԭ<EFBFBD><EFBFBD>
* @throws IOException
* @throws Exception
*/
public static String priDecrypt(String priKey, String src) throws Exception {
String target = null;
ByteArrayOutputStream out = null;
try {
Key key = KeysFactory.getPrivateKey(priKey);
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");
cipher.init(Cipher.DECRYPT_MODE, key, new OAEPParameterSpec("SHA-256", "MGF1", new MGF1ParameterSpec("SHA-256"), PSource.PSpecified.DEFAULT));
byte[] data = Base64Util.decryptBASE64(src);
int inputLen = data.length;
out = new ByteArrayOutputStream();
int offSet = 0;
byte[] cache;
int i = 0;
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷֶν<EFBFBD><EFBFBD><EFBFBD>
while (inputLen - offSet > 0) {
if (inputLen - offSet > MAX_DECRYPT_BLOCK) {
cache = cipher.doFinal(data, offSet, MAX_DECRYPT_BLOCK);
} else {
cache = cipher.doFinal(data, offSet, inputLen - offSet);
}
out.write(cache, 0, cache.length);
i++;
offSet = i * MAX_DECRYPT_BLOCK;
}
target = new String(out.toByteArray());
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
throw new Exception("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>" + e.getMessage());
} finally {
if (out != null) {
out.close();
}
}
return target;
}
}

View File

@ -0,0 +1,96 @@
package com.hzya.frame.finance.utils;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.OAEPParameterSpec;
import javax.crypto.spec.PSource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.spec.MGF1ParameterSpec;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public class Encryption {
// RSA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С
private static final int MAX_ENCRYPT_BLOCK = 117;
/**
* symEncrypt <EFBFBD>ԳƼ<EFBFBD><EFBFBD><EFBFBD>
*
* @param strkey <EFBFBD>Գ<EFBFBD><EFBFBD><EFBFBD>Կ
* @param src ԭ<EFBFBD><EFBFBD>
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public static String symEncrypt(String strkey, String src) throws Exception {
String target = null;
try {
Key key = KeysFactory.getSymKey(strkey);
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Cipher cipher = Cipher.getInstance(CipherConstant.AES_ALGORITHM);
IvParameterSpec iv = new IvParameterSpec(strkey.substring(0, 16).getBytes());
cipher.init(Cipher.ENCRYPT_MODE, key, iv);
byte[] encodeResult = cipher.doFinal(src.getBytes(StandardCharsets.UTF_8));
target = Base64Util.encryptBASE64(encodeResult);
} catch (NoSuchAlgorithmException | NoSuchPaddingException | UnsupportedEncodingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
throw new Exception("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>" + e.getMessage());
}
return target;
}
/**
* pubEncrypt <EFBFBD><EFBFBD>Կ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @param pubKey <EFBFBD><EFBFBD>Կ
* @param src ԭ<EFBFBD><EFBFBD>
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @throws IOException
* @throws Exception
*/
public static String pubEncrypt(String pubKey, String src) throws Exception {
String target = null;
ByteArrayOutputStream out = null;
try {
Key key = KeysFactory.getPublicKey(pubKey);
Cipher cipher = Cipher.getInstance(CipherConstant.RSA_ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, key,new OAEPParameterSpec("SHA-256", "MGF1", new MGF1ParameterSpec("SHA-256"), PSource.PSpecified.DEFAULT));
byte[] data = src.getBytes();
int inputLen = data.length;
out = new ByteArrayOutputStream();
int offSet = 0;
byte[] cache;
int i = 0;
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷֶμ<EFBFBD><EFBFBD><EFBFBD>
while (inputLen - offSet > 0) {
if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);
} else {
cache = cipher.doFinal(data, offSet, inputLen - offSet);
}
out.write(cache, 0, cache.length);
i++;
offSet = i * MAX_ENCRYPT_BLOCK;
}
target = Base64Util.encryptBASE64(out.toByteArray());
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
throw new Exception("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>" + e.getMessage());
} finally {
if (out != null) {
out.close();
}
}
return target;
}
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.finance.utils;
import java.security.KeyPair;
/**
* KeyPairs
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
*/
public class KeyPairs {
private KeyPair keyPair;
public KeyPairs(KeyPair keyPair){
this.keyPair = keyPair;
}
public String getPublicKey(){
return Base64Util.encryptBASE64(keyPair.getPublic().getEncoded());
}
public String getPrivateKey(){
return Base64Util.encryptBASE64(keyPair.getPrivate().getEncoded());
}
}

View File

@ -0,0 +1,101 @@
package com.hzya.frame.finance.utils;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
/**
* Key<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public class KeysFactory {
/**
* buildAsymKey <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ǶԳ<EFBFBD><EFBFBD><EFBFBD>Կ
*
* @return KeyPair key<EFBFBD><EFBFBD>PublicKey<EFBFBD><EFBFBD>PrivateKey
* @throws NoSuchAlgorithmException
*/
public static KeyPairs buildAsymKey() throws Exception {
/* <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>Կ<EFBFBD><D4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(CipherConstant.RSA);
keyPairGenerator.initialize(2048, SecureRandomProxy.getRandomInstance());
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ */
return new KeyPairs(keyPairGenerator.generateKeyPair());
}
/**
* buildAsymKey <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>Գ<EFBFBD><EFBFBD><EFBFBD>Կ
*
* @return <EFBFBD>Գ<EFBFBD><EFBFBD><EFBFBD>Կ
* @throws NoSuchAlgorithmException
* @throws Exception
*/
public static String buildSymKey() throws Exception {
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Key
KeyGenerator keyGenerator = KeyGenerator.getInstance(CipherConstant.AES);
keyGenerator.init(256, SecureRandomProxy.getRandomInstance());
// ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֳ<EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ψһ<EFBFBD>̶<EFBFBD><EFBFBD>ġ<EFBFBD>
SecretKey secretKey = keyGenerator.generateKey();
return Base64Util.encryptBASE64(secretKey.getEncoded());
}
public static Key getPublicKey(String pubKey) throws Exception {
Key key = null;
try {
byte[] keyBytes = Base64Util.decryptBASE64(pubKey);
KeyFactory keyFactory = KeyFactory.getInstance(CipherConstant.RSA);
X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes);
key = keyFactory.generatePublic(x509KeySpec);
} catch (Exception e) {
throw new Exception("<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ " + e.getMessage());
}
return key;
}
public static Key getPrivateKey(String priKey) throws Exception {
Key key = null;
try {
byte[] keyBytes = Base64Util.decryptBASE64(priKey);
KeyFactory keyFactory = KeyFactory.getInstance(CipherConstant.RSA);
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
key = keyFactory.generatePrivate(pkcs8KeySpec);
} catch (Exception e) {
throw new Exception("<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>Կ " + e.getMessage());
}
return key;
}
public static Key getSymKey(String symKey) throws Exception {
Key key = null;
try {
byte[] keyBytes = Base64Util.decryptBASE64(symKey);
// Keyת<EFBFBD><EFBFBD>
key = new SecretKeySpec(keyBytes, CipherConstant.AES);
} catch (Exception e) {
throw new Exception("<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>Կ " + e.getMessage());
}
return key;
}
}

View File

@ -0,0 +1,45 @@
package com.hzya.frame.finance.utils;
public class ResultMessageUtil {
private boolean success;
private Object data;
private String code;
private String errorMessage;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}

View File

@ -0,0 +1,52 @@
package com.hzya.frame.finance.utils;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
public class SHA256Util {
public static String getSHA256(String str, String key) {
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
byte[] salt = new byte[16];
try {
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.setSeed(key.getBytes());
random.nextBytes(salt);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
String salt_string = Base64Util.encryptBASE64(salt);
// System.out.println("salt_String::" + salt_string);
return getSHA256(str + salt_string.replaceAll("\r|\n", ""));
}
private static String getSHA256(String str) {
MessageDigest messageDigest;
String encodestr = "";
try {
messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes(StandardCharsets.UTF_8));
encodestr = byte2Hex(messageDigest.digest());
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
return encodestr;
}
private static String byte2Hex(byte[] bytes) {
StringBuffer stringBuffer = new StringBuffer();
String temp = null;
for (int i = 0; i < bytes.length; i++) {
temp = Integer.toHexString(bytes[i] & 0xFF);
if (temp.length() == 1) {
// 1得到<EFBFBD>?<EFBFBD><EFBFBD>的进行补0操作
stringBuffer.append("0");
}
stringBuffer.append(temp);
}
return stringBuffer.toString();
}
}

View File

@ -0,0 +1,23 @@
package com.hzya.frame.finance.utils;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
/**
* @Describe
*/
public class SecureRandomProxy {
public static SecureRandom getRandomInstance() {
SecureRandom random = null;
try {
random = SecureRandom.getInstance("SHA1PRNG");
// random = SecureRandom.getInstance("NativePRNG");
// random = SecureRandom.getInstance("NativePRNGNonBlocking");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return random;
}
}

View File

@ -0,0 +1,18 @@
package com.hzya.frame.finance.utils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ZTResult {
private String msg;
private String type;
private String flag;
private String status;
private Attribute attribute;
private String headMsg;
}

View File

@ -0,0 +1,21 @@
package com.hzya.frame.finance.utils.pufabank;
import java.security.MessageDigest;
import javax.xml.bind.DatatypeConverter;
public class SHA1 {
public static String digest(String content) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
messageDigest.update(content.getBytes("UTF-8"));
byte[] digestBytes = messageDigest.digest();
return DatatypeConverter.printBase64Binary(digestBytes);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

View File

@ -0,0 +1,105 @@
package com.hzya.frame.finance.utils.pufabank;
import java.math.BigInteger;
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.math.ec.ECPoint;
/**
* 国密加密类实现
*
*/
public class SM2Cipher {
private int ct;
private ECPoint p2;
private SM3Digest sm3keybase;// SM3摘要
private SM3Digest sm3c3;
private byte key[];
private byte keyOff;
public SM2Cipher() {
this.ct = 1;
this.key = new byte[32];
this.keyOff = 0;
}
/**
* 重置
*/
private void Reset() {
this.sm3keybase = new SM3Digest();
this.sm3c3 = new SM3Digest();
byte p[] = SM2Util.byteConvert32Bytes(p2.getXCoord().toBigInteger());
this.sm3keybase.update(p, 0, p.length);
this.sm3c3.update(p, 0, p.length);
p = SM2Util.byteConvert32Bytes(p2.getYCoord().toBigInteger());
this.sm3keybase.update(p, 0, p.length);
this.ct = 1;
NextKey();
}
private void NextKey() {
SM3Digest sm3keycur = new SM3Digest(this.sm3keybase);
sm3keycur.update((byte) (ct >> 24 & 0xff));
sm3keycur.update((byte) (ct >> 16 & 0xff));
sm3keycur.update((byte) (ct >> 8 & 0xff));
sm3keycur.update((byte) (ct & 0xff));
sm3keycur.doFinal(key, 0);
this.keyOff = 0;
this.ct++;
}
public ECPoint Init_enc(SM2Factory sm2, ECPoint userKey) {
AsymmetricCipherKeyPair key = sm2.ecc_key_pair_generator.generateKeyPair();
ECPrivateKeyParameters ecpriv = (ECPrivateKeyParameters) key.getPrivate();
ECPublicKeyParameters ecpub = (ECPublicKeyParameters) key.getPublic();
BigInteger k = ecpriv.getD();
ECPoint c1 = ecpub.getQ();
this.p2 = userKey.multiply(k);
Reset();
return c1;
}
public void Encrypt(byte data[]) {
this.sm3c3.update(data, 0, data.length);
for (int i = 0; i < data.length; i++) {
if (keyOff == key.length) {
NextKey();
}
data[i] ^= key[keyOff++];
}
}
public void Init_dec(BigInteger userD, ECPoint c1) {
this.p2 = c1.multiply(userD);
Reset();
}
public void Decrypt(byte data[]) {
for (int i = 0; i < data.length; i++) {
if (keyOff == key.length) {
NextKey();
}
data[i] ^= key[keyOff++];
}
this.sm3c3.update(data, 0, data.length);
}
public void Dofinal(byte c3[]) {
byte p[] = SM2Util.byteConvert32Bytes(p2.getYCoord().toBigInteger());
this.sm3c3.update(p, 0, p.length);
this.sm3c3.doFinal(c3, 0);
Reset();
}
}

View File

@ -0,0 +1,173 @@
package com.hzya.frame.finance.utils.pufabank;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.Security;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.codec.digest.DigestUtils;
import org.bouncycastle.crypto.digests.SM3Digest;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
/**
* 报文加解密工具类
*
*/
public class SM2Cryptor {
static {
Security.addProvider(new BouncyCastleProvider());
}
// 算法名称
public static final String ALGORITHM_NAME = "sm4";
// P5填充
public static final String ALGORITHM_NAME_ECB_PADDING = "SM4/ECB/PKCS5Padding";
/**
* SHA256加密
*
* @param str
* @return
*/
public static String sha256(String str) {
MessageDigest messageDigest = null;
String enencdeStr = "";
try {
messageDigest = MessageDigest.getInstance("SHA-256");
byte[] hash = messageDigest.digest(str.getBytes("UTF-8"));
enencdeStr = Hex.encodeHexString(hash);
} catch (Exception e) {
e.printStackTrace();
}
return enencdeStr;
}
/**
* MD5加密
*
* @param hash
* @return
*/
public static String md5(String hash) {
String md5Str = DigestUtils.md5Hex(hash);
return md5Str;
}
/**
*
* sm3加密处理
*
* @param data
* @return 2019年11月26日
*
*/
public static String sm3(String data) {
String charset = "UTF-8";
String sm3Data = "";
try {
byte[] dataBytes = data.getBytes(charset);
byte[] hashBytes = hash(dataBytes);
sm3Data = ByteUtils.toHexString(hashBytes);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return sm3Data;
}
/**
*
* 返回长度为32位的byte数组 生成对应的hash值
*
* @param dataBytes
* @return 2019年10月28日
*
*/
public static byte[] hash(byte[] dataBytes) {
SM3Digest digest = new SM3Digest();
digest.update(dataBytes, 0, dataBytes.length);
byte[] hash = new byte[digest.getDigestSize()];
digest.doFinal(hash, 0);
return hash;
}
/**
* 报文体加密
*
* @param key
* @param data
* @return
*/
public static String encrypt(String key, String data) {
String encrypted = "";
try {
String charset = "UTF-8";
String sha256Key = sha256(key);
String sm3Key = sm3(sha256Key);
String md5Key = md5(sm3Key);
byte[] keyBytes = ByteUtils.fromHexString(md5Key);
byte[] dataBytes = data.getBytes(charset);
Cipher cipher = Cipher.getInstance(ALGORITHM_NAME_ECB_PADDING,
BouncyCastleProvider.PROVIDER_NAME);
SecretKeySpec sm4Key = new SecretKeySpec(keyBytes, ALGORITHM_NAME);
cipher.init(Cipher.ENCRYPT_MODE, sm4Key);
byte[] encryptBytes = cipher.doFinal(dataBytes);
String hexSignature = ByteUtils.toHexString(encryptBytes).toUpperCase();
byte[] signBytes = hexSignature.getBytes(charset);
encrypted = DatatypeConverter.printBase64Binary(signBytes);
return encrypted;
} catch (Exception e) {
e.printStackTrace();
}
return encrypted;
}
/**
* 报文体解密
*
* @param key
* @param signature
* @return
*/
public static String decrypt(String key, String encrypted) {
String decrypted = "";
try {
String sha256Key = sha256(key);
String sm3Key = sm3(sha256Key);
String md5Key = md5(sm3Key);
byte[] keyBytes = ByteUtils.fromHexString(md5Key);
byte[] encryptBytes = DatatypeConverter.parseBase64Binary(encrypted);
String hexSignature = new String(encryptBytes).toLowerCase();
byte[] cipherBytes = ByteUtils.fromHexString(hexSignature);
Cipher cipher = Cipher.getInstance(ALGORITHM_NAME_ECB_PADDING,
BouncyCastleProvider.PROVIDER_NAME);
SecretKeySpec sm4Key = new SecretKeySpec(keyBytes, ALGORITHM_NAME);
cipher.init(Cipher.DECRYPT_MODE, sm4Key);
byte[] doFinal = cipher.doFinal(cipherBytes);
decrypted = new String(doFinal);
return decrypted;
} catch (Exception e) {
e.printStackTrace();
}
return decrypted;
}
}

View File

@ -0,0 +1,79 @@
package com.hzya.frame.finance.utils.pufabank;
import java.io.IOException;
import java.math.BigInteger;
import org.bouncycastle.math.ec.ECPoint;
/**
* SM2加解密工具类
*
*/
public class SM2EnDecryptor {
/**
* SM2加密
*
* @param hexStrPub 公钥信息
* @param data 加密数据信息
* @return
*/
public static String encrypt(byte[] hexStrPub, byte[] data) {
byte[] source = new byte[data.length];
byte[] formatedPubKey;
System.arraycopy(data, 0, source, 0, data.length);
SM2Cipher cipher2sm2 = new SM2Cipher();
SM2Factory sm2Factory = SM2Factory.getInstance();
if (hexStrPub.length == 64) {
formatedPubKey = new byte[65];
formatedPubKey[0] = 0x04;
System.arraycopy(hexStrPub, 0, formatedPubKey, 1, hexStrPub.length);
} else {
formatedPubKey = hexStrPub;
}
ECPoint ecPoint = sm2Factory.ecc_curve.decodePoint(formatedPubKey);
ECPoint c1 = cipher2sm2.Init_enc(sm2Factory, ecPoint);
cipher2sm2.Encrypt(source);
byte[] c3 = new byte[32];
cipher2sm2.Dofinal(c3);
return SM2Util.byteToHex(c1.getEncoded(false)) + SM2Util.byteToHex(source) + SM2Util.byteToHex(c3);
}
/**
* SM2解密
*
* @param privateKey 私钥信息
* @param encryptedData 加密后的数据信息
* @return
* @throws IOException
*/
public static byte[] decrypt(byte[] privateKey, byte[] encryptedData) throws IOException {
if (privateKey == null || privateKey.length == 0) {
return null;
}
if (encryptedData == null || encryptedData.length == 0) {
return null;
}
// 加密字节数组转换为十六进制的字符串 长度变为encryptedData.length * 2
String data = SM2Util.byteToHex(encryptedData);
/***
* 分解加密字串 C1 = C1标志位2位 + C1实体部分128位 = 130 C3 = C3实体部分64位 = 64 C2 = encryptedData.length
* * 2 - C1长度 - C2长度
*/
byte[] c1Bytes = SM2Util.hexToByte(data.substring(0, 130));
int c2Len = encryptedData.length - 97;
byte[] c2 = SM2Util.hexToByte(data.substring(130, 130 + 2 * c2Len));
byte[] c3 = SM2Util.hexToByte(data.substring(130 + 2 * c2Len, 194 + 2 * c2Len));
SM2Factory sm2 = SM2Factory.getInstance();
BigInteger userD = new BigInteger(1, privateKey);
// 通过C1实体字节来生成ECPoint
ECPoint c1 = sm2.ecc_curve.decodePoint(c1Bytes);
SM2Cipher cipher = new SM2Cipher();
cipher.Init_dec(userD, c1);
cipher.Decrypt(c2);
cipher.Dofinal(c3);
// 返回解密结果
return c2;
}
}

View File

@ -0,0 +1,197 @@
package com.hzya.frame.finance.utils.pufabank;
import java.math.BigInteger;
import java.security.SecureRandom;
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.generators.ECKeyPairGenerator;
import org.bouncycastle.crypto.params.ECDomainParameters;
import org.bouncycastle.crypto.params.ECKeyGenerationParameters;
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECFieldElement;
import org.bouncycastle.math.ec.ECPoint;
import org.bouncycastle.math.ec.ECFieldElement.Fp;
/**
* 国密工厂类
*
*/
@SuppressWarnings(value = { "deprecation", "static-access" })
public class SM2Factory {
/*-----------------------国密算法相关参数begin-----------
* ------------------*/
// A 第一系数
private static final BigInteger a = new BigInteger(
"fffffffeffffffffffffffffffffffffffffffff00000000fffffffffffffffc", 16);
// B 第二系数
private static final BigInteger b = new BigInteger(
"28e9fa9e9d9f5e344d5a9e4bcf6509a7f39789f515ab8f92ddbcbd414d940e93", 16);
// 曲线X系数
private static final BigInteger gx = new BigInteger(
"32c4ae2c1f1981195f9904466a39c9948fe30bbff2660be1715a4589334c74c7", 16);
// 曲线Y系数
private static final BigInteger gy = new BigInteger(
"bc3736a2f4f6779c59bdcee36b692153d0a9877cc62a474002df32e52139f0a0", 16);
// 生产者顺序系数
private static final BigInteger n = new BigInteger(
"fffffffeffffffffffffffffffffffff7203df6b21c6052b53bbf40939d54123", 16);
// 素数
private static final BigInteger p = new BigInteger(
"fffffffeffffffffffffffffffffffffffffffff00000000ffffffffffffffff", 16);
// 因子系数 1
// private static final int h = 1;
/*-----------------------国密算法相关参数end-----------------------------*/
// 一些必要类
public final ECFieldElement ecc_gx_fieldelement;
public final ECFieldElement ecc_gy_fieldelement;
public final ECCurve ecc_curve;
public final ECPoint ecc_point_g;
public final ECDomainParameters ecc_bc_spec;
public final ECKeyPairGenerator ecc_key_pair_generator;
/**
* 初始化方法
*
* @return
*/
public static SM2Factory getInstance() {
return new SM2Factory();
}
public SM2Factory() {
this.ecc_gx_fieldelement = new Fp(this.p, this.gx);
this.ecc_gy_fieldelement = new Fp(this.p, this.gy);
this.ecc_curve = new ECCurve.Fp(this.p, this.a, this.b);
this.ecc_point_g = new ECPoint.Fp(this.ecc_curve, this.ecc_gx_fieldelement, this.ecc_gy_fieldelement);
this.ecc_bc_spec = new ECDomainParameters(this.ecc_curve, this.ecc_point_g, this.n);
ECKeyGenerationParameters ecc_ecgenparam;
ecc_ecgenparam = new ECKeyGenerationParameters(this.ecc_bc_spec, new SecureRandom());
this.ecc_key_pair_generator = new ECKeyPairGenerator();
this.ecc_key_pair_generator.init(ecc_ecgenparam);
}
/**
* 根据私钥曲线参数计算Z
*
* @param userId
* @param userKey
* @return
*/
public byte[] sm2GetZ(byte[] userId, ECPoint userKey) {
SM3Digest sm3 = new SM3Digest();
int len = userId.length * 8;
sm3.update((byte) (len >> 8 & 0xFF));
sm3.update((byte) (len & 0xFF));
sm3.update(userId, 0, userId.length);
byte[] p = SM2Util.byteConvert32Bytes(this.a);
sm3.update(p, 0, p.length);
p = SM2Util.byteConvert32Bytes(this.b);
sm3.update(p, 0, p.length);
p = SM2Util.byteConvert32Bytes(this.gx);
sm3.update(p, 0, p.length);
p = SM2Util.byteConvert32Bytes(this.gy);
sm3.update(p, 0, p.length);
p = SM2Util.byteConvert32Bytes(userKey.normalize().getXCoord().toBigInteger());
sm3.update(p, 0, p.length);
p = SM2Util.byteConvert32Bytes(userKey.normalize().getYCoord().toBigInteger());
sm3.update(p, 0, p.length);
byte[] md = new byte[sm3.getDigestSize()];
sm3.doFinal(md, 0);
return md;
}
/**
* 签名相关值计算
*
* @param md
* @param userD
* @param userKey
* @param sm2Result
*/
public void sm2Sign(byte[] md, BigInteger userD, ECPoint userKey, SM2Result sm2Result) {
BigInteger e = new BigInteger(1, md);
BigInteger k = null;
ECPoint kp = null;
BigInteger r = null;
BigInteger s = null;
do {
do {
// 正式环境
AsymmetricCipherKeyPair keypair = ecc_key_pair_generator.generateKeyPair();
ECPrivateKeyParameters ecpriv = (ECPrivateKeyParameters) keypair.getPrivate();
ECPublicKeyParameters ecpub = (ECPublicKeyParameters) keypair.getPublic();
k = ecpriv.getD();
kp = ecpub.getQ();
// r
r = e.add(kp.getXCoord().toBigInteger());
r = r.mod(this.n);
} while (r.equals(BigInteger.ZERO) || r.add(k).equals(this.n));
// (1 + dA)~-1
BigInteger da_1 = userD.add(BigInteger.ONE);
da_1 = da_1.modInverse(this.n);
// s
s = r.multiply(userD);
s = k.subtract(s).mod(this.n);
s = da_1.multiply(s).mod(this.n);
} while (s.equals(BigInteger.ZERO));
sm2Result.r = r;
sm2Result.s = s;
}
/**
* 验签
*
* @param md sm3摘要
* @param userKey 根据公钥decode一个ecpoint对象
* @param r 没有特殊含义
* @param s 没有特殊含义
* @param sm2Result 接收参数的对象
*/
public void sm2Verify(byte md[], ECPoint userKey, BigInteger r, BigInteger s, SM2Result sm2Result) {
sm2Result.R = null;
BigInteger e = new BigInteger(1, md);
BigInteger t = r.add(s).mod(this.n);
if (t.equals(BigInteger.ZERO)) {
return;
} else {
ECPoint x1y1 = ecc_point_g.multiply(sm2Result.s);
x1y1 = x1y1.add(userKey.multiply(t));
sm2Result.R = e.add(x1y1.normalize().getXCoord().toBigInteger()).mod(this.n);
return;
}
}
}

View File

@ -0,0 +1,33 @@
package com.hzya.frame.finance.utils.pufabank;
import java.math.BigInteger;
import org.bouncycastle.math.ec.ECPoint;
/**
* SM2
*
*/
public class SM2Result {
public SM2Result() {}
public BigInteger r;// 签名r
public BigInteger s;
public BigInteger R;// 验签R
public byte[] sa;// 密钥交换
public byte[] sb;
public byte[] s1;
public byte[] s2;
public ECPoint keyra;
public ECPoint keyrb;
}

View File

@ -0,0 +1,151 @@
package com.hzya.frame.finance.utils.pufabank;
/**
* SM2签名所计算的值 可以根据实际情况增加删除字段属性
*
*/
public class SM2Sign {
// 16进制的私钥
public String sm2_userd;
// 椭圆曲线点X
public String x_coord;
// 椭圆曲线点Y
public String y_coord;
// SM3摘要Z
public String sm3_z;
// 明文数据16进制
public String sign_express;
// SM3摘要值
public String sm3_digest;
// R
public String sign_r;
// S
public String sign_s;
// R
public String verify_r;
// S
public String verify_s;
// 签名值
public String sm2_sign;
// sign 签名 verfiy验签
public String sm2_type;
// 是否验签成功 true false
public boolean isVerify;
public String getX_coord() {
return x_coord;
}
public void setX_coord(String x_coord) {
this.x_coord = x_coord;
}
public String getY_coord() {
return y_coord;
}
public void setY_coord(String y_coord) {
this.y_coord = y_coord;
}
public String getSm3_z() {
return sm3_z;
}
public void setSm3_z(String sm3_z) {
this.sm3_z = sm3_z;
}
public String getSm3_digest() {
return sm3_digest;
}
public void setSm3_digest(String sm3_digest) {
this.sm3_digest = sm3_digest;
}
public String getSm2_sign() {
return sm2_sign;
}
public void setSm2_sign(String sm2_sign) {
this.sm2_sign = sm2_sign;
}
public String getSign_express() {
return sign_express;
}
public void setSign_express(String sign_express) {
this.sign_express = sign_express;
}
public String getSm2_userd() {
return sm2_userd;
}
public void setSm2_userd(String sm2_userd) {
this.sm2_userd = sm2_userd;
}
public String getSm2_type() {
return sm2_type;
}
public void setSm2_type(String sm2_type) {
this.sm2_type = sm2_type;
}
public boolean isVerify() {
return isVerify;
}
public void setVerify(boolean isVerify) {
this.isVerify = isVerify;
}
public String getSign_r() {
return sign_r;
}
public void setSign_r(String sign_r) {
this.sign_r = sign_r;
}
public String getSign_s() {
return sign_s;
}
public void setSign_s(String sign_s) {
this.sign_s = sign_s;
}
public String getVerify_r() {
return verify_r;
}
public void setVerify_r(String verify_r) {
this.verify_r = verify_r;
}
public String getVerify_s() {
return verify_s;
}
public void setVerify_s(String verify_s) {
this.verify_s = verify_s;
}
}

View File

@ -0,0 +1,132 @@
package com.hzya.frame.finance.utils.pufabank;
import java.io.ByteArrayInputStream;
import java.math.BigInteger;
import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.math.ec.ECPoint;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
/**
* 国密算法的签名验签
*
*/
public class SM2SignVerify {
/**
* 默认USERID
*/
public static String USER_ID = "1234567812345678";
/**
* 私钥签名 使用SM3进行对明文数据计算一个摘要值
*
* @param privatekey 私钥
* @param sourceData 明文数据
* @return 签名后的值
* @throws Exception
*/
public static SM2Sign sign(byte[] privatekey, byte[] sourceData) throws Exception {
SM2Sign sm2SignVO = new SM2Sign();
sm2SignVO.setSm2_type("sign");
SM2Factory factory = SM2Factory.getInstance();
BigInteger userD = new BigInteger(1, privatekey);
sm2SignVO.setSm2_userd(userD.toString(16));
ECPoint userKey = factory.ecc_point_g.multiply(userD);
sm2SignVO.setX_coord(userKey.getXCoord().toBigInteger().toString(16));
sm2SignVO.setY_coord(userKey.getYCoord().toBigInteger().toString(16));
SM3Digest sm3Digest = new SM3Digest();
byte[] z = factory.sm2GetZ(USER_ID.getBytes(), userKey);
sm2SignVO.setSm3_z(SM2Util.getHexString(z));
sm2SignVO.setSign_express(SM2Util.getHexString(sourceData));
sm3Digest.update(z, 0, z.length);
sm3Digest.update(sourceData, 0, sourceData.length);
byte[] md = new byte[32];
sm3Digest.doFinal(md, 0);
sm2SignVO.setSm3_digest(SM2Util.getHexString(md));
SM2Result sm2Result = new SM2Result();
factory.sm2Sign(md, userD, userKey, sm2Result);
sm2SignVO.setSign_r(sm2Result.r.toString(16));
sm2SignVO.setSign_s(sm2Result.s.toString(16));
ASN1Integer d_r = new ASN1Integer(sm2Result.r);
ASN1Integer d_s = new ASN1Integer(sm2Result.s);
ASN1EncodableVector v2 = new ASN1EncodableVector();
v2.add(d_r);
v2.add(d_s);
DERSequence sign = new DERSequence(v2);
String result = ByteUtils.toHexString(sign.getEncoded());
sm2SignVO.setSm2_sign(result);
return sm2SignVO;
}
/**
* 验证签名(验签)
*
* @param publicKey 公钥信息
* @param sourceData 密文信息
* @param signData 签名信息
* @return 验签的对象 包含了相关参数和验签结果
*/
@SuppressWarnings("unchecked")
public static SM2Sign validateSign(byte[] publicKey, byte[] sourceData, byte[] signData) {
try {
byte[] formatedPubKey;
SM2Sign verifyVo = new SM2Sign();
verifyVo.setSm2_type("verify");
if (publicKey.length == 64) {
// 添加一字节标识用于ECPoint解析
formatedPubKey = new byte[65];
formatedPubKey[0] = 0x04;
System.arraycopy(publicKey, 0, formatedPubKey, 1, publicKey.length);
} else {
formatedPubKey = publicKey;
}
SM2Factory factory = SM2Factory.getInstance();
ECPoint userKey = factory.ecc_curve.decodePoint(formatedPubKey);
SM3Digest sm3Digest = new SM3Digest();
byte[] z = factory.sm2GetZ(USER_ID.getBytes(), userKey);
verifyVo.setSm3_z(SM2Util.getHexString(z));
sm3Digest.update(z, 0, z.length);
sm3Digest.update(sourceData, 0, sourceData.length);
byte[] md = new byte[32];
sm3Digest.doFinal(md, 0);
verifyVo.setSm3_digest(SM2Util.getHexString(md));
ByteArrayInputStream bis = new ByteArrayInputStream(signData);
ASN1InputStream dis = new ASN1InputStream(bis);
SM2Result sm2Result = null;
ASN1Primitive derObj = dis.readObject();
dis.close();
bis.close();
Enumeration<ASN1Integer> e = ((ASN1Sequence) derObj).getObjects();
BigInteger r = ((ASN1Integer) e.nextElement()).getValue();
BigInteger s = ((ASN1Integer) e.nextElement()).getValue();
sm2Result = new SM2Result();
sm2Result.r = r;
sm2Result.s = s;
verifyVo.setVerify_r(sm2Result.r.toString(16));
verifyVo.setVerify_s(sm2Result.s.toString(16));
factory.sm2Verify(md, userKey, sm2Result.r, sm2Result.s, sm2Result);
boolean verifyFlag = sm2Result.r.equals(sm2Result.R);
verifyVo.setVerify(verifyFlag);
return verifyVo;
} catch (IllegalArgumentException e) {
System.out.println(e);
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}

View File

@ -0,0 +1,609 @@
package com.hzya.frame.finance.utils.pufabank;
import java.math.BigInteger;
public class SM2Util {
/**
* 整形转换成网络传输的字节流字节数组型数据
*
* @param num 一个整型数据
* @return 4个字节的自己数组
*/
public static byte[] intToBytes(int num) {
byte[] bytes = new byte[4];
bytes[0] = (byte) (0xff & (num >> 0));
bytes[1] = (byte) (0xff & (num >> 8));
bytes[2] = (byte) (0xff & (num >> 16));
bytes[3] = (byte) (0xff & (num >> 24));
return bytes;
}
/**
* 四个字节的字节数据转换成一个整形数据
*
* @param bytes 4个字节的字节数组
* @return 一个整型数据
*/
public static int byteToInt(byte[] bytes) {
int num = 0;
int temp;
temp = (0x000000ff & (bytes[0])) << 0;
num = num | temp;
temp = (0x000000ff & (bytes[1])) << 8;
num = num | temp;
temp = (0x000000ff & (bytes[2])) << 16;
num = num | temp;
temp = (0x000000ff & (bytes[3])) << 24;
num = num | temp;
return num;
}
/**
* 长整形转换成网络传输的字节流字节数组型数据
*
* @param num 一个长整型数据
* @return 4个字节的自己数组
*/
public static byte[] longToBytes(long num) {
byte[] bytes = new byte[8];
for (int i = 0; i < 8; i++) {
bytes[i] = (byte) (0xff & (num >> (i * 8)));
}
return bytes;
}
/**
* 大数字转换字节流字节数组型数据
*
* @param n
* @return
*/
public static byte[] byteConvert32Bytes(BigInteger n) {
byte tmpd[] = (byte[]) null;
if (n == null) {
return null;
}
if (n.toByteArray().length == 33) {
tmpd = new byte[32];
System.arraycopy(n.toByteArray(), 1, tmpd, 0, 32);
} else if (n.toByteArray().length == 32) {
tmpd = n.toByteArray();
} else {
tmpd = new byte[32];
for (int i = 0; i < 32 - n.toByteArray().length; i++) {
tmpd[i] = 0;
}
System.arraycopy(n.toByteArray(), 0, tmpd, 32 - n.toByteArray().length, n.toByteArray().length);
}
return tmpd;
}
/**
* 换字节流字节数组型数据转大数字
*
* @param b
* @return
*/
public static BigInteger byteConvertInteger(byte[] b) {
if (b[0] < 0) {
byte[] temp = new byte[b.length + 1];
temp[0] = 0;
System.arraycopy(b, 0, temp, 1, b.length);
return new BigInteger(temp);
}
return new BigInteger(b);
}
/**
* 根据字节数组获得值(十六进制数字)
*
* @param bytes
* @return
*/
public static String getHexString(byte[] bytes) {
return getHexString(bytes, true);
}
/**
* 根据字节数组获得值(十六进制数字)
*
* @param bytes
* @param upperCase
* @return
*/
public static String getHexString(byte[] bytes, boolean upperCase) {
String ret = "";
for (int i = 0; i < bytes.length; i++) {
ret += Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1);
}
return upperCase ? ret.toUpperCase() : ret;
}
/**
* 打印十六进制字符串
*
* @param bytes
*/
public static void printHexString(byte[] bytes) {
for (int i = 0; i < bytes.length; i++) {
String hex = Integer.toHexString(bytes[i] & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
}
}
/**
* Convert hex string to byte[]
*
* @param hexString the hex string
* @return byte[]
*/
public static byte[] hexStringToBytes(String hexString) {
if (hexString == null || hexString.equals("")) {
return null;
}
hexString = hexString.toUpperCase();
int length = hexString.length() / 2;
char[] hexChars = hexString.toCharArray();
byte[] d = new byte[length];
for (int i = 0; i < length; i++) {
int pos = i * 2;
d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
}
return d;
}
/**
* Convert char to byte
*
* @param c char
* @return byte
*/
public static byte charToByte(char c) {
return (byte) "0123456789ABCDEF".indexOf(c);
}
/**
* 用于建立十六进制字符的输出的小写字符数组
*/
private static final char[] DIGITS_LOWER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
'c', 'd', 'e', 'f' };
/**
* 用于建立十六进制字符的输出的大写字符数组
*/
private static final char[] DIGITS_UPPER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
'C', 'D', 'E', 'F' };
/**
* 将字节数组转换为十六进制字符数组
*
* @param data byte[]
* @return 十六进制char[]
*/
public static char[] encodeHex(byte[] data) {
return encodeHex(data, true);
}
/**
* 将字节数组转换为十六进制字符数组
*
* @param data byte[]
* @param toLowerCase <code>true</code> 传换成小写格式 <code>false</code> 传换成大写格式
* @return 十六进制char[]
*/
public static char[] encodeHex(byte[] data, boolean toLowerCase) {
return encodeHex(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER);
}
/**
* 将字节数组转换为十六进制字符数组
*
* @param data byte[]
* @param toDigits 用于控制输出的char[]
* @return 十六进制char[]
*/
protected static char[] encodeHex(byte[] data, char[] toDigits) {
int l = data.length;
char[] out = new char[l << 1];
// two characters form the hex value.
for (int i = 0, j = 0; i < l; i++) {
out[j++] = toDigits[(0xF0 & data[i]) >>> 4];
out[j++] = toDigits[0x0F & data[i]];
}
return out;
}
/**
* 将字节数组转换为十六进制字符串
*
* @param data byte[]
* @return 十六进制String
*/
public static String encodeHexString(byte[] data) {
return encodeHexString(data, true);
}
/**
* 将字节数组转换为十六进制字符串
*
* @param data byte[]
* @param toLowerCase <code>true</code> 传换成小写格式 <code>false</code> 传换成大写格式
* @return 十六进制String
*/
public static String encodeHexString(byte[] data, boolean toLowerCase) {
return encodeHexString(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER);
}
/**
* 将字节数组转换为十六进制字符串
*
* @param data byte[]
* @param toDigits 用于控制输出的char[]
* @return 十六进制String
*/
protected static String encodeHexString(byte[] data, char[] toDigits) {
return new String(encodeHex(data, toDigits));
}
/**
* 将十六进制字符数组转换为字节数组
*
* @param data 十六进制char[]
* @return byte[]
* @throws RuntimeException 如果源十六进制字符数组是一个奇怪的长度将抛出运行时异常
*/
public static byte[] decodeHex(char[] data) {
int len = data.length;
if ((len & 0x01) != 0) {
throw new RuntimeException("Odd number of characters.");
}
byte[] out = new byte[len >> 1];
// two characters form the hex value.
for (int i = 0, j = 0; j < len; i++) {
int f = toDigit(data[j], j) << 4;
j++;
f = f | toDigit(data[j], j);
j++;
out[i] = (byte) (f & 0xFF);
}
return out;
}
/**
* 将十六进制字符转换成一个整数
*
* @param ch 十六进制char
* @param index 十六进制字符在字符数组中的位置
* @return 一个整数
* @throws RuntimeException 当ch不是一个合法的十六进制字符时抛出运行时异常
*/
protected static int toDigit(char ch, int index) {
int digit = Character.digit(ch, 16);
if (digit == -1) {
throw new RuntimeException("Illegal hexadecimal character " + ch + " at index " + index);
}
return digit;
}
/**
* 数字字符串转ASCII码字符串
*
* @param String 字符串
* @return ASCII字符串
*/
public static String StringToAsciiString(String content) {
String result = "";
int max = content.length();
for (int i = 0; i < max; i++) {
char c = content.charAt(i);
String b = Integer.toHexString(c);
result = result + b;
}
return result;
}
/**
* 十六进制转字符串
*
* @param hexString 十六进制字符串
* @param encodeType 编码类型4Unicode2普通编码
* @return 字符串
*/
public static String hexStringToString(String hexString, int encodeType) {
String result = "";
int max = hexString.length() / encodeType;
for (int i = 0; i < max; i++) {
char c = (char) hexStringToAlgorism(hexString.substring(i * encodeType, (i + 1) * encodeType));
result += c;
}
return result;
}
/**
* 十六进制字符串装十进制
*
* @param hex 十六进制字符串
* @return 十进制数值
*/
public static int hexStringToAlgorism(String hex) {
hex = hex.toUpperCase();
int max = hex.length();
int result = 0;
for (int i = max; i > 0; i--) {
char c = hex.charAt(i - 1);
int algorism = 0;
if (c >= '0' && c <= '9') {
algorism = c - '0';
} else {
algorism = c - 55;
}
result += Math.pow(16, max - i) * algorism;
}
return result;
}
/**
* 十六转二进制
*
* @param hex 十六进制字符串
* @return 二进制字符串
*/
public static String hexStringToBinary(String hex) {
hex = hex.toUpperCase();
String result = "";
int max = hex.length();
for (int i = 0; i < max; i++) {
char c = hex.charAt(i);
switch (c) {
case '0':
result += "0000";
break;
case '1':
result += "0001";
break;
case '2':
result += "0010";
break;
case '3':
result += "0011";
break;
case '4':
result += "0100";
break;
case '5':
result += "0101";
break;
case '6':
result += "0110";
break;
case '7':
result += "0111";
break;
case '8':
result += "1000";
break;
case '9':
result += "1001";
break;
case 'A':
result += "1010";
break;
case 'B':
result += "1011";
break;
case 'C':
result += "1100";
break;
case 'D':
result += "1101";
break;
case 'E':
result += "1110";
break;
case 'F':
result += "1111";
break;
}
}
return result;
}
/**
* ASCII码字符串转数字字符串
*
* @param String ASCII字符串
* @return 字符串
*/
public static String AsciiStringToString(String content) {
String result = "";
int length = content.length() / 2;
for (int i = 0; i < length; i++) {
String c = content.substring(i * 2, i * 2 + 2);
int a = hexStringToAlgorism(c);
char b = (char) a;
String d = String.valueOf(b);
result += d;
}
return result;
}
/**
* 将十进制转换为指定长度的十六进制字符串
*
* @param algorism int 十进制数字
* @param maxLength int 转换后的十六进制字符串长度
* @return String 转换后的十六进制字符串
*/
public static String algorismToHexString(int algorism, int maxLength) {
String result = "";
result = Integer.toHexString(algorism);
if (result.length() % 2 == 1) {
result = "0" + result;
}
return patchHexString(result.toUpperCase(), maxLength);
}
/**
* 字节数组转为普通字符串ASCII对应的字符
*
* @param bytearray byte[]
* @return String
*/
public static String byteToString(byte[] bytearray) {
String result = "";
char temp;
int length = bytearray.length;
for (int i = 0; i < length; i++) {
temp = (char) bytearray[i];
result += temp;
}
return result;
}
/**
* 二进制字符串转十进制
*
* @param binary 二进制字符串
* @return 十进制数值
*/
public static int binaryToAlgorism(String binary) {
int max = binary.length();
int result = 0;
for (int i = max; i > 0; i--) {
char c = binary.charAt(i - 1);
int algorism = c - '0';
result += Math.pow(2, max - i) * algorism;
}
return result;
}
/**
* 十进制转换为十六进制字符串
*
* @param algorism int 十进制的数字
* @return String 对应的十六进制字符串
*/
public static String algorismToHEXString(int algorism) {
String result = "";
result = Integer.toHexString(algorism);
if (result.length() % 2 == 1) {
result = "0" + result;
}
result = result.toUpperCase();
return result;
}
/**
* HEX字符串前补0主要用于长度位数不足
*
* @param str String 需要补充长度的十六进制字符串
* @param maxLength int 补充后十六进制字符串的长度
* @return 补充结果
*/
static public String patchHexString(String str, int maxLength) {
String temp = "";
for (int i = 0; i < maxLength - str.length(); i++) {
temp = "0" + temp;
}
str = (temp + str).substring(0, maxLength);
return str;
}
/**
* 将一个字符串转换为int
*
* @param s String 要转换的字符串
* @param defaultInt int 如果出现异常,默认返回的数字
* @param radix int 要转换的字符串是什么进制的,如16 8 10.
* @return int 转换后的数字
*/
public static int parseToInt(String s, int defaultInt, int radix) {
int i = 0;
try {
i = Integer.parseInt(s, radix);
} catch (NumberFormatException ex) {
i = defaultInt;
}
return i;
}
/**
* 将一个十进制形式的数字字符串转换为int
*
* @param s String 要转换的字符串
* @param defaultInt int 如果出现异常,默认返回的数字
* @return int 转换后的数字
*/
public static int parseToInt(String s, int defaultInt) {
int i = 0;
try {
i = Integer.parseInt(s);
} catch (NumberFormatException ex) {
i = defaultInt;
}
return i;
}
/**
* 十六进制串转化为byte数组
*
* @return the array of byte
*/
public static byte[] hexToByte(String hex) throws IllegalArgumentException {
if (hex.length() % 2 != 0) {
throw new IllegalArgumentException();
}
char[] arr = hex.toCharArray();
byte[] b = new byte[hex.length() / 2];
for (int i = 0, j = 0, l = hex.length(); i < l; i++, j++) {
String swap = "" + arr[i++] + arr[i];
int byteint = Integer.parseInt(swap, 16) & 0xFF;
b[j] = new Integer(byteint).byteValue();
}
return b;
}
/**
* 字节数组转换为十六进制字符串
*
* @param b byte[] 需要转换的字节数组
* @return String 十六进制字符串
*/
public static String byteToHex(byte b[]) {
if (b == null) {
throw new IllegalArgumentException("Argument b ( byte array ) is null! ");
}
String hs = "";
String stmp = "";
for (int n = 0; n < b.length; n++) {
stmp = Integer.toHexString(b[n] & 0xff);
if (stmp.length() == 1) {
hs = hs + "0" + stmp;
} else {
hs = hs + stmp;
}
}
return hs.toUpperCase();
}
public static byte[] subByte(byte[] input, int startIndex, int length) {
byte[] bt = new byte[length];
for (int i = 0; i < length; i++) {
bt[i] = input[i + startIndex];
}
return bt;
}
}

View File

@ -0,0 +1,258 @@
package com.hzya.frame.finance.utils.pufabank;
/**
* SM3
*
*/
public class SM3 {
public static final byte[] iv = { 0x73, (byte) 0x80, 0x16, 0x6f, 0x49, 0x14, (byte) 0xb2, (byte) 0xb9,
0x17, 0x24, 0x42, (byte) 0xd7, (byte) 0xda, (byte) 0x8a, 0x06, 0x00, (byte) 0xa9, 0x6f, 0x30,
(byte) 0xbc, (byte) 0x16, 0x31, 0x38, (byte) 0xaa, (byte) 0xe3, (byte) 0x8d, (byte) 0xee, 0x4d,
(byte) 0xb0, (byte) 0xfb, 0x0e, 0x4e };
public static int[] Tj = new int[64];
static {
for (int i = 0; i < 16; i++) {
Tj[i] = 0x79cc4519;
}
for (int i = 16; i < 64; i++) {
Tj[i] = 0x7a879d8a;
}
}
public static byte[] CF(byte[] V, byte[] B) {
int[] v, b;
v = convert(V);
b = convert(B);
return convert(CF(v, b));
}
private static int[] convert(byte[] arr) {
int[] out = new int[arr.length / 4];
byte[] tmp = new byte[4];
for (int i = 0; i < arr.length; i += 4) {
System.arraycopy(arr, i, tmp, 0, 4);
out[i / 4] = bigEndianByteToInt(tmp);
}
return out;
}
private static byte[] convert(int[] arr) {
byte[] out = new byte[arr.length * 4];
byte[] tmp = null;
for (int i = 0; i < arr.length; i++) {
tmp = bigEndianIntToByte(arr[i]);
System.arraycopy(tmp, 0, out, i * 4, 4);
}
return out;
}
public static int[] CF(int[] V, int[] B) {
int a, b, c, d, e, f, g, h;
int ss1, ss2, tt1, tt2;
a = V[0];
b = V[1];
c = V[2];
d = V[3];
e = V[4];
f = V[5];
g = V[6];
h = V[7];
int[][] arr = expand(B);
int[] w = arr[0];
int[] w1 = arr[1];
for (int j = 0; j < 64; j++) {
ss1 = (bitCycleLeft(a, 12) + e + bitCycleLeft(Tj[j], j));
ss1 = bitCycleLeft(ss1, 7);
ss2 = ss1 ^ bitCycleLeft(a, 12);
tt1 = FFj(a, b, c, j) + d + ss2 + w1[j];
tt2 = GGj(e, f, g, j) + h + ss1 + w[j];
d = c;
c = bitCycleLeft(b, 9);
b = a;
a = tt1;
h = g;
g = bitCycleLeft(f, 19);
f = e;
e = P0(tt2);
}
int[] out = new int[8];
out[0] = a ^ V[0];
out[1] = b ^ V[1];
out[2] = c ^ V[2];
out[3] = d ^ V[3];
out[4] = e ^ V[4];
out[5] = f ^ V[5];
out[6] = g ^ V[6];
out[7] = h ^ V[7];
return out;
}
private static int[][] expand(int[] B) {
int W[] = new int[68];
int W1[] = new int[64];
for (int i = 0; i < B.length; i++) {
W[i] = B[i];
}
for (int i = 16; i < 68; i++) {
W[i] = P1(W[i - 16] ^ W[i - 9] ^ bitCycleLeft(W[i - 3], 15)) ^ bitCycleLeft(W[i - 13], 7)
^ W[i - 6];
}
for (int i = 0; i < 64; i++) {
W1[i] = W[i] ^ W[i + 4];
}
int arr[][] = new int[][] { W, W1 };
return arr;
}
private static byte[] bigEndianIntToByte(int num) {
return back(SM2Util.intToBytes(num));
}
private static int bigEndianByteToInt(byte[] bytes) {
return SM2Util.byteToInt(back(bytes));
}
private static int FFj(int X, int Y, int Z, int j) {
if (j >= 0 && j <= 15) {
return FF1j(X, Y, Z);
} else {
return FF2j(X, Y, Z);
}
}
private static int GGj(int X, int Y, int Z, int j) {
if (j >= 0 && j <= 15) {
return GG1j(X, Y, Z);
} else {
return GG2j(X, Y, Z);
}
}
// 逻辑位运算函数
private static int FF1j(int X, int Y, int Z) {
int tmp = X ^ Y ^ Z;
return tmp;
}
private static int FF2j(int X, int Y, int Z) {
int tmp = ((X & Y) | (X & Z) | (Y & Z));
return tmp;
}
private static int GG1j(int X, int Y, int Z) {
int tmp = X ^ Y ^ Z;
return tmp;
}
private static int GG2j(int X, int Y, int Z) {
int tmp = (X & Y) | (~X & Z);
return tmp;
}
private static int P0(int X) {
int y = rotateLeft(X, 9);
y = bitCycleLeft(X, 9);
int z = rotateLeft(X, 17);
z = bitCycleLeft(X, 17);
int t = X ^ y ^ z;
return t;
}
private static int P1(int X) {
int t = X ^ bitCycleLeft(X, 15) ^ bitCycleLeft(X, 23);
return t;
}
/**
* 对最后一个分组字节数据padding
*
* @param in
* @param bLen 分组个数
* @return
*/
public static byte[] padding(byte[] in, int bLen) {
int k = 448 - (8 * in.length + 1) % 512;
if (k < 0) {
k = 960 - (8 * in.length + 1) % 512;
}
k += 1;
byte[] padd = new byte[k / 8];
padd[0] = (byte) 0x80;
long n = in.length * 8 + bLen * 512;
byte[] out = new byte[in.length + k / 8 + 64 / 8];
int pos = 0;
System.arraycopy(in, 0, out, 0, in.length);
pos += in.length;
System.arraycopy(padd, 0, out, pos, padd.length);
pos += padd.length;
byte[] tmp = back(SM2Util.longToBytes(n));
System.arraycopy(tmp, 0, out, pos, tmp.length);
return out;
}
/**
* 字节数组逆序
*
* @param in
* @return
*/
private static byte[] back(byte[] in) {
byte[] out = new byte[in.length];
for (int i = 0; i < out.length; i++) {
out[i] = in[out.length - i - 1];
}
return out;
}
public static int rotateLeft(int x, int n) {
return (x << n) | (x >> (32 - n));
}
private static int bitCycleLeft(int n, int bitLen) {
bitLen %= 32;
byte[] tmp = bigEndianIntToByte(n);
int byteLen = bitLen / 8;
int len = bitLen % 8;
if (byteLen > 0) {
tmp = byteCycleLeft(tmp, byteLen);
}
if (len > 0) {
tmp = bitSmall8CycleLeft(tmp, len);
}
return bigEndianByteToInt(tmp);
}
private static byte[] bitSmall8CycleLeft(byte[] in, int len) {
byte[] tmp = new byte[in.length];
int t1, t2, t3;
for (int i = 0; i < tmp.length; i++) {
t1 = (byte) ((in[i] & 0x000000ff) << len);
t2 = (byte) ((in[(i + 1) % tmp.length] & 0x000000ff) >> (8 - len));
t3 = (byte) (t1 | t2);
tmp[i] = (byte) t3;
}
return tmp;
}
private static byte[] byteCycleLeft(byte[] in, int byteLen) {
byte[] tmp = new byte[in.length];
System.arraycopy(in, byteLen, tmp, 0, in.length - byteLen);
System.arraycopy(in, 0, tmp, in.length - byteLen, byteLen);
return tmp;
}
}

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