|
@@ -184,8 +184,12 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
//获取人员该月份填写的日报的总时长
|
|
//获取人员该月份填写的日报的总时长
|
|
List<Map<String, Object>> userTimeList = null;
|
|
List<Map<String, Object>> userTimeList = null;
|
|
if (syncUserCost || syncHistoryReport) {
|
|
if (syncUserCost || syncHistoryReport) {
|
|
-// userTimeList = reportMapper.getUserWorkingTimeByRange(companyId, startStr, endStr);
|
|
|
|
userTimeList = reportMapper.getUserWorkingTimeByRangeWithExclude(companyId, yearMonth,startStr, endStr);
|
|
userTimeList = reportMapper.getUserWorkingTimeByRangeWithExclude(companyId, yearMonth,startStr, endStr);
|
|
|
|
+ if (userTimeList.size() == 0) {
|
|
|
|
+ msg.setError("当月没有相关项目的日报数据,请检查是否设置了不参与项目");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//设置财务核算薪资模板配置
|
|
//设置财务核算薪资模板配置
|
|
@@ -384,6 +388,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
}
|
|
}
|
|
|
|
|
|
if (first != null && first.isPresent()) {
|
|
if (first != null && first.isPresent()) {
|
|
|
|
+ System.out.println("匹配到的人员:"+first.get().getName());
|
|
finance.setUserId(first.get().getId());
|
|
finance.setUserId(first.get().getId());
|
|
BigDecimal total = new BigDecimal(0);
|
|
BigDecimal total = new BigDecimal(0);
|
|
if (salaryCell != null) {
|
|
if (salaryCell != null) {
|
|
@@ -512,14 +517,22 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
BigDecimal db = timeType.getMonthDays().multiply(new BigDecimal(timeType.getAllday()));
|
|
BigDecimal db = timeType.getMonthDays().multiply(new BigDecimal(timeType.getAllday()));
|
|
localUser.setCost(total.divide(db, 6, BigDecimal.ROUND_HALF_UP));
|
|
localUser.setCost(total.divide(db, 6, BigDecimal.ROUND_HALF_UP));
|
|
} else {
|
|
} else {
|
|
|
|
+ boolean find = false;
|
|
for (int i=0;i<userTimeList.size(); i++) {
|
|
for (int i=0;i<userTimeList.size(); i++) {
|
|
Map<String, Object> map = userTimeList.get(i);
|
|
Map<String, Object> map = userTimeList.get(i);
|
|
if (map.get("creatorId").equals(finance.getUserId())) {
|
|
if (map.get("creatorId").equals(finance.getUserId())) {
|
|
|
|
+ find = true;
|
|
double time = (Double)map.get("workingTime");
|
|
double time = (Double)map.get("workingTime");
|
|
localUser.setCost(total.divide(new BigDecimal(time), 6, BigDecimal.ROUND_HALF_UP));
|
|
localUser.setCost(total.divide(new BigDecimal(time), 6, BigDecimal.ROUND_HALF_UP));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (!find) {
|
|
|
|
+ //没有找到对应的工时,按标准工时来
|
|
|
|
+ System.out.println("没有找到对应的工时,按标准工时来, userId="+finance.getUserId()+", jobNumber="+finance.getJobNumber());
|
|
|
|
+ BigDecimal db = timeType.getMonthDays().multiply(new BigDecimal(timeType.getAllday()));
|
|
|
|
+ localUser.setCost(total.divide(db, 6, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
updateUserList.add(localUser);
|
|
updateUserList.add(localUser);
|