|
@@ -11,6 +11,10 @@ import cn.ezhizao.project.business.company.domain.BizCompany;
|
|
import cn.ezhizao.project.business.company.service.IBizCompanyService;
|
|
import cn.ezhizao.project.business.company.service.IBizCompanyService;
|
|
import cn.ezhizao.project.business.deduction.domain.BizDeduction;
|
|
import cn.ezhizao.project.business.deduction.domain.BizDeduction;
|
|
import cn.ezhizao.project.business.deduction.service.IBizDeductionService;
|
|
import cn.ezhizao.project.business.deduction.service.IBizDeductionService;
|
|
|
|
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
|
|
|
|
+import cn.ezhizao.project.business.entrust.service.IBizEntrustService;
|
|
|
|
+import cn.ezhizao.project.business.history.domain.BizHistory;
|
|
|
|
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
|
|
import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetail;
|
|
import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetail;
|
|
import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetailEmployee;
|
|
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.EmployeeExcel;
|
|
@@ -34,6 +38,7 @@ import com.alibaba.excel.EasyExcel;
|
|
import com.alibaba.excel.ExcelWriter;
|
|
import com.alibaba.excel.ExcelWriter;
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
|
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.catalina.security.SecurityUtil;
|
|
import org.apache.catalina.security.SecurityUtil;
|
|
@@ -82,7 +87,11 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
IBizDeductionService deductionService;
|
|
IBizDeductionService deductionService;
|
|
@Resource
|
|
@Resource
|
|
IBizWorkOrderRecordService bizWorkOrderRecordService;
|
|
IBizWorkOrderRecordService bizWorkOrderRecordService;
|
|
|
|
+ @Resource
|
|
|
|
+ private IBizEntrustService bizEntrustService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private IBizHistoryService bizHistoryService;
|
|
@ApiOperation(value = "根据id查询", notes = "根据id查询")
|
|
@ApiOperation(value = "根据id查询", notes = "根据id查询")
|
|
@GetMapping("/getById/{id}")
|
|
@GetMapping("/getById/{id}")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -379,9 +388,6 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
String month = condition.getMonth();
|
|
String month = condition.getMonth();
|
|
String s1 = year + month;
|
|
String s1 = year + month;
|
|
String s2 = nowYear + formattedMonth;
|
|
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("当前月未找到数据");
|
|
return error("当前月未找到数据");
|
|
}
|
|
}
|
|
@@ -410,7 +416,17 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
condition.setIsFirstSocialSecurity(company.getIsFirstSocialSecurity());
|
|
condition.setIsFirstSocialSecurity(company.getIsFirstSocialSecurity());
|
|
return success(condition);
|
|
return success(condition);
|
|
}
|
|
}
|
|
- return success(socialSecurityConfirmDetails.get(0));
|
|
|
|
|
|
+ Long id = condition.getSocialSecurityDeclareId();
|
|
|
|
+ Long workOrderId = socialSecurityDeclareService.getById(id).getWorkOrderId();
|
|
|
|
+ String s3 = year +"-"+ month+ "-01";
|
|
|
|
+ BizEntrust one = bizEntrustService.getOne(new LambdaQueryWrapper<BizEntrust>()
|
|
|
|
+ .eq(BizEntrust::getWorkOrderId, workOrderId)
|
|
|
|
+ .eq(BizEntrust::getDeleted, 0)
|
|
|
|
+ .eq(BizEntrust::getCurrentMonth, s3 ));
|
|
|
|
+ BizSocialSecurityDeclareDetail bizSocialSecurityDeclareDetail = socialSecurityConfirmDetails.get(0);
|
|
|
|
+ bizSocialSecurityDeclareDetail.setEntrust(one);
|
|
|
|
+
|
|
|
|
+ return success(bizSocialSecurityDeclareDetail);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -419,6 +435,7 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
@PostMapping("/saveDetail")
|
|
@PostMapping("/saveDetail")
|
|
@Log(title = "社保申报", businessType = BusinessType.UPDATE)
|
|
@Log(title = "社保申报", businessType = BusinessType.UPDATE)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult saveDetail(@RequestBody BizSocialSecurityDeclareDetail detail) {
|
|
public AjaxResult saveDetail(@RequestBody BizSocialSecurityDeclareDetail detail) {
|
|
detail.setVerifierId(SecurityUtils.getUserId());
|
|
detail.setVerifierId(SecurityUtils.getUserId());
|
|
detail.setVerifierTime(new Date());
|
|
detail.setVerifierTime(new Date());
|
|
@@ -440,6 +457,13 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
delCondition.setMasterId(detail.getId());
|
|
delCondition.setMasterId(detail.getId());
|
|
delCondition.setMasterTableName("biz_social_security_declare_detail");
|
|
delCondition.setMasterTableName("biz_social_security_declare_detail");
|
|
fileStorageService.physicalDelete(delCondition);
|
|
fileStorageService.physicalDelete(delCondition);
|
|
|
|
+ BizHistory bizHistory = new BizHistory();
|
|
|
|
+ bizHistory.setTableName("biz_social_security_declare");
|
|
|
|
+ bizHistory.setCompanyId(detail.getCompanyId());
|
|
|
|
+ bizHistory.setEvent("保存");
|
|
|
|
+ bizHistory.setTenantId(getTenantId());
|
|
|
|
+ bizHistory.setBelongPeriod(detail.getYear() + "-" +String.format("%02d", Integer.valueOf(detail.getMonth())));
|
|
|
|
+ bizHistoryService.save(bizHistory);
|
|
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();
|
|
return bool ? success(detail) : error();
|
|
}
|
|
}
|
|
@@ -607,6 +631,13 @@ public class SocialSecurityDeclareController extends BaseController {
|
|
return error("该社保记录已扣款");
|
|
return error("该社保记录已扣款");
|
|
}
|
|
}
|
|
deductionService.removeBatchByIds(deductions.stream().map(BizDeduction::getId).collect(Collectors.toList()));
|
|
deductionService.removeBatchByIds(deductions.stream().map(BizDeduction::getId).collect(Collectors.toList()));
|
|
|
|
+ BizHistory bizHistory = new BizHistory();
|
|
|
|
+ bizHistory.setTableName("biz_social_security_declare");
|
|
|
|
+ bizHistory.setCompanyId(detail.getCompanyId());
|
|
|
|
+ bizHistory.setEvent("退回");
|
|
|
|
+ bizHistory.setTenantId(getTenantId());
|
|
|
|
+ bizHistory.setBelongPeriod(detail.getYear() + "-" +String.format("%02d", Integer.valueOf(detail.getMonth())));
|
|
|
|
+ bizHistoryService.save(bizHistory);
|
|
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();
|
|
}
|
|
}
|
|
|
|
|