|
|
|
@ -24,6 +24,8 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
|
|
|
|
|
BaseBean bs = new BaseBean();
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> addAllowanceRecords(Map<String, Object> params) {
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
try {
|
|
|
|
|
//获取modeId,考勤方案的modeId
|
|
|
|
|
Map<String,String> formmodeIdMap = Utils.getFormmodeIdMap();
|
|
|
|
@ -64,9 +66,10 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
|
|
|
|
|
}
|
|
|
|
|
//构建班次和津贴映射关系
|
|
|
|
|
Map<String, Map<String, Object>> allowanceIdWithKqxmInfo = new HashMap<>();
|
|
|
|
|
Map<String, List<String>> bcWithAllowanceInfo = new HashMap<>();
|
|
|
|
|
if (targetAllowanceIdList.size() > 0) {
|
|
|
|
|
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);
|
|
|
|
|
Map<String, List<String>> bcWithAllowanceInfo = new HashMap<>();
|
|
|
|
|
for (Map<String, Object> map : bcData) {
|
|
|
|
|
String bcArr = map.get("sydbc").toString();
|
|
|
|
|
String allowanceId = map.get("id").toString();
|
|
|
|
@ -83,12 +86,17 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取出勤结果,遍历处理津贴信息
|
|
|
|
|
String startDate = Util.null2String(params.get("startDate"));
|
|
|
|
|
String endDate = Util.null2String(params.get("endDate"));
|
|
|
|
|
List<Map<String, Object>> cqData = new ArrayList<>();
|
|
|
|
|
if (targetEmpIdList.size() > 0 && targetBcIdList.size() > 0) {
|
|
|
|
|
String cqSql = "select * from uf_jcl_kq_cqjg where ygid in ("+String.join(",",targetEmpIdList) + ") and rq >= '" + startDate +"'" + " and rq <= '" + endDate +"'"
|
|
|
|
|
+ " and bc in ("+String.join(",",targetBcIdList) + ")";
|
|
|
|
|
List<Map<String, Object>> cqData = DbTools.getSqlToList(cqSql);
|
|
|
|
|
cqData = DbTools.getSqlToList(cqSql);
|
|
|
|
|
}
|
|
|
|
|
bs.writeLog("cqData_size : " + cqData.size());
|
|
|
|
|
bs.writeLog("empIdWithAllowanceInfo : " + empIdWithAllowanceInfo);
|
|
|
|
|
bs.writeLog("bcWithAllowanceInfo : " + bcWithAllowanceInfo);
|
|
|
|
@ -96,6 +104,7 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
|
|
|
|
|
//获取待新增的津贴数据
|
|
|
|
|
List<Map<String, String>> allowanceInfoList = createAllowanceInfo(cqData, empIdWithAllowanceInfo, bcWithAllowanceInfo, allowanceIdWithKqxmInfo);
|
|
|
|
|
bs.writeLog("allowanceInfoList_size : " + allowanceInfoList.size());
|
|
|
|
|
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) + ")";
|
|
|
|
@ -121,11 +130,14 @@ public class AllowanceServiceImpl extends Service implements AllowanceService {
|
|
|
|
|
bs.writeLog("津贴数据记录入库开始---");
|
|
|
|
|
boolean insertSign =rs.executeBatchSql(insertSql,dataList);
|
|
|
|
|
bs.writeLog("insertSign : " + insertSign);
|
|
|
|
|
result.put("result", insertSign);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
bs.errorLog("catch error :{}",e);
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Map<String, String>> createAllowanceInfo(List<Map<String, Object>> cqData, Map<String, List<String>> empIdWithAllowanceInfo, Map<String
|
|
|
|
|