报销接口编写修改

This commit is contained in:
lvleigang 2024-08-16 15:11:45 +08:00
parent aa124c9657
commit ef9ad4727a
4 changed files with 51 additions and 15 deletions

View File

@ -43,6 +43,7 @@ public interface IOerDjmlDao extends IBaseDao<OerDjmlEntity,String> {
List<OerDjmlEntity> queryOerDjml(OerDjmlEntity oerDjmlAllEntity);
Integer updateOerDjmlZt(OerDjmlEntity oerDjmlAllEntity);
Integer updateOerDjml(OerDjmlEntity oerDjmlAllEntity);
Integer updateGbiZbsyrecByDjid(GbiZbsyrecAllEntity gbiZbsyrecAllEntity);

View File

@ -71,6 +71,13 @@ public class OerDjmlDaoImpl extends MybatisGenericDao<OerDjmlEntity,String> impl
Integer o = super.update(getSqlIdPrifx() + "updateOerDjmlZt", entity);
return o;
}
@DS("#entity.dataSourceCode")
@Override
public Integer updateOerDjml(OerDjmlEntity entity) {
Integer o = super.update(getSqlIdPrifx() + "updateOerDjml", entity);
return o;
}
@DS("#entity.dataSourceCode")
@Override
public Integer updateGbiZbsyrecByDjid(GbiZbsyrecAllEntity entity) {

View File

@ -163,7 +163,7 @@ GSDM,KJND,mlId
<update id="OerDjmlEntity_update_data" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
update oer_djml set
<trim prefixOverrides=",">
<trim prefixOverrides="," suffixOverrides=",">
<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>
@ -244,7 +244,7 @@ GSDM,KJND,mlId
<trim suffix="" suffixOverrides=",">
<if test="gsdm != null and gsdm != ''"> GSDM = #{gsdm}, </if>
<if test="kjnd != null and kjnd != ''"> KJND = #{kjnd}, </if>
<if test="djlxid != null"> DJLXID = #{djlxid},</if>
<if test="djlxId != null"> DJLXID = #{djlxId},</if>
<if test="dqrq != null and dqrq != ''"> DQRQ = #{dqrq},</if>
<if test="zt != null and zt != ''"> ZT = #{zt},</if>
<if test="crerdm != null and crerdm != ''"> CRERDM = #{crerdm},</if>
@ -476,6 +476,13 @@ GSDM,KJND,mlId
</trim>
where MLID = #{mlid}
</update>
<update id="updateOerDjml" parameterType = "com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity" >
update OER_DJML set
<trim suffix="" suffixOverrides=",">
<if test="zt != null and zt != ''"> ZT = #{zt},</if>
</trim>
where MLID = #{mlId} and DJBH = #{djbh}
</update>
<update id="updateGbiZbsyrecByDjid" parameterType = "com.hzya.frame.grpU8.nxproof.oerdjml.entity.GbiZbsyrecAllEntity" >
update GBI_ZBSYREC set
<trim suffix="" suffixOverrides=",">

View File

@ -198,6 +198,7 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
*/
public PubObjFlowEntity setPubObjFlow(OerDjmlEntity entity, String maxMlId){
PubObjFlowEntity pubObjFlowEntity = new PubObjFlowEntity();
pubObjFlowEntity.setDataSourceCode(entity.getDataSourceCode());
PubObjFlowEntity pubObjFlowEntityPofid=iPubObjFlowDao.query(pubObjFlowEntity, "PubObjFlowEntity_list_base");
pubObjFlowEntity.setDjh(maxMlId);
pubObjFlowEntity.setPofId(pubObjFlowEntityPofid.getPofId());
@ -301,6 +302,7 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
pubAuditLogEntity.setServdatetime("1");
pubAuditLogEntity.setAdatetime("1");
//获取最大值logid
pubAuditLogEntity.setDataSourceCode(entity.getDataSourceCode());
PubAuditLogEntity pubAuditLogEntityLogid = iPubAuditLogDao.query(pubAuditLogEntity, "PubAuditLogEntity_list_base_max");
pubAuditLogEntity.setLogId(pubAuditLogEntityLogid.getLogId());
//获取最大值logseq
@ -371,7 +373,7 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
yszbEntity.setModule("OER");
yszbEntity.setDjlx(djnrEntity.getDjlxId());
yszbEntity.setDjId(djnrEntity.getMlId());
yszbEntity.setDjflh(djnrEntity.getDjflh());
yszbEntity.setDjflh(djnrEntity.getXh());
yszbEntity.setDjflmx(djnrEntity.getMlId());
yszbEntity.setDjywrq(entity.getDjdate());
yszbEntity.setDjzt(entity.getZt());
@ -734,12 +736,13 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
if (entity.getZt() == null || "".equals(entity.getZt())) {
return BaseResult.getFailureMessageEntity("状态不允许为空");
}
if (entity.getDjbh() == null || "".equals(entity.getDjbh())) {
return BaseResult.getFailureMessageEntity("单据编号不允许为空");
}
if(ColEventTypeEnum.ONSTART.getType().equals(entity.getLclb())){//流程发起
return saveOrUpdateData(dataSourceCode,entity);
}else if(ColEventTypeEnum.ONCANCEL.getType().equals(entity.getLclb())){//流程撤销
if (entity.getDjbh() == null || "".equals(entity.getDjbh())) {
return BaseResult.getFailureMessageEntity("单据编号不允许为空");
}
OerDjmlEntity oerDjmlAllEntity = new OerDjmlEntity();
oerDjmlAllEntity.setDataSourceCode(dataSourceCode);
oerDjmlAllEntity.setDjbh(entity.getDjbh());
@ -748,7 +751,7 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
//修改状态
oerDjmlAllEntity.setMlId(oerDjmlAllEntities.get(0).getMlId());
oerDjmlAllEntity.setZt(entity.getZt());
iOerDjmlDao.updateOerDjmlZt(oerDjmlAllEntity);
iOerDjmlDao.updateOerDjml(oerDjmlAllEntity);
//释放指标
GbiZbsyrecAllEntity gbiZbsyrecAllEntity = new GbiZbsyrecAllEntity();
gbiZbsyrecAllEntity.setDjlx(oerDjmlAllEntities.get(0).getDjlxId());
@ -764,6 +767,9 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
return BaseResult.getFailureMessageEntity("根据单据编号存在多条报销单");
}
}else if(ColEventTypeEnum.ONSTOP.getType().equals(entity.getLclb())){//流程终止
if (entity.getDjbh() == null || "".equals(entity.getDjbh())) {
return BaseResult.getFailureMessageEntity("单据编号不允许为空");
}
OerDjmlEntity oerDjmlAllEntity = new OerDjmlEntity();
oerDjmlAllEntity.setDataSourceCode(dataSourceCode);
oerDjmlAllEntity.setDjbh(entity.getDjbh());
@ -772,7 +778,7 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
//修改状态
oerDjmlAllEntity.setMlId(oerDjmlAllEntities.get(0).getMlId());
oerDjmlAllEntity.setZt(entity.getZt());
iOerDjmlDao.updateOerDjmlZt(oerDjmlAllEntity);
iOerDjmlDao.updateOerDjml(oerDjmlAllEntity);
//释放指标
GbiZbsyrecAllEntity gbiZbsyrecAllEntity = new GbiZbsyrecAllEntity();
gbiZbsyrecAllEntity.setDjlx(oerDjmlAllEntities.get(0).getDjlxId());
@ -788,6 +794,9 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
return BaseResult.getFailureMessageEntity("根据单据编号存在多条报销单");
}
}else if(ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(entity.getLclb())){//流程结束
if (entity.getDjbh() == null || "".equals(entity.getDjbh())) {
return BaseResult.getFailureMessageEntity("单据编号不允许为空");
}
OerDjmlEntity oerDjmlAllEntity = new OerDjmlEntity();
oerDjmlAllEntity.setDataSourceCode(dataSourceCode);
oerDjmlAllEntity.setDjbh(entity.getDjbh());
@ -796,7 +805,7 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
//修改状态
oerDjmlAllEntity.setMlId(oerDjmlAllEntities.get(0).getMlId());
oerDjmlAllEntity.setZt(entity.getZt());
iOerDjmlDao.updateOerDjmlZt(oerDjmlAllEntity);
iOerDjmlDao.updateOerDjml(oerDjmlAllEntity);
}else {
return BaseResult.getFailureMessageEntity("根据单据编号存在多条报销单");
}
@ -1023,7 +1032,15 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
boolean flag = false;
String maxDjbh = null;
String maxMlId = null;
if(entity.getDjbh() != null && !"".equals(entity.getDjbh())){
if (entity.getDjbh() == null || "".equals(entity.getDjbh())) {
OerDjmlEntity oerDjmlEntity = new OerDjmlEntity();
oerDjmlEntity.setDataSourceCode(dataSourceCode);
oerDjmlEntity.setGsdm(gsdm);
oerDjmlEntity.setDjdate(entity.getDjdate());
oerDjmlEntity.setFph(nullConvert(entity.getFph()));
maxDjbh = iOerDjmlDao.getMaxDjbgByGsdm(oerDjmlEntity);
entity.setDjbh(maxDjbh);
}else {
OerDjmlEntity oerDjmlAllEntity = new OerDjmlEntity();
oerDjmlAllEntity.setDataSourceCode(dataSourceCode);
oerDjmlAllEntity.setDjbh(entity.getDjbh());
@ -1035,6 +1052,7 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
}
}
if(!flag){
//logger.info("获取最大单据编号");
OerDjmlEntity oerDjmlEntity = new OerDjmlEntity();
@ -1120,11 +1138,14 @@ public class OerDjmlServiceImpl implements IOerDjmlService {
pubAuditLog.setDataSourceCode(dataSourceCode);
iPubAuditLogDao.saveData(pubAuditLog);
}
//保存节点PUB_OBJ_FLOW
PubObjFlowEntity pubObjFlowEntity = setPubObjFlow(entity, maxMlId);
pubObjFlowEntity.setDataSourceCode(dataSourceCode);
iPubObjFlowDao.saveData(pubObjFlowEntity);
return BaseResult.getSuccessMessageEntity("保存报销单成功");
if(!flag){
//保存节点PUB_OBJ_FLOW
PubObjFlowEntity pubObjFlowEntity = setPubObjFlow(entity, maxMlId);
pubObjFlowEntity.setDataSourceCode(dataSourceCode);
iPubObjFlowDao.saveData(pubObjFlowEntity);
}
return BaseResult.getSuccessMessageEntity("保存报销单成功",maxDjbh);
}
/**