ly 1 год назад
Родитель
Сommit
5bb89ddb2e

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

@@ -32,6 +32,8 @@ import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBi
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBizFinancialIndividualIncomeTaxDetailIsZeroService;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirm;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetail;
+import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetailEmployee;
+import cn.ezhizao.project.business.housingFund.service.IBizHousingFundConfirmDetailEmployeeService;
 import cn.ezhizao.project.business.housingFund.service.IBizHousingFundConfirmDetailService;
 import cn.ezhizao.project.business.housingFund.service.IBizHousingFundConfirmService;
 import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccount;
@@ -49,6 +51,8 @@ import cn.ezhizao.project.business.salary.service.IBizFinancialSalaryDetailEmplo
 import cn.ezhizao.project.business.salary.service.IBizFinancialSalaryDetailService;
 import cn.ezhizao.project.business.socialSecurity.domain.BizSocialSecurityConfirm;
 import cn.ezhizao.project.business.socialSecurity.domain.BizSocialSecurityConfirmDetail;
+import cn.ezhizao.project.business.socialSecurity.domain.BizSocialSecurityConfirmDetailEmployee;
+import cn.ezhizao.project.business.socialSecurity.service.IBizSocialSecurityConfirmDetailEmployeeService;
 import cn.ezhizao.project.business.socialSecurity.service.IBizSocialSecurityConfirmDetailService;
 import cn.ezhizao.project.business.socialSecurity.service.IBizSocialSecurityConfirmService;
 import cn.ezhizao.project.business.workOrder.domain.BizWorkOrderRecord;
@@ -70,6 +74,7 @@ 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.omg.CORBA.PRIVATE_MEMBER;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -124,6 +129,7 @@ public class BizFinancialSalaryController extends BaseController {
     @Autowired
     private FreeMarkerConfigurer freeMarkerConfigurer;
 
+
     @Resource
     private IBizFinancialSalaryDetailEmployeeService bizFinancialSalaryDetailEmployeeService;
     @Resource
@@ -133,6 +139,11 @@ public class BizFinancialSalaryController extends BaseController {
 
     @Resource
     private IBizSocialSecurityConfirmDetailService socialSecurityConfirmDetailService;
+    @Resource
+    private IBizSocialSecurityConfirmDetailEmployeeService socialSecurityConfirmDetailEmployeeService;
+
+    @Resource
+    private IBizHousingFundConfirmDetailEmployeeService housingFundConfirmDetailEmployeeService;
 
     @Resource
     private IBizSocialSecurityConfirmService socialSecurityConfirmService;
@@ -379,13 +390,89 @@ public class BizFinancialSalaryController extends BaseController {
             if (detail != null) {
                 List<BizFinancialSalaryDetailEmployee> employees = bizFinancialSalaryDetailEmployeeService.query().eq("financial_salary_detail_id", detail.getId()).list();
                 employees.forEach(l -> l.setId(null));
+                //社保存在
+                BizSocialSecurityConfirmDetail one = socialSecurityConfirmDetailService.getOne(new LambdaQueryWrapper<BizSocialSecurityConfirmDetail>()
+                        .eq(BizSocialSecurityConfirmDetail::getYear, bizFinancialSalaryDetail.getYear())
+                        .eq(BizSocialSecurityConfirmDetail::getMonth, bizFinancialSalaryDetail.getMonth())
+                        .eq(BizSocialSecurityConfirmDetail::getCompanyId, bizFinancialSalaryDetail.getCompanyId())
+                        .last("limit 1"));
+
+                BizHousingFundConfirmDetail one1 = housingFundConfirmDetailService.getOne(new LambdaQueryWrapper<BizHousingFundConfirmDetail>()
+                        .eq(BizHousingFundConfirmDetail::getYear, bizFinancialSalaryDetail.getYear())
+                        .eq(BizHousingFundConfirmDetail::getMonth, bizFinancialSalaryDetail.getMonth())
+                        .eq(BizHousingFundConfirmDetail::getCompanyId, bizFinancialSalaryDetail.getCompanyId())
+                        .last("limit 1"));
+                if (one != null){
+                    List<BizSocialSecurityConfirmDetailEmployee> employeeList = socialSecurityConfirmDetailEmployeeService.list(new LambdaQueryWrapper<BizSocialSecurityConfirmDetailEmployee>()
+                            .eq(BizSocialSecurityConfirmDetailEmployee::getSocialSecurityConfirmDetailId, one.getId()));
+                    if (employeeList != null){
+                        List<String> employeeName = employeeList.stream().map(BizSocialSecurityConfirmDetailEmployee::getEmployeeName).collect(Collectors.toList());
+                        for (BizFinancialSalaryDetailEmployee employee : employees) {
+                            if (employeeName.contains(employee.getEmployeeName())){
+                                employee.setSocialSecurityStatus(1);
+                            }
+                        }
+                    }
+                }
+                if (one1 != null){
+                    List<BizHousingFundConfirmDetailEmployee> employeeList = housingFundConfirmDetailEmployeeService.list(new LambdaQueryWrapper<BizHousingFundConfirmDetailEmployee>()
+                            .eq(BizHousingFundConfirmDetailEmployee::getHousingFundConfirmDetailId, one1.getId()));
+                    if (employeeList != null){
+                        List<String> employeeName = employeeList.stream().map(BizHousingFundConfirmDetailEmployee::getEmployeeName).collect(Collectors.toList());
+                        for (BizFinancialSalaryDetailEmployee employee : employees) {
+                            if (employeeName.contains(employee.getEmployeeName())){
+                                employee.setHousingFundStatus(1);
+                            }
+                        }
+                    }
+                }
                 bizFinancialSalaryDetail.setDetails(employees);
             } else {
                 bizFinancialSalaryDetail.setDetails(new ArrayList<>());
             }
             return success(bizFinancialSalaryDetail);
         }
-        return success(bizFinancialSalaryDetails.get(0));
+
+        BizFinancialSalaryDetail bizFinancialSalaryDetail1 = bizFinancialSalaryDetails.get(0);
+        List<BizFinancialSalaryDetailEmployee> details = bizFinancialSalaryDetail1.getDetails();
+
+        //社保存在
+        BizSocialSecurityConfirmDetail one = socialSecurityConfirmDetailService.getOne(new LambdaQueryWrapper<BizSocialSecurityConfirmDetail>()
+                .eq(BizSocialSecurityConfirmDetail::getYear, bizFinancialSalaryDetail.getYear())
+                .eq(BizSocialSecurityConfirmDetail::getMonth, bizFinancialSalaryDetail.getMonth())
+                .eq(BizSocialSecurityConfirmDetail::getCompanyId, bizFinancialSalaryDetail.getCompanyId())
+                .last("limit 1"));
+
+        BizHousingFundConfirmDetail one1 = housingFundConfirmDetailService.getOne(new LambdaQueryWrapper<BizHousingFundConfirmDetail>()
+                .eq(BizHousingFundConfirmDetail::getYear, bizFinancialSalaryDetail.getYear())
+                .eq(BizHousingFundConfirmDetail::getMonth, bizFinancialSalaryDetail.getMonth())
+                .eq(BizHousingFundConfirmDetail::getCompanyId, bizFinancialSalaryDetail.getCompanyId())
+                .last("limit 1"));
+        if (one != null){
+            List<BizSocialSecurityConfirmDetailEmployee> employeeList = socialSecurityConfirmDetailEmployeeService.list(new LambdaQueryWrapper<BizSocialSecurityConfirmDetailEmployee>()
+                    .eq(BizSocialSecurityConfirmDetailEmployee::getSocialSecurityConfirmDetailId, one.getId()));
+            if (employeeList != null){
+                List<String> employeeName = employeeList.stream().map(BizSocialSecurityConfirmDetailEmployee::getEmployeeName).collect(Collectors.toList());
+                for (BizFinancialSalaryDetailEmployee employee : details) {
+                    if (employeeName.contains(employee.getEmployeeName())){
+                        employee.setSocialSecurityStatus(1);
+                    }
+                }
+            }
+        }
+        if (one1 != null){
+            List<BizHousingFundConfirmDetailEmployee> employeeList = housingFundConfirmDetailEmployeeService.list(new LambdaQueryWrapper<BizHousingFundConfirmDetailEmployee>()
+                    .eq(BizHousingFundConfirmDetailEmployee::getHousingFundConfirmDetailId, one1.getId()));
+            if (employeeList != null){
+                List<String> employeeName = employeeList.stream().map(BizHousingFundConfirmDetailEmployee::getEmployeeName).collect(Collectors.toList());
+                for (BizFinancialSalaryDetailEmployee employee : details) {
+                    if (employeeName.contains(employee.getEmployeeName())){
+                        employee.setHousingFundStatus(1);
+                    }
+                }
+            }
+        }
+        return success(bizFinancialSalaryDetail1);
     }
 
     @PreAuthorize("@ss.hasPermi('business:salary:edit')")

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

@@ -19,7 +19,10 @@ import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizF
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxIsZero;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBizFinancialIndividualIncomeTaxDetailIsZeroService;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBizFinancialIndividualIncomeTaxIsZeroService;
+import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetail;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetailEmployee;
+import cn.ezhizao.project.business.housingFund.service.IBizHousingFundConfirmDetailEmployeeService;
+import cn.ezhizao.project.business.housingFund.service.IBizHousingFundConfirmDetailService;
 import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccount;
 import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccountDetail;
 import cn.ezhizao.project.business.keepAccounts.service.IBizFinancialKeepAccountDetailService;
@@ -34,6 +37,10 @@ import cn.ezhizao.project.business.salary.domain.vo.BizFinancialSalaryDetailEmpl
 import cn.ezhizao.project.business.salary.service.IBizFinancialSalaryDetailEmployeeService;
 import cn.ezhizao.project.business.salary.service.IBizFinancialSalaryDetailService;
 import cn.ezhizao.project.business.salary.service.IBizFinancialSalaryService;
+import cn.ezhizao.project.business.socialSecurity.domain.BizSocialSecurityConfirmDetail;
+import cn.ezhizao.project.business.socialSecurity.domain.BizSocialSecurityConfirmDetailEmployee;
+import cn.ezhizao.project.business.socialSecurity.service.IBizSocialSecurityConfirmDetailEmployeeService;
+import cn.ezhizao.project.business.socialSecurity.service.IBizSocialSecurityConfirmDetailService;
 import cn.ezhizao.project.business.workOrder.domain.BizWorkOrderRecord;
 import cn.ezhizao.project.business.workOrder.service.IBizWorkOrderRecordService;
 import cn.ezhizao.project.system.domain.SysUser;
@@ -86,12 +93,21 @@ public class BizFinancialSalaryZeroController extends BaseController {
     @Resource
     private IBizCompanyService companyService;
     @Resource
+    private IBizSocialSecurityConfirmDetailService socialSecurityConfirmDetailService;
+    @Resource
     private IBizFinancialSalaryDetailEmployeeService bizFinancialSalaryDetailEmployeeService;
     @Resource
     private IBizFinancialKeepAccountService financialKeepAccountService;
     @Resource
     private IBizFinancialKeepAccountDetailService financialKeepAccountDetailService;
 
+    @Resource
+    private IBizHousingFundConfirmDetailEmployeeService housingFundConfirmDetailEmployeeService;
+    @Resource
+    private IBizHousingFundConfirmDetailService housingFundConfirmDetailService;
+
+    @Resource
+    private IBizSocialSecurityConfirmDetailEmployeeService socialSecurityConfirmDetailEmployeeService;
     @Resource
     private IBizEntrustService bizEntrustService;
 
@@ -246,13 +262,88 @@ public class BizFinancialSalaryZeroController extends BaseController {
             if (detail != null) {
                 List<BizFinancialSalaryDetailEmployee> employees = bizFinancialSalaryDetailEmployeeService.query().eq("financial_salary_detail_id", detail.getId()).list();
                 employees.forEach(l -> l.setId(null));
+                //社保存在
+                BizSocialSecurityConfirmDetail one = socialSecurityConfirmDetailService.getOne(new LambdaQueryWrapper<BizSocialSecurityConfirmDetail>()
+                        .eq(BizSocialSecurityConfirmDetail::getYear, bizFinancialSalaryDetail.getYear())
+                        .eq(BizSocialSecurityConfirmDetail::getMonth, bizFinancialSalaryDetail.getMonth())
+                        .eq(BizSocialSecurityConfirmDetail::getCompanyId, bizFinancialSalaryDetail.getCompanyId())
+                        .last("limit 1"));
+
+                BizHousingFundConfirmDetail one1 = housingFundConfirmDetailService.getOne(new LambdaQueryWrapper<BizHousingFundConfirmDetail>()
+                        .eq(BizHousingFundConfirmDetail::getYear, bizFinancialSalaryDetail.getYear())
+                        .eq(BizHousingFundConfirmDetail::getMonth, bizFinancialSalaryDetail.getMonth())
+                        .eq(BizHousingFundConfirmDetail::getCompanyId, bizFinancialSalaryDetail.getCompanyId())
+                        .last("limit 1"));
+                if (one != null){
+                    List<BizSocialSecurityConfirmDetailEmployee> employeeList = socialSecurityConfirmDetailEmployeeService.list(new LambdaQueryWrapper<BizSocialSecurityConfirmDetailEmployee>()
+                            .eq(BizSocialSecurityConfirmDetailEmployee::getSocialSecurityConfirmDetailId, one.getId()));
+                    if (employeeList != null){
+                        List<String> employeeName = employeeList.stream().map(BizSocialSecurityConfirmDetailEmployee::getEmployeeName).collect(Collectors.toList());
+                        for (BizFinancialSalaryDetailEmployee employee : employees) {
+                            if (employeeName.contains(employee.getEmployeeName())){
+                                employee.setSocialSecurityStatus(1);
+                            }
+                        }
+                    }
+                }
+                if (one1 != null){
+                    List<BizHousingFundConfirmDetailEmployee> employeeList = housingFundConfirmDetailEmployeeService.list(new LambdaQueryWrapper<BizHousingFundConfirmDetailEmployee>()
+                            .eq(BizHousingFundConfirmDetailEmployee::getHousingFundConfirmDetailId, one1.getId()));
+                    if (employeeList != null){
+                        List<String> employeeName = employeeList.stream().map(BizHousingFundConfirmDetailEmployee::getEmployeeName).collect(Collectors.toList());
+                        for (BizFinancialSalaryDetailEmployee employee : employees) {
+                            if (employeeName.contains(employee.getEmployeeName())){
+                                employee.setHousingFundStatus(1);
+                            }
+                        }
+                    }
+                }
                 bizFinancialSalaryDetail.setDetails(employees);
             } else {
                 bizFinancialSalaryDetail.setDetails(new ArrayList<>());
             }
             return success(bizFinancialSalaryDetail);
         }
-        return success(bizFinancialSalaryDetails.get(0));
+        BizFinancialSalaryDetail bizFinancialSalaryDetail1 = bizFinancialSalaryDetails.get(0);
+        List<BizFinancialSalaryDetailEmployee> details = bizFinancialSalaryDetail1.getDetails();
+
+        //社保存在
+        BizSocialSecurityConfirmDetail one = socialSecurityConfirmDetailService.getOne(new LambdaQueryWrapper<BizSocialSecurityConfirmDetail>()
+                .eq(BizSocialSecurityConfirmDetail::getYear, bizFinancialSalaryDetail.getYear())
+                .eq(BizSocialSecurityConfirmDetail::getMonth, bizFinancialSalaryDetail.getMonth())
+                .eq(BizSocialSecurityConfirmDetail::getCompanyId, bizFinancialSalaryDetail.getCompanyId())
+                .last("limit 1"));
+
+        BizHousingFundConfirmDetail one1 = housingFundConfirmDetailService.getOne(new LambdaQueryWrapper<BizHousingFundConfirmDetail>()
+                .eq(BizHousingFundConfirmDetail::getYear, bizFinancialSalaryDetail.getYear())
+                .eq(BizHousingFundConfirmDetail::getMonth, bizFinancialSalaryDetail.getMonth())
+                .eq(BizHousingFundConfirmDetail::getCompanyId, bizFinancialSalaryDetail.getCompanyId())
+                .last("limit 1"));
+        if (one != null){
+            List<BizSocialSecurityConfirmDetailEmployee> employeeList = socialSecurityConfirmDetailEmployeeService.list(new LambdaQueryWrapper<BizSocialSecurityConfirmDetailEmployee>()
+                    .eq(BizSocialSecurityConfirmDetailEmployee::getSocialSecurityConfirmDetailId, one.getId()));
+            if (employeeList != null){
+                List<String> employeeName = employeeList.stream().map(BizSocialSecurityConfirmDetailEmployee::getEmployeeName).collect(Collectors.toList());
+                for (BizFinancialSalaryDetailEmployee employee : details) {
+                    if (employeeName.contains(employee.getEmployeeName())){
+                        employee.setSocialSecurityStatus(1);
+                    }
+                }
+            }
+        }
+        if (one1 != null){
+            List<BizHousingFundConfirmDetailEmployee> employeeList = housingFundConfirmDetailEmployeeService.list(new LambdaQueryWrapper<BizHousingFundConfirmDetailEmployee>()
+                    .eq(BizHousingFundConfirmDetailEmployee::getHousingFundConfirmDetailId, one1.getId()));
+            if (employeeList != null){
+                List<String> employeeName = employeeList.stream().map(BizHousingFundConfirmDetailEmployee::getEmployeeName).collect(Collectors.toList());
+                for (BizFinancialSalaryDetailEmployee employee : details) {
+                    if (employeeName.contains(employee.getEmployeeName())){
+                        employee.setHousingFundStatus(1);
+                    }
+                }
+            }
+        }
+        return success(bizFinancialSalaryDetail1);
     }
 
     @PreAuthorize("@ss.hasPermi('business:salary:edit')")

+ 7 - 0
src/main/java/cn/ezhizao/project/business/salary/domain/BizFinancialSalaryDetailEmployee.java

@@ -208,4 +208,11 @@ public class BizFinancialSalaryDetailEmployee extends BaseEntity
     /** 备注 */
     @Excel(name = "备注")
     private String remark;
+
+    @TableField(exist = false)
+    private Integer socialSecurityStatus;
+
+    @TableField(exist = false)
+    /**0未申报 1已申报*/
+    private Integer housingFundStatus;
 }