|
@@ -11,8 +11,15 @@ import cn.ezhizao.project.business.company.domain.BizCompany;
|
|
|
import cn.ezhizao.project.business.company.service.IBizCompanyService;
|
|
|
import cn.ezhizao.project.business.deduction.domain.BizDeduction;
|
|
|
import cn.ezhizao.project.business.deduction.service.IBizDeductionService;
|
|
|
+import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetail;
|
|
|
+import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetailEmployee;
|
|
|
+import cn.ezhizao.project.business.housingFund.domain.vo.EmployeeExcel;
|
|
|
+import cn.ezhizao.project.business.housingFund.domain.vo.HousingFundEmployeeVo;
|
|
|
import cn.ezhizao.project.business.reportTaxIsZero.domain.BizFinancialReportTaxDetail;
|
|
|
import cn.ezhizao.project.business.socialSecurity.domain.*;
|
|
|
+import cn.ezhizao.project.business.socialSecurity.domain.vo.SocialSecurityDetailVo;
|
|
|
+import cn.ezhizao.project.business.socialSecurity.domain.vo.SocialSecurityEmployeeExcel;
|
|
|
+import cn.ezhizao.project.business.socialSecurity.domain.vo.SocialSecurityEmployeeVo;
|
|
|
import cn.ezhizao.project.business.socialSecurity.service.IBizSocialSecurityConfirmDetailEmployeeService;
|
|
|
import cn.ezhizao.project.business.socialSecurity.service.IBizSocialSecurityConfirmDetailService;
|
|
|
import cn.ezhizao.project.business.socialSecurity.service.IBizSocialSecurityDeclareDetailService;
|
|
@@ -23,18 +30,29 @@ import cn.ezhizao.project.system.domain.SysFileStorage;
|
|
|
import cn.ezhizao.project.system.domain.SysUser;
|
|
|
import cn.ezhizao.project.system.mapper.SysUserMapper;
|
|
|
import cn.ezhizao.project.system.service.ISysFileStorageService;
|
|
|
+import com.alibaba.excel.EasyExcel;
|
|
|
+import com.alibaba.excel.ExcelWriter;
|
|
|
+import com.alibaba.excel.write.metadata.WriteSheet;
|
|
|
+import com.alibaba.excel.write.metadata.fill.FillConfig;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.catalina.security.SecurityUtil;
|
|
|
+import org.springframework.core.io.ClassPathResource;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.BufferedOutputStream;
|
|
|
+import java.io.InputStream;
|
|
|
+import java.io.OutputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -127,38 +145,177 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/exportDetail")
|
|
|
+ public void exportDetail(HttpServletResponse response, SocialSecurityEmployeeVo vo) throws Exception {
|
|
|
+ OutputStream out = null;
|
|
|
+ BufferedOutputStream bos = null;
|
|
|
+ List<BizSocialSecurityConfirmDetailEmployee> employees = new ArrayList<>();
|
|
|
+ List<SocialSecurityEmployeeExcel> employeeExcels = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ClassPathResource classPathResource = new ClassPathResource("importTemplate/社保明细模板 .xlsx");
|
|
|
+ InputStream inputStream = classPathResource.getInputStream();
|
|
|
+ response.setContentType("application/vnd.ms-excel");
|
|
|
+ response.setCharacterEncoding("utf-8");
|
|
|
+ String fileName = URLEncoder.encode("社保模板.xls", "utf-8");
|
|
|
+ response.setHeader("Content-disposition", "attachment; filename=" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1"));
|
|
|
+
|
|
|
+ out = response.getOutputStream();
|
|
|
+ bos = new BufferedOutputStream(out);
|
|
|
+
|
|
|
+ //读取Excel
|
|
|
+ ExcelWriter excelWriter = EasyExcel.write(bos).withTemplate(inputStream).build();
|
|
|
+ WriteSheet writeSheet = EasyExcel.writerSheet().build();
|
|
|
+
|
|
|
+ FillConfig fillConfig = FillConfig.builder()
|
|
|
+ // 开启填充换行
|
|
|
+ .forceNewRow(true)
|
|
|
+ .build();
|
|
|
+ // 直接写入Excel数据
|
|
|
+ List<SocialSecurityEmployeeExcel> list = getList(vo, employees, employeeExcels);
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ BizCompany company = companyService.getById(vo.getCompanyId());
|
|
|
+ String titleName = vo.getYear() + "年" + vo.getMonth() + "月" + company.getName() + "社保明细";
|
|
|
+ AtomicReference<BigDecimal>[] totals = new AtomicReference[17];
|
|
|
+ // 初始化数组
|
|
|
+ for (int i = 0; i < totals.length; i++) {
|
|
|
+ totals[i] = new AtomicReference<>(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ // 处理列表并更新每个 AtomicReference
|
|
|
+ list.forEach(item -> {
|
|
|
+ totals[0].updateAndGet(v -> v.add(item.getBasePayment()));
|
|
|
+ totals[1].updateAndGet(v -> v.add(item.getMmBasePayment()));
|
|
|
+ totals[2].updateAndGet(v -> v.add(item.getHeatingPayment()));
|
|
|
+ totals[3].updateAndGet(v -> v.add(item.getCompanyBirth()));
|
|
|
+ totals[4].updateAndGet(v -> v.add(item.getCompanyLargeMedical()));
|
|
|
+ totals[5].updateAndGet(v -> v.add(item.getCompanyMedical()));
|
|
|
+ totals[6].updateAndGet(v -> v.add(item.getCompanyElderly()));
|
|
|
+ totals[7].updateAndGet(v -> v.add(item.getCompanyUnemployment()));
|
|
|
+ totals[8].updateAndGet(v -> v.add(item.getCompanyInjury()));
|
|
|
+ totals[9].updateAndGet(v -> v.add(item.getHeatingPayment()));
|
|
|
+ totals[10].updateAndGet(v -> v.add(item.getCompanyCount()));
|
|
|
+ totals[11].updateAndGet(v -> v.add(item.getOneSelfLargeMedical()));
|
|
|
+ totals[12].updateAndGet(v -> v.add(item.getOneSelfElderly()));
|
|
|
+ totals[13].updateAndGet(v -> v.add(item.getOneSelfUnemployment()));
|
|
|
+ totals[14].updateAndGet(v -> v.add(item.getOneSelfEMedical()));
|
|
|
+ totals[15].updateAndGet(v -> v.add(item.getOneSelfCount()));
|
|
|
+ totals[16].updateAndGet(v -> v.add(item.getTotalAmount()));
|
|
|
+ });
|
|
|
+ // 将结果放入 map 中
|
|
|
+ map.put("titleName", titleName);
|
|
|
+ for (int i = 0; i < totals.length; i++) {
|
|
|
+ map.put("total" + (i + 1), totals[i].get());
|
|
|
+ }
|
|
|
+ excelWriter.fill(list, fillConfig, writeSheet);
|
|
|
+ excelWriter.fill(map, fillConfig, writeSheet);
|
|
|
+ excelWriter.finish();
|
|
|
+ bos.flush();
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ bos.close();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<SocialSecurityEmployeeExcel> getList(SocialSecurityEmployeeVo vo, List<BizSocialSecurityConfirmDetailEmployee> employees, List<SocialSecurityEmployeeExcel> employeeExcels) {
|
|
|
+ BizSocialSecurityConfirmDetail detail = socialSecurityConfirmDetailService
|
|
|
+ .query().eq("company_id", vo.getCompanyId())
|
|
|
+ .eq("year", vo.getYear())
|
|
|
+ .eq("month", vo.getMonth())
|
|
|
+ .eq("deleted", 0).one();
|
|
|
+
|
|
|
+ if (detail != null) {
|
|
|
+ employees = socialSecurityConfirmDetailEmployeeService.query()
|
|
|
+ .eq("social_security_confirm_detail_id", detail.getId())
|
|
|
+ .eq("deleted", 0)
|
|
|
+ .ne("change_status", 2)
|
|
|
+ .list();
|
|
|
+ }
|
|
|
+ //0.05%
|
|
|
+ BigDecimal zeroPointZeroFiveDecimal = new BigDecimal("0.0005");
|
|
|
+ //0.2%
|
|
|
+ BigDecimal ZeroPointTwoDecimal = new BigDecimal("0.002");
|
|
|
+ //0.5%
|
|
|
+ BigDecimal halfOneDecimal = new BigDecimal("0.005");
|
|
|
+ //1%
|
|
|
+ BigDecimal onePercent = new BigDecimal("0.01");
|
|
|
+ //2%
|
|
|
+ BigDecimal twoPercent = new BigDecimal("0.02");
|
|
|
+ //8%
|
|
|
+ BigDecimal eightDecimal = new BigDecimal("0.08");
|
|
|
+ //16%
|
|
|
+ BigDecimal sixteenPercent = new BigDecimal("0.16");
|
|
|
+ if (!CollectionUtils.isEmpty(employees)) {
|
|
|
+ for (int i = 0; i < employees.size(); i++) {
|
|
|
+ BizSocialSecurityConfirmDetailEmployee employee = employees.get(i);
|
|
|
+ SocialSecurityEmployeeExcel item = new SocialSecurityEmployeeExcel();
|
|
|
+ item.setIndex(i + 1);
|
|
|
+ item.setName(employee.getEmployeeName());
|
|
|
+ item.setBasePayment(employee.getCardinalNumber());
|
|
|
+ item.setMmBasePayment(employee.getMedicalCardinalNumber());
|
|
|
+ item.setHeatingPayment(employee.getHeatingFee());
|
|
|
+ item.setCompanyBirth(this.multiplication(employee.getMedicalCardinalNumber(), onePercent));
|
|
|
+ item.setCompanyLargeMedical((this.multiplication(employee.getMedicalCardinalNumber(), ZeroPointTwoDecimal)));
|
|
|
+
|
|
|
+ item.setCompanyMedical(this.multiplication(employee.getMedicalCardinalNumber(), eightDecimal));
|
|
|
+ item.setCompanyElderly(this.multiplication(employee.getCardinalNumber(), sixteenPercent));
|
|
|
+ item.setCompanyUnemployment(this.multiplication(employee.getCardinalNumber(), halfOneDecimal));
|
|
|
+ if (vo.getRadio() != null) {
|
|
|
+ item.setCompanyInjury(this.multiplication(employee.getCardinalNumber(), vo.getRadio().divide(BigDecimal.valueOf(100))));
|
|
|
+ } else {
|
|
|
+ item.setCompanyInjury(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ item.setCompanyHeat(this.multiplication(employee.getHeatingFee(), onePercent));
|
|
|
+ item.setCompanyCount(
|
|
|
+ item.getCompanyBirth().add(item.getCompanyLargeMedical()).add(item.getCompanyMedical())
|
|
|
+ .add(item.getCompanyElderly()).add(item.getCompanyUnemployment()).add(item.getCompanyInjury()).add(item.getCompanyHeat())
|
|
|
+ );
|
|
|
+ item.setOneSelfLargeMedical(this.multiplication(employee.getMedicalCardinalNumber(), zeroPointZeroFiveDecimal));
|
|
|
+ item.setOneSelfElderly(this.multiplication(employee.getCardinalNumber(), eightDecimal));
|
|
|
+ item.setOneSelfUnemployment(this.multiplication(employee.getCardinalNumber(), halfOneDecimal));
|
|
|
+ item.setOneSelfEMedical(this.multiplication(employee.getMedicalCardinalNumber(), twoPercent));
|
|
|
+ item.setOneSelfCount(
|
|
|
+ item.getOneSelfLargeMedical().add(item.getOneSelfElderly()).add(item.getOneSelfUnemployment()).add(item.getOneSelfEMedical())
|
|
|
+ );
|
|
|
+ item.setTotalAmount(item.getCompanyCount().add(item.getOneSelfCount()));
|
|
|
+ employeeExcels.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return employeeExcels;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导出列表
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('business:socialSecurityConfirm:export')")
|
|
|
@Log(title = "个税详情", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, BizSocialSecurityDeclare conditions) throws NoSuchFieldException, IllegalAccessException
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, BizSocialSecurityDeclare conditions) throws NoSuchFieldException, IllegalAccessException {
|
|
|
setTenantId(conditions);
|
|
|
startOrderBy();
|
|
|
List<BizSocialSecurityDeclare> list = socialSecurityDeclareService.getListByBean(conditions);
|
|
|
- for (BizSocialSecurityDeclare l: list){
|
|
|
- l.setCurrentPeriod(conditions.getYear()+"-"+conditions.getMonth());
|
|
|
+ for (BizSocialSecurityDeclare l : list) {
|
|
|
+ l.setCurrentPeriod(conditions.getYear() + "-" + conditions.getMonth());
|
|
|
BizSocialSecurityDeclareDetail detail = new BizSocialSecurityDeclareDetail();
|
|
|
detail.setSocialSecurityDeclareId(l.getId());
|
|
|
detail.setYear(conditions.getYear());
|
|
|
detail.setMonth(conditions.getMonth());
|
|
|
List<BizSocialSecurityDeclareDetail> details = socialSecurityDeclareDetailService.getListByBean(detail);
|
|
|
- if(details.size() == 0){
|
|
|
+ if (details.size() == 0) {
|
|
|
l.setStatusText("未开始");
|
|
|
l.setMakeOut("未填写");
|
|
|
l.setServiceName("");
|
|
|
- }else{
|
|
|
- detail=details.get(0);
|
|
|
+ } else {
|
|
|
+ detail = details.get(0);
|
|
|
List<BizWorkOrderRecord> records = bizWorkOrderRecordService.query().eq("work_order_id", l.getWorkOrderId()).eq("year", conditions.getYear()).eq("month", conditions.getMonth()).eq("from_id", 0).list();
|
|
|
- if(records.size()>0){
|
|
|
+ if (records.size() > 0) {
|
|
|
SysUser sysUser = sysUserMapper.selectUserById(records.get(0).getRecorderId());
|
|
|
- l.setServiceName(sysUser==null?"":sysUser.getNickName());
|
|
|
- }else{
|
|
|
+ l.setServiceName(sysUser == null ? "" : sysUser.getNickName());
|
|
|
+ } else {
|
|
|
l.setServiceName("");
|
|
|
}
|
|
|
- switch (detail.getStatus()){
|
|
|
+ switch (detail.getStatus()) {
|
|
|
case 0:
|
|
|
l.setStatusText("未开始");
|
|
|
l.setMakeOut("未填写");
|
|
@@ -201,7 +358,6 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "整体保存", notes = "整体保存")
|
|
|
@PostMapping("/saveFile")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -221,12 +377,12 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
|
String formattedMonth = String.format("%02d", nowMonth);
|
|
|
String year = condition.getYear();
|
|
|
String month = condition.getMonth();
|
|
|
- String s1= year+month;
|
|
|
- String s2 = nowYear+ formattedMonth;
|
|
|
+ String s1 = year + month;
|
|
|
+ String s2 = nowYear + formattedMonth;
|
|
|
// if(s1.equals(s2) && socialSecurityConfirmDetails .isEmpty()){
|
|
|
// return success(new BizSocialSecurityDeclareDetail());
|
|
|
// }
|
|
|
- if(!s1.equals(s2) && socialSecurityConfirmDetails.isEmpty()){
|
|
|
+ if (!s1.equals(s2) && socialSecurityConfirmDetails.isEmpty()) {
|
|
|
return error("当前月未找到数据");
|
|
|
}
|
|
|
if (socialSecurityConfirmDetails.isEmpty()) {
|
|
@@ -234,12 +390,13 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
|
// 先获取之前的一个月是否已填报,然后获取填报后的工资人员信息
|
|
|
BizSocialSecurityDeclareDetail detail = socialSecurityDeclareDetailService.query().eq("social_security_declare_id", condition.getSocialSecurityDeclareId()).lt("concat(year,month)", condition.getYear() + condition.getMonth()).orderByDesc("concat(year, month)").last("limit 1").one();
|
|
|
if (detail != null) {
|
|
|
- List<SysFileStorage> files = fileStorageService.query().eq("master_table_name", "biz_social_security_declare_detail").eq("master_id", detail.getId()).eq("type","evidenceFile").list();
|
|
|
+ List<SysFileStorage> files = fileStorageService.query().eq("master_table_name", "biz_social_security_declare_detail").eq("master_id", detail.getId()).eq("type", "evidenceFile").list();
|
|
|
files.forEach(l -> l.setId(null));
|
|
|
condition.setEvidenceFiles(files);
|
|
|
- List<SysFileStorage> reportFiles = fileStorageService.query().eq("master_table_name", "biz_social_security_declare_detail").eq("master_id", detail.getId()).eq("type","reportFile").list();
|
|
|
+ List<SysFileStorage> reportFiles = fileStorageService.query().eq("master_table_name", "biz_social_security_declare_detail").eq("master_id", detail.getId()).eq("type", "reportFile").list();
|
|
|
reportFiles.forEach(l -> l.setId(null));
|
|
|
condition.setReportFiles(reportFiles);
|
|
|
+ condition.setInjuryRadio(detail.getInjuryRadio());
|
|
|
} else {
|
|
|
condition.setEvidenceFiles(new ArrayList<>());
|
|
|
condition.setReportFiles(new ArrayList<>());
|
|
@@ -283,7 +440,7 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
|
delCondition.setMasterId(detail.getId());
|
|
|
delCondition.setMasterTableName("biz_social_security_declare_detail");
|
|
|
fileStorageService.physicalDelete(delCondition);
|
|
|
- bool = bool && (reportFiles.isEmpty() || fileStorageService.saveOrUpdateBatch(reportFiles))&& (fileStorages.isEmpty() || fileStorageService.saveOrUpdateBatch(fileStorages)) && addRecord(detail.getSocialSecurityDeclareId(), detail.getYear(), detail.getMonth(), SecurityUtils.getUserId(), detail.getAmount().compareTo(BigDecimal.ZERO) > 0 ? "社保申报保存" : "社保申报完成", detail.getAmount().compareTo(BigDecimal.ZERO) > 0 ? 1 : 3);
|
|
|
+ bool = bool && (reportFiles.isEmpty() || fileStorageService.saveOrUpdateBatch(reportFiles)) && (fileStorages.isEmpty() || fileStorageService.saveOrUpdateBatch(fileStorages)) && addRecord(detail.getSocialSecurityDeclareId(), detail.getYear(), detail.getMonth(), SecurityUtils.getUserId(), detail.getAmount().compareTo(BigDecimal.ZERO) > 0 ? "社保申报保存" : "社保申报完成", detail.getAmount().compareTo(BigDecimal.ZERO) > 0 ? 1 : 3);
|
|
|
return bool ? success(detail) : error();
|
|
|
}
|
|
|
|
|
@@ -349,6 +506,7 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
|
return success(new ArrayList<>());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@PreAuthorize("@ss.hasPermi('business:socialSecurityDeclare:query')")
|
|
|
@ApiOperation("获取社保人员信息")
|
|
|
@PostMapping("/getMembersNoDelete")
|
|
@@ -365,7 +523,78 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
|
return success(new ArrayList<>());
|
|
|
}
|
|
|
}
|
|
|
- @PreAuthorize("@ss.hasPermi('business:socialSecurityDeclare:edit')")
|
|
|
+
|
|
|
+ @ApiOperation("获取社保人员信息")
|
|
|
+ @PostMapping("/getTableDetail")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult getTableDetail(@RequestBody BizSocialSecurityConfirmDetail detail) {
|
|
|
+ ArrayList<SocialSecurityDetailVo> vos = new ArrayList<>();
|
|
|
+ BizSocialSecurityConfirmDetail financialSocialSecurityConfirmDetail = socialSecurityConfirmDetailService.query().eq("company_id", detail.getCompanyId()).eq("year", detail.getYear()).eq("month", detail.getMonth()).one();
|
|
|
+ if (financialSocialSecurityConfirmDetail != null) {
|
|
|
+ List<BizSocialSecurityConfirmDetailEmployee> employees = socialSecurityConfirmDetailEmployeeService.query()
|
|
|
+ .eq("social_security_confirm_detail_id", financialSocialSecurityConfirmDetail.getId())
|
|
|
+ .ne("change_status", 2)
|
|
|
+ .list();
|
|
|
+ //0.05%
|
|
|
+ BigDecimal zeroPointZeroFiveDecimal = new BigDecimal("0.0005");
|
|
|
+ //0.2%
|
|
|
+ BigDecimal ZeroPointTwoDecimal = new BigDecimal("0.002");
|
|
|
+ //0.5%
|
|
|
+ BigDecimal halfOneDecimal = new BigDecimal("0.005");
|
|
|
+ //1%
|
|
|
+ BigDecimal onePercent = new BigDecimal("0.01");
|
|
|
+ //2%
|
|
|
+ BigDecimal twoPercent = new BigDecimal("0.02");
|
|
|
+ //8%
|
|
|
+ BigDecimal eightDecimal = new BigDecimal("0.08");
|
|
|
+ //16%
|
|
|
+ BigDecimal sixteenPercent = new BigDecimal("0.16");
|
|
|
+ for (BizSocialSecurityConfirmDetailEmployee employee : employees) {
|
|
|
+ SocialSecurityDetailVo vo = new SocialSecurityDetailVo();
|
|
|
+ vo.setName(employee.getEmployeeName());
|
|
|
+ vo.setBasePayment(employee.getCardinalNumber());
|
|
|
+ //医疗、生育缴费基数
|
|
|
+ vo.setMmBasePayment(employee.getMedicalCardinalNumber());
|
|
|
+ vo.setHeatingPayment(employee.getHeatingFee());
|
|
|
+
|
|
|
+ vo.setCompanyBirth(this.multiplication(employee.getMedicalCardinalNumber(), onePercent));
|
|
|
+ vo.setCompanyLargeMedical(this.multiplication(employee.getMedicalCardinalNumber(), ZeroPointTwoDecimal));
|
|
|
+ vo.setCompanyMedical(this.multiplication(employee.getMedicalCardinalNumber(), eightDecimal));
|
|
|
+ vo.setCompanyElderly(this.multiplication(employee.getCardinalNumber(), sixteenPercent));
|
|
|
+ vo.setCompanyUnemployment(this.multiplication(employee.getCardinalNumber(), halfOneDecimal));
|
|
|
+ if (detail.getInjuryRadio() != null) {
|
|
|
+ vo.setCompanyInjury(this.multiplication(employee.getCardinalNumber(), detail.getInjuryRadio().divide(BigDecimal.valueOf(100))));
|
|
|
+ } else {
|
|
|
+ vo.setCompanyInjury(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ vo.setCompanyHeat(this.multiplication(employee.getHeatingFee(), onePercent));
|
|
|
+ vo.setCompanyCount(
|
|
|
+ vo.getCompanyBirth().add(vo.getCompanyLargeMedical()).add(vo.getCompanyMedical())
|
|
|
+ .add(vo.getCompanyElderly()).add(vo.getCompanyUnemployment()).add(vo.getCompanyInjury()).add(vo.getCompanyHeat())
|
|
|
+ );
|
|
|
+ vo.setOneSelfLargeMedical(this.multiplication(employee.getMedicalCardinalNumber(), zeroPointZeroFiveDecimal));
|
|
|
+ vo.setOneSelfElderly(this.multiplication(employee.getCardinalNumber(), eightDecimal));
|
|
|
+ vo.setOneSelfUnemployment(this.multiplication(employee.getCardinalNumber(), halfOneDecimal));
|
|
|
+ vo.setOneSelfEMedical(this.multiplication(employee.getMedicalCardinalNumber(), twoPercent));
|
|
|
+ vo.setOneSelfCount(
|
|
|
+ vo.getOneSelfLargeMedical().add(vo.getOneSelfElderly()).add(vo.getOneSelfUnemployment()).add(vo.getOneSelfEMedical())
|
|
|
+ );
|
|
|
+ vo.setTotalAmount(vo.getCompanyCount().add(vo.getOneSelfCount()));
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+ return success(vos);
|
|
|
+ } else {
|
|
|
+ return success(new ArrayList<>());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public BigDecimal multiplication(BigDecimal a, BigDecimal b) {
|
|
|
+
|
|
|
+ return a.multiply(b).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:socialSecurityDeclare:return')")
|
|
|
@ApiOperation("退回")
|
|
|
@PostMapping("/turnBackDetail")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -378,7 +607,7 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
|
return error("该社保记录已扣款");
|
|
|
}
|
|
|
deductionService.removeBatchByIds(deductions.stream().map(BizDeduction::getId).collect(Collectors.toList()));
|
|
|
- return socialSecurityDeclareDetailService.updateById(detail) && addRecord(detail.getSocialSecurityDeclareId(), detail.getYear(), detail.getMonth(), SecurityUtils.getUserId(), "社保申报退回", 1)? success() : error();
|
|
|
+ return socialSecurityDeclareDetailService.updateById(detail) && addRecord(detail.getSocialSecurityDeclareId(), detail.getYear(), detail.getMonth(), SecurityUtils.getUserId(), "社保申报退回", 1) ? success() : error();
|
|
|
}
|
|
|
|
|
|
|