ezhizao_zx 1 éve
szülő
commit
4fb209728b
37 módosított fájl, 434 hozzáadás és 56 törlés
  1. 4 0
      src/main/java/cn/ezhizao/project/business/archiveTicket/domain/BizArchiveReceiveTicket.java
  2. 1 1
      src/main/java/cn/ezhizao/project/business/deduction/controller/DeductionController.java
  3. 4 0
      src/main/java/cn/ezhizao/project/business/deduction/domain/BizDeduction.java
  4. 8 0
      src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTax/domain/BizFinancialIndividualIncomeTax.java
  5. 8 0
      src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTaxIsZero/domain/BizFinancialIndividualIncomeTaxIsZero.java
  6. 1 1
      src/main/java/cn/ezhizao/project/business/housingFund/controller/BizHousingFundDeclareController.java
  7. 4 0
      src/main/java/cn/ezhizao/project/business/housingFund/domain/BizHousingFundConfirm.java
  8. 4 0
      src/main/java/cn/ezhizao/project/business/housingFund/domain/BizHousingFundDeclare.java
  9. 1 1
      src/main/java/cn/ezhizao/project/business/keepAccounts/controller/BizFinancialKeepAccountController.java
  10. 8 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/domain/BizFinancialKeepAccount.java
  11. 2 2
      src/main/java/cn/ezhizao/project/business/receiveTicket/controller/BizFinancialReceiveTicketController.java
  12. 49 1
      src/main/java/cn/ezhizao/project/business/receiveTicket/domain/BizFinancialReceiveTicket.java
  13. 8 0
      src/main/java/cn/ezhizao/project/business/receiveTicket/domain/BizFinancialReceiveTicketFeedback.java
  14. 8 0
      src/main/java/cn/ezhizao/project/business/reportTax/domain/BizFinancialReportTaxNonZero.java
  15. 8 0
      src/main/java/cn/ezhizao/project/business/reportTaxIsZero/domain/BizFinancialReportTax.java
  16. 141 9
      src/main/java/cn/ezhizao/project/business/salary/controller/BizFinancialSalaryController.java
  17. 1 1
      src/main/java/cn/ezhizao/project/business/salary/controller/BizFinancialSalaryZeroController.java
  18. 12 0
      src/main/java/cn/ezhizao/project/business/salary/domain/BizFinancialSalary.java
  19. 1 1
      src/main/java/cn/ezhizao/project/business/socialSecurity/controller/SocialSecurityConfirmController.java
  20. 9 0
      src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityConfirm.java
  21. 8 0
      src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityDeclare.java
  22. 4 0
      src/main/java/cn/ezhizao/project/business/workOrder/domain/BizWorkOrder.java
  23. 10 8
      src/main/resources/mybatis/business/BizArchiveReceiveTicketMapper.xml
  24. 6 3
      src/main/resources/mybatis/business/BizDeductionMapper.xml
  25. 10 12
      src/main/resources/mybatis/business/BizFinancialIndividualIncomeTaxIsZeroMapper.xml
  26. 10 10
      src/main/resources/mybatis/business/BizFinancialIndividualIncomeTaxMapper.xml
  27. 12 0
      src/main/resources/mybatis/business/BizFinancialKeepAccountMapper.xml
  28. 16 0
      src/main/resources/mybatis/business/BizFinancialReceiveTicketFeedbackMapper.xml
  29. 10 0
      src/main/resources/mybatis/business/BizFinancialReceiveTicketMapper.xml
  30. 9 0
      src/main/resources/mybatis/business/BizFinancialReportTaxMapper.xml
  31. 9 0
      src/main/resources/mybatis/business/BizFinancialReportTaxNonZeroMapper.xml
  32. 15 1
      src/main/resources/mybatis/business/BizFinancialSalaryMapper.xml
  33. 8 2
      src/main/resources/mybatis/business/BizHousingFundConfirmMapper.xml
  34. 3 0
      src/main/resources/mybatis/business/BizHousingFundDeclareMapper.xml
  35. 11 3
      src/main/resources/mybatis/business/BizSocialSecurityConfirmMapper.xml
  36. 8 0
      src/main/resources/mybatis/business/BizSocialSecurityDeclareMapper.xml
  37. 3 0
      src/main/resources/mybatis/business/BizWorkOrderMapper.xml

+ 4 - 0
src/main/java/cn/ezhizao/project/business/archiveTicket/domain/BizArchiveReceiveTicket.java

@@ -63,5 +63,9 @@ public class BizArchiveReceiveTicket extends BaseEntity
     @TableField(exist = false)
     private BizArchiveReceiveTicketFinished uploadTicketFinished;
 
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
 
 }

+ 1 - 1
src/main/java/cn/ezhizao/project/business/deduction/controller/DeductionController.java

@@ -75,7 +75,7 @@ public class DeductionController extends BaseController {
 
     @PostMapping("/save")
     @ApiOperation(value = "保存", notes = "保存")
-    @PreAuthorize("@ss.hasPermi('business:deduction:confirm,business:deduction:deduction')")
+    @PreAuthorize("@ss.hasAnyPermi('business:deduction:confirm,business:deduction:deduction')")
     @ResponseBody
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult save(@RequestBody BizDeduction deduction) {

+ 4 - 0
src/main/java/cn/ezhizao/project/business/deduction/domain/BizDeduction.java

@@ -103,4 +103,8 @@ public class BizDeduction extends BaseEntity implements Serializable {
 
     @ApiModelProperty("工单外键")
     private Long workOrderId;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
 }

+ 8 - 0
src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTax/domain/BizFinancialIndividualIncomeTax.java

@@ -79,5 +79,13 @@ public class BizFinancialIndividualIncomeTax extends BaseEntity implements Seria
     @TableField(exist = false)
     private Integer status;
 
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
+
 
 }

+ 8 - 0
src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTaxIsZero/domain/BizFinancialIndividualIncomeTaxIsZero.java

@@ -81,5 +81,13 @@ public class BizFinancialIndividualIncomeTaxIsZero extends BaseEntity implements
     @TableField(exist = false)
     private Integer status;
 
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
+
 
 }

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

@@ -150,7 +150,7 @@ public class BizHousingFundDeclareController extends BaseController {
         return bool ? success(fileStorage) : error();
     }
 
-    @PreAuthorize("@ss.hasPermi('business:housingFundDeclare:query,business:housingFundDeclare:verify')")
+    @PreAuthorize("@ss.hasAnyPermi('business:housingFundDeclare:query,business:housingFundDeclare:verify')")
     @PostMapping("/getDetail")
     public AjaxResult getDetail(@RequestBody BizHousingFundDeclareDetail condition) {
         List<BizHousingFundDeclareDetail> housingFundDeclareDetails = housingFundDeclareDetailService.getListByBean(condition);

+ 4 - 0
src/main/java/cn/ezhizao/project/business/housingFund/domain/BizHousingFundConfirm.java

@@ -67,4 +67,8 @@ public class BizHousingFundConfirm extends BaseEntity implements Serializable {
 
     private Long workOrderId;
 
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
 }

+ 4 - 0
src/main/java/cn/ezhizao/project/business/housingFund/domain/BizHousingFundDeclare.java

@@ -69,4 +69,8 @@ public class BizHousingFundDeclare extends BaseEntity implements Serializable {
     private String keyword;
 
     private Long workOrderId;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
 }

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

@@ -95,7 +95,7 @@ public class BizFinancialKeepAccountController extends BaseController {
         return success(map);
     }
 
-    @PreAuthorize("@ss.hasPermi('business:keepAccount:query,business:keepAccount:view')")
+    @PreAuthorize("@ss.hasAnyPermi('business:keepAccount:query,business:keepAccount:view')")
     @PostMapping("/getDetail")
     public AjaxResult getDetail(@RequestBody BizFinancialKeepAccountDetail detail) {
         List<BizFinancialKeepAccountDetail> keepAccountDetails = financialKeepAccountDetailService.getList(detail);

+ 8 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/domain/BizFinancialKeepAccount.java

@@ -78,4 +78,12 @@ public class BizFinancialKeepAccount extends BaseEntity {
     @ApiModelProperty(value = "是否停止")
     @TableField(exist = false)
     private Integer isStop;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
 }

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

@@ -90,7 +90,7 @@ public class BizFinancialReceiveTicketController extends BaseController
         }
         return getDataTable(list);
     }
-    @PreAuthorize("@ss.hasPermi('business:receiveTicket:query,business:receiveTicket:view')")
+    @PreAuthorize("@ss.hasAnyPermi('business:receiveTicket:query,business:receiveTicket:view')")
     @PostMapping("/getDetail")
     public AjaxResult getDetail(@RequestBody BizFinancialReceiveTicketDetail details) {
         List<BizFinancialReceiveTicketDetail> bizFinancialSalaryDetails = financialReceiveTicketDetailService.getList(details);
@@ -102,7 +102,7 @@ public class BizFinancialReceiveTicketController extends BaseController
 
     @ApiOperation("根据客户id和当前年月获取当前工资信息")
     @PostMapping("/getSalaryDetail")
-    @PreAuthorize("@ss.hasPermi('business:receiveTicket:query,business:receiveTicket:view')")
+    @PreAuthorize("@ss.hasAnyPermi('business:receiveTicket:query,business:receiveTicket:view')")
     @ResponseBody
     public AjaxResult getSalaryDetailByCondition(@RequestBody BizFinancialSalaryDetail conditions) {
         BizFinancialSalaryDetail detail = financialSalaryDetailService.getList(conditions).stream().findFirst().orElse(null);

+ 49 - 1
src/main/java/cn/ezhizao/project/business/receiveTicket/domain/BizFinancialReceiveTicket.java

@@ -1,6 +1,5 @@
 package cn.ezhizao.project.business.receiveTicket.domain;
 
-import cn.ezhizao.project.business.salary.domain.BizFinancialSalaryDetail;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import cn.ezhizao.framework.web.domain.BaseEntity;
@@ -74,4 +73,53 @@ public class BizFinancialReceiveTicket extends BaseEntity
     private List<BizFinancialReceiveTicketDetail> details;
     @TableField(exist = false)
     private Integer isZero;
+
+    //收入票
+    @TableField(exist = false)
+    private Integer hasIncomeTicket;
+
+    //成本票
+    @TableField(exist = false)
+    private Integer hasCostTicket;
+
+    //费用票
+    @TableField(exist = false)
+    private Integer feeTicket;
+
+    //社保公积金
+    @TableField(exist = false)
+    private Integer hasSsafTicket;
+
+    //工资表
+    @TableField(exist = false)
+    private Integer payroll;
+
+    //银行回单
+    @TableField(exist = false)
+    private Integer bankSlips;
+
+    //银行对账单
+    @TableField(exist = false)
+    private Integer bankCopy;
+
+    //其他
+    @TableField(exist = false)
+    private Integer others;
+
+    //总数
+    @TableField(exist = false)
+    private Integer sumNumber;
+
+    //送达方式
+    @TableField(exist = false)
+    private Integer saveStatus;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
+
 }

+ 8 - 0
src/main/java/cn/ezhizao/project/business/receiveTicket/domain/BizFinancialReceiveTicketFeedback.java

@@ -75,4 +75,12 @@ public class BizFinancialReceiveTicketFeedback extends BaseEntity
     private String year;
     @TableField(exist = false)
     private String month;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
 }

+ 8 - 0
src/main/java/cn/ezhizao/project/business/reportTax/domain/BizFinancialReportTaxNonZero.java

@@ -63,4 +63,12 @@ public class BizFinancialReportTaxNonZero extends BaseEntity {
     private String month;
     @TableField(exist = false)
     private Integer status;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
 }

+ 8 - 0
src/main/java/cn/ezhizao/project/business/reportTaxIsZero/domain/BizFinancialReportTax.java

@@ -63,4 +63,12 @@ public class BizFinancialReportTax extends BaseEntity {
     private String month;
     @TableField(exist = false)
     private Integer status;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
 }

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

@@ -1,13 +1,21 @@
 package cn.ezhizao.project.business.salary.controller;
 
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.sql.Timestamp;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 import javax.annotation.Resource;
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 
 import cn.ezhizao.common.utils.SecurityUtils;
+import cn.ezhizao.project.business.company.domain.BizCompany;
+import cn.ezhizao.project.business.company.service.IBizCompanyService;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxDetailIsZero;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxIsZero;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBizFinancialIndividualIncomeTaxIsZeroService;
@@ -25,17 +33,17 @@ import cn.ezhizao.project.business.salary.service.IBizFinancialSalaryDetailEmplo
 import cn.ezhizao.project.business.salary.service.IBizFinancialSalaryDetailService;
 import cn.ezhizao.project.business.workOrder.domain.BizWorkOrderRecord;
 import cn.ezhizao.project.business.workOrder.service.IBizWorkOrderRecordService;
+import cn.hutool.core.io.IoUtil;
+import cn.hutool.poi.excel.ExcelWriter;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.ApiOperation;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Font;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import cn.ezhizao.framework.aspectj.lang.annotation.Log;
 import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
 import cn.ezhizao.project.business.salary.domain.BizFinancialSalary;
@@ -68,6 +76,8 @@ public class BizFinancialSalaryController extends BaseController {
     private IBizFinancialReceiveTicketDetailService financialReceiveTicketDetailService;
     @Resource
     private IBizWorkOrderRecordService bizWorkOrderRecordService;
+    @Resource
+    private IBizCompanyService companyService;
 
     @Resource
     private IBizFinancialSalaryDetailEmployeeService bizFinancialSalaryDetailEmployeeService;
@@ -150,7 +160,7 @@ public class BizFinancialSalaryController extends BaseController {
         return toAjax(bizFinancialSalaryService.removeBatchByIds(ids));
     }
 
-    @PreAuthorize("@ss.hasPermi('business:salary:query,business:salary:view')")
+    @PreAuthorize("@ss.hasAnyPermi('business:salary:query,business:salary:view')")
     @PostMapping("/getDetail")
     public AjaxResult getDetail(@RequestBody BizFinancialSalaryDetail bizFinancialSalaryDetail) {
         List<BizFinancialSalaryDetail> bizFinancialSalaryDetails = bizFinancialSalaryDetailService.getList(bizFinancialSalaryDetail);
@@ -328,4 +338,126 @@ public class BizFinancialSalaryController extends BaseController {
                     bizWorkOrderRecordService.updateById(fromRecord);
         }
     }
+
+    @ApiOperation("导出工资数据")
+    @PostMapping("/exportDetailExcel")
+    public void exportDetailExcel(@RequestParam Long id, HttpServletResponse response) {
+        BizFinancialSalaryDetail financialSalaryDetail = bizFinancialSalaryDetailService.getById(id);
+        BizCompany company;
+
+        if (null != financialSalaryDetail) {
+            BizFinancialSalaryDetailEmployee map = new BizFinancialSalaryDetailEmployee();
+//            map.put("financialSalaryDetailId", financialSalaryDetail.getId());
+            map.setFinancialSalaryDetailId(financialSalaryDetail.getId());
+            List<BizFinancialSalaryDetailEmployee> financialSalaryDetailEmployeeList = bizFinancialSalaryDetailEmployeeService.getList(map);
+            financialSalaryDetail.setDetails(financialSalaryDetailEmployeeList);
+            company = companyService.getById(financialSalaryDetail.getCompanyId());
+        } else {
+            return;
+        }
+        ExcelWriter writer = cn.hutool.poi.excel.ExcelUtil.getWriter(true);
+        writer.merge(0, 0, 0, 12, "工资单", true);
+        writer.merge(1, 1, 0, 3, company.getName(), false);
+        writer.merge(1, 1, 4, 7, financialSalaryDetail.getYear() + "年 第" + financialSalaryDetail.getMonth() + "期", false);
+        writer.merge(1, 1, 8, 12, "单位:元", false);
+        writer.writeCellValue(0, 2, "员工名");
+        writer.writeCellValue(1, 2, "身份证号");
+        writer.writeCellValue(2, 2, "应发工资");
+        writer.writeCellValue(3, 2, "实发工资");
+        writer.writeCellValue(4, 2, "奖金及其他");
+        writer.writeCellValue(5, 2, "养老保险");
+        writer.writeCellValue(6, 2, "医疗保险");
+        writer.writeCellValue(7, 2, "失业险");
+        writer.writeCellValue(8, 2, "大病险");
+        writer.writeCellValue(9, 2, "公积金");
+        writer.writeCellValue(10, 2, "个税");
+        writer.writeCellValue(11, 2, "其他扣款");
+        writer.writeCellValue(12, 2, "备注");
+
+//        List<String> rowHead = CollUtil.newArrayList("员工名", "公司名称", "身份证号", "应发工资", "实发工资", "奖金及其他", "养老保险", "医疗保险", "失业险", "大病险", "公积金", "个税", "其他扣款", "备注");
+        // 自定义标题别名
+
+//        writer.writeHeadRow(rowHead);
+        int row = 0;
+        for (int i = 0; i < financialSalaryDetail.getDetails().size(); i++) {
+            writer.writeCellValue(0, i + 3, financialSalaryDetail.getDetails().get(i).getEmployeeName());
+//            writer.writeCellValue(1, i + 1, company.getName());
+            writer.writeCellValue(1, i + 3, financialSalaryDetail.getDetails().get(i).getIdCode());
+            writer.writeCellValue(2, i + 3, financialSalaryDetail.getDetails().get(i).getPlanSalary());
+            writer.writeCellValue(3, i + 3, financialSalaryDetail.getDetails().get(i).getActuallySalary());
+            writer.writeCellValue(4, i + 3, financialSalaryDetail.getDetails().get(i).getBonusAmount());
+            writer.writeCellValue(5, i + 3, financialSalaryDetail.getDetails().get(i).getEndowmentInsurance());
+            writer.writeCellValue(6, i + 3, financialSalaryDetail.getDetails().get(i).getMedicalInsurance());
+            writer.writeCellValue(7, i + 3, financialSalaryDetail.getDetails().get(i).getUnemploymentBenefit());
+            writer.writeCellValue(8, i + 3, financialSalaryDetail.getDetails().get(i).getSeriousIllnessInsurance());
+            writer.writeCellValue(9, i + 3, financialSalaryDetail.getDetails().get(i).getHousingFund());
+            writer.writeCellValue(10, i + 3, financialSalaryDetail.getHasIndividualIncomeTax().equals(1) ? financialSalaryDetail.getDetails().get(i).getIndividualIncomeTaxConfirm() : financialSalaryDetail.getDetails().get(i).getCurrentIndividualIncomeTax());
+            writer.writeCellValue(11, i + 3, financialSalaryDetail.getDetails().get(i).getOtherCut());
+            writer.writeCellValue(12, i + 3, financialSalaryDetail.getDetails().get(i).getRemark());
+            row = i + 1;
+        }
+        writer.writeCellValue(0, row + 3, "合计");
+        writer.writeCellValue(1, row + 3, "");
+        writer.writeCellValue(2, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getPlanSalary().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(3, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getActuallySalary().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(4, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getBonusAmount().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(5, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getEndowmentInsurance().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(6, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getMedicalInsurance().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(7, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getUnemploymentBenefit().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(8, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getSeriousIllnessInsurance().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(9, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getHousingFund().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(10, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getCurrentIndividualIncomeTax().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+        writer.writeCellValue(11, row + 3, BigDecimal.valueOf(financialSalaryDetail.getDetails().stream().mapToDouble(v -> v.getOtherCut().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
+
+        writer.writeCellValue(12, row + 3, "");
+
+        // 默认的,未添加alias的属性也会写出,如果想只写出加了别名的字段,可以调用此方法排除之
+        writer.setOnlyAlias(true);
+        // 设置列宽行高
+        writer.setDefaultRowHeight(22);
+        // 设置第一行 列宽
+        // writer.setColumnWidth(0, 20);
+        // 合并单元格后的标题行,使用默认标题样式
+//        writer.merge(9, "客户");
+//        writer.setRowHeight(0, 22);
+        //设置标题单元格 样式
+        Font headFont = writer.createFont();
+        // 设置字体大小,加载到样式中
+        headFont.setFontHeightInPoints((short) 11);
+        headFont.setFontName("楷体_GB2312");
+        headFont.setBold(true);
+        CellStyle headCellStyle = writer.getStyleSet().getHeadCellStyle();
+        headCellStyle.setFont(headFont);
+        headCellStyle.setAlignment(HorizontalAlignment.CENTER);
+        headCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        //设置普通单元格 样式
+        Font contentFont = writer.createFont();
+        // 设置字体大小,加载到样式中
+        contentFont.setFontHeightInPoints((short) 11);
+        contentFont.setFontName("宋体");
+        CellStyle cellstyle = writer.getStyleSet().getCellStyle();
+        cellstyle.setFont(contentFont);
+        cellstyle.setAlignment(HorizontalAlignment.CENTER);
+        cellstyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        writer.setRowHeight(1, 22);
+        // headSize 为表格 标题 和 表头所占的 行数
+        int headSize = 2;
+        // 设置所有列宽自适应
+        writer.autoSizeColumnAll();
+        //out为OutputStream,需要写出到的目标流 response为HttpServletResponse对象
+        response.setContentType("application/vnd.ms-excel;charset=utf-8");
+        //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
+        response.setHeader("Content-Disposition", "attachment;filename=test.xlsx");
+        ServletOutputStream out = null;
+        try {
+            out = response.getOutputStream();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        writer.flush(out, true);
+        // 关闭writer,释放内存
+        writer.close();
+        //此处记得关闭输出Servlet流
+        IoUtil.close(out);
+    }
 }

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

@@ -143,7 +143,7 @@ public class BizFinancialSalaryZeroController extends BaseController {
         return toAjax(bizFinancialSalaryService.removeBatchByIds(ids));
     }
 
-    @PreAuthorize("@ss.hasPermi('business:salaryZero:query,business:salaryZero:edit,business:salaryZero:view')")
+    @PreAuthorize("@ss.hasAnyPermi('business:salaryZero:query,business:salaryZero:edit,business:salaryZero:view')")
     @PostMapping("/getDetail")
     public AjaxResult getDetail(@RequestBody BizFinancialSalaryDetail bizFinancialSalaryDetail) {
         List<BizFinancialSalaryDetail> bizFinancialSalaryDetails = bizFinancialSalaryDetailService.getList(bizFinancialSalaryDetail);

+ 12 - 0
src/main/java/cn/ezhizao/project/business/salary/domain/BizFinancialSalary.java

@@ -64,12 +64,24 @@ public class BizFinancialSalary extends BaseEntity
     /** 查询条件新增 */
     @TableField(exist = false)
     private String year;
+
     @TableField(exist = false)
     private String month;
+
     @TableField(exist = false)
     private Integer status;
 
+    @TableField(exist = false)
+    private Integer hasIndividualIncomeTax;
+
     @TableField(exist = false)
     private Integer isZero;
 
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
 }

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

@@ -55,7 +55,7 @@ public class SocialSecurityConfirmController extends BaseController {
     }
 
 
-    @PreAuthorize("@ss.hasPermi('business:socialSecurityConfirm:query,business:socialSecurityConfirm:view')")
+    @PreAuthorize("@ss.hasAnyPermi('business:socialSecurityConfirm:query,business:socialSecurityConfirm:view')")
     @PostMapping("/getDetail")
     public AjaxResult getDetail(@RequestBody BizSocialSecurityConfirmDetail condition) {
         List<BizSocialSecurityConfirmDetail> socialSecurityConfirmDetails = socialSecurityConfirmDetailService.getListByBean(condition);

+ 9 - 0
src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityConfirm.java

@@ -64,5 +64,14 @@ public class BizSocialSecurityConfirm extends BaseEntity implements Serializable
     @TableField(exist = false)
     private String keyword;
 
+    @TableField(exist = false)
     private Long workOrderId;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
 }

+ 8 - 0
src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityDeclare.java

@@ -69,4 +69,12 @@ public class BizSocialSecurityDeclare extends BaseEntity implements Serializable
 
     @ApiModelProperty("工单外键")
     private Long workOrderId;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
 }

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

@@ -161,4 +161,8 @@ public class BizWorkOrder extends BaseEntity
     private BizEntrust entrust;
     @TableField(exist = false)
     private BizWorkOrderRecord record;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
 }

+ 10 - 8
src/main/resources/mybatis/business/BizArchiveReceiveTicketMapper.xml

@@ -6,19 +6,21 @@
 
     <resultMap type="cn.ezhizao.project.business.archiveTicket.domain.BizArchiveReceiveTicket"
                id="BizArchiveReceiveTicketResult">
-        <id column="id" property="id"/>
+        <id column="id" jdbcType="BIGINT" property="id"/>
     </resultMap>
 
 
     <select id="getList" parameterType="BizArchiveReceiveTicket" resultMap="BizArchiveReceiveTicketResult">
-        SELECT * FROM biz_archive_receive_ticket
+        SELECT t1.* FROM biz_archive_receive_ticket t1
+        LEFT JOIN biz_company t2 ON t2.id = t2.id = t1.company_id
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
-            deleted = 0
-            <if test="companyId != null ">AND company_id = #{companyId}</if>
-            <if test="year != null  and year != ''">AND year = #{year}</if>
-            <if test="month != null  and month != ''">AND month = #{month}</if>
-            <if test="fileUrl != null  and fileUrl != ''">AND file_url = #{fileUrl}</if>
-            <if test="fileName != null  and fileName != ''">AND file_name like concat('%', #{fileName}, '%')</if>
+            t1.deleted = 0
+            <if test="companyId != null ">AND t1.company_id = #{companyId}</if>
+
+            <if test="year != null  and year != ''">AND t1.year = #{year}</if>
+            <if test="month != null  and month != ''">AND t1.month = #{month}</if>
+            <if test="fileUrl != null  and fileUrl != ''">AND t1.file_url = #{fileUrl}</if>
+            <if test="fileName != null  and fileName != ''">AND t1.file_name like concat('%', #{fileName}, '%')</if>
         </trim>
     </select>
 

+ 6 - 3
src/main/resources/mybatis/business/BizDeductionMapper.xml

@@ -61,6 +61,9 @@
             <if test="id != null  ">
                 t1.id = #{id} AND
             </if>
+            <if test="principal != null and principal != ''">
+                 (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
+            </if>
             <if test="companyName != null  ">
                 t2.name like concat('%', #{companyName}, '%') AND
             </if>
@@ -127,11 +130,11 @@
             </if>
             <if test="tenantId != null  ">
                 (t1.tenant_id = #{tenantId}
-                or (case when t1.source_name = '税款' then exists (select 1 from biz_entrust entrust where entrust.deleted = 0 and date_format(entrust.current_month, '%y%m') = concat(t1.year, t1.month) and entrust.company_id =
+                or (case when t1.source_name = '税款' then exists (select 1 from biz_entrust entrust where entrust.deleted = 0 and date_format(entrust.current_month, '%Y%m') = concat(t1.year, t1.month) and entrust.company_id =
                 t1.company_id and entrust.task_type_id = 1 and entrust.to_tenant_id = #{tenantId})
-                when t1.source_name = '社保' then exists (select 1 from biz_entrust entrust where entrust.deleted = 0 and date_format(entrust.current_month, '%y%m') = concat(t1.year, t1.month) and entrust.company_id = t1.company_id
+                when t1.source_name = '社保' then exists (select 1 from biz_entrust entrust where entrust.deleted = 0 and date_format(entrust.current_month, '%Y%m') = concat(t1.year, t1.month) and entrust.company_id = t1.company_id
                 and entrust.task_type_id = 2 and entrust.to_tenant_id = #{tenantId})
-                when t1.source_name = '公积金' then exists (select 1 from biz_entrust entrust where entrust.deleted = 0 and date_format(entrust.current_month, '%y%m') = concat(t1.year, t1.month) and entrust.company_id =
+                when t1.source_name = '公积金' then exists (select 1 from biz_entrust entrust where entrust.deleted = 0 and date_format(entrust.current_month, '%Y%m') = concat(t1.year, t1.month) and entrust.company_id =
                 t1.company_id and entrust.task_type_id = 3 and entrust.to_tenant_id = #{tenantId})
                 else false end
                 )

+ 10 - 12
src/main/resources/mybatis/business/BizFinancialIndividualIncomeTaxIsZeroMapper.xml

@@ -10,7 +10,7 @@
         <id column="id" property="id"/>
         <result column="account_sets_id" jdbcType="INTEGER" property="accountSetsId"/>
         <result column="tenant_id" jdbcType="BIGINT" property="tenantId"/>
-
+        <result column="company_id" jdbcType="BIGINT" property="companyId"/>
 
         <association property="companyName" javaType="java.lang.String" select="getCompanyName" column="company_id"/>
         <association property="socialCreditCode" javaType="java.lang.String" select="getSocialCreditCode"
@@ -21,8 +21,8 @@
         <association property="currentEmployeeName" javaType="java.lang.String" select="getCurrentEmployeeName"
                      column="current_employee_id"/>
         <association property="evidenceFile" javaType="java.lang.String" select="getCurrentEvidenceFile" column="id"/>
-
         <association property="companyId" javaType="java.lang.Long" select="getCompanyId" column="id"/>
+        <association property="serviceName" javaType="java.lang.Long" select="getServiceName" column="company_id"/>
     </resultMap>
 
     <resultMap type="cn.ezhizao.project.business.salary.domain.BizFinancialSalaryDetailEmployee"
@@ -45,15 +45,6 @@
         <id column="id" property="id"/>
     </resultMap>
 
-
-    <!--    <select id="getDetail" resultType="cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxDetailIsZero">-->
-    <!--        SELECT * FROM biz_financial_individual_income_tax_detail-->
-    <!--        WHERE financial_individual_income_tax_id = #{id}-->
-    <!--    AND year = #{year}-->
-    <!--                  AND month = #{month}-->
-    <!--          AND deleted = 0-->
-    <!--    </select>-->
-
     <select id="getTaxDetail" parameterType="BizFinancialIndividualIncomeTaxDetail"
             resultMap="BizFinancialIndividualIncomeTaxDetailResult">
         SELECT *
@@ -64,6 +55,11 @@
           AND deleted = 0
     </select>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
 
     <select id="getList" parameterType="BizFinancialIndividualIncomeTax"
             resultMap="BizFinancialIndividualIncomeTaxResult">
@@ -75,7 +71,9 @@
             AND c.is_zero=1
             <if test="currentEmployeeId != null ">AND current_employee_id = #{currentEmployeeId}</if>
             <if test="companyName != null and companyName !=''  ">AND c.name like concat('%', #{companyName}, '%')</if>
-
+            <if test="principal != null and principal != ''">
+                AND(c.leader_id=#{principal} OR c.adviser_id=#{principal})
+            </if>
             <if test="taxType != null and taxType != null">
                 AND c.tax_type = #{taxType}
             </if>

+ 10 - 10
src/main/resources/mybatis/business/BizFinancialIndividualIncomeTaxMapper.xml

@@ -9,6 +9,7 @@
         <id column="id" property="id"/>
         <result column="account_sets_id" jdbcType="INTEGER" property="accountSetsId"/>
         <result column="tenant_id" jdbcType="BIGINT" property="tenantId"/>
+        <result column="company_id" jdbcType="BIGINT" property="companyId"/>
         <association property="companyName" javaType="java.lang.String" select="getCompanyName" column="company_id"/>
         <association property="socialCreditCode" javaType="java.lang.String" select="getSocialCreditCode"
                      column="company_id"/>
@@ -18,8 +19,8 @@
         <association property="currentEmployeeName" javaType="java.lang.String" select="getCurrentEmployeeName"
                      column="current_employee_id"/>
         <association property="evidenceFile" javaType="java.lang.String" select="getCurrentEvidenceFile" column="id"/>
-        <!--        <association property="detail" javaType="cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxDetailIsZero" select="getDetail" column="id"/>-->
         <association property="companyId" javaType="java.lang.Long" select="getCompanyId" column="id"/>
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
     <resultMap type="cn.ezhizao.project.business.salary.domain.BizFinancialSalaryDetailEmployee"
@@ -59,6 +60,9 @@
             f.deleted = 0
             AND c.is_zero=0
             <if test="currentEmployeeId != null ">AND current_employee_id = #{currentEmployeeId}</if>
+            <if test="principal != null and principal != ''">
+                AND (c.leader_id=#{principal} OR c.adviser_id=#{principal})
+            </if>
             <if test="companyName != null and companyName !=''  ">AND c.name like concat('%', #{companyName}, '%')</if>
 
             <if test="taxType != null and taxType != null">
@@ -97,6 +101,11 @@
         </trim>
     </select>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
     <select id="getFiles" resultMap="FileStorageResult">
         select *
         from sys_file_storage
@@ -104,15 +113,6 @@
           and master_id = #{id}
     </select>
 
-
-    <!--    <select id="getDetail" resultType="cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxDetailIsZero">-->
-    <!--        SELECT * FROM biz_financial_individual_income_tax_detail-->
-    <!--        WHERE financial_individual_income_tax_id = #{id}-->
-    <!--    AND year = #{year}-->
-    <!--                  AND month = #{month}-->
-    <!--          AND deleted = 0-->
-    <!--    </select>-->
-
     <select id="getTaxDetail" parameterType="BizFinancialIndividualIncomeTaxDetail"
             resultMap="BizFinancialIndividualIncomeTaxDetailResult">
         SELECT *

+ 12 - 0
src/main/resources/mybatis/business/BizFinancialKeepAccountMapper.xml

@@ -4,6 +4,7 @@
     <!-- 基础的返回map 多表复杂的 自行组合 -->
     <resultMap id="BaseResultMap" type="cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccount" >
         <result column="company_id" jdbcType="BIGINT" property="companyId"/>
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
     <!--带条件的List查询-->
@@ -16,6 +17,11 @@
         SELECT COUNT(1) FROM (<include refid="getListSql" />) AS t
     </select>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
     <sql id="getListSql">
         SELECT
         t1.*, t2.name as company_name,
@@ -28,6 +34,9 @@
         <if test="id != null">
             AND t1.id = #{id}
         </if>
+        <if test="principal != null and principal != ''">
+            AND (t2.leader_id=#{principal} OR t2.adviser_id=#{principal})
+        </if>
         <if test="isZero != null">
             AND t2.is_zero = #{isZero}
         </if>
@@ -43,6 +52,9 @@
         <if test="fromCompanyName != null and fromCompanyName != ''">
             AND (t3.account_name like concat('%', #{fromCompanyName}, '%'))
         </if>
+        <if test="companyName != null and companyName != ''">
+            AND (t2.name like concat('%', #{companyName}, '%'))
+        </if>
         <if test="month != null and year != null">
             <if test="tenantId != null">
                 AND exists (select 1 from biz_entrust eb

+ 16 - 0
src/main/resources/mybatis/business/BizFinancialReceiveTicketFeedbackMapper.xml

@@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <resultMap type="cn.ezhizao.project.business.receiveTicket.domain.BizFinancialReceiveTicketFeedback" id="BizFinancialReceiveTicketFeedbackResult">
         <id column="id" property="id"/>
+        <result column="company_id" jdbcType="BIGINT" property="companyId"/>
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
 
@@ -20,6 +22,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null  ">
                 t1.id = #{id} AND
             </if>
+            <if test="principal != null and principal != ''">
+                 (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
+            </if>
+            <if test="year != null  ">
+                t3.year = #{year} AND
+            </if>
+            <if test="month != null  ">
+                t3.month = #{month} AND
+            </if>
             <if test="financialReceiveTicketId != null  ">
                 t1.financial_receive_ticket_id = #{financialReceiveTicketId} AND
             </if>
@@ -89,6 +100,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
     </select>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
     <delete id="physicalDelete">
         DELETE FROM biz_financial_receive_ticket_feedback
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">

+ 10 - 0
src/main/resources/mybatis/business/BizFinancialReceiveTicketMapper.xml

@@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <resultMap type="cn.ezhizao.project.business.receiveTicket.domain.BizFinancialReceiveTicket" id="BizFinancialReceiveTicketResult">
         <id column="id" property="id"/>
+        <result column="company_id" jdbcType="BIGINT" property="companyId" />
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
     <select id="getList" parameterType="BizFinancialReceiveTicket" resultMap="BizFinancialReceiveTicketResult">
@@ -21,6 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="id != null">
             AND t1.id = #{id}
         </if>
+        <if test="principal != null and principal != ''">
+            AND (t2.leader_id=#{principal} OR t2.adviser_id=#{principal})
+        </if>
         <if test="isZero != null">
             AND t2.is_zero = #{isZero}
         </if>
@@ -53,6 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
     <delete id="physicalDelete">
         DELETE FROM biz_financial_receive_ticket
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">

+ 9 - 0
src/main/resources/mybatis/business/BizFinancialReportTaxMapper.xml

@@ -6,6 +6,7 @@
         <result column="company_id" jdbcType="BIGINT" property="companyId"/>
         <association property="currentEmployeeName" javaType="java.lang.String" select="getCurrentEmployeeName"
                      column="current_employee_id"/>
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
     <!--带条件的List查询-->
@@ -51,6 +52,9 @@
         <if test="fromCompanyName != null and fromCompanyName != ''">
             AND t3.account_name like concat('%', #{fromCompanyName}, '%')
         </if>
+        <if test="principal != null and principal != ''">
+            AND (t2.leader_id=#{principal} OR t2.adviser_id=#{principal})
+        </if>
         <if test="month != null and year != null">
             <if test="tenantId != null">
                 AND exists (select 1 from biz_entrust eb
@@ -76,6 +80,11 @@
         </if>
     </sql>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
     <!-- 查询当前维护人员 -->
     <select id="getCurrentEmployeeName" resultType="java.lang.String">
         SELECT nick_name

+ 9 - 0
src/main/resources/mybatis/business/BizFinancialReportTaxNonZeroMapper.xml

@@ -6,6 +6,7 @@
         <result column="company_id" jdbcType="BIGINT" property="companyId"/>
         <association property="currentEmployeeName" javaType="java.lang.String" select="getCurrentEmployeeName"
                      column="current_employee_id"/>
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
     <!--带条件的List查询-->
@@ -36,6 +37,9 @@
         <if test="id != null">
             AND t1.id = #{id}
         </if>
+        <if test="principal != null and principal != ''">
+            AND (t2.leader_id=#{principal} OR t2.adviser_id=#{principal})
+        </if>
         <if test="taxType != null and taxType != ''">
             AND t2.tax_type = #{taxType}
         </if>
@@ -76,6 +80,11 @@
         </if>
     </sql>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
     <!-- 查询当前维护人员 -->
     <select id="getCurrentEmployeeName" resultType="java.lang.String">
         SELECT nick_name

+ 15 - 1
src/main/resources/mybatis/business/BizFinancialSalaryMapper.xml

@@ -6,11 +6,13 @@
 
     <resultMap type="cn.ezhizao.project.business.salary.domain.BizFinancialSalary" id="BizFinancialSalaryResult">
         <id column="id" property="id"/>
+        <result column="company_id" jdbcType="BIGINT" property="companyId"/>
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
 
     <select id="getList" parameterType="BizFinancialSalary" resultMap="BizFinancialSalaryResult">
-        SELECT t1.*, t2.name as company_name, t2.tax_type, t3.account_name as from_company_name
+        SELECT t1.*, t2.name as company_name,t2.tax_type, t3.account_name as from_company_name
         FROM biz_financial_salary t1
         left join biz_company t2 on t2.id = t1.company_id
         left join biz_tenant t3 on t3.id = t1.tenant_id
@@ -27,6 +29,9 @@
             <if test="fromCompanyName != null and fromCompanyName != ''">
                 AND (t3.account_name like concat('%', #{fromCompanyName}, '%'))
             </if>
+            <if test="principal != null and principal != ''">
+                AND (t2.leader_id=#{principal} OR t2.adviser_id=#{principal})
+            </if>
             <if test="month != null and year != null">
                 <if test="tenantId != null">
                     AND exists (select 1 from biz_entrust eb
@@ -44,10 +49,19 @@
                     AND not exists (select 1 from biz_financial_salary_detail fsd where fsd.financial_salary_id = t1.id and
                     fsd.month = #{month} and fsd.year = #{year})
                 </if>
+                <if test="hasIndividualIncomeTax != null">
+                    AND exists (select 1 from biz_financial_salary_detail fsd where fsd.financial_salary_id = t1.id and
+                    has_individual_income_tax=#{hasIndividualIncomeTax} and fsd.month = #{month} and fsd.year = #{year})
+                </if>
             </if>
         </trim>
     </select>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
     <delete id="physicalDelete">
         DELETE FROM biz_financial_salary
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">

+ 8 - 2
src/main/resources/mybatis/business/BizHousingFundConfirmMapper.xml

@@ -34,6 +34,9 @@
             <if test="companyId != null  ">
                 t1.company_id = #{companyId} AND
             </if>
+            <if test="principal != null and principal != ''">
+                 (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
+            </if>
             <if test="accountSetsId != null  ">
                 t1.account_sets_id = #{accountSetsId} AND
             </if>
@@ -46,6 +49,9 @@
             <if test="fromCompanyName != null and fromCompanyName != ''">
                 (t3.account_name like concat('%', #{fromCompanyName}, '%')) AND
             </if>
+            <if test="companyName != null and companyName != ''">
+                 (t2.name like concat('%', #{companyName}, '%')) AND
+            </if>
             <if test="currentEmployeeId != null  ">
                 t1.current_employee_id = #{currentEmployeeId} AND
             </if>
@@ -81,11 +87,11 @@
                     ) AND
                 </if>
                 <if test="status != null and status != 0">
-                    exists (select 1 from biz_housing_fund_confirm_detail fsd where fsd.biz_housing_fund_confirm_id = t1.id and
+                    exists (select 1 from biz_housing_fund_confirm_detail fsd where fsd.housing_fund_confirm_id = t1.id and
                     fsd.month = #{month} and fsd.year = #{year} and fsd.status = #{status}) AND
                 </if>
                 <if test="status != null and status == 0">
-                    not exists (select 1 from biz_housing_fund_confirm_detail fsd where fsd.biz_housing_fund_confirm_id = t1.id and
+                    not exists (select 1 from biz_housing_fund_confirm_detail fsd where fsd.housing_fund_confirm_id = t1.id and
                     fsd.month = #{month} and fsd.year = #{year}) AND
                 </if>
             </if>

+ 3 - 0
src/main/resources/mybatis/business/BizHousingFundDeclareMapper.xml

@@ -34,6 +34,9 @@
             <if test="companyId != null  ">
                 t1.company_id = #{companyId} AND
             </if>
+            <if test="principal != null and principal != ''">
+                (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
+            </if>
             <if test="keyword != null and keyword != ''">
                 (t2.name like concat('%', #{keyword}, '%') or t2.code like concat('%', #{keyword}, '%')) AND
             </if>

+ 11 - 3
src/main/resources/mybatis/business/BizSocialSecurityConfirmMapper.xml

@@ -6,7 +6,7 @@
         <id column="id" jdbcType="BIGINT" property="id"/>
         <result column="id" jdbcType="BIGINT" property="id"/>
         <result column="company_id" jdbcType="BIGINT" property="companyId"/>
-
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
     <!--带条件的List查询-->
@@ -34,6 +34,9 @@
             <if test="companyId != null  ">
                 t1.company_id = #{companyId} AND
             </if>
+            <if test="principal != null and principal != ''">
+                 (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
+            </if>
             <if test="accountSetsId != null  ">
                 t1.account_sets_id = #{accountSetsId} AND
             </if>
@@ -80,14 +83,19 @@
                     ) AND
                 </if>
                 <if test="status != null and status != 0">
-                    AND exists (select 1 from biz_social_security_confirm_detail fsd where fsd.social_security_confirm_id = t1.id and
+                     exists (select 1 from biz_social_security_confirm_detail fsd where fsd.social_security_confirm_id = t1.id and
                     fsd.month = #{month} and fsd.year = #{year} and fsd.status = #{status}) AND
                 </if>
                 <if test="status != null and status == 0">
-                    AND not exists (select 1 from biz_social_security_confirm_detail fsd where fsd.social_security_confirm_id = t1.id and
+                     not exists (select 1 from biz_social_security_confirm_detail fsd where fsd.social_security_confirm_id = t1.id and
                     fsd.month = #{month} and fsd.year = #{year}) AND
                 </if>
             </if>
         </trim>
     </sql>
+
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
 </mapper>

+ 8 - 0
src/main/resources/mybatis/business/BizSocialSecurityDeclareMapper.xml

@@ -6,6 +6,7 @@
         <id column="id" jdbcType="BIGINT" property="id"/>
         <result column="id" jdbcType="BIGINT" property="id"/>
         <result column="company_id" jdbcType="BIGINT" property="companyId"/>
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
     </resultMap>
 
     <!--带条件的List查询-->
@@ -30,6 +31,9 @@
             <if test="id != null  ">
                 t1.id = #{id} AND
             </if>
+            <if test="principal != null and principal != ''">
+                 (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
+            </if>
             <if test="keyword != null and keyword != ''">
                 (t2.name like concat('%', #{keyword}, '%') or t2.code like concat('%', #{keyword}, '%')) AND
             </if>
@@ -90,4 +94,8 @@
         </trim>
     </sql>
 
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
 </mapper>

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

@@ -39,6 +39,9 @@
             <if test="taskTypeId != null "> AND t1.task_type_id = #{taskTypeId}</if>
             <if test="companyId != null "> AND t1.company_id = #{companyId}</if>
             <if test="type != null ">AND t1.type = #{type}</if>
+            <if test="principal != null and principal != ''">
+                AND (t2.leader_id=#{principal} OR t2.adviser_id=#{principal})
+            </if>
             <if test="noContract != null ">AND t1.no_contract = #{noContract}</if>
             <if test="workOrderNo != null  and workOrderNo != ''">AND t1.work_order_no = #{workOrderNo}</if>
             <if test="startMonth != null ">AND t1.start_month = #{startMonth}</if>