|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.management.platform.entity.*;
|
|
|
+import com.management.platform.entity.excel.SpecialContractMonthSalary;
|
|
|
import com.management.platform.mapper.*;
|
|
|
import com.management.platform.service.*;
|
|
|
import com.management.platform.util.ExcelUtil;
|
|
@@ -696,11 +697,18 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
|
headList.add(MessageUtils.message("entry.projectName"));
|
|
|
//headList.add("人员");
|
|
|
headList.add(MessageUtils.message("entry.personnel"));
|
|
|
- headList.add(MessageUtils.message("entry.dept"));
|
|
|
- for (UserCustom userCustom : userCustoms) {
|
|
|
- headList.add(userCustom.getName());
|
|
|
- fixedColCount++;
|
|
|
+// headList.add(userCustoms.get(0).getName());
|
|
|
+
|
|
|
+ if(companyId == 7737){ //
|
|
|
+ headList.add(userCustoms.get(0).getName());
|
|
|
+ }else{
|
|
|
+ headList.add(MessageUtils.message("entry.dept"));
|
|
|
+ for (UserCustom userCustom : userCustoms) {
|
|
|
+ headList.add(userCustom.getName());
|
|
|
+ fixedColCount++;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
//headList.add("工时(h)");
|
|
|
headList.add(MessageUtils.message("entry.workHours")+"(h)");
|
|
|
fixedColCount++;
|
|
@@ -1185,9 +1193,15 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
|
rowData.add(p.projectCode);
|
|
|
rowData.add(p.project);
|
|
|
rowData.add("项目合计");
|
|
|
- //部门空出来
|
|
|
- rowData.add("");
|
|
|
- userCustoms.forEach(userCustom -> {rowData.add("");});
|
|
|
+
|
|
|
+ if(7737 == companyId){//
|
|
|
+ rowData.add("");
|
|
|
+ }else{
|
|
|
+ //部门空出来
|
|
|
+ rowData.add("");
|
|
|
+ userCustoms.forEach(userCustom -> {rowData.add("");});
|
|
|
+ }
|
|
|
+
|
|
|
rowData.add(workTimeFormatter.format(p.workingTime));
|
|
|
rowData.add(p.salary.toPlainString());
|
|
|
rowData.add(p.bonus.toPlainString());
|
|
@@ -1221,6 +1235,109 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
|
rowData.add(p.cost.toPlainString());
|
|
|
allList.add(rowData);
|
|
|
|
|
|
+ if(0 == onlyTotal){
|
|
|
+ if(7737 == companyId){//
|
|
|
+ List<SpecialContractMonthSalary> list =new ArrayList<>();
|
|
|
+ //普通
|
|
|
+ List<SpecialContractMonthSalary> tmpListOne =this.transProjectTimeToMonthSalary(projectTimeList,userTime,p
|
|
|
+ ,userList,finances,allDepartments,wxCorpInfo,dingding,userCustoms,cusColList);
|
|
|
+ list.addAll(tmpListOne);
|
|
|
+ //无项目人员成本
|
|
|
+ if (assignNoProUser != null && assignNoProUser){
|
|
|
+ List<SpecialContractMonthSalary> tmpListTwo = this.transNoProjectUserToMonthSalary(noProjectUser,p
|
|
|
+ ,userList,noPUserDataList,allDepartments,wxCorpInfo,dingding,userCustoms,cusColList);
|
|
|
+ list.addAll(tmpListTwo);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(CollectionUtils.isNotEmpty(list)){
|
|
|
+ //按照合同主体分类 plate1
|
|
|
+// DecimalFormat workTimeFormatter = new DecimalFormat("0.00");
|
|
|
+ Map<String, List<SpecialContractMonthSalary>> contractMap = list.stream()
|
|
|
+ .collect(Collectors.groupingBy(t-> StringUtils.isBlank(t.getPlate1())?"":t.getPlate1()));
|
|
|
+ for (Map.Entry<String, List<SpecialContractMonthSalary>> entry : contractMap.entrySet()) {
|
|
|
+ String plate1 = entry.getKey();
|
|
|
+ List<SpecialContractMonthSalary> salaryList = entry.getValue();
|
|
|
+ List<String> plate1List = new ArrayList<>();
|
|
|
+ plate1List.add("");//projectCode
|
|
|
+ plate1List.add("");//project
|
|
|
+ plate1List.add("");//$userName
|
|
|
+// plate1List.add("");//$departmentName
|
|
|
+ plate1List.add(plate1);//plate1
|
|
|
+
|
|
|
+ BigDecimal workingTime = new BigDecimal(0);
|
|
|
+ BigDecimal salary = new BigDecimal(0);
|
|
|
+ BigDecimal bonus = new BigDecimal(0);
|
|
|
+ BigDecimal allowance = new BigDecimal(0);
|
|
|
+ BigDecimal old = new BigDecimal(0);
|
|
|
+ BigDecimal medical = new BigDecimal(0);
|
|
|
+ BigDecimal loseJob = new BigDecimal(0);
|
|
|
+ BigDecimal injury = new BigDecimal(0);
|
|
|
+ BigDecimal house = new BigDecimal(0);
|
|
|
+ BigDecimal field1 = new BigDecimal(0);
|
|
|
+ BigDecimal field2 = new BigDecimal(0);
|
|
|
+ BigDecimal field3 = new BigDecimal(0);
|
|
|
+ BigDecimal field4 = new BigDecimal(0);
|
|
|
+ BigDecimal field5 = new BigDecimal(0);
|
|
|
+ BigDecimal field6 = new BigDecimal(0);
|
|
|
+ BigDecimal field7 = new BigDecimal(0);
|
|
|
+ BigDecimal cost = new BigDecimal(0);
|
|
|
+ for (SpecialContractMonthSalary monthSalary : salaryList) {
|
|
|
+ workingTime = workingTime.add(BigDecimal.valueOf(null == monthSalary.getWorkingTime()?0:monthSalary.getWorkingTime()));
|
|
|
+ salary = salary.add(null == monthSalary.getSalary()?new BigDecimal(0):monthSalary.getSalary());
|
|
|
+ bonus = bonus.add(null == monthSalary.getBonus()?new BigDecimal(0):monthSalary.getBonus());
|
|
|
+ allowance= allowance.add(null == monthSalary.getAllowance()?new BigDecimal(0):monthSalary.getAllowance());
|
|
|
+ old = old.add(null == monthSalary.getOld()?new BigDecimal(0):monthSalary.getOld());
|
|
|
+ medical= medical.add(null == monthSalary.getMedical()?new BigDecimal(0):monthSalary.getMedical());
|
|
|
+ loseJob = loseJob.add(null == monthSalary.getLoseJob()?new BigDecimal(0):monthSalary.getLoseJob());
|
|
|
+ injury= injury.add(null == monthSalary.getInjury()?new BigDecimal(0):monthSalary.getInjury());
|
|
|
+ house= house.add(null == monthSalary.getHouse()?new BigDecimal(0):monthSalary.getHouse());
|
|
|
+ field1 = field1.add(null == monthSalary.getField1()?new BigDecimal(0):monthSalary.getField1());
|
|
|
+ field2 = field2.add(null == monthSalary.getField2()?new BigDecimal(0):monthSalary.getField2());
|
|
|
+ field3= field3.add(null == monthSalary.getField3()?new BigDecimal(0):monthSalary.getField3());
|
|
|
+ field4 = field4.add(null == monthSalary.getField4()?new BigDecimal(0):monthSalary.getField4());
|
|
|
+ field5 = field5.add(null == monthSalary.getField5()?new BigDecimal(0):monthSalary.getField5());
|
|
|
+ field6 = field6.add(null == monthSalary.getField6()?new BigDecimal(0):monthSalary.getField6());
|
|
|
+ field7 = field7.add(null == monthSalary.getField7()?new BigDecimal(0):monthSalary.getField7());
|
|
|
+ cost = cost.add(null == monthSalary.getCost()?new BigDecimal(0):monthSalary.getCost());
|
|
|
+ }
|
|
|
+ plate1List.add(workingTime.setScale(2 ,BigDecimal.ROUND_HALF_UP).toPlainString());//workingTime
|
|
|
+ plate1List.add(salary.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());//salary
|
|
|
+ plate1List.add(bonus.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());//bonus
|
|
|
+ plate1List.add(allowance.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());//allowance
|
|
|
+ plate1List.add(old.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());//old
|
|
|
+ plate1List.add(medical.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());//medical
|
|
|
+ plate1List.add(loseJob.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());//loseJob
|
|
|
+ plate1List.add(injury.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());//injury
|
|
|
+ plate1List.add(house.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());//house
|
|
|
+ if (cusColList.size() > 0) {
|
|
|
+ plate1List.add(field1.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 1) {
|
|
|
+ plate1List.add(field2.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 2) {
|
|
|
+ plate1List.add(field3.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 3) {
|
|
|
+ plate1List.add(field4.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 4) {
|
|
|
+ plate1List.add(field5.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 5) {
|
|
|
+ plate1List.add(field6.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 6) {
|
|
|
+ plate1List.add(field7.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
|
|
+ }
|
|
|
+ plate1List.add(cost.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
|
|
+ allList.add(plate1List);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(0 != onlyTotal){
|
|
|
//获取成员
|
|
|
for (Map<String, Object> membMap : projectTimeList) {
|
|
@@ -1449,6 +1566,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1630,6 +1748,247 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
|
+ private List<SpecialContractMonthSalary> transNoProjectUserToMonthSalary(List<Finance> noProjectUser,ProjectSumItem p
|
|
|
+ ,List<User> userList, List<Map> noPUserDataList
|
|
|
+ , List<Department> allDepartments, WxCorpInfo wxCorpInfo, CompanyDingding dingding, List<UserCustom> userCustoms
|
|
|
+ , List<FinanceTblcuscol> cusColList) {
|
|
|
+ List<SpecialContractMonthSalary> resList =new ArrayList<>();
|
|
|
+ for (Finance npu : noProjectUser) {
|
|
|
+ SpecialContractMonthSalary toAddItem = new SpecialContractMonthSalary();
|
|
|
+ toAddItem.setProjectCode(p.projectCode);
|
|
|
+ toAddItem.setProject(p.project);
|
|
|
+ Double workingTime = new Double(0);
|
|
|
+ Finance userFinance = npu;
|
|
|
+ Optional<Map> op = noPUserDataList.stream().filter(map->((Integer)map.get("projectId")).equals(p.projectId) && ((String)map.get("creatorId")).equals(npu.getUserId())).findFirst();
|
|
|
+ if (op.isPresent()) {
|
|
|
+ Map percentMap = op.get();
|
|
|
+ double percent = (double)percentMap.get("percent");
|
|
|
+ if (percent > 0) {
|
|
|
+ //各项收入按比例计算,累加到当前项目上
|
|
|
+ Finance newFinance = Finance.getByPercent(npu, percent);
|
|
|
+
|
|
|
+ BigDecimal cost = newFinance.getTotalCost();
|
|
|
+ BigDecimal salary = newFinance.getMonthCost();
|
|
|
+ BigDecimal bonus = newFinance.getBonus();
|
|
|
+ BigDecimal allowance = newFinance.getAllowance();
|
|
|
+ BigDecimal old = newFinance.getInsuranceOld();
|
|
|
+ BigDecimal medical = newFinance.getInsuranceMedical();
|
|
|
+ BigDecimal loseJob = newFinance.getInsuranceLosejob();
|
|
|
+ BigDecimal injury = newFinance.getInsuranceInjury();
|
|
|
+ BigDecimal house = newFinance.getHouseFund();
|
|
|
+ BigDecimal field1 = newFinance.getCustomField1() == null? new BigDecimal(0):newFinance.getCustomField1();
|
|
|
+ BigDecimal field2 = newFinance.getCustomField2() == null? new BigDecimal(0):newFinance.getCustomField2();
|
|
|
+ BigDecimal field3 = newFinance.getCustomField3() == null? new BigDecimal(0):newFinance.getCustomField3();
|
|
|
+ BigDecimal field4 = newFinance.getCustomField4() == null? new BigDecimal(0):newFinance.getCustomField4();
|
|
|
+ BigDecimal field5 = newFinance.getCustomField5() == null? new BigDecimal(0):newFinance.getCustomField5();
|
|
|
+ BigDecimal field6 = newFinance.getCustomField6() == null? new BigDecimal(0):newFinance.getCustomField6();
|
|
|
+ BigDecimal field7 = newFinance.getCustomField7() == null? new BigDecimal(0):newFinance.getCustomField7();
|
|
|
+ User us = userList.stream().filter(u->u.getId().equals(npu.getUserId())).findFirst().get();
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ toAddItem.setUserName("$userName="+(us.getCorpwxUserid()==null?"":us.getCorpwxUserid())+"$");
|
|
|
+ }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
+ toAddItem.setUserName("$userName="+us.getName()+"$");
|
|
|
+ }else {
|
|
|
+ toAddItem.setUserName(npu.getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //增加部门
|
|
|
+ Optional<Department> first = allDepartments.stream().filter(dp -> dp.getDepartmentId().equals(us.getDepartmentId())).findFirst();
|
|
|
+ if (first.isPresent()) {
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ toAddItem.setDepartmentName("$departmentName="+(first.get().getCorpwxDeptid()==null?"":first.get().getCorpwxDeptid())+"$");
|
|
|
+ }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
+ toAddItem.setDepartmentName("$departmentName="+(first.get().getDdDeptid()==null?"":first.get().getDdDeptid())+"$");
|
|
|
+ }else {
|
|
|
+ toAddItem.setDepartmentName(first.get().getDepartmentName());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ toAddItem.setDepartmentName("");
|
|
|
+ }
|
|
|
+ //自定义字段的显示
|
|
|
+ for (int i = 0; i < userCustoms.size(); i++) {
|
|
|
+ switch (i){
|
|
|
+ case 0:
|
|
|
+ toAddItem.setPlate1(us.getPlate1()==null?"":us.getPlate1());
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ toAddItem.setPlate2(us.getPlate2()==null?"":us.getPlate2());
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ toAddItem.setPlate3(us.getPlate3()==null?"":us.getPlate3());
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ toAddItem.setPlate4(us.getPlate4()==null?"":us.getPlate4());
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ toAddItem.setPlate5(us.getPlate5()==null?"":us.getPlate5());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ toAddItem.setWorkingTime(workingTime);
|
|
|
+ toAddItem.setSalary(salary);
|
|
|
+ toAddItem.setBonus(bonus);
|
|
|
+ toAddItem.setAllowance(allowance);
|
|
|
+ toAddItem.setOld(old);
|
|
|
+ toAddItem.setMedical(medical);
|
|
|
+ toAddItem.setLoseJob(loseJob);
|
|
|
+ toAddItem.setInjury(injury);
|
|
|
+ toAddItem.setHouse(house);
|
|
|
+ //自定义字段
|
|
|
+ if (cusColList.size() > 0) {
|
|
|
+ toAddItem.setField1(field1);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 1) {
|
|
|
+ toAddItem.setField2(field2);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 2) {
|
|
|
+ toAddItem.setField3(field3);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 3) {
|
|
|
+ toAddItem.setField4(field4);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 4) {
|
|
|
+ toAddItem.setField5(field5);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 5) {
|
|
|
+
|
|
|
+ toAddItem.setField6(field6);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 6) {
|
|
|
+ toAddItem.setField7(field7);
|
|
|
+ }
|
|
|
+ toAddItem.setCost(cost);
|
|
|
+ resList.add(toAddItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return resList;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<SpecialContractMonthSalary> transProjectTimeToMonthSalary(
|
|
|
+ List<Map<String, Object>> projectTimeList,HashMap<String,UserWorkTime> userTime
|
|
|
+ ,ProjectSumItem p,List<User> userList,List<Finance> finances
|
|
|
+ ,List<Department> allDepartments
|
|
|
+ ,WxCorpInfo wxCorpInfo,CompanyDingding dingding
|
|
|
+ ,List<UserCustom> userCustoms,List<FinanceTblcuscol> cusColList
|
|
|
+ ) {
|
|
|
+ List<SpecialContractMonthSalary> resList= new ArrayList<>();
|
|
|
+ for (Map<String, Object> membMap : projectTimeList) {
|
|
|
+ SpecialContractMonthSalary toAddItem = new SpecialContractMonthSalary();
|
|
|
+ Integer projectId = ((Long) membMap.get("projectId")).intValue();
|
|
|
+ //修改为按照projectId匹配
|
|
|
+ if (projectId.equals(p.projectId)) {
|
|
|
+ //匹配到项目了
|
|
|
+ toAddItem.setProjectCode(p.projectCode);
|
|
|
+ toAddItem.setProject(p.project);
|
|
|
+ Double workingTime = (Double) membMap.get("workingTime");
|
|
|
+ String creatorId = (String) membMap.get("creatorId");
|
|
|
+ User us = userList.stream().filter(u->u.getId().equals(creatorId)).findFirst().get();
|
|
|
+ Optional<Finance> first = finances.stream().filter(f -> f.getUserId().equals(creatorId)).findFirst();
|
|
|
+ if (!first.isPresent()) {
|
|
|
+ logger.info(MessageUtils.message("report.userNull",us.getName()));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Finance userFinance = first.get();
|
|
|
+
|
|
|
+ BigDecimal cost = userFinance.getTotalCost().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal salary = userFinance.getMonthCost().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal bonus = userFinance.getBonus().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal allowance = userFinance.getAllowance().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal old = userFinance.getInsuranceOld().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal medical = userFinance.getInsuranceMedical().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal loseJob = userFinance.getInsuranceLosejob().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal injury = userFinance.getInsuranceInjury().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal house = userFinance.getHouseFund().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal field1 = userFinance.getCustomField1() == null? new BigDecimal(0):userFinance.getCustomField1().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal field2 = userFinance.getCustomField2() == null? new BigDecimal(0):userFinance.getCustomField2().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal field3 = userFinance.getCustomField3() == null? new BigDecimal(0):userFinance.getCustomField3().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal field4 = userFinance.getCustomField4() == null? new BigDecimal(0):userFinance.getCustomField4().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal field5 = userFinance.getCustomField5() == null? new BigDecimal(0):userFinance.getCustomField5().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal field6 = userFinance.getCustomField6() == null? new BigDecimal(0):userFinance.getCustomField6().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal field7 = userFinance.getCustomField7() == null? new BigDecimal(0):userFinance.getCustomField6().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //增加部门
|
|
|
+ Optional<Department> findDept = allDepartments.stream().filter(dp -> dp.getDepartmentId().equals(us.getDepartmentId())).findFirst();
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ toAddItem.setUserName("$userName="+(us.getCorpwxUserid()==null?"":us.getCorpwxUserid())+"$");
|
|
|
+ if (findDept.isPresent()) {
|
|
|
+ toAddItem.setDepartmentName("$departmentName="+findDept.get().getDepartmentName()+"$");
|
|
|
+ } else {
|
|
|
+ toAddItem.setDepartmentName("");
|
|
|
+ }
|
|
|
+ }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
+ toAddItem.setUserName("$userName="+us.getName()+"$");
|
|
|
+ if (findDept.isPresent()) {
|
|
|
+ toAddItem.setDepartmentName("$departmentName="+findDept.get().getDepartmentName()+"$");
|
|
|
+ } else {
|
|
|
+ toAddItem.setDepartmentName("");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ toAddItem.setUserName(us.getName());
|
|
|
+ if (findDept.isPresent()) {
|
|
|
+ toAddItem.setDepartmentName(findDept.get().getDepartmentName());
|
|
|
+ } else {
|
|
|
+ toAddItem.setDepartmentName("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (int i = 0; i < userCustoms.size(); i++) {
|
|
|
+ switch (i){
|
|
|
+ case 0:
|
|
|
+ toAddItem.setPlate1(us.getPlate1()==null?"":us.getPlate1());
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ toAddItem.setPlate2(us.getPlate2()==null?"":us.getPlate2());
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ toAddItem.setPlate3(us.getPlate3()==null?"":us.getPlate3());
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ toAddItem.setPlate4(us.getPlate4()==null?"":us.getPlate4());
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ toAddItem.setPlate5(us.getPlate5()==null?"":us.getPlate5());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ toAddItem.setWorkingTime(workingTime);
|
|
|
+ toAddItem.setSalary(salary);
|
|
|
+ toAddItem.setBonus(bonus);
|
|
|
+ toAddItem.setAllowance(allowance);
|
|
|
+ toAddItem.setOld(old);
|
|
|
+ toAddItem.setMedical(medical);
|
|
|
+ toAddItem.setLoseJob(loseJob);
|
|
|
+ toAddItem.setInjury(injury);
|
|
|
+ toAddItem.setHouse(house);
|
|
|
+ //自定义字段
|
|
|
+ if (cusColList.size() > 0) {
|
|
|
+ toAddItem.setField1(field1);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 1) {
|
|
|
+ toAddItem.setField2(field2);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 2) {
|
|
|
+ toAddItem.setField3(field3);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 3) {
|
|
|
+ toAddItem.setField4(field4);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 4) {
|
|
|
+ toAddItem.setField5(field5);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 5) {
|
|
|
+
|
|
|
+ toAddItem.setField6(field6);
|
|
|
+ }
|
|
|
+ if (cusColList.size() > 6) {
|
|
|
+ toAddItem.setField7(field7);
|
|
|
+ }
|
|
|
+ toAddItem.setCost(cost);
|
|
|
+ resList.add(toAddItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return resList;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public HttpRespMsg getTimeCost(String yearMonth, Boolean assignNoProUser, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|