Commit e88ed847 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TSalaryStandardController.java
#	yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryStandardService.java
#	yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardServiceImpl.java
parents f69520be 11a29c2c
...@@ -1055,6 +1055,19 @@ public class InsurancesConstants { ...@@ -1055,6 +1055,19 @@ public class InsurancesConstants {
*/ */
public static final String CORRECT_SETTLE_BILL = "红冲结算单信息"; public static final String CORRECT_SETTLE_BILL = "红冲结算单信息";
/**
* 突发事件创建
*/
public static final String URGENT_UPDATE_IS_USE = "突发事件创建";
/**
* 系统触发
*/
public static final String SYSTEM_TRIGGER = "系统触发";
} }
...@@ -175,5 +175,10 @@ public class InsuranceExportListVO implements Serializable { ...@@ -175,5 +175,10 @@ public class InsuranceExportListVO implements Serializable {
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
} }
...@@ -181,4 +181,10 @@ public class InsuranceRefundListVo implements Serializable { ...@@ -181,4 +181,10 @@ public class InsuranceRefundListVo implements Serializable {
*/ */
@Schema(description = "购买月数") @Schema(description = "购买月数")
private Long buyMonth; private Long buyMonth;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
} }
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
...@@ -25,6 +22,12 @@ public class InsuredOrderListVo implements Serializable { ...@@ -25,6 +22,12 @@ public class InsuredOrderListVo implements Serializable {
@Schema(description = "主键") @Schema(description = "主键")
private String id; private String id;
/**
* 唯一id
*/
@Schema(description = "唯一id")
private String onlyId;
/** /**
* 投保类型, 1新增、3批增、4替换 * 投保类型, 1新增、3批增、4替换
*/ */
......
...@@ -194,4 +194,10 @@ public class RefundExportListVo implements Serializable { ...@@ -194,4 +194,10 @@ public class RefundExportListVo implements Serializable {
*/ */
@Schema(description = "购买天数") @Schema(description = "购买天数")
private long buyDay; private long buyDay;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
} }
...@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; ...@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -50,6 +51,7 @@ public class TInsuranceCompanyController { ...@@ -50,6 +51,7 @@ public class TInsuranceCompanyController {
*/ */
@GetMapping("/{id}" ) @GetMapping("/{id}" )
@Operation(summary = "通过id查询保险公司详情", description = "通过id查询保险公司详情") @Operation(summary = "通过id查询保险公司详情", description = "通过id查询保险公司详情")
@PreAuthorize("@pms.hasPermission('insurance:insuranceCompany_getById')")
public R<TInsuranceCompany> getById(@PathVariable("id" ) String id) { public R<TInsuranceCompany> getById(@PathVariable("id" ) String id) {
return R.ok(insuranceCompanyService.getById(id)); return R.ok(insuranceCompanyService.getById(id));
} }
...@@ -60,10 +62,10 @@ public class TInsuranceCompanyController { ...@@ -60,10 +62,10 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 保险公司明细 * @param insuranceCompany 保险公司明细
* @return R * @return R
*/ */
@Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('demo_insuranceCompany_add')") @Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('insurance:insuranceCompany_save')")
@SysLog("新增保险公司" ) @SysLog("新增保险公司" )
@PostMapping("/save") @PostMapping("/save")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_add')" ) @PreAuthorize("@pms.hasPermission('insurance_company_ad')")
public R save(@RequestBody TInsuranceCompany insuranceCompany) { public R save(@RequestBody TInsuranceCompany insuranceCompany) {
return insuranceCompanyService.saveInsuranceCompany(insuranceCompany); return insuranceCompanyService.saveInsuranceCompany(insuranceCompany);
} }
...@@ -73,10 +75,9 @@ public class TInsuranceCompanyController { ...@@ -73,10 +75,9 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 修改实体类 * @param insuranceCompany 修改实体类
* @return R * @return R
*/ */
@Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('demo_insuranceCompany_update')") @Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('insurance:insuranceCompany_update')")
@SysLog("修改保险公司" ) @SysLog("修改保险公司" )
@PostMapping("/update") @PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_update')" )
public R update(@RequestBody TInsuranceCompany insuranceCompany) { public R update(@RequestBody TInsuranceCompany insuranceCompany) {
return insuranceCompanyService.updateInsuranceCompany(insuranceCompany); return insuranceCompanyService.updateInsuranceCompany(insuranceCompany);
} }
...@@ -85,7 +86,7 @@ public class TInsuranceCompanyController { ...@@ -85,7 +86,7 @@ public class TInsuranceCompanyController {
* 查询保险公司列表(不分页) * 查询保险公司列表(不分页)
* @return * @return
*/ */
@Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页)") @Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页):insurance:insuranceCompany_list")
@GetMapping("/list") @GetMapping("/list")
public R<List<TInsuranceCompany>> getInsuranceCompanyList() { public R<List<TInsuranceCompany>> getInsuranceCompanyList() {
return R.ok(insuranceCompanyService.getInsuranceCompanyList()); return R.ok(insuranceCompanyService.getInsuranceCompanyList());
......
...@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; ...@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -46,6 +47,7 @@ public class TInsuranceEnclosureController { ...@@ -46,6 +47,7 @@ public class TInsuranceEnclosureController {
@SysLog("电子保单上传") @SysLog("电子保单上传")
@Schema(description = "电子保单上传") @Schema(description = "电子保单上传")
@PostMapping(value = "/uploadInsuranceEnclosure") @PostMapping(value = "/uploadInsuranceEnclosure")
@PreAuthorize("@pms.hasPermission('insurance_handle_electronic_import')")
public R uploadInsuranceEnclosure(@RequestBody MultipartFile file, String filePath,String remark) throws IOException { public R uploadInsuranceEnclosure(@RequestBody MultipartFile file, String filePath,String remark) throws IOException {
return tInsuranceEnclosureService.uploadInsuranceEnclosure(file, filePath,remark); return tInsuranceEnclosureService.uploadInsuranceEnclosure(file, filePath,remark);
} }
...@@ -76,6 +78,7 @@ public class TInsuranceEnclosureController { ...@@ -76,6 +78,7 @@ public class TInsuranceEnclosureController {
@Schema(description = "删除电子保单") @Schema(description = "删除电子保单")
@SysLog("删除电子保单") @SysLog("删除电子保单")
@GetMapping("/deleteInsuranceEnclosure/{id}") @GetMapping("/deleteInsuranceEnclosure/{id}")
@PreAuthorize("@pms.hasPermission('insurance_handle_electronic_delete')")
public R deleteInsuranceEnclosure(@PathVariable String id) { public R deleteInsuranceEnclosure(@PathVariable String id) {
return tInsuranceEnclosureService.deleteInsuranceEnclosure(id); return tInsuranceEnclosureService.deleteInsuranceEnclosure(id);
} }
......
...@@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; ...@@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -47,9 +48,10 @@ public class TInsuranceTypeController { ...@@ -47,9 +48,10 @@ public class TInsuranceTypeController {
* @param insuranceType 险种明细 * @param insuranceType 险种明细
* @return R * @return R
*/ */
@Operation(summary = "新增险种", description = "新增险种:hasPermission('demo_insuranceType_add')") @Operation(summary = "新增险种", description = "新增险种:hasPermission('insurance:insuranceType_save')")
@SysLog("新增险种") @SysLog("新增险种")
@PostMapping("/save") @PostMapping("/save")
@PreAuthorize("@pms.hasPermission('insuranceType_add')")
public R save(@RequestBody TInsuranceType insuranceType) { public R save(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.saveInsuranceType(insuranceType); return insuranceTypeService.saveInsuranceType(insuranceType);
} }
...@@ -59,8 +61,9 @@ public class TInsuranceTypeController { ...@@ -59,8 +61,9 @@ public class TInsuranceTypeController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')") @Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('insurance:insuranceType_getInsuranceTypeDetail')")
@GetMapping("/{id}" ) @GetMapping("/{id}" )
//@PreAuthorize("@pms.hasPermission('insurance:insuranceType_getInsuranceTypeDetail')")
public R getInsuranceTypeDetail(@PathVariable("id" ) String id) { public R getInsuranceTypeDetail(@PathVariable("id" ) String id) {
return insuranceTypeService.getInsuranceTypeDetail(id); return insuranceTypeService.getInsuranceTypeDetail(id);
} }
...@@ -71,9 +74,10 @@ public class TInsuranceTypeController { ...@@ -71,9 +74,10 @@ public class TInsuranceTypeController {
* @param insuranceType 险种明细 * @param insuranceType 险种明细
* @return R * @return R
*/ */
@Operation(summary = "修改险种", description = "新增险种:hasPermission('demo_insuranceType_add')") @Operation(summary = "修改险种", description = "新增险种:hasPermission('insurance:insuranceType_update')")
@SysLog("修改险种") @SysLog("修改险种")
@PostMapping("/update") @PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('insurance:insuranceType_update')")
public R update(@RequestBody TInsuranceType insuranceType) { public R update(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.updateInsuranceType(insuranceType); return insuranceTypeService.updateInsuranceType(insuranceType);
} }
......
...@@ -943,6 +943,7 @@ ...@@ -943,6 +943,7 @@
( (
select select
detail.id as id, detail.id as id,
detail.id as onlyId,
detail.BUY_TYPE as buyType, detail.BUY_TYPE as buyType,
detail.CREATE_BY as createBy, detail.CREATE_BY as createBy,
detail.EMP_NAME as empName, detail.EMP_NAME as empName,
...@@ -984,6 +985,7 @@ ...@@ -984,6 +985,7 @@
union all( union all(
select select
detail.id as id, detail.id as id,
refund.id as onlyId,
refund.BUY_TYPE as buyType, refund.BUY_TYPE as buyType,
refund.CREATE_BY as createBy, refund.CREATE_BY as createBy,
detail.EMP_NAME as empName, detail.EMP_NAME as empName,
......
...@@ -70,57 +70,62 @@ public class TStatisticsBonus { ...@@ -70,57 +70,62 @@ public class TStatisticsBonus {
/** /**
* 员工姓名 * 员工姓名
*/ */
@ExcelAttribute(name = "员工姓名", maxLength = 32) @ExcelAttribute(name = "姓名", maxLength = 32)
@Length(max = 32, message = "员工姓名不能超过32个字符") @Length(max = 32, message = "员工姓名不能超过32个字符")
@ExcelProperty("员工姓名") @ExcelProperty("姓名")
@Schema(description = "员工姓名") @Schema(description = "员工姓名")
private String empName; private String empName;
/** /**
* 身份证号 * 身份证号
*/ */
@ExcelAttribute(name = "证件号码", maxLength = 32) @ExcelAttribute(name = "身份证号码", maxLength = 32)
@Length(max = 32, message = "身份证号不能超过32个字符") @Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("证件号码") @ExcelProperty("身份证号码")
@Schema(description = "身份证号") @Schema(description = "身份证号")
private String empIdcard; private String empIdcard;
/** /**
* 年终奖 * 年终奖
*/ */
@ExcelAttribute(name = "年终奖") @ExcelAttribute(name = "年终奖(元)")
@ExcelProperty("年终奖") @ExcelProperty("年终奖(元)")
@Schema(description = "年终奖(元)") @Schema(description = "年终奖(元)")
private BigDecimal annualBonus; private BigDecimal annualBonus;
/** /**
* 年终奖单独扣税应缴税额 * 年终奖单独扣税应缴税额
*/ */
@ExcelAttribute(name = "年终奖单独扣税应缴税额") @ExcelAttribute(name = "年终奖单独扣税")
@ExcelProperty("年终奖单独扣税应缴税额") @ExcelProperty("年终奖单独扣税")
@Schema(description = "年终奖单独扣税应缴税额") @Schema(description = "年终奖单独扣税应缴税额")
private BigDecimal bonusTax; private BigDecimal bonusTax;
/** /**
* 项目id * 项目id
*/ */
@Schema(description = "项目id") @Schema(description = "项目id")
@ExcelIgnore
private String deptId; private String deptId;
/** /**
* 项目编码 * 项目编码
*/ */
@Schema(description = "项目编码") @Schema(description = "项目编码")
@ExcelIgnore
private String deptNo; private String deptNo;
/** /**
* 项目名称 * 项目名称
*/ */
@Schema(description = "项目名称") @Schema(description = "项目名称")
@ExcelIgnore
private String deptName; private String deptName;
/** /**
* 单位id * 单位id
*/ */
@Schema(description = "单位id") @Schema(description = "单位id")
@ExcelIgnore
private String unitId; private String unitId;
/** /**
* 单位编码 * 单位编码
*/ */
@Schema(description = "单位编码") @Schema(description = "单位编码")
@ExcelIgnore
private String unitNo; private String unitNo;
} }
...@@ -72,9 +72,9 @@ public class TStatisticsRemuneration { ...@@ -72,9 +72,9 @@ public class TStatisticsRemuneration {
/** /**
* 身份证号 * 身份证号
*/ */
@ExcelAttribute(name = "身份证号", maxLength = 32) @ExcelAttribute(name = "证件号码", maxLength = 32)
@Length(max = 32, message = "身份证号不能超过32个字符") @Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("身份证号") @ExcelProperty("证件号码")
private String empIdcard; private String empIdcard;
/** /**
* 证件类型 * 证件类型
......
...@@ -158,15 +158,15 @@ public class TSalaryStandardController { ...@@ -158,15 +158,15 @@ public class TSalaryStandardController {
* 审核 * 审核
* *
* @param auditFlag 是否通过 0 是 1 否 * @param auditFlag 是否通过 0 是 1 否
* @param AuditRemark 审核意见 * @param auditRemark 审核意见
* @param id * @param id
* @return * @return
*/ */
@Operation(description = "薪酬审核") @Operation(description = "薪酬审核")
@PostMapping("/salaryStandardAudit") @PostMapping("/salaryStandardAudit")
public R<Boolean> salaryStandardAudit(@RequestParam String auditFlag, @RequestParam(required = false) String AuditRemark, public R<String> salaryStandardAudit(@RequestParam String auditFlag, @RequestParam(required = false) String auditRemark,
@RequestParam String id) { @RequestParam String id) {
return tSalaryStandardService.salaryStandardAudit(auditFlag, AuditRemark, id); return tSalaryStandardService.salaryStandardAudit(auditFlag, auditRemark, id);
} }
/** /**
...@@ -175,7 +175,7 @@ public class TSalaryStandardController { ...@@ -175,7 +175,7 @@ public class TSalaryStandardController {
*/ */
@Operation(description = "保存并提交") @Operation(description = "保存并提交")
@PostMapping("/doSubmit") @PostMapping("/doSubmit")
public R<Boolean> salaryStandardAudit(@RequestBody TSalaryStandard tSalaryStandard) { public R<String> salaryStandardAudit(@RequestBody TSalaryStandard tSalaryStandard) {
if (tSalaryStandard != null && Common.isNotNull(tSalaryStandard.getId())) { if (tSalaryStandard != null && Common.isNotNull(tSalaryStandard.getId())) {
TSalaryStandard s = tSalaryStandardService.getById(tSalaryStandard.getId()); TSalaryStandard s = tSalaryStandardService.getById(tSalaryStandard.getId());
if (s == null) { if (s == null) {
...@@ -197,7 +197,7 @@ public class TSalaryStandardController { ...@@ -197,7 +197,7 @@ public class TSalaryStandardController {
tSalaryStandard.setSubmitTime(new Date()); tSalaryStandard.setSubmitTime(new Date());
tSalaryStandard.setStatus(CommonConstants.ONE_INT); tSalaryStandard.setStatus(CommonConstants.ONE_INT);
tSalaryStandardService.updateById(tSalaryStandard); tSalaryStandardService.updateById(tSalaryStandard);
return R.ok(true,"提交成功!"); return R.ok("提交成功!");
} else { } else {
return R.failed("请登录!"); return R.failed("请登录!");
} }
......
...@@ -20,14 +20,12 @@ package com.yifu.cloud.plus.v1.yifu.salary.service; ...@@ -20,14 +20,12 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List; import java.util.List;
/** /**
...@@ -44,8 +42,6 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> { ...@@ -44,8 +42,6 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
*/ */
IPage<TSalaryStandard> getTSalaryStandardPage(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard); IPage<TSalaryStandard> getTSalaryStandardPage(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TSalaryStandardSearchVo searchVo); void listExport(HttpServletResponse response, TSalaryStandardSearchVo searchVo);
List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo); List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo);
...@@ -60,11 +56,11 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> { ...@@ -60,11 +56,11 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
/** /**
* 标准薪酬工资表审核 * 标准薪酬工资表审核
* @param auditFlag 是否通过 0 是 1 否 * @param auditFlag 是否通过 0 是 1 否
* @param AuditRemark 审核意见 * @param auditRemark 审核意见
* @param id * @param id
* @return * @return
*/ */
R<Boolean> salaryStandardAudit(String auditFlag, String AuditRemark,String id); R<String> salaryStandardAudit(String auditFlag, String auditRemark,String id);
/** /**
* @Description: 删除工资表 * @Description: 删除工资表
......
...@@ -1770,7 +1770,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1770,7 +1770,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
sai.setCnName(SalaryConstants.RELAY_SALARY); sai.setCnName(SalaryConstants.RELAY_SALARY);
sai.setJavaFiedName(SalaryConstants.RELAY_SALARY_JAVA); sai.setJavaFiedName(SalaryConstants.RELAY_SALARY_JAVA);
sai.setIsTax(CommonConstants.ZERO_INT); sai.setIsTax(CommonConstants.ZERO_INT);
sai.setSalaryMoney(BigDecimalUtils.safeAdd(nowTaxT,actualSalarySumNow).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)); sai.setSalaryMoney(relaySalary);
saiList.add(sai); saiList.add(sai);
return nowTaxY; return nowTaxY;
} }
......
...@@ -16,13 +16,8 @@ ...@@ -16,13 +16,8 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.salary.service.impl; package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import cn.hutool.core.bean.BeanUtil; import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -31,7 +26,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -31,7 +26,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TDepartSettlementInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TDepartSettlementInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
...@@ -51,7 +49,6 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService; ...@@ -51,7 +49,6 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants; import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -61,7 +58,6 @@ import org.springframework.stereotype.Service; ...@@ -61,7 +58,6 @@ import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -103,6 +99,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -103,6 +99,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
public IPage<TSalaryStandard> getTSalaryStandardPageApply(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) { public IPage<TSalaryStandard> getTSalaryStandardPageApply(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) {
return baseMapper.getTSalaryStandardPageApply(page, tSalaryStandard); return baseMapper.getTSalaryStandardPageApply(page, tSalaryStandard);
} }
/** /**
* 标准薪酬工资表简单分页查询 * 标准薪酬工资表简单分页查询
* *
...@@ -132,10 +129,10 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -132,10 +129,10 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8")); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TSalaryStandardExportVo.class).build(); ExcelWriter excelWriter = EasyExcelFactory.write(out, TSalaryStandardExportVo.class).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) { for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
...@@ -147,17 +144,16 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -147,17 +144,16 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
} }
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("项目薪酬表" + index).build(); WriteSheet writeSheet = EasyExcelFactory.writerSheet("项目薪酬表" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
} }
} else { } else {
WriteSheet writeSheet = EasyExcel.writerSheet("项目薪酬表" + index).build(); WriteSheet writeSheet = EasyExcelFactory.writerSheet("项目薪酬表" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
...@@ -180,91 +176,11 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -180,91 +176,11 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
@Override @Override
public List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo) { public List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo) {
return baseMapper.getSalaryStandardExport(searchVo,Common.getList(searchVo.getIds())); return baseMapper.getSalaryStandardExport(searchVo, Common.getList(searchVo.getIds()));
} }
private int noPageCountDiy(TSalaryStandardSearchVo searchVo) { private int noPageCountDiy(TSalaryStandardSearchVo searchVo) {
return baseMapper.getSalaryStandardExportCount(searchVo,Common.getList(searchVo.getIds())); return baseMapper.getSalaryStandardExportCount(searchVo, Common.getList(searchVo.getIds()));
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TSalaryStandardVo> util1 = new ExcelUtil<>(TSalaryStandardVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TSalaryStandardVo.class, new ReadListener<TSalaryStandardVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TSalaryStandardVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TSalaryStandardVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTSalaryStandard(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importTSalaryStandard(List<TSalaryStandardVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TSalaryStandardVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TSalaryStandardVo excel) {
TSalaryStandard insert = new TSalaryStandard();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
} }
@Override @Override
...@@ -273,7 +189,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -273,7 +189,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
} }
@Override @Override
public R<Boolean> salaryStandardAudit(String auditFlag, String auditRemark, String id) { public R<String> salaryStandardAudit(String auditFlag, String auditRemark, String id) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
TSalaryStandard tSalaryStandard = baseMapper.selectById(id); TSalaryStandard tSalaryStandard = baseMapper.selectById(id);
if (Common.isNotNull(tSalaryStandard)) { if (Common.isNotNull(tSalaryStandard)) {
...@@ -320,7 +236,6 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -320,7 +236,6 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
} else { } else {
return R.failed("删除失败:未找到工资表!"); return R.failed("删除失败:未找到工资表!");
} }
String deptId = sf.getDeptId();
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) { if (null == user || null == user.getId()) {
return R.failed("删除工资表失败-获取登录人信息为空"); return R.failed("删除工资表失败-获取登录人信息为空");
......
...@@ -36,6 +36,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants; ...@@ -36,6 +36,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryTaxConfig; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryTaxConfig;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsBonus; import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsBonus;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsBonusMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsBonusMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountItemService; import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountItemService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryTaxConfigService; import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryTaxConfigService;
...@@ -73,6 +74,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -73,6 +74,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
private final TSalaryAccountItemService tSalaryAccountItemService; private final TSalaryAccountItemService tSalaryAccountItemService;
private final TSalaryAccountMapper accountMapper;
/** /**
* 全年一次性奖金申报表简单分页查询 * 全年一次性奖金申报表简单分页查询
* @param tStatisticsBonus 全年一次性奖金申报表 * @param tStatisticsBonus 全年一次性奖金申报表
...@@ -90,7 +93,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -90,7 +93,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
*/ */
@Override @Override
public void listExport(HttpServletResponse response, TStatisticsBonusSearchVo searchVo){ public void listExport(HttpServletResponse response, TStatisticsBonusSearchVo searchVo){
String fileName = "全年一次性奖金申报表批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "全年一次性奖金批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TStatisticsBonus> list = new ArrayList<>(); List<TStatisticsBonus> list = new ArrayList<>();
long count = noPageCountDiy(searchVo); long count = noPageCountDiy(searchVo);
...@@ -179,13 +182,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -179,13 +182,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
BigDecimal finalSalaryNoSalary; BigDecimal finalSalaryNoSalary;
//年终奖合并扣税12月税费 //年终奖合并扣税12月税费
BigDecimal finalSalaryWithSalary; BigDecimal finalSalaryWithSalary;
//12月已发工资税费
BigDecimal twlSalaryTax;
try { try {
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8")); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsBonusImportVo.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsBonusImportVo.class).build();
int index = 0; int index = 0;
//个税配置 //个税配置
List<TSalaryTaxConfig> personTax = tSalaryTaxConfigService.getTaxConfigByPersonList(new TSalaryTaxConfig()); List<TSalaryTaxConfig> personTax = tSalaryTaxConfigService.getTaxConfigByPersonList(new TSalaryTaxConfig());
...@@ -229,6 +234,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -229,6 +234,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimal.ZERO; maxAnualSalary = BigDecimal.ZERO;
costReduction = BigDecimal.ZERO; costReduction = BigDecimal.ZERO;
isTax = BigDecimal.ZERO; isTax = BigDecimal.ZERO;
twlSalaryTax = BigDecimal.ZERO;
//12月是否发薪 //12月是否发薪
Boolean isSend = false; Boolean isSend = false;
//年终奖单独扣税12月税费 //年终奖单独扣税12月税费
...@@ -255,9 +261,32 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -255,9 +261,32 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
if (SalaryConstants.COST_REDUCTION_JAVA.equals(item.getJavaFiedName())) { if (SalaryConstants.COST_REDUCTION_JAVA.equals(item.getJavaFiedName())) {
costReduction = costReduction.add(item.getSalaryMoney()); costReduction = costReduction.add(item.getSalaryMoney());
} }
if (CommonConstants.ONE_INT == item.getIsTax()) { if (SalaryConstants.PERSONAL_SOCIAL_JAVA.equals(item.getJavaFiedName())) {
isTax = isTax.add(item.getSalaryMoney());
}
if (SalaryConstants.PERSONAL_FUND_JAVA.equals(item.getJavaFiedName())) {
isTax = isTax.add(item.getSalaryMoney());
}
if (SalaryConstants.EXEMPTION_PERSION_TAX_JAVA.equals(item.getJavaFiedName())) {
isTax = isTax.add(item.getSalaryMoney());
}
if (SalaryConstants.WITHHOLIDING_PERSON_SOCIAL.equals(item.getJavaFiedName())) {
isTax = isTax.add(item.getSalaryMoney()); isTax = isTax.add(item.getSalaryMoney());
} }
if (SalaryConstants.WITHHOLIDING_PERSON_FUND.equals(item.getJavaFiedName())) {
isTax = isTax.add(item.getSalaryMoney());
}
if (SalaryConstants.ENTERPRISE_ANNUITY_JAVA.equals(item.getJavaFiedName())) {
isTax = isTax.add(item.getSalaryMoney());
}
if (SalaryConstants.ONLY_CHILD_JAVA.equals(item.getJavaFiedName())) {
isTax = isTax.add(item.getSalaryMoney());
}
if (item.getSettlementMonth().contains(CommonConstants.TWELVE_STRING)) {
if (SalaryConstants.SALARY_TAX.equals(item.getJavaFiedName())) {
twlSalaryTax.add(item.getSalaryMoney());
}
}
} }
} }
if (CommonConstants.IS_TRUE.equals(infoVo.getIsTSend())) { if (CommonConstants.IS_TRUE.equals(infoVo.getIsTSend())) {
...@@ -271,14 +300,13 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -271,14 +300,13 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
//年终奖合并扣税 //年终奖合并扣税
if (isSend) { if (isSend) {
//年终奖单独扣税 //年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus()); finalSalaryNoSalary = BigDecimalUtils.safeAdd(calculationSalary(annousTax,infoVo.getAnnualBonus()),twlSalaryTax);
wSalary = infoVo.getAnnualBonus(); wSalary = infoVo.getAnnualBonus();
finalSalaryWithSalary = finalSalaryNoSalary; finalSalaryWithSalary = finalSalaryNoSalary;
} else { } else {
//年终奖单独扣税 //年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
BigDecimal annualTSalary = calculationSalaryT(personTax,infoVo.getAnnualTSalary()); BigDecimal annualTSalary = calculationSalaryT(personTax,infoVo.getAnnualTSalary());
finalSalaryNoSalary = BigDecimalUtils.safeAdd(finalSalaryNoSalary,annualTSalary); finalSalaryNoSalary = BigDecimalUtils.safeAdd(calculationSalary(annousTax,infoVo.getAnnualBonus()),annualTSalary);
wSalary = BigDecimalUtils.safeAdd(infoVo.getAnnualBonus(), infoVo.getAnnualTSalary()); wSalary = BigDecimalUtils.safeAdd(infoVo.getAnnualBonus(), infoVo.getAnnualTSalary());
finalSalaryWithSalary = calculationSalary(annousTax, wSalary); finalSalaryWithSalary = calculationSalary(annousTax, wSalary);
} }
...@@ -486,6 +514,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -486,6 +514,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} }
jsonObject.put("anRes",map); jsonObject.put("anRes",map);
jsonObject.put("zySalary",salary); jsonObject.put("zySalary",salary);
map.clear();
zySalary.clear();
return jsonObject; return jsonObject;
} }
......
...@@ -82,7 +82,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -82,7 +82,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
String fileName = "收入明细批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "收入明细批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<IncomeExportVo> list = new ArrayList<>(); List<IncomeExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo,null,Common.getList(searchVo.getIds()),""); long count = noPageCountDiy(searchVo, null, Common.getList(searchVo.getIds()), "");
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
out = response.getOutputStream(); out = response.getOutputStream();
...@@ -97,7 +97,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -97,7 +97,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo,null,Common.getList(searchVo.getIds()),""); list = noPageDiy(searchVo, null, Common.getList(searchVo.getIds()), "");
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
ExcelUtil<IncomeExportVo> util = new ExcelUtil<>(IncomeExportVo.class); ExcelUtil<IncomeExportVo> util = new ExcelUtil<>(IncomeExportVo.class);
for (IncomeExportVo vo : list) { for (IncomeExportVo vo : list) {
...@@ -140,14 +140,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -140,14 +140,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
List<String> settleDomainIds, List<String> settleDomainIds,
List<String> ids, List<String> ids,
String sql) { String sql) {
return baseMapper.noPageDiy(searchVo,settleDomainIds,ids,sql); return baseMapper.noPageDiy(searchVo, settleDomainIds, ids, sql);
} }
private int noPageCountDiy(TIncomeSearchVo searchVo, private int noPageCountDiy(TIncomeSearchVo searchVo,
List<String> settleDomainIds, List<String> settleDomainIds,
List<String> ids, List<String> ids,
String sql) { String sql) {
return baseMapper.noPageCountDiy(searchVo,settleDomainIds,ids,sql); return baseMapper.noPageCountDiy(searchVo, settleDomainIds, ids, sql);
} }
@Override @Override
...@@ -245,12 +245,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -245,12 +245,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
tIncomeDetail.setCreateTime(new Date()); tIncomeDetail.setCreateTime(new Date());
tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0)); tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0));
tIncomeDetailService.save(tIncomeDetail); tIncomeDetailService.save(tIncomeDetail);
// TODO-获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
// 获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
TIncome income = new TIncome(); TIncome income = new TIncome();
income.setEmpIdcard(tIncomeDetail.getEmpIdcard()); income.setEmpIdcard(tIncomeDetail.getEmpIdcard());
income.setDeptId(tIncomeDetail.getDeptId()); income.setDeptId(tIncomeDetail.getDeptId());
List<TIncome> incomeList = baseMapper.getTIncomeList(income); List<TIncome> incomeList = baseMapper.getTIncomeList(income);
TIncomeDetail detail = new TIncomeDetail(); TIncomeDetail detail = new TIncomeDetail();
detail.setEmpIdcard(tIncomeDetail.getEmpIdcard()); detail.setEmpIdcard(tIncomeDetail.getEmpIdcard());
detail.setDeptId(tIncomeDetail.getDeptId()); detail.setDeptId(tIncomeDetail.getDeptId());
...@@ -272,6 +273,12 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -272,6 +273,12 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return this.save(income); return this.save(income);
} }
/**
* @Description: 明细转统计核心逻辑
* @Author: hgw
* @Date: 2022/9/2 10:22
* @return: boolean
**/
private boolean copyCore(TIncomeDetail tIncomeDetail, List<TIncome> incomeList, List<TIncomeDetail> detailList) { private boolean copyCore(TIncomeDetail tIncomeDetail, List<TIncome> incomeList, List<TIncomeDetail> detailList) {
// 判断,比例,直接加 // 判断,比例,直接加
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getFeeMode())) { if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getFeeMode())) {
...@@ -309,46 +316,37 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -309,46 +316,37 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
+ CommonConstants.DOWN_LINE_STRING + income.getRedData(), CommonConstants.ZERO_INT); + CommonConstants.DOWN_LINE_STRING + income.getRedData(), CommonConstants.ZERO_INT);
} }
// 金额人数、人次,需要判重 // 金额人数、人次,需要判重
// 1:预估模式(管理费风险金的结算方式:1预估2实缴) // 社保、公积金(收入来源:1社保2公积金3商险4薪资)
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getMrSettleType())) { if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getSourceType())
// 社保、公积金(收入来源:1社保2公积金3商险4薪资) || CommonConstants.TWO_STRING.equals(tIncomeDetail.getSourceType())) {
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getSourceType()) if (incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()
|| CommonConstants.TWO_STRING.equals(tIncomeDetail.getSourceType())) { + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData()) == null) {
if (incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType() return this.saveIncome(tIncomeDetail);
}
} else if (CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) {
// 商险。收费方式:2金额-人数
if (CommonConstants.TWO_STRING.equals(tIncomeDetail.getFeeMode())) {
if (insureMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData()) == null) { + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData()) == null) {
return this.saveIncome(tIncomeDetail); return this.saveIncome(tIncomeDetail);
} }
} else if (CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) {
// 商险。收费方式:2金额-人数
if (CommonConstants.TWO_STRING.equals(tIncomeDetail.getFeeMode())) {
if (insureMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData()) == null) {
return this.saveIncome(tIncomeDetail);
}
} else {
// 各个模式累加逻辑:
return this.judgeMixModel(tIncomeDetail, numMap, incomeMap);
}
} else { } else {
// 薪资。收费方式:2金额-人数 // 各个模式累加逻辑:
if (CommonConstants.TWO_STRING.equals(tIncomeDetail.getFeeMode())) { return this.judgeMixModel(tIncomeDetail, numMap, incomeMap);
if (incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData()) == null) {
return this.saveIncome(tIncomeDetail);
}
} else {
// 3金额-人次
// 各个模式累加逻辑:
return this.judgeMixModel(tIncomeDetail, numMap, incomeMap);
}
} }
} else { } else {
// 实缴 // 薪资。收费方式:2金额-人数
// TODO if (CommonConstants.TWO_STRING.equals(tIncomeDetail.getFeeMode())) {
if (incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData()) == null) {
return this.saveIncome(tIncomeDetail);
}
} else {
// 3金额-人次
// 各个模式累加逻辑:
return this.judgeMixModel(tIncomeDetail, numMap, incomeMap);
}
} }
} }
return true; return true;
} }
...@@ -360,15 +358,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -360,15 +358,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @return: boolean * @return: boolean
**/ **/
private boolean judgeMixModel(TIncomeDetail tIncomeDetail, Map<String, Integer> numMap, Map<String, Integer> incomeMap) { private boolean judgeMixModel(TIncomeDetail tIncomeDetail, Map<String, Integer> numMap, Map<String, Integer> incomeMap) {
Integer nums; Integer nums = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
Integer maxNum;
nums = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData()); + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData());
maxNum = incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType() Integer maxNum = incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData()); + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getRedData());
// 当明细的次数大于总次数,才可以新增统计 // 当明细的次数大于总次数,才可以新增统计
if (nums > maxNum) { if (Common.isEmpty(maxNum) || nums > maxNum) {
return this.saveIncome(tIncomeDetail); return this.saveIncome(tIncomeDetail);
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment