调整部门。职员,指标,如果根据编码查询存在则不保存也不更新,返回该编码已存在

This commit is contained in:
hecan 2024-09-04 16:14:07 +08:00
parent 2f4cbe3fa8
commit 540cde8ca1
7 changed files with 63 additions and 14 deletions

View File

@ -78,6 +78,18 @@ public class GbiZbxmbServiceImpl extends BaseService<GbiZbxmbEntity, String> imp
if(!checkStr(jsonObject.getString("zbdm"))){ if(!checkStr(jsonObject.getString("zbdm"))){
return BaseResult.getFailureMessageEntity("请传递指标代码"); return BaseResult.getFailureMessageEntity("请传递指标代码");
} }
if(!checkStr(jsonObject.getString("lrrq"))){
return BaseResult.getFailureMessageEntity("请传递录入日期");
}
if(!checkStr(jsonObject.getString("lrsj"))){
return BaseResult.getFailureMessageEntity("请传递录入时间");
}
if(!checkStr(jsonObject.getString("ysfadm"))){
return BaseResult.getFailureMessageEntity("请传递预算方案代码");
}
if(!checkStr(jsonObject.getString("ysfamc"))){
return BaseResult.getFailureMessageEntity("请传递预算方案名称");
}
GbiZbxmbEntity gbiZbxmbEntity = jsonObject.toJavaObject(GbiZbxmbEntity.class); GbiZbxmbEntity gbiZbxmbEntity = jsonObject.toJavaObject(GbiZbxmbEntity.class);
/*try { /*try {
//查询指标id最大值和指标代码最大值 //查询指标id最大值和指标代码最大值
@ -98,7 +110,8 @@ public class GbiZbxmbServiceImpl extends BaseService<GbiZbxmbEntity, String> imp
gbiZbxmb.setDataSourceCode(gbiZbxmbEntity.getDataSourceCode()); gbiZbxmb.setDataSourceCode(gbiZbxmbEntity.getDataSourceCode());
List<GbiZbxmbEntity> gbiZbxmbEntities = gbiZbxmbDao.queryGbiZbxmbEntity(gbiZbxmb); List<GbiZbxmbEntity> gbiZbxmbEntities = gbiZbxmbDao.queryGbiZbxmbEntity(gbiZbxmb);
if(CollectionUtils.isNotEmpty(gbiZbxmbEntities)){ if(CollectionUtils.isNotEmpty(gbiZbxmbEntities)){
return BaseResult.getFailureMessageEntity("保存指标失败,该指标已经存在"); logger.info("指标id{}和编码:{}在公司代码为:{}和会计年度为{}中已经存在",gbiZbxmbEntity.getZbid(),gbiZbxmbEntity.getZbdm(),gbiZbxmbEntity.getGsdm(),gbiZbxmbEntity.getKjnd());
return BaseResult.getFailureMessageEntity("该指标已经存在,不保存");
} }
}catch (Exception e){ }catch (Exception e){
logger.info("根据指标id,指标编码,会计年度,公司代码查询指标是否存在失败:{}",gbiZbxmbEntity.getZbid(),gbiZbxmbEntity.getZbdm(),gbiZbxmbEntity.getKjnd(),gbiZbxmbEntity.getGsdm(),e.getMessage()); logger.info("根据指标id,指标编码,会计年度,公司代码查询指标是否存在失败:{}",gbiZbxmbEntity.getZbid(),gbiZbxmbEntity.getZbdm(),gbiZbxmbEntity.getKjnd(),gbiZbxmbEntity.getGsdm(),e.getMessage());
@ -108,7 +121,7 @@ public class GbiZbxmbServiceImpl extends BaseService<GbiZbxmbEntity, String> imp
JsonResultEntity jsonResultEntity = updateOtherTable(gbiZbxmbEntity); JsonResultEntity jsonResultEntity = updateOtherTable(gbiZbxmbEntity);
//保存指标项目表 //保存指标项目表
try { try {
gbiZbxmbEntity.setZt("1");//状态为1为保存 gbiZbxmbEntity.setZt("3");
gbiZbxmbEntity.setIdzbbh(String.valueOf(UUID.randomUUID()));//IDZBBH gbiZbxmbEntity.setIdzbbh(String.valueOf(UUID.randomUUID()));//IDZBBH
gbiZbxmbEntity.setSfjz("0");//是否结转 gbiZbxmbEntity.setSfjz("0");//是否结转
gbiZbxmbEntity.setCyskzfs("0");//超预算控制方式 gbiZbxmbEntity.setCyskzfs("0");//超预算控制方式
@ -119,6 +132,7 @@ public class GbiZbxmbServiceImpl extends BaseService<GbiZbxmbEntity, String> imp
gbiZbxmbEntity.setXfzt("0");//下发状态 gbiZbxmbEntity.setXfzt("0");//下发状态
gbiZbxmbEntity.setNcysy(0.00);//年初已使用 gbiZbxmbEntity.setNcysy(0.00);//年初已使用
gbiZbxmbEntity.setSjzbid(0);//上级指标id gbiZbxmbEntity.setSjzbid(0);//上级指标id
gbiZbxmbEntity.setModule("全部");//模块
logger.info("=========开始保存指标项目表========="); logger.info("=========开始保存指标项目表=========");
GbiZbxmbEntity save = gbiZbxmbDao.saveGbiZbxmbEntity(gbiZbxmbEntity); GbiZbxmbEntity save = gbiZbxmbDao.saveGbiZbxmbEntity(gbiZbxmbEntity);
@ -166,7 +180,8 @@ public class GbiZbxmbServiceImpl extends BaseService<GbiZbxmbEntity, String> imp
GbiZbxmbEntity gbiZbxmbEntity = jsonObject.toJavaObject(GbiZbxmbEntity.class); GbiZbxmbEntity gbiZbxmbEntity = jsonObject.toJavaObject(GbiZbxmbEntity.class);
try { try {
JsonResultEntity jsonResultEntity = updateOtherTable(gbiZbxmbEntity); JsonResultEntity jsonResultEntity = updateOtherTable(gbiZbxmbEntity);
gbiZbxmbEntity.setZt("1"); gbiZbxmbEntity.setZt("3");
gbiZbxmbEntity.setModule("全部");//模块
gbiZbxmbEntity.setNcysy(0.00);//年初已使用 gbiZbxmbEntity.setNcysy(0.00);//年初已使用
logger.info("=========开始更新指标项目表========="); logger.info("=========开始更新指标项目表=========");
GbiZbxmbEntity save = gbiZbxmbDao.updateGbiZbxmbEntity(gbiZbxmbEntity); GbiZbxmbEntity save = gbiZbxmbDao.updateGbiZbxmbEntity(gbiZbxmbEntity);
@ -213,7 +228,7 @@ public class GbiZbxmbServiceImpl extends BaseService<GbiZbxmbEntity, String> imp
} }
GbiZbxmbEntity gbiZbxmbEntity = jsonObject.toJavaObject(GbiZbxmbEntity.class); GbiZbxmbEntity gbiZbxmbEntity = jsonObject.toJavaObject(GbiZbxmbEntity.class);
try { try {
gbiZbxmbEntity.setZt("1"); gbiZbxmbEntity.setZt("3");
logger.info("=========开始删除指标项目表========="); logger.info("=========开始删除指标项目表=========");
int delete = gbiZbxmbDao.deleteGbiZbxmbEntity(gbiZbxmbEntity); int delete = gbiZbxmbDao.deleteGbiZbxmbEntity(gbiZbxmbEntity);
logger.info("==========指标项目表删除完毕======"); logger.info("==========指标项目表删除完毕======");

View File

@ -272,7 +272,7 @@
left join gl_pznr pznr on pznr.idpzh=pzml.idpzh and pzml.kjqj=pznr.kjqj left join gl_pznr pznr on pznr.idpzh=pzml.idpzh and pzml.kjqj=pznr.kjqj
<trim prefix="where" prefixOverrides="and"> <trim prefix="where" prefixOverrides="and">
<if test="idpzh !=null and idpzh!='' "> and pzml.idpzh = #{idpzh} </if> <if test="idpzh !=null and idpzh!='' "> and pzml.idpzh = #{idpzh} </if>
and pzml.kjqj =#{kjqj} and pznr.kjqj =#{kjqj} and pznr.zbid!=0 and (pzml.srrq>=#{srrq} or pzml.shrq >=#{shrq} or pzml.jzrq>=#{jzrq}) and pznr.zbid!=0
</trim> </trim>
group by pzml.idpzh, group by pzml.idpzh,
pzml.kjqj, pzml.kjqj,

View File

@ -670,10 +670,15 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
public Object queryGlPzmlSxy(JSONObject json){ public Object queryGlPzmlSxy(JSONObject json){
JSONObject jsonObject = json.getJSONObject("jsonStr"); JSONObject jsonObject = json.getJSONObject("jsonStr");
SenderGlPzmlEntity glPzmlEntity = jsonObject.toJavaObject(SenderGlPzmlEntity.class); SenderGlPzmlEntity glPzmlEntity = jsonObject.toJavaObject(SenderGlPzmlEntity.class);
if(StrUtil.isEmpty(glPzmlEntity.getKjqj())){ if(StrUtil.isEmpty(glPzmlEntity.getSrrq())){
glPzmlEntity.setKjqj(DateUtil.format(new Date(),"yyyyMM")); glPzmlEntity.setSrrq(DateUtil.format(new Date(),"yyyyMMdd"));
}
if(StrUtil.isEmpty(glPzmlEntity.getShrq())){
glPzmlEntity.setShrq(DateUtil.format(new Date(),"yyyyMMdd"));
}
if(StrUtil.isEmpty(glPzmlEntity.getJzrq())){
glPzmlEntity.setJzrq(DateUtil.format(new Date(),"yyyyMMdd"));
} }
//glPzmlEntity.setIdpzh("0C69E35D-912A-48F7-A5D4-F73227CC75B6");
//获取token //获取token
String token = getToken(); String token = getToken();
if(StrUtil.isEmpty(token)){ if(StrUtil.isEmpty(token)){

View File

@ -339,7 +339,20 @@ public class SenderPubbmxxServiceImpl extends BaseService<SenderPubbmxxEntity, S
senderPubbmxxEntity.setBmdm(receiverPubbmxxEntity.getBmdm()); senderPubbmxxEntity.setBmdm(receiverPubbmxxEntity.getBmdm());
senderPubbmxxEntity.setDataSourceCode(receiverPubbmxxEntity.getDataSourceCode()); senderPubbmxxEntity.setDataSourceCode(receiverPubbmxxEntity.getDataSourceCode());
List<SenderPubbmxxEntity> senderPubbmxxEntities = queryEntityPageHealthBureau(senderPubbmxxEntity); List<SenderPubbmxxEntity> senderPubbmxxEntities = queryEntityPageHealthBureau(senderPubbmxxEntity);
if(CollectionUtils.isEmpty(senderPubbmxxEntities)){ if(CollectionUtils.isNotEmpty(senderPubbmxxEntities)){
logger.info("====根据公司编码:{},会计年度:{},部门代码:{}查询数据有{}条",receiverPubbmxxEntity.getGsdm(),receiverPubbmxxEntity.getKjnd(),receiverPubbmxxEntity.getBmdm(),senderPubbmxxEntities.size());
logger.info("部门代码:{}在公司代码为:{}和会计年度为{}中已经存在",receiverPubbmxxEntity.getBmdm(),receiverPubbmxxEntity.getGsdm(),receiverPubbmxxEntity.getKjnd());
return BaseResult.getFailureMessageEntity("该部门编码已经存在,不保存");
}else{
receiverPubbmxxEntity.setId(receiverPubbmxxEntity.getGsdm()+'-'+receiverPubbmxxEntity.getKjnd()+'-'+receiverPubbmxxEntity.getBmdm());
logger.info("==========开始保存公司编码为:{}得部门信息id为:{}=========",receiverPubbmxxEntity.getGsdm(),receiverPubbmxxEntity.getId());
SenderPubbmxxEntity receiverPubbmxxEntity1 = senderPubbmxxDao.savePubbmxxHealthBureau(receiverPubbmxxEntity);
JSONObject jsonObject1=new JSONObject();
jsonObject1.put("status","200");
jsonObject1.put("bmxx",receiverPubbmxxEntity1);
return jsonObject1;
}
/*if(CollectionUtils.isEmpty(senderPubbmxxEntities)){
receiverPubbmxxEntity.setId(receiverPubbmxxEntity.getGsdm()+'-'+receiverPubbmxxEntity.getKjnd()+'-'+receiverPubbmxxEntity.getBmdm()); receiverPubbmxxEntity.setId(receiverPubbmxxEntity.getGsdm()+'-'+receiverPubbmxxEntity.getKjnd()+'-'+receiverPubbmxxEntity.getBmdm());
logger.info("==========开始保存公司编码为:{}得部门信息id为:{}=========",receiverPubbmxxEntity.getGsdm(),receiverPubbmxxEntity.getId()); logger.info("==========开始保存公司编码为:{}得部门信息id为:{}=========",receiverPubbmxxEntity.getGsdm(),receiverPubbmxxEntity.getId());
SenderPubbmxxEntity receiverPubbmxxEntity1 = senderPubbmxxDao.savePubbmxxHealthBureau(receiverPubbmxxEntity); SenderPubbmxxEntity receiverPubbmxxEntity1 = senderPubbmxxDao.savePubbmxxHealthBureau(receiverPubbmxxEntity);
@ -354,7 +367,7 @@ public class SenderPubbmxxServiceImpl extends BaseService<SenderPubbmxxEntity, S
jsonObject1.put("status","200"); jsonObject1.put("status","200");
jsonObject1.put("bmxx",receiverPubbmxxEntity1); jsonObject1.put("bmxx",receiverPubbmxxEntity1);
return jsonObject1; return jsonObject1;
} }*/
}catch (Exception e){ }catch (Exception e){
logger.info("保存公司编码为:{}得GROU8部门信息失败:{}",receiverPubbmxxEntity.getGsdm(),e.getMessage()); logger.info("保存公司编码为:{}得GROU8部门信息失败:{}",receiverPubbmxxEntity.getGsdm(),e.getMessage());
return BaseResult.getFailureMessageEntity("保存GROU8部门信息失败"); return BaseResult.getFailureMessageEntity("保存GROU8部门信息失败");

View File

@ -328,7 +328,22 @@ public class SenderPubzyxxServiceImpl extends BaseService<SenderPubzyxxEntity, S
senderPubzyxxEntity.setZydm(receiverPubzyxxEntity.getZydm()); senderPubzyxxEntity.setZydm(receiverPubzyxxEntity.getZydm());
senderPubzyxxEntity.setDataSourceCode(receiverPubzyxxEntity.getDataSourceCode()); senderPubzyxxEntity.setDataSourceCode(receiverPubzyxxEntity.getDataSourceCode());
List<SenderPubzyxxEntity> senderPubzyxxEntities = queryEntityPageHealthBureau(senderPubzyxxEntity); List<SenderPubzyxxEntity> senderPubzyxxEntities = queryEntityPageHealthBureau(senderPubzyxxEntity);
if(CollectionUtils.isEmpty(senderPubzyxxEntities)){ if(CollectionUtils.isNotEmpty(senderPubzyxxEntities)){
logger.info("====根据公司编码:{},会计年度:{},职员代码:{}查询数据有{}条",receiverPubzyxxEntity.getGsdm(),receiverPubzyxxEntity.getKjnd(),receiverPubzyxxEntity.getZydm(),senderPubzyxxEntities.size());
logger.info("职员代码:{}在公司代码为:{}和会计年度为{}中已经存在",receiverPubzyxxEntity.getZydm(),receiverPubzyxxEntity.getGsdm(),receiverPubzyxxEntity.getKjnd());
return BaseResult.getFailureMessageEntity("该职员编码已经存在,不保存");
}else{
receiverPubzyxxEntity.setSyzt("0");
receiverPubzyxxEntity.setGlzt("0");
receiverPubzyxxEntity.setId(receiverPubzyxxEntity.getGsdm()+'-'+receiverPubzyxxEntity.getKjnd()+'-'+receiverPubzyxxEntity.getZydm());
logger.info("==========开始保存公司编码为:{}得人员信息id为:{}=========",receiverPubzyxxEntity.getGsdm(),receiverPubzyxxEntity.getId());
SenderPubzyxxEntity receiverPubzyxxEntity1 = senderPubzyxxDao.savePubzyxxHealthBureau(receiverPubzyxxEntity);
JSONObject jsonObject1=new JSONObject();
jsonObject1.put("status","200");
jsonObject1.put("zyxx",receiverPubzyxxEntity1);
return jsonObject1;
}
/*if(CollectionUtils.isEmpty(senderPubzyxxEntities)){
receiverPubzyxxEntity.setSyzt("0"); receiverPubzyxxEntity.setSyzt("0");
receiverPubzyxxEntity.setGlzt("0"); receiverPubzyxxEntity.setGlzt("0");
receiverPubzyxxEntity.setId(receiverPubzyxxEntity.getGsdm()+'-'+receiverPubzyxxEntity.getKjnd()+'-'+receiverPubzyxxEntity.getZydm()); receiverPubzyxxEntity.setId(receiverPubzyxxEntity.getGsdm()+'-'+receiverPubzyxxEntity.getKjnd()+'-'+receiverPubzyxxEntity.getZydm());
@ -344,7 +359,7 @@ public class SenderPubzyxxServiceImpl extends BaseService<SenderPubzyxxEntity, S
jsonObject1.put("status","200"); jsonObject1.put("status","200");
jsonObject1.put("zyxx",receiverPubzyxxEntity1); jsonObject1.put("zyxx",receiverPubzyxxEntity1);
return jsonObject1; return jsonObject1;
} }*/
}catch (Exception e){ }catch (Exception e){
logger.info("保存公司编码为:{}得GROU8人员信息失败:{}",receiverPubzyxxEntity.getGsdm(),e.getMessage()); logger.info("保存公司编码为:{}得GROU8人员信息失败:{}",receiverPubzyxxEntity.getGsdm(),e.getMessage());
return BaseResult.getFailureMessageEntity("保存GROU8人员信息失败"); return BaseResult.getFailureMessageEntity("保存GROU8人员信息失败");

View File

@ -11,7 +11,6 @@ import com.hzya.frame.grpU8.nxproof.zbwhsz.entity.ZbWhszEntity;
* @since 2024-08-06 10:52:29 * @since 2024-08-06 10:52:29
*/ */
public interface IZbWhszDao extends IBaseDao<ZbWhszEntity, String> { public interface IZbWhszDao extends IBaseDao<ZbWhszEntity, String> {
/** /**
* *
* @content 更新文号 * @content 更新文号
@ -22,5 +21,6 @@ public interface IZbWhszDao extends IBaseDao<ZbWhszEntity, String> {
* **/ * **/
ZbWhszEntity updateZbWhszEntity(ZbWhszEntity zbWhszEntity); ZbWhszEntity updateZbWhszEntity(ZbWhszEntity zbWhszEntity);
} }

View File

@ -11,7 +11,6 @@ import com.hzya.frame.grpU8.nxproof.zbzbly.entity.ZbZblyEntity;
* @since 2024-08-06 10:54:31 * @since 2024-08-06 10:54:31
*/ */
public interface IZbZblyDao extends IBaseDao<ZbZblyEntity, String> { public interface IZbZblyDao extends IBaseDao<ZbZblyEntity, String> {
/** /**
* *
* @content 更新指标来源 * @content 更新指标来源
@ -22,5 +21,7 @@ public interface IZbZblyDao extends IBaseDao<ZbZblyEntity, String> {
* **/ * **/
ZbZblyEntity updateZbZblyEntity(ZbZblyEntity zblyEntity); ZbZblyEntity updateZbZblyEntity(ZbZblyEntity zblyEntity);
} }