# Conflicts:
#	service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/entity/OerDjmlEntity.java
This commit is contained in:
xiang2lin 2024-08-15 17:29:55 +08:00
commit b125e46f9b
5 changed files with 313 additions and 15 deletions

View File

@ -122,6 +122,9 @@
<delete id="GbiZbsyrecEntity_delete_oer" parameterType="com.hzya.frame.grpU8.nxproof.gbizbsyrec.entity.GbiZbsyrecEntity">
delete FROM gbi_zbsyrec where GSDM =#{gsdm} and KJND=#{kjnd} and MODULE='OER' and djlx=#{djlx} and djid=#{djId} AND DJFLMX=#{djflmx}
</delete>
<delete id="GbiZbsyrecEntity_delete_mlid" parameterType="com.hzya.frame.grpU8.nxproof.gbizbsyrec.entity.GbiZbsyrecEntity">
delete FROM gbi_zbsyrec where GSDM =#{gsdm} and KJND=#{kjnd} and djid=#{djId}
</delete>
<!--删除 单据删除时使用-->
<delete id="GbiZbsyrecEntity_delete_del" parameterType="com.hzya.frame.grpU8.nxproof.gbizbsyrec.entity.GbiZbsyrecEntity">

View File

@ -128,5 +128,9 @@ GSDM,KJND
<delete id="OerDjjsfsEntity_delete_del" parameterType="com.hzya.frame.grpU8.nxproof.oerdjjsfs.entity.OerDjjsfsEntity">
DELETE FROM oer_djjsfs WHERE GSDM = #{gsdm} AND KJND = #{kjnd} AND DJLXID = #{djlxId} AND MLID = #{mlId}
</delete>
<!--单据删除 单据删除时使用-->
<delete id="OerDjjsfsEntity_delete_delMlid" parameterType="com.hzya.frame.grpU8.nxproof.oerdjjsfs.entity.OerDjjsfsEntity">
DELETE FROM oer_djjsfs WHERE GSDM = #{gsdm} AND MLID = #{mlId}
</delete>
</mapper>

View File

@ -1,6 +1,7 @@
package com.hzya.frame.grpU8.nxproof.oerdjml.entity;
import com.hzya.frame.grpU8.nxproof.gbizbsyrec.entity.GbiZbsyrecEntity;
import com.hzya.frame.grpU8.nxproof.oerdjjsfs.entity.OerDjjsfsEntity;
import com.hzya.frame.grpU8.nxproof.oerdjnr.entity.OerDjnrEntity;
import com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity;
import com.hzya.frame.web.entity.BaseEntity;
@ -75,8 +76,7 @@ public class OerDjmlEntity extends BaseEntity {
private List<GbiZbsyrecEntity> gbiZbsyrecEntitylist;
private List<OerDjnrEntity> oerDjnrEntityList;
private List<OerYszbEntity> oerYszbEntityList;
private List<OerDjjsfsEntity> oerDjjsfsEntityList;
public String getMlId() {
return mlId;
@ -350,28 +350,28 @@ public class OerDjmlEntity extends BaseEntity {
this.lclb = lclb;
}
public List<GbiZbsyrecEntity> getGbiZbsyrecEntitylist() {
return gbiZbsyrecEntitylist;
public List<GbiZbsyrecAllEntity> getGbiZbsyrecAllEntitylist() {
return gbiZbsyrecAllEntitylist;
}
public void setGbiZbsyrecEntitylist(List<GbiZbsyrecEntity> gbiZbsyrecEntitylist) {
this.gbiZbsyrecEntitylist = gbiZbsyrecEntitylist;
public void setGbiZbsyrecAllEntitylist(List<GbiZbsyrecAllEntity> gbiZbsyrecAllEntitylist) {
this.gbiZbsyrecAllEntitylist = gbiZbsyrecAllEntitylist;
}
public List<OerDjnrEntity> getOerDjnrEntityList() {
return oerDjnrEntityList;
public List<OerDjnrAllEntity> getOerDjnrAllEntityList() {
return oerDjnrAllEntityList;
}
public void setOerDjnrEntityList(List<OerDjnrEntity> oerDjnrEntityList) {
this.oerDjnrEntityList = oerDjnrEntityList;
public void setOerDjnrAllEntityList(List<OerDjnrAllEntity> oerDjnrAllEntityList) {
this.oerDjnrAllEntityList = oerDjnrAllEntityList;
}
public List<OerYszbEntity> getOerYszbEntityList() {
return oerYszbEntityList;
public List<OerYszbAllEntity> getOerYszbAllEntityList() {
return oerYszbAllEntityList;
}
public void setOerYszbEntityList(List<OerYszbEntity> oerYszbEntityList) {
this.oerYszbEntityList = oerYszbEntityList;
public void setOerYszbAllEntityList(List<OerYszbAllEntity> oerYszbAllEntityList) {
this.oerYszbAllEntityList = oerYszbAllEntityList;
}
public String getXmdm() {
@ -453,4 +453,12 @@ public class OerDjmlEntity extends BaseEntity {
public void setSsr(String ssr) {
this.ssr = ssr;
}
public List<OerDjjsfsEntity> getOerDjjsfsEntityList() {
return oerDjjsfsEntityList;
}
public void setOerDjjsfsEntityList(List<OerDjjsfsEntity> oerDjjsfsEntityList) {
this.oerDjjsfsEntityList = oerDjjsfsEntityList;
}
}

View File

@ -160,6 +160,43 @@ GSDM,KJND,mlId
where GSDM = #{gsdm} and KJND=#{kjnd} and DJLXID=${djlxId} and MLID=${mlId}
</update>
<update id="OerDjmlEntity_update_data" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
update oer_djml set
<trim prefixOverrides=",">
<if test="gsdm != null and gsdm !='' "> GSDM = #{gsdm}, </if>
<if test="kjnd != null and kjnd !='' "> KJND = #{kjnd}, </if>
<if test="djlxId != null and djlxId !='' "> DJLXID = #{djlxId}, </if>
<if test="mlId != null and mlId !='' "> MLID = #{mlId}, </if>
<if test="zt != null and zt !='' "> ZT = #{zt}, </if>
<if test="crerdm != null and crerdm !=''"> CRerDM = #{crerdm}, </if>
<if test="crermc != null and crermc !='' "> CRerMC = #{crermc}, </if>
<if test="crerdate != null and crerdate !='' "> CRerDate = #{crerdate}, </if>
<if test="flowcode != null and flowcode !='' "> FlowCode = #{flowcode},</if>
<if test="curshjd != null and curshjd !='' "> CurSHJD = #{curshjd}, </if>
<if test="nextshjd != null and nextshjd !='' "> NextSHJD = #{nextshjd},</if>
<if test="shrs != null and shrs !='' "> SHR = #{shrs},</if>
<if test="shrId != null and shrId !=''"> SHRID = #{shrId}, </if>
<if test="shrq != null and shrq !='' "> SHRQ = #{shrq}, </if>
<if test="jsfs != null and jsfs !='' "> JSFS = #{jsfs}, </if>
<if test="djbh != null and djbh !='' "> DJBH = #{djbh}, </if>
<if test="djdate != null and djdate !='' "> DJDate = #{djdate}, </if>
<if test="fjs != null and fjs !='' "> FJS = #{fjs},</if>
<if test="bmdm != null and bmdm !='' "> BMDM = #{bmdm}, </if>
<if test="bmmc != null and bmmc !='' "> BMMC = #{bmmc},</if>
<if test="grdm != null and grdm !='' ">GRDM = #{grdm}, </if>
<if test="grmc != null and grmc !='' ">GRMC = #{grmc},</if>
<if test="tel != null and tel !='' "> TEL = #{tel}, </if>
<if test="yjje != null and yjje !='' "> YJJE = #{yjje}, </if>
<if test="thje != null and thje !='' "> THJE = #{thje},</if>
<if test="blje != null and blje !='' "> BLJE = #{blje}, </if>
<if test="je != null and je !='' "> JE = #{je}, </if>
<if test="whje != null and whje !='' "> WHJE = #{whje},</if>
<if test="jedx != null and jedx !='' "> JEDX = #{jedx}, </if>
</trim>
where DJBH = #{djbh} and MLID=${mlId}
</update>
<!--删除,用于单据删除时使用-->
<delete id="OerDjmlEntity_delete" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
DELETE

View File

@ -191,6 +191,27 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
return pubObjFlowEntity;
}
/**
* 保存节点PUB_OBJ_FLOW
* @param entity
* @param maxMlId
*/
public PubObjFlowEntity setPubObjFlow(OerDjmlEntity entity, String maxMlId){
PubObjFlowEntity pubObjFlowEntity = new PubObjFlowEntity();
PubObjFlowEntity pubObjFlowEntityPofid=iPubObjFlowDao.query(pubObjFlowEntity, "PubObjFlowEntity_list_base");
pubObjFlowEntity.setDjh(maxMlId);
pubObjFlowEntity.setPofId(pubObjFlowEntityPofid.getPofId());
pubObjFlowEntity.setModCode("OER");
pubObjFlowEntity.setDjlx(entity.getDjlxId());
pubObjFlowEntity.setShrs(entity.getCrerdm());
pubObjFlowEntity.setShrmc(entity.getCrermc());
pubObjFlowEntity.setFlowcode(entity.getFlowcode());
pubObjFlowEntity.setAuditFlag("999");
pubObjFlowEntity.setAuditAftFlag("-1");
pubObjFlowEntity.setIsaudit("1");
return pubObjFlowEntity;
}
/**
* 新增日志表PubAuditLog
* @param jsonObject
@ -251,6 +272,43 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
pubAuditLogEntityList.add(pubAuditLogEntity);
pubAuditLogEntityList.add(pubAuditLogEntityTwo);*/
pubAuditLogEntityList.add(pubAuditLogEntity);
return pubAuditLogEntityList;
}
/**
* 新增日志表PubAuditLog
* @param entity
* @param maxMlId
*/
public List<PubAuditLogEntity> setPubAuditLog(OerDjmlEntity entity,String maxMlId){
List<PubAuditLogEntity> pubAuditLogEntityList=new ArrayList<>();
//拼接送审参数
PubAuditLogEntity pubAuditLogEntity = new PubAuditLogEntity();
pubAuditLogEntity.setBillname("费用报销[向导式]");
pubAuditLogEntity.setFlowname("暂时费用报销审批流");
pubAuditLogEntity.setNodeseq("-9");
pubAuditLogEntity.setNodename("送审");
pubAuditLogEntity.setAuditorId("1");
pubAuditLogEntity.setAuditor("系统管理员");
pubAuditLogEntity.setAmt(entity.getJe());
pubAuditLogEntity.setRemark("国子系统送审成功");
pubAuditLogEntity.setAtype("国子系统通过");
pubAuditLogEntity.setBillId(maxMlId);
pubAuditLogEntity.setModname("OER");
pubAuditLogEntity.setFlowcode(entity.getFlowcode());
pubAuditLogEntity.setGsdm(entity.getGsdm());
pubAuditLogEntity.setKjnd(entity.getKjnd());
pubAuditLogEntity.setServdatetime("1");
pubAuditLogEntity.setAdatetime("1");
//获取最大值logid
PubAuditLogEntity pubAuditLogEntityLogid = iPubAuditLogDao.query(pubAuditLogEntity, "PubAuditLogEntity_list_base_max");
pubAuditLogEntity.setLogId(pubAuditLogEntityLogid.getLogId());
//获取最大值logseq
PubAuditLogEntity pubAuditLogEntityLogseq=iPubAuditLogDao.query(pubAuditLogEntity,"PubAuditLogEntity_list_base_logseq");
pubAuditLogEntity.setLogseq(pubAuditLogEntityLogseq.getLogseq());
pubAuditLogEntityList.add(pubAuditLogEntity);
return pubAuditLogEntityList;
}
@ -300,6 +358,35 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
return yszbEntity;
}
/*****
* 根据预算指标生成指标生成指标使用记录
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-06-29 16:43
* @Param [djnrEntity]
* @return com.hzya.frame.online.expense.insert.oerYszb.entity.oerYszbEntity
**/
private GbiZbsyrecEntity setOerYszbEntity(OerDjmlEntity entity,OerDjnrEntity djnrEntity) {
GbiZbsyrecEntity yszbEntity = new GbiZbsyrecEntity();
BeanUtil.copyProperties(djnrEntity,yszbEntity);
yszbEntity.setModule(djnrEntity.getModule());
yszbEntity.setDjlx(djnrEntity.getDjlxId());
yszbEntity.setDjId(djnrEntity.getMlId());
yszbEntity.setDjflh(djnrEntity.getDjflh());
yszbEntity.setDjflmx(djnrEntity.getMlId());
yszbEntity.setDjywrq(entity.getDjdate());
yszbEntity.setDjzt(entity.getZt());
yszbEntity.setJhId(djnrEntity.getZbId());
yszbEntity.setDjje(djnrEntity.getJe());
yszbEntity.setSl("0");
yszbEntity.setDjzy(djnrEntity.getZy());
yszbEntity.setSzfx("1");
yszbEntity.setZblb("MXZB");
yszbEntity.setJdzb("0");
yszbEntity.setCzlx("0");
yszbEntity.setZzbz("0");
return yszbEntity;
}
/****
* 组装结算方式集合
@ -328,6 +415,22 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
return oerDjjsfsEntityList;
}
}
/****
* 组装结算方式集合
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-06-29 16:08
* @param entity 三方json数据, maxDjbh, maxMlId]
* @return java.util.List<com.hzya.frame.online.expense.insert.oerDjjsfs.entity.oerDjjsfsEntity>
**/
private List<OerDjjsfsEntity> setOerDjjsfsEntityList(OerDjmlEntity entity, String maxDjbh, String maxMlId) {
List<OerDjjsfsEntity> oerDjjsfsEntityList = entity.getOerDjjsfsEntityList();
for (int i = 0; i < oerDjjsfsEntityList.size(); i++) {
oerDjjsfsEntityList.get(i).setMlId(maxMlId);
oerDjjsfsEntityList.get(i).setGsdm(entity.getGsdm());
}
return oerDjjsfsEntityList;
}
/****
* 根据报销明细生成预算指标数据
@ -895,9 +998,152 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
* @return java.lang.Object
**/
private Object saveOrUpdateData(OerDjmlEntity entity) {
//获取主表数据
logger.info("开始处理数据:------>");
String gsdm = entity.getGsdm();
logger.info("根据公司代码查询最大单据编号,公司代码:------>"+gsdm);
if(StrUtil.isEmpty(gsdm)){
return BaseResult.getFailureMessageEntity("公司代码不能为空请排查参数gsdm");
}
if(StrUtil.isEmpty(entity.getDjdate())){
return BaseResult.getFailureMessageEntity("单据日期不能为空请排查参数djdate");
}
if(entity.getOerDjnrEntityList() == null || entity.getOerDjnrEntityList().size() == 0 ){
return BaseResult.getFailureMessageEntity("报销单明细数据为空!请检查参数");
}
if(entity.getOerDjjsfsEntityList() == null || entity.getOerDjjsfsEntityList().size() == 0 ){
return BaseResult.getFailureMessageEntity("报销单结算明细数据为空!请检查参数");
}
boolean flag = false;
String maxDjbh = null;
String maxMlId = null;
if(entity.getDjbh() != null && !"".equals(entity.getDjbh())){
OerDjmlEntity oerDjmlAllEntity = new OerDjmlEntity();
oerDjmlAllEntity.setDjbh(entity.getDjbh());
List<OerDjmlEntity> oerDjmlAllEntities = iOerDjmlDao.queryOerDjml(oerDjmlAllEntity);
if(oerDjmlAllEntities != null && oerDjmlAllEntities.size() == 1){
flag = true;
maxDjbh = oerDjmlAllEntities.get(0).getDjbh();
maxMlId = oerDjmlAllEntities.get(0).getMlId();
}
}
if(!flag){
logger.info("获取最大单据编号");
OerDjmlEntity oerDjmlEntity = new OerDjmlEntity();
oerDjmlEntity.setGsdm(gsdm);
oerDjmlEntity.setDjdate(entity.getDjdate());
oerDjmlEntity.setFph(nullConvert(entity.getFph()));
maxDjbh = iOerDjmlDao.getMaxDjbgByGsdm(oerDjmlEntity);
logger.info("获取到最大单据编号:------>"+maxDjbh);
//查询最大单据ID mlid
maxMlId = iOerDjmlDao.getMaxMlIdByGsdm(oerDjmlEntity);
logger.info("获取到最大单据ID MLID:------>"+maxMlId);
}
return null;
logger.info("组装单据主表数据开始:------>");
OerDjmlEntity oerdjml = setMainData(entity,maxDjbh,maxMlId);
logger.info("保存主表信息:------>");
if(flag){
iOerDjmlDao.update("OerDjmlEntity_update_data",oerdjml);
//删除明细
OerDjnrEntity oerDjnrEntity = new OerDjnrEntity();
oerDjnrEntity.setMlId(maxMlId);
oerDjnrEntity.setGsdm(entity.getGsdm());
oerDjnrEntity.setKjnd(entity.getKjnd());
oerDjnrEntity.setDjlxId(entity.getDjlxId());
iOerDjnrDao.delete("OerDjnrEntity_delete",oerDjnrEntity);
//删除预算指标
OerYszbEntity oerYszbEntity = new OerYszbEntity();
oerYszbEntity.setGsdm(entity.getGsdm());
oerYszbEntity.setKjnd(entity.getKjnd());
oerYszbEntity.setMlId(maxMlId);
iOerYszbDao.delete("OerYszbEntity_delete",oerYszbEntity);
//删除预算指标记录
GbiZbsyrecEntity oeryszb= new GbiZbsyrecEntity();
oeryszb.setGsdm(entity.getGsdm());
oeryszb.setKjnd(entity.getKjnd());
oeryszb.setDjId(maxMlId);
iGbiZbsyrecDao.delete("GbiZbsyrecEntity_delete_mlid",oeryszb);
//删除单据结算方式
OerDjjsfsEntity oerDjjsfsEntity = new OerDjjsfsEntity();
oerDjjsfsEntity.setMlId(maxMlId);
oerDjjsfsEntity.setGsdm(entity.getGsdm());
iOerDjjsfsDao.delete("OerDjjsfsEntity_delete_delMlid",oerDjjsfsEntity);
//删除日志
//删除节点
}else {
iOerDjmlDao.save("OerDjmlEntity_insert",oerdjml);
}
logger.info("组装单据报销明细开始:------>");
List<OerDjnrEntity> oerDjnrEntityList = setOerDjnrEntity(entity,maxDjbh,maxMlId);
logger.info("保存报销明细开始:------>");
for(OerDjnrEntity djnrEntity : oerDjnrEntityList){
iOerDjnrDao.save("OerDjnrEntity_insert",djnrEntity);
logger.info("保存完报销明细后,根据明细数据生成预算指标数据:------>");
OerYszbEntity yszbEntity = createOerYszbEntity(djnrEntity,maxMlId);
logger.info("保存预算指标开始:------>");
iOerYszbDao.save("OerYszbEntity_insert",yszbEntity);
logger.info("保存预算指标记录:------>");
GbiZbsyrecEntity oeryszb= setOerYszbEntity(entity,djnrEntity);
iGbiZbsyrecDao.save("GbiZbsyrecEntity_insert",oeryszb);
}
logger.info("组装单据结算方式明细开始:------>");
List<OerDjjsfsEntity> oerDjjsfsEntityList = setOerDjjsfsEntityList(entity,maxDjbh,maxMlId);
logger.info("保存结算方式明细开始:------>");
for(OerDjjsfsEntity oerdjjsfs :oerDjjsfsEntityList){
iOerDjjsfsDao.save("OerDjjsfsEntity_insert",oerdjjsfs);
}
//保存日志表PubAuditLog
List<PubAuditLogEntity> pubAuditLogEntityList = setPubAuditLog(entity, maxMlId);
for (PubAuditLogEntity pubAuditLog : pubAuditLogEntityList) {
iPubAuditLogDao.save("PubAuditLogEntity_insert",pubAuditLog);
}
//保存节点PUB_OBJ_FLOW
PubObjFlowEntity pubObjFlowEntity = setPubObjFlow(entity, maxMlId);
iPubObjFlowDao.save("PubObjFlowEntity_insert",pubObjFlowEntity);
return BaseResult.getSuccessMessageEntity("保存报销单成功");
}
/**
* @Author lvleigang
* @Description 设置报销单明细
* @Date 3:39 下午 2024/8/15
* @param entity
* @param maxDjbh
* @param maxMlId
* @return java.util.List<com.hzya.frame.grpU8.nxproof.oerdjnr.entity.OerDjnrEntity>
**/
private List<OerDjnrEntity> setOerDjnrEntity(OerDjmlEntity entity, String maxDjbh, String maxMlId) {
List<OerDjnrEntity> djnrEntityList = entity.getOerDjnrEntityList();
for (int i = 0; i < djnrEntityList.size(); i++) {
djnrEntityList.get(i).setMlId(maxMlId);
djnrEntityList.get(i).setGsdm(entity.getGsdm());
}
return djnrEntityList;
}
/**
* @Author lvleigang
* @Description 设置值
* @Date 3:30 下午 2024/8/15
* @param oerDjmlEntity
* @param maxDjbh
* @param maxMlId
* @return com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity
**/
private OerDjmlEntity setMainData(OerDjmlEntity oerDjmlEntity, String maxDjbh, String maxMlId) {
oerDjmlEntity.setDjbh(maxDjbh);
oerDjmlEntity.setMlId(maxMlId);
//oerDjmlEntity.setZt("3");
//oerDjmlEntity.setFlowcode("000006");
//oerDjmlEntity.setCurshjd("999");
//oerDjmlEntity.setNextshjd("-1");
logger.info("主表数据组装完成:"+JSON.toJSONString(oerDjmlEntity));
return oerDjmlEntity;
}
protected <T> T getData(String key, JSONObject jsonObject, Class<T> clz) {