ly hai 1 ano
pai
achega
54daae3d86

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

@@ -228,7 +228,7 @@ public class BizHousingFundConfirmController extends BaseController {
     @PreAuthorize("@ss.hasPermi('business:housingFundConfirm:edit')")
     @PostMapping("/updateDetail")
     @Transactional(rollbackFor = Exception.class)
-    @Log(title = "修改社保人员信息", businessType = BusinessType.UPDATE)
+    @Log(title = "修改公积金人员信息", businessType = BusinessType.UPDATE)
     public AjaxResult updateDetail(@RequestBody BizHousingFundConfirmDetail detail) {
         BizCompany company = companyService.getById(detail.getCompanyId());
         company.setHousingFundPassword(detail.getHousingFundPassword());
@@ -239,10 +239,12 @@ public class BizHousingFundConfirmController extends BaseController {
         companyService.updateById(company);
 
         // 获取上个月的人员信息
-        List<BizHousingFundConfirmDetailEmployee> employees = detail.getDetails();
-        BizHousingFundConfirmDetail old = housingFundConfirmDetailService.query().eq("housing_fund_confirm_id", detail.getHousingFundConfirmId()).lt("concat(year,month)", detail.getYear() + detail.getMonth()).orderByDesc("concat(year, month)").last("limit 1").one();
+        List<BizHousingFundConfirmDetailEmployee> employees = detail.getDetails().stream().filter(v ->  v.getChangeStatus()==null||v.getChangeStatus() != 2).collect(Collectors.toList());;
+        BizHousingFundConfirmDetail old = housingFundConfirmDetailService.query()
+                .eq("housing_fund_confirm_id", detail.getHousingFundConfirmId()).lt("concat(year,month)", detail.getYear() + detail.getMonth()).orderByDesc("concat(year, month)").last("limit 1").one();
         if (old != null) {
-            List<BizHousingFundConfirmDetailEmployee> oldEmployees = housingFundConfirmDetailEmployeeService.query().eq("housing_fund_confirm_detail_id", old.getId()).ne("change_status", 2).list();
+            List<BizHousingFundConfirmDetailEmployee> oldEmployees = housingFundConfirmDetailEmployeeService.query()
+                    .eq("housing_fund_confirm_detail_id", old.getId()).ne("change_status", 2).list();
             employees.forEach(l -> {
                 // 判断是新增还是不变
                 if (oldEmployees.stream().anyMatch(v -> v.getPhone().equals(l.getPhone()) && v.getEmployeeName().equals(l.getEmployeeName()))) {