From b4512cda29b3caf779b1545758cd5d025eb6cb5e Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 17 May 2024 17:58:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=EF=BC=8C=E5=87=BA=E5=8B=A4?= =?UTF-8?q?=E6=B4=A5=E8=B4=B4=E6=95=B0=E6=8D=AE=E7=94=9F=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96=EF=BC=8C=E6=97=A7?= =?UTF-8?q?=E7=9A=84=E6=B4=A5=E8=B4=B4=E6=95=B0=E6=8D=AE=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E5=A4=8D=EF=BC=8C=E6=B4=A5=E8=B4=B4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=8A=B6=E6=80=81=E8=B5=8B=E5=80=BC=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AllowanceServiceImpl.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/com/engine/attendance/workflow/service/impl/AllowanceServiceImpl.java b/src/com/engine/attendance/workflow/service/impl/AllowanceServiceImpl.java index b93d55a..dff085f 100644 --- a/src/com/engine/attendance/workflow/service/impl/AllowanceServiceImpl.java +++ b/src/com/engine/attendance/workflow/service/impl/AllowanceServiceImpl.java @@ -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> bcData = DbTools.getSqlToList(bcSql); - for (Map map : bcData) { + String allowanceWithBcSql = "select * from uf_jcl_kq_kqxm where id in ("+String.join(",",targetAllowanceIdList) + ") and sydbc is not null "; + List> allowanceWithBcData = DbTools.getSqlToList(allowanceWithBcSql); + for (Map 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> 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 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 map : allowanceInfoList) { List 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 {