考勤,出勤津贴数据生成功能逻辑优化,旧的津贴数据删除逻辑修复,津贴数据状态赋值逻辑添加

zm_dev
sy 11 months ago
parent cd0cdad702
commit b4512cda29

@ -109,9 +109,9 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
//去重
targetAllowanceIdList = targetAllowanceIdList.stream().distinct().collect(Collectors.toList());
//构建映射
String bcSql = "select * from uf_jcl_kq_kqxm where id in ("+String.join(",",targetAllowanceIdList) + ") and sydbc is not null ";
List<Map<String, Object>> bcData = DbTools.getSqlToList(bcSql);
for (Map<String, Object> map : bcData) {
String allowanceWithBcSql = "select * from uf_jcl_kq_kqxm where id in ("+String.join(",",targetAllowanceIdList) + ") and sydbc is not null ";
List<Map<String, Object>> allowanceWithBcData = DbTools.getSqlToList(allowanceWithBcSql);
for (Map<String, Object> map : allowanceWithBcData) {
String bcArr = map.get("sydbc").toString();
String allowanceId = map.get("id").toString();
allowanceIdWithKqxmInfo.put(allowanceId, map);
@ -151,16 +151,16 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
//获取待新增的津贴数据
List<Map<String, String>> allowanceInfoList = createAllowanceInfo(cqData, empIdWithAllowanceInfo, bcWithAllowanceInfo, allowanceIdWithKqxmInfo);
bs.writeLog("allowanceInfoList_size : " + allowanceInfoList.size());
//新增津贴数据,先删后加
String delSql = "delete from uf_jcl_kq_cqjt where rq >= '" + startDate +"'" + " and rq <= '" + endDate +"'"
+ " and yg in (" + String.join(",",targetEmpIdList) + ") and bc in (" + String.join(",",targetBcIdList) + ")";
boolean delSign = DbTools.update(delSql);
bs.writeLog("delSign : " + delSign + ", delSql : " + delSql);
if (allowanceInfoList.size() > 0) {
//新增津贴数据,先删后加
String delSql = "delete from uf_jcl_kq_cqjt where rq >= '" + startDate +"'" + " and rq <= '" + endDate +"'"
+ " and yg in (" + String.join(",",targetEmpIdList) + ") and bc in (" + String.join(",",targetBcIdList) + ")";
boolean delSign = DbTools.update(delSql);
bs.writeLog("delSign : " + delSign + ", delSql : " + delSql);
//插入津贴数据
List<List> dataList = new ArrayList<>();
String insertSql = " insert into uf_jcl_kq_cqjt(formmodeid,modeuuid,modedatacreater,modedatacreatertype,modedatacreatedate,modedatacreatetime," +
"szjg,yg,rq,bc,jtlx,sc) values(?,?,?,?,?,?,?,?,?,?,?,?)";
"szjg,yg,rq,bc,jtlx,sc,zt) values(?,?,?,?,?,?,?,?,?,?,?,?,?)";
String formmodeId = formmodeIdMap.get("uf_jcl_kq_cqjt");
for (Map<String, String> map : allowanceInfoList) {
List<String> list = new ArrayList<>();
@ -177,6 +177,7 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
list.add(map.get("bc"));
list.add(map.get("jtlx"));
list.add(map.get("sc"));
list.add(map.get("zt"));
dataList.add(list);
}
@ -245,6 +246,8 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
if (!banKqxm.equals("")) {
banKqxmList = Arrays.asList(banKqxm.split(","));
}
//是否需要审核标识,,0-否1-是
String checkSign = Util.null2String(allowanceInfo.get("sfxysh"));
//出勤日期
String cqRq = Util.null2String(map.get("rq"));
//正常工作时长计入核算量_标识,0-否1-是
@ -347,6 +350,8 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
allowanceInfoItem.put("rq", cqRq);
allowanceInfoItem.put("bc", Util.null2String(map.get("bc")));
allowanceInfoItem.put("jtlx", allowanceId);
//不需要审核的话,直接就是已审核状态
allowanceInfoItem.put("zt", !"1".equals(checkSign) ? "1" : "0");
if (!allowanceUnit.equals(AccountingUnitEnum.ONCE.getKey())) {
allowanceInfoItem.put("sc", String.format("%.2f", sc));
} else {

Loading…
Cancel
Save