ly 1 рік тому
батько
коміт
ff32c9b14c
21 змінених файлів з 563 додано та 52 видалено
  1. 31 6
      pom.xml
  2. 1 1
      src/main/java/cn/ezhizao/project/business/housingFund/controller/BizHousingFundConfirmController.java
  3. 126 18
      src/main/java/cn/ezhizao/project/business/housingFund/controller/BizHousingFundDeclareController.java
  4. 6 0
      src/main/java/cn/ezhizao/project/business/housingFund/domain/BizHousingFundConfirmDetailEmployee.java
  5. 16 0
      src/main/java/cn/ezhizao/project/business/housingFund/domain/vo/EmployeeExcel.java
  6. 15 0
      src/main/java/cn/ezhizao/project/business/housingFund/domain/vo/HousingFundEmployeeVo.java
  7. 1 1
      src/main/java/cn/ezhizao/project/business/keepAccounts/controller/BizFinancialKeepAccountController.java
  8. 1 1
      src/main/java/cn/ezhizao/project/business/receiveTicket/controller/BizFinancialReceiveTicketController.java
  9. 1 1
      src/main/java/cn/ezhizao/project/business/salary/controller/BizFinancialSalaryController.java
  10. 1 1
      src/main/java/cn/ezhizao/project/business/salary/controller/BizFinancialSalaryZeroController.java
  11. 4 2
      src/main/java/cn/ezhizao/project/business/socialSecurity/controller/SocialSecurityConfirmController.java
  12. 249 20
      src/main/java/cn/ezhizao/project/business/socialSecurity/controller/SocialSecurityDeclareController.java
  13. 3 0
      src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityConfirmDetail.java
  14. 3 0
      src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityDeclareDetail.java
  15. 41 0
      src/main/java/cn/ezhizao/project/business/socialSecurity/domain/vo/SocialSecurityDetailVo.java
  16. 40 0
      src/main/java/cn/ezhizao/project/business/socialSecurity/domain/vo/SocialSecurityEmployeeExcel.java
  17. 18 0
      src/main/java/cn/ezhizao/project/business/socialSecurity/domain/vo/SocialSecurityEmployeeVo.java
  18. 3 0
      src/main/java/cn/ezhizao/project/business/workOrder/domain/BizWorkOrder.java
  19. BIN
      src/main/resources/importTemplate/公积金模板.xlsx
  20. BIN
      src/main/resources/importTemplate/社保明细模板 .xlsx
  21. 3 1
      src/main/resources/mybatis/business/BizWorkOrderMapper.xml

+ 31 - 6
pom.xml

@@ -16,7 +16,7 @@
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
         <version>2.6.8</version>
-        <relativePath />
+        <relativePath/>
     </parent>
 
     <properties>
@@ -149,7 +149,32 @@
             <artifactId>core</artifactId>
             <version>3.5.1</version>
         </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>3.0.5</version>
+<!--            <exclusions>-->
+<!--                <exclusion>-->
+<!--                    <groupId>javax.servlet</groupId>-->
+<!--                    <artifactId>servlet-api</artifactId>-->
+<!--                </exclusion>-->
+<!--                <exclusion>-->
+<!--                    <groupId>org.apache.poi</groupId>-->
+<!--                    <artifactId>poi</artifactId>-->
+<!--                </exclusion>-->
+<!--                <exclusion>-->
+<!--                    <groupId>org.apache.poi</groupId>-->
+<!--                    <artifactId>poi-ooxml</artifactId>-->
+<!--                </exclusion>-->
+<!--                <exclusion>-->
+<!--                    <groupId>org.apache.poi</groupId>-->
+<!--                    <artifactId>poi-ooxml-schemas</artifactId>-->
+<!--                </exclusion>-->
+
+<!--            </exclusions>-->
+
 
+        </dependency>
         <!-- 分布式锁 -->
         <dependency>
             <groupId>org.redisson</groupId>
@@ -170,11 +195,11 @@
         </dependency>
          -->
 
-<!--        <dependency>-->
-<!--            <groupId>cn.hutool</groupId>-->
-<!--            <artifactId>hutool-all</artifactId>-->
-<!--            <version>${hutool.version}</version>-->
-<!--        </dependency>-->
+        <!--        <dependency>-->
+        <!--            <groupId>cn.hutool</groupId>-->
+        <!--            <artifactId>hutool-all</artifactId>-->
+        <!--            <version>${hutool.version}</version>-->
+        <!--        </dependency>-->
 
         <!-- mybaits-plus  -->
         <dependency>

+ 1 - 1
src/main/java/cn/ezhizao/project/business/housingFund/controller/BizHousingFundConfirmController.java

@@ -321,7 +321,7 @@ public class BizHousingFundConfirmController extends BaseController {
         return toAjax(bool);
     }
 
-    @PreAuthorize("@ss.hasPermi('business:housingFundConfirm:verify')")
+    @PreAuthorize("@ss.hasPermi('business:housingFundConfirm:return')")
     @PostMapping("/turnBackDetail")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult turnBackDetail(@RequestBody BizHousingFundConfirmDetail detail) {

+ 126 - 18
src/main/java/cn/ezhizao/project/business/housingFund/controller/BizHousingFundDeclareController.java

@@ -15,29 +15,41 @@ import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetai
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetailEmployee;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundDeclare;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundDeclareDetail;
+import cn.ezhizao.project.business.housingFund.domain.vo.EmployeeExcel;
+import cn.ezhizao.project.business.housingFund.domain.vo.HousingFundEmployeeVo;
 import cn.ezhizao.project.business.housingFund.service.IBizHousingFundConfirmDetailEmployeeService;
 import cn.ezhizao.project.business.housingFund.service.IBizHousingFundConfirmDetailService;
 import cn.ezhizao.project.business.housingFund.service.IBizHousingFundDeclareDetailService;
 import cn.ezhizao.project.business.housingFund.service.IBizHousingFundDeclareService;
-import cn.ezhizao.project.business.socialSecurity.domain.BizSocialSecurityDeclare;
-import cn.ezhizao.project.business.socialSecurity.domain.BizSocialSecurityDeclareDetail;
 import cn.ezhizao.project.business.workOrder.domain.BizWorkOrderRecord;
 import cn.ezhizao.project.business.workOrder.service.IBizWorkOrderRecordService;
 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.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.ResourceLoader;
 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;
 
 
@@ -67,6 +79,8 @@ public class BizHousingFundDeclareController extends BaseController {
     IBizDeductionService deductionService;
     @Resource
     IBizWorkOrderRecordService bizWorkOrderRecordService;
+    @Resource
+    ResourceLoader resourceLoader;
 
     @ApiOperation(value = "根据id查询", notes = "根据id查询")
     @GetMapping("/getById/{id}")
@@ -82,6 +96,93 @@ public class BizHousingFundDeclareController extends BaseController {
         return (housingFundDeclare.getId() == null ? housingFundDeclareService.save(housingFundDeclare) : housingFundDeclareService.updateById(housingFundDeclare)) ? success() : error();
     }
 
+    @PostMapping("/exportDetail")
+    public void exportDetail(HttpServletResponse response, HousingFundEmployeeVo vo) throws Exception {
+        OutputStream out = null;
+        BufferedOutputStream bos = null;
+        List<BizHousingFundConfirmDetailEmployee> employees = new ArrayList<>();
+        List<EmployeeExcel> 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<EmployeeExcel> 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> totat1 = new AtomicReference<>(BigDecimal.ZERO);
+            AtomicReference<BigDecimal> totat2 = new AtomicReference<>(BigDecimal.ZERO);
+            AtomicReference<BigDecimal> totat3 = new AtomicReference<>(BigDecimal.ZERO);
+            list.forEach(item -> {
+                totat1.updateAndGet(v -> v .add(item.getCompanyAmount()));
+                totat2.updateAndGet(v -> v .add(item.getOneSelfAmount()));
+                totat3.updateAndGet(v -> v .add(item.getTotalAmount()));
+            });
+            map.put("titleName", titleName);
+            map.put("totat1", totat1.get());
+            map.put("totat2", totat2.get());
+            map.put("totat3", totat3.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<EmployeeExcel> getList(HousingFundEmployeeVo vo, List<BizHousingFundConfirmDetailEmployee> employees, List<EmployeeExcel> employeeExcels) {
+        BizHousingFundConfirmDetail housingFundConfirmDetail = housingFundConfirmDetailService
+                .query().eq("company_id", vo.getCompanyId())
+                .eq("year", vo.getYear())
+                .eq("month", vo.getMonth())
+                .eq("deleted", 0).one();
+        if (housingFundConfirmDetail != null) {
+            employees = housingFundConfirmDetailEmployeeService.query()
+                    .eq("housing_fund_confirm_detail_id", housingFundConfirmDetail.getId())
+                    .eq("deleted", 0)
+                    .ne("change_status", 2)
+                    .list();
+        }
+        if (!CollectionUtils.isEmpty(employees)) {
+            for (int i = 0; i < employees.size(); i++) {
+                BizHousingFundConfirmDetailEmployee employee = employees.get(i);
+                //去掉百分比
+                BigDecimal ratio = employee.getRatio().divide(BigDecimal.valueOf(100)).setScale(2);
+                EmployeeExcel employeeExcel = new EmployeeExcel();
+                employeeExcel.setIndex(i + 1);
+                employeeExcel.setEmployeeName(employee.getEmployeeName());
+                employeeExcel.setCardinalNumber(employee.getCardinalNumber());
+                employeeExcel.setRatio(ratio);
+                employeeExcel.setCompanyAmount(employee.getCardinalNumber().multiply(ratio).setScale(2));
+                employeeExcel.setOneSelfAmount(employee.getCardinalNumber().multiply(ratio).setScale(2));
+                employeeExcel.setTotalAmount(employeeExcel.getCompanyAmount().add(employeeExcel.getOneSelfAmount()));
+                employeeExcels.add(employeeExcel);
+            }
+        }
+        return employeeExcels;
+    }
+
     @PostMapping("/saveBatch")
     @ApiOperation(value = "批量保存", notes = "批量保存")
     @ResponseBody
@@ -108,7 +209,7 @@ public class BizHousingFundDeclareController extends BaseController {
     @GetMapping("/list")
     @ResponseBody
     public TableDataInfo getList(BizHousingFundDeclare conditions) throws NoSuchFieldException, IllegalAccessException {
-       setTenantId(conditions);
+        setTenantId(conditions);
         startPage();
         startOrderBy();
         List<BizHousingFundDeclare> list = housingFundDeclareService.getListByBean(conditions);
@@ -170,9 +271,9 @@ public class BizHousingFundDeclareController extends BaseController {
         String formattedMonth = String.format("%02d", nowMonth);
         String year = condition.getYear();
         String month = condition.getMonth();
-        String s1= year+month;
-        String s2 = nowYear+ formattedMonth;
-        if(!s1.equals(s2) && housingFundDeclareDetails.isEmpty()){
+        String s1 = year + month;
+        String s2 = nowYear + formattedMonth;
+        if (!s1.equals(s2) && housingFundDeclareDetails.isEmpty()) {
             return error("当前月未找到数据");
         }
         if (housingFundDeclareDetails.isEmpty()) {
@@ -204,31 +305,30 @@ public class BizHousingFundDeclareController extends BaseController {
     @PreAuthorize("@ss.hasPermi('business:housingFundDeclare:export')")
     @Log(title = "公积金申报任务", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, BizHousingFundDeclare conditions) throws NoSuchFieldException, IllegalAccessException
-    {
+    public void export(HttpServletResponse response, BizHousingFundDeclare conditions) throws NoSuchFieldException, IllegalAccessException {
         setTenantId(conditions);
         startOrderBy();
         List<BizHousingFundDeclare> list = housingFundDeclareService.getListByBean(conditions);
-        for (BizHousingFundDeclare l: list){
-            l.setCurrentPeriod(conditions.getYear()+"-"+conditions.getMonth());
+        for (BizHousingFundDeclare l : list) {
+            l.setCurrentPeriod(conditions.getYear() + "-" + conditions.getMonth());
             BizHousingFundDeclareDetail detail = new BizHousingFundDeclareDetail();
             detail.setHousingFundDeclareId(l.getId());
             detail.setYear(conditions.getYear());
             detail.setMonth(conditions.getMonth());
             List<BizHousingFundDeclareDetail> details = housingFundDeclareDetailService.getListByBean(detail);
-            if(details.size() == 0){
+            if (details.size() == 0) {
                 l.setStatusText("未开始");
                 l.setMakeOut("未填写");
-            }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("未填写");
@@ -315,6 +415,7 @@ public class BizHousingFundDeclareController extends BaseController {
         }
 
     }
+
     @ApiOperation("获取公积金人员信息")
     @PostMapping("/getMembersNoDelete")
     @ResponseBody
@@ -325,12 +426,19 @@ public class BizHousingFundDeclareController extends BaseController {
                     .eq("housing_fund_confirm_detail_id", housingFundConfirmDetail.getId())
                     .ne("change_status", 2)
                     .list();
+
+            for (BizHousingFundConfirmDetailEmployee employee : employees) {
+                employee.setCompanyAmount(employee.getRatio().divide(BigDecimal.valueOf(100)).multiply(employee.getCardinalNumber()));
+                employee.setOneSelfAmount(employee.getRatio().divide(BigDecimal.valueOf(100)).multiply(employee.getCardinalNumber()));
+                employee.setTotalAmount(employee.getCompanyAmount().add(employee.getOneSelfAmount()));
+            }
             return success(employees);
         } else {
             return success(new ArrayList<>());
         }
 
     }
+
     private Boolean checkDeduction(BizHousingFundDeclareDetail detail) {
         BizHousingFundDeclare main = housingFundDeclareService.getById(detail.getHousingFundDeclareId());
         if (detail.getAmount() != null && detail.getAmount().compareTo(BigDecimal.ZERO) > 0 && detail.getStatus().equals(3)) {
@@ -354,7 +462,7 @@ public class BizHousingFundDeclareController extends BaseController {
 
     @ApiOperation("退回")
     @PostMapping("/turnBackDetail")
-    @PreAuthorize("@ss.hasPermi('business:housingFundDeclare:edit')")
+    @PreAuthorize("@ss.hasPermi('business:housingFundDeclare:return')")
     @Transactional(rollbackFor = Exception.class)
     @Log(title = "公积金申报任务-退回", businessType = BusinessType.UPDATE)
     @ResponseBody

+ 6 - 0
src/main/java/cn/ezhizao/project/business/housingFund/domain/BizHousingFundConfirmDetailEmployee.java

@@ -61,6 +61,12 @@ public class BizHousingFundConfirmDetailEmployee extends BaseEntity implements S
     @ApiModelProperty(value = "备注")
     private String remark;
 
+    @TableField(exist = false)
+    private BigDecimal companyAmount;
+    @TableField(exist = false)
+    private BigDecimal oneSelfAmount;
+    @TableField(exist = false)
+    private BigDecimal totalAmount;
     public void setRemark(String remark)
     {
         this.remark = remark;

+ 16 - 0
src/main/java/cn/ezhizao/project/business/housingFund/domain/vo/EmployeeExcel.java

@@ -0,0 +1,16 @@
+package cn.ezhizao.project.business.housingFund.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class EmployeeExcel {
+    private Integer index;
+    private String employeeName;
+    private BigDecimal cardinalNumber;
+    private BigDecimal ratio;
+    private BigDecimal companyAmount;
+    private BigDecimal oneSelfAmount;
+    private BigDecimal totalAmount;
+}

+ 15 - 0
src/main/java/cn/ezhizao/project/business/housingFund/domain/vo/HousingFundEmployeeVo.java

@@ -0,0 +1,15 @@
+package cn.ezhizao.project.business.housingFund.domain.vo;
+
+
+import lombok.Data;
+
+@Data
+public class HousingFundEmployeeVo {
+
+    private String companyId;
+
+    private String year;
+
+    private String month;
+
+}

+ 1 - 1
src/main/java/cn/ezhizao/project/business/keepAccounts/controller/BizFinancialKeepAccountController.java

@@ -312,7 +312,7 @@ public class BizFinancialKeepAccountController extends BaseController {
         return toAjax(financialKeepAccountDetailService.updateById(bizFinancialSalaryDetail) && addRecord(bizFinancialSalaryDetail.getFinancialKeepAccountId(), bizFinancialSalaryDetail.getYear(), bizFinancialSalaryDetail.getMonth(), SecurityUtils.getUserId(), "修改记账信息"));
     }
 
-    @PreAuthorize("@ss.hasPermi('business:keepAccount:edit')")
+    @PreAuthorize("@ss.hasPermi('business:keepAccount:return')")
     @PostMapping("/turnBackDetail")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult turnBackDetail(@RequestBody BizFinancialKeepAccountDetail detail) {

+ 1 - 1
src/main/java/cn/ezhizao/project/business/receiveTicket/controller/BizFinancialReceiveTicketController.java

@@ -274,7 +274,7 @@ public class BizFinancialReceiveTicketController extends BaseController {
         return toAjax(bool && financialReceiveTicketDetailService.updateById(detail));
     }
 
-    @PreAuthorize("@ss.hasPermi('business:receiveTicket:verify')")
+    @PreAuthorize("@ss.hasPermi('business:receiveTicket:return')")
     @PostMapping("/turnBackDetail")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult turnBackDetail(@RequestBody BizFinancialReceiveTicketDetail detail) {

+ 1 - 1
src/main/java/cn/ezhizao/project/business/salary/controller/BizFinancialSalaryController.java

@@ -447,7 +447,7 @@ public class BizFinancialSalaryController extends BaseController {
     }
 
     @Log(title = "生产管理-公司非零申报-退回", businessType = BusinessType.UPDATE)
-    @PreAuthorize("@ss.hasPermi('business:salary:verify')")
+    @PreAuthorize("@ss.hasPermi('business:salary:back')")
     @PostMapping("/turnBackDetail")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult turnBackDetail(@RequestBody BizFinancialSalaryDetail detail) {

+ 1 - 1
src/main/java/cn/ezhizao/project/business/salary/controller/BizFinancialSalaryZeroController.java

@@ -325,7 +325,7 @@ public class BizFinancialSalaryZeroController extends BaseController {
         return toAjax(bool);
     }
 
-    @PreAuthorize("@ss.hasPermi('business:salaryZero:verify')")
+    @PreAuthorize("@ss.hasPermi('business:salaryZero:back')")
     @PostMapping("/turnBackDetail")
     @Transactional(rollbackFor = Exception.class)
     @Log(title = "生产管理-工资零申报-审核退回", businessType = BusinessType.UPDATE)

+ 4 - 2
src/main/java/cn/ezhizao/project/business/socialSecurity/controller/SocialSecurityConfirmController.java

@@ -115,12 +115,14 @@ public class SocialSecurityConfirmController extends BaseController {
         if (socialSecurityConfirmDetails.isEmpty()) {
             // 获取上个月的工资人员信息
             // 先获取之前的一个月是否已填报,然后获取填报后的工资人员信息
-            BizSocialSecurityConfirmDetail detail = socialSecurityConfirmDetailService.query().eq("social_security_confirm_id", condition.getSocialSecurityConfirmId()).lt("concat(year,month)", condition.getYear() + condition.getMonth()).orderByDesc("concat(year, month)").last("limit 1").one();
+            BizSocialSecurityConfirmDetail detail = socialSecurityConfirmDetailService.query()
+                    .eq("social_security_confirm_id", condition.getSocialSecurityConfirmId()).lt("concat(year,month)", condition.getYear() + condition.getMonth()).orderByDesc("concat(year, month)").last("limit 1").one();
             if (detail != null) {
                 List<BizSocialSecurityConfirmDetailEmployee> employees = socialSecurityConfirmDetailEmployeeService.query()
                         .eq("social_security_confirm_detail_id", detail.getId())
                         .ne("change_status",2)
                         .list();
+
                 employees.forEach(l -> l.setId(null));
                 condition.setDetails(employees);
             } else {
@@ -427,7 +429,7 @@ public class SocialSecurityConfirmController extends BaseController {
         return toAjax(bool);
     }
 
-    @PreAuthorize("@ss.hasPermi('business:socialSecurityConfirm:verify')")
+    @PreAuthorize("@ss.hasPermi('business:socialSecurityConfirm:return')")
     @PostMapping("/turnBackDetail")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult turnBackDetail(@RequestBody BizSocialSecurityConfirmDetail detail) {

+ 249 - 20
src/main/java/cn/ezhizao/project/business/socialSecurity/controller/SocialSecurityDeclareController.java

@@ -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();
     }
 
 

+ 3 - 0
src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityConfirmDetail.java

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -79,4 +80,6 @@ public class BizSocialSecurityConfirmDetail extends BaseEntity implements Serial
     private Integer isChanged;
     @ApiModelProperty("审核人")
     private Date verifierTime;
+    @TableField(exist = false)
+    private BigDecimal injuryRadio;
 }

+ 3 - 0
src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityDeclareDetail.java

@@ -113,4 +113,7 @@ public class BizSocialSecurityDeclareDetail extends BaseEntity implements Serial
     @TableField(exist = false)
     private List<Long> mainIds;
 
+
+    private BigDecimal injuryRadio;
+
 }

+ 41 - 0
src/main/java/cn/ezhizao/project/business/socialSecurity/domain/vo/SocialSecurityDetailVo.java

@@ -0,0 +1,41 @@
+package cn.ezhizao.project.business.socialSecurity.domain.vo;
+
+import io.swagger.annotations.ApiOperation;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class SocialSecurityDetailVo {
+    private String name;
+    private BigDecimal basePayment;
+    /**
+     * 医疗基数
+     */
+    private BigDecimal mmBasePayment;
+    /**
+     * 采暖基数
+     */
+    private BigDecimal heatingPayment;
+    /**
+     * 生育保险公司
+     */
+    private BigDecimal companyBirth;
+    private BigDecimal companyLargeMedical;
+    private BigDecimal companyMedical;
+    /**
+     * 养老
+     */
+    private BigDecimal companyElderly;
+    private BigDecimal companyUnemployment;
+    private BigDecimal companyInjury;
+    private BigDecimal companyHeat;
+    private BigDecimal companyCount;
+    private BigDecimal oneSelfLargeMedical;
+    private BigDecimal oneSelfElderly;
+    private BigDecimal oneSelfUnemployment;
+    private BigDecimal oneSelfEMedical;
+    private BigDecimal oneSelfCount;
+    private BigDecimal totalAmount;
+
+}

+ 40 - 0
src/main/java/cn/ezhizao/project/business/socialSecurity/domain/vo/SocialSecurityEmployeeExcel.java

@@ -0,0 +1,40 @@
+package cn.ezhizao.project.business.socialSecurity.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class SocialSecurityEmployeeExcel {
+    private Integer index;
+    private String name;
+    private BigDecimal basePayment;
+    /**
+     * 医疗基数
+     */
+    private BigDecimal mmBasePayment;
+    /**
+     * 采暖基数
+     */
+    private BigDecimal heatingPayment;
+    /**
+     * 生育保险公司
+     */
+    private BigDecimal companyBirth;
+    private BigDecimal companyLargeMedical;
+    private BigDecimal companyMedical;
+    /**
+     * 养老
+     */
+    private BigDecimal companyElderly;
+    private BigDecimal companyUnemployment;
+    private BigDecimal companyInjury;
+    private BigDecimal companyHeat;
+    private BigDecimal companyCount;
+    private BigDecimal oneSelfLargeMedical;
+    private BigDecimal oneSelfElderly;
+    private BigDecimal oneSelfUnemployment;
+    private BigDecimal oneSelfEMedical;
+    private BigDecimal oneSelfCount;
+    private BigDecimal totalAmount;
+}

+ 18 - 0
src/main/java/cn/ezhizao/project/business/socialSecurity/domain/vo/SocialSecurityEmployeeVo.java

@@ -0,0 +1,18 @@
+package cn.ezhizao.project.business.socialSecurity.domain.vo;
+
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class SocialSecurityEmployeeVo {
+    private String companyId;
+
+    private String year;
+
+    private String month;
+
+    private BigDecimal radio;
+
+}

+ 3 - 0
src/main/java/cn/ezhizao/project/business/workOrder/domain/BizWorkOrder.java

@@ -264,4 +264,7 @@ public class BizWorkOrder extends BaseEntity {
 
     @TableField(exist = false)
     private Integer recordStatus;
+
+    @TableField(exist = false)
+    private String accountName;
 }

BIN
src/main/resources/importTemplate/公积金模板.xlsx


BIN
src/main/resources/importTemplate/社保明细模板 .xlsx


+ 3 - 1
src/main/resources/mybatis/business/BizWorkOrderMapper.xml

@@ -32,7 +32,7 @@
         t3.name as task_type_name,
         t4.name as task_type_detail_name, t5.nick_name as
         service_name,t6.alter_type,t6.address_style,t6.fiction_address_id,t6.province as inputProvince,t6.city as
-        inputCity,t6.district as inputDistrict
+        inputCity,t6.district as inputDistrict,t10.account_name
         FROM biz_work_order t1
         left join biz_company t2 on t2.id = t1.company_id
         left join biz_task_type t3 on t3.id = t1.task_type_id
@@ -41,6 +41,8 @@
         LEFT JOIN biz_archive_input_detail t6 ON t6.id = t1.contract_detail_id
         left join biz_work_order_record t7 on t7.work_order_id = t1.id
         left join sys_user t8 on t7.handler_id = t8.user_id
+        left join biz_entrust t9 on t9.work_order_id = t1.id and t9.deleted = 0
+        left join biz_tenant t10 on t10.id = t9.from_tenant_id
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             t1.deleted = 0
             <if test="id != null ">AND t1.id = #{id}</if>