|
@@ -155,8 +155,21 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
userTimeList = reportMapper.getUserWorkingTimeByRange(companyId, startStr, endStr);
|
|
userTimeList = reportMapper.getUserWorkingTimeByRange(companyId, startStr, endStr);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //设置财务核算薪资模板配置
|
|
List<FinanceTblcuscol> cusColList = financeTblcuscolMapper.selectList(new QueryWrapper<FinanceTblcuscol>().eq("company_id", companyId));
|
|
List<FinanceTblcuscol> cusColList = financeTblcuscolMapper.selectList(new QueryWrapper<FinanceTblcuscol>().eq("company_id", companyId));
|
|
-
|
|
|
|
|
|
+ FinanceFixedcolname financeConfig = financeFixedcolnameService.getFixed(companyId);
|
|
|
|
+ if (cusColList.size() > 0) {
|
|
|
|
+ financeConfig.setField1(cusColList.get(0).getFieldName());
|
|
|
|
+ financeConfig.setField1Calculate(cusColList.get(0).getNeedCalculate());
|
|
|
|
+ }
|
|
|
|
+ if (cusColList.size() > 1) {
|
|
|
|
+ financeConfig.setField2(cusColList.get(1).getFieldName());
|
|
|
|
+ financeConfig.setField2Calculate(cusColList.get(1).getNeedCalculate());
|
|
|
|
+ }
|
|
|
|
+ if (cusColList.size() > 2) {
|
|
|
|
+ financeConfig.setField3(cusColList.get(2).getFieldName());
|
|
|
|
+ financeConfig.setField3Calculate(cusColList.get(2).getNeedCalculate());
|
|
|
|
+ }
|
|
//由于第一行需要指明列对应的标题
|
|
//由于第一行需要指明列对应的标题
|
|
for (int rowIndex = 0; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
|
|
for (int rowIndex = 0; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
|
|
Row row = sheet.getRow(rowIndex);
|
|
Row row = sheet.getRow(rowIndex);
|
|
@@ -204,7 +217,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
String item = salaryCell.getStringCellValue();
|
|
String item = salaryCell.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setMonthCost(value);
|
|
finance.setMonthCost(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getMonthCostCalculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
|
|
|
|
//按姓名做匹配
|
|
//按姓名做匹配
|
|
@@ -218,49 +231,49 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
String bonusString = bonusCell.getStringCellValue();
|
|
String bonusString = bonusCell.getStringCellValue();
|
|
BigDecimal bonus = bonusString != null ? new BigDecimal(bonusString.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal bonus = bonusString != null ? new BigDecimal(bonusString.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setBonus(bonus);
|
|
finance.setBonus(bonus);
|
|
- total = total.add(bonus);
|
|
|
|
|
|
+ if (financeConfig.getBonusCalculate()==1) total = total.add(bonus);
|
|
}
|
|
}
|
|
if (allowanceCell != null) {
|
|
if (allowanceCell != null) {
|
|
allowanceCell.setCellType(CellType.STRING);
|
|
allowanceCell.setCellType(CellType.STRING);
|
|
String item = allowanceCell.getStringCellValue();
|
|
String item = allowanceCell.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setAllowance(value);
|
|
finance.setAllowance(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getAllowanceCalculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
if (inJobCell != null) {
|
|
if (inJobCell != null) {
|
|
inJobCell.setCellType(CellType.STRING);
|
|
inJobCell.setCellType(CellType.STRING);
|
|
String item = inJobCell.getStringCellValue();
|
|
String item = inJobCell.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setInsuranceLosejob(value);
|
|
finance.setInsuranceLosejob(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getInsuranceLosejobCalculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
if (inMedicalCell != null) {
|
|
if (inMedicalCell != null) {
|
|
inMedicalCell.setCellType(CellType.STRING);
|
|
inMedicalCell.setCellType(CellType.STRING);
|
|
String item = inMedicalCell.getStringCellValue();
|
|
String item = inMedicalCell.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setInsuranceMedical(value);
|
|
finance.setInsuranceMedical(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getInsuranceMedicalCalculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
if (inOldCell != null) {
|
|
if (inOldCell != null) {
|
|
inOldCell.setCellType(CellType.STRING);
|
|
inOldCell.setCellType(CellType.STRING);
|
|
String item = inOldCell.getStringCellValue();
|
|
String item = inOldCell.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setInsuranceOld(value);
|
|
finance.setInsuranceOld(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getInsuranceOldCalculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
if (injuryCell != null) {
|
|
if (injuryCell != null) {
|
|
injuryCell.setCellType(CellType.STRING);
|
|
injuryCell.setCellType(CellType.STRING);
|
|
String item = injuryCell.getStringCellValue();
|
|
String item = injuryCell.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setInsuranceInjury(value);
|
|
finance.setInsuranceInjury(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getInsuranceInjuryCalculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
if (houseFundCell != null) {
|
|
if (houseFundCell != null) {
|
|
houseFundCell.setCellType(CellType.STRING);
|
|
houseFundCell.setCellType(CellType.STRING);
|
|
String item = houseFundCell.getStringCellValue();
|
|
String item = houseFundCell.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setHouseFund(value);
|
|
finance.setHouseFund(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getHouseFundCalculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
|
|
|
|
if (field1 != null) {
|
|
if (field1 != null) {
|
|
@@ -268,21 +281,21 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
|
|
String item = field1.getStringCellValue();
|
|
String item = field1.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setCustomField1(value);
|
|
finance.setCustomField1(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getField1Calculate() != null && financeConfig.getField1Calculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
if (field2 != null) {
|
|
if (field2 != null) {
|
|
field2.setCellType(CellType.STRING);
|
|
field2.setCellType(CellType.STRING);
|
|
String item = field2.getStringCellValue();
|
|
String item = field2.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setCustomField2(value);
|
|
finance.setCustomField2(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getField2Calculate() != null && financeConfig.getField2Calculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
if (field3 != null) {
|
|
if (field3 != null) {
|
|
field3.setCellType(CellType.STRING);
|
|
field3.setCellType(CellType.STRING);
|
|
String item = field3.getStringCellValue();
|
|
String item = field3.getStringCellValue();
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
|
|
finance.setCustomField3(value);
|
|
finance.setCustomField3(value);
|
|
- total = total.add(value);
|
|
|
|
|
|
+ if (financeConfig.getField3Calculate() != null && financeConfig.getField3Calculate()==1) total = total.add(value);
|
|
}
|
|
}
|
|
finance.setTotalCost(total);
|
|
finance.setTotalCost(total);
|
|
|
|
|