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 {
*/
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 {
@Schema(description = "备注")
private String remark;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
}
......@@ -181,4 +181,10 @@ public class InsuranceRefundListVo implements Serializable {
*/
@Schema(description = "购买月数")
private Long buyMonth;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
}
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.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
......@@ -25,6 +22,12 @@ public class InsuredOrderListVo implements Serializable {
@Schema(description = "主键")
private String id;
/**
* 唯一id
*/
@Schema(description = "唯一id")
private String onlyId;
/**
* 投保类型, 1新增、3批增、4替换
*/
......
......@@ -194,4 +194,10 @@ public class RefundExportListVo implements Serializable {
*/
@Schema(description = "购买天数")
private long buyDay;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
}
......@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -50,6 +51,7 @@ public class TInsuranceCompanyController {
*/
@GetMapping("/{id}" )
@Operation(summary = "通过id查询保险公司详情", description = "通过id查询保险公司详情")
@PreAuthorize("@pms.hasPermission('insurance:insuranceCompany_getById')")
public R<TInsuranceCompany> getById(@PathVariable("id" ) String id) {
return R.ok(insuranceCompanyService.getById(id));
}
......@@ -60,10 +62,10 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 保险公司明细
* @return R
*/
@Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('demo_insuranceCompany_add')")
@Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('insurance:insuranceCompany_save')")
@SysLog("新增保险公司" )
@PostMapping("/save")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_add')" )
@PreAuthorize("@pms.hasPermission('insurance_company_ad')")
public R save(@RequestBody TInsuranceCompany insuranceCompany) {
return insuranceCompanyService.saveInsuranceCompany(insuranceCompany);
}
......@@ -73,10 +75,9 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 修改实体类
* @return R
*/
@Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('demo_insuranceCompany_update')")
@Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('insurance:insuranceCompany_update')")
@SysLog("修改保险公司" )
@PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_update')" )
public R update(@RequestBody TInsuranceCompany insuranceCompany) {
return insuranceCompanyService.updateInsuranceCompany(insuranceCompany);
}
......@@ -85,7 +86,7 @@ public class TInsuranceCompanyController {
* 查询保险公司列表(不分页)
* @return
*/
@Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页)")
@Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页):insurance:insuranceCompany_list")
@GetMapping("/list")
public R<List<TInsuranceCompany>> getInsuranceCompanyList() {
return R.ok(insuranceCompanyService.getInsuranceCompanyList());
......
......@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -46,6 +47,7 @@ public class TInsuranceEnclosureController {
@SysLog("电子保单上传")
@Schema(description = "电子保单上传")
@PostMapping(value = "/uploadInsuranceEnclosure")
@PreAuthorize("@pms.hasPermission('insurance_handle_electronic_import')")
public R uploadInsuranceEnclosure(@RequestBody MultipartFile file, String filePath,String remark) throws IOException {
return tInsuranceEnclosureService.uploadInsuranceEnclosure(file, filePath,remark);
}
......@@ -76,6 +78,7 @@ public class TInsuranceEnclosureController {
@Schema(description = "删除电子保单")
@SysLog("删除电子保单")
@GetMapping("/deleteInsuranceEnclosure/{id}")
@PreAuthorize("@pms.hasPermission('insurance_handle_electronic_delete')")
public R deleteInsuranceEnclosure(@PathVariable String id) {
return tInsuranceEnclosureService.deleteInsuranceEnclosure(id);
}
......
......@@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -47,9 +48,10 @@ public class TInsuranceTypeController {
* @param insuranceType 险种明细
* @return R
*/
@Operation(summary = "新增险种", description = "新增险种:hasPermission('demo_insuranceType_add')")
@Operation(summary = "新增险种", description = "新增险种:hasPermission('insurance:insuranceType_save')")
@SysLog("新增险种")
@PostMapping("/save")
@PreAuthorize("@pms.hasPermission('insuranceType_add')")
public R save(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.saveInsuranceType(insuranceType);
}
......@@ -59,8 +61,9 @@ public class TInsuranceTypeController {
* @param id id
* @return R
*/
@Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')")
@Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('insurance:insuranceType_getInsuranceTypeDetail')")
@GetMapping("/{id}" )
//@PreAuthorize("@pms.hasPermission('insurance:insuranceType_getInsuranceTypeDetail')")
public R getInsuranceTypeDetail(@PathVariable("id" ) String id) {
return insuranceTypeService.getInsuranceTypeDetail(id);
}
......@@ -71,9 +74,10 @@ public class TInsuranceTypeController {
* @param insuranceType 险种明细
* @return R
*/
@Operation(summary = "修改险种", description = "新增险种:hasPermission('demo_insuranceType_add')")
@Operation(summary = "修改险种", description = "新增险种:hasPermission('insurance:insuranceType_update')")
@SysLog("修改险种")
@PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('insurance:insuranceType_update')")
public R update(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.updateInsuranceType(insuranceType);
}
......
......@@ -943,6 +943,7 @@
(
select
detail.id as id,
detail.id as onlyId,
detail.BUY_TYPE as buyType,
detail.CREATE_BY as createBy,
detail.EMP_NAME as empName,
......@@ -984,6 +985,7 @@
union all(
select
detail.id as id,
refund.id as onlyId,
refund.BUY_TYPE as buyType,
refund.CREATE_BY as createBy,
detail.EMP_NAME as empName,
......
......@@ -70,57 +70,62 @@ public class TStatisticsBonus {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 32)
@ExcelAttribute(name = "姓名", maxLength = 32)
@Length(max = 32, message = "员工姓名不能超过32个字符")
@ExcelProperty("员工姓名")
@ExcelProperty("姓名")
@Schema(description = "员工姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "证件号码", maxLength = 32)
@ExcelAttribute(name = "身份证号码", maxLength = 32)
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("证件号码")
@ExcelProperty("身份证号码")
@Schema(description = "身份证号")
private String empIdcard;
/**
* 年终奖
*/
@ExcelAttribute(name = "年终奖")
@ExcelProperty("年终奖")
@ExcelAttribute(name = "年终奖(元)")
@ExcelProperty("年终奖(元)")
@Schema(description = "年终奖(元)")
private BigDecimal annualBonus;
/**
* 年终奖单独扣税应缴税额
*/
@ExcelAttribute(name = "年终奖单独扣税应缴税额")
@ExcelProperty("年终奖单独扣税应缴税额")
@ExcelAttribute(name = "年终奖单独扣税")
@ExcelProperty("年终奖单独扣税")
@Schema(description = "年终奖单独扣税应缴税额")
private BigDecimal bonusTax;
/**
* 项目id
*/
@Schema(description = "项目id")
@ExcelIgnore
private String deptId;
/**
* 项目编码
*/
@Schema(description = "项目编码")
@ExcelIgnore
private String deptNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
@ExcelIgnore
private String deptName;
/**
* 单位id
*/
@Schema(description = "单位id")
@ExcelIgnore
private String unitId;
/**
* 单位编码
*/
@Schema(description = "单位编码")
@ExcelIgnore
private String unitNo;
}
......@@ -72,9 +72,9 @@ public class TStatisticsRemuneration {
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", maxLength = 32)
@ExcelAttribute(name = "证件号码", maxLength = 32)
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("身份证号")
@ExcelProperty("证件号码")
private String empIdcard;
/**
* 证件类型
......
......@@ -158,15 +158,15 @@ public class TSalaryStandardController {
* 审核
*
* @param auditFlag 是否通过 0 是 1 否
* @param AuditRemark 审核意见
* @param auditRemark 审核意见
* @param id
* @return
*/
@Operation(description = "薪酬审核")
@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) {
return tSalaryStandardService.salaryStandardAudit(auditFlag, AuditRemark, id);
return tSalaryStandardService.salaryStandardAudit(auditFlag, auditRemark, id);
}
/**
......@@ -175,7 +175,7 @@ public class TSalaryStandardController {
*/
@Operation(description = "保存并提交")
@PostMapping("/doSubmit")
public R<Boolean> salaryStandardAudit(@RequestBody TSalaryStandard tSalaryStandard) {
public R<String> salaryStandardAudit(@RequestBody TSalaryStandard tSalaryStandard) {
if (tSalaryStandard != null && Common.isNotNull(tSalaryStandard.getId())) {
TSalaryStandard s = tSalaryStandardService.getById(tSalaryStandard.getId());
if (s == null) {
......@@ -197,7 +197,7 @@ public class TSalaryStandardController {
tSalaryStandard.setSubmitTime(new Date());
tSalaryStandard.setStatus(CommonConstants.ONE_INT);
tSalaryStandardService.updateById(tSalaryStandard);
return R.ok(true,"提交成功!");
return R.ok("提交成功!");
} else {
return R.failed("请登录!");
}
......
......@@ -20,14 +20,12 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
......@@ -44,8 +42,6 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
*/
IPage<TSalaryStandard> getTSalaryStandardPage(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TSalaryStandardSearchVo searchVo);
List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo);
......@@ -60,11 +56,11 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
/**
* 标准薪酬工资表审核
* @param auditFlag 是否通过 0 是 1 否
* @param AuditRemark 审核意见
* @param auditRemark 审核意见
* @param id
* @return
*/
R<Boolean> salaryStandardAudit(String auditFlag, String AuditRemark,String id);
R<String> salaryStandardAudit(String auditFlag, String auditRemark,String id);
/**
* @Description: 删除工资表
......
......@@ -1770,7 +1770,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
sai.setCnName(SalaryConstants.RELAY_SALARY);
sai.setJavaFiedName(SalaryConstants.RELAY_SALARY_JAVA);
sai.setIsTax(CommonConstants.ZERO_INT);
sai.setSalaryMoney(BigDecimalUtils.safeAdd(nowTaxT,actualSalarySumNow).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP));
sai.setSalaryMoney(relaySalary);
saiList.add(sai);
return nowTaxY;
}
......
......@@ -16,13 +16,8 @@
*/
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -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.common.core.constant.CommonConstants;
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.dapr.config.DaprSocialProperties;
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;
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.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -61,7 +58,6 @@ import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
......@@ -103,6 +99,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
public IPage<TSalaryStandard> getTSalaryStandardPageApply(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) {
return baseMapper.getTSalaryStandardPageApply(page, tSalaryStandard);
}
/**
* 标准薪酬工资表简单分页查询
*
......@@ -132,10 +129,10 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TSalaryStandardExportVo.class).build();
ExcelWriter excelWriter = EasyExcelFactory.write(out, TSalaryStandardExportVo.class).build();
int index = 0;
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.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
......@@ -147,17 +144,16 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("项目薪酬表" + index).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet("项目薪酬表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("项目薪酬表" + index).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet("项目薪酬表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
......@@ -180,91 +176,11 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
@Override
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) {
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);
return baseMapper.getSalaryStandardExportCount(searchVo, Common.getList(searchVo.getIds()));
}
@Override
......@@ -273,7 +189,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
}
@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();
TSalaryStandard tSalaryStandard = baseMapper.selectById(id);
if (Common.isNotNull(tSalaryStandard)) {
......@@ -320,7 +236,6 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
} else {
return R.failed("删除失败:未找到工资表!");
}
String deptId = sf.getDeptId();
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed("删除工资表失败-获取登录人信息为空");
......
......@@ -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.TSalaryTaxConfig;
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.service.TSalaryAccountItemService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryTaxConfigService;
......@@ -73,6 +74,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
private final TSalaryAccountItemService tSalaryAccountItemService;
private final TSalaryAccountMapper accountMapper;
/**
* 全年一次性奖金申报表简单分页查询
* @param tStatisticsBonus 全年一次性奖金申报表
......@@ -90,7 +93,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
*/
@Override
public void listExport(HttpServletResponse response, TStatisticsBonusSearchVo searchVo){
String fileName = "全年一次性奖金申报表批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "全年一次性奖金批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TStatisticsBonus> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -179,6 +182,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
BigDecimal finalSalaryNoSalary;
//年终奖合并扣税12月税费
BigDecimal finalSalaryWithSalary;
//12月已发工资税费
BigDecimal twlSalaryTax;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
......@@ -229,6 +234,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimal.ZERO;
costReduction = BigDecimal.ZERO;
isTax = BigDecimal.ZERO;
twlSalaryTax = BigDecimal.ZERO;
//12月是否发薪
Boolean isSend = false;
//年终奖单独扣税12月税费
......@@ -255,9 +261,32 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
if (SalaryConstants.COST_REDUCTION_JAVA.equals(item.getJavaFiedName())) {
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());
}
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())) {
......@@ -271,14 +300,13 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
//年终奖合并扣税
if (isSend) {
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
finalSalaryNoSalary = BigDecimalUtils.safeAdd(calculationSalary(annousTax,infoVo.getAnnualBonus()),twlSalaryTax);
wSalary = infoVo.getAnnualBonus();
finalSalaryWithSalary = finalSalaryNoSalary;
} else {
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
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());
finalSalaryWithSalary = calculationSalary(annousTax, wSalary);
}
......@@ -486,6 +514,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
jsonObject.put("anRes",map);
jsonObject.put("zySalary",salary);
map.clear();
zySalary.clear();
return jsonObject;
}
......
......@@ -82,7 +82,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
String fileName = "收入明细批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
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;
try {
out = response.getOutputStream();
......@@ -97,7 +97,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
// 获取实际记录
searchVo.setLimitStart(i);
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)) {
ExcelUtil<IncomeExportVo> util = new ExcelUtil<>(IncomeExportVo.class);
for (IncomeExportVo vo : list) {
......@@ -140,14 +140,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
List<String> settleDomainIds,
List<String> ids,
String sql) {
return baseMapper.noPageDiy(searchVo,settleDomainIds,ids,sql);
return baseMapper.noPageDiy(searchVo, settleDomainIds, ids, sql);
}
private int noPageCountDiy(TIncomeSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql) {
return baseMapper.noPageCountDiy(searchVo,settleDomainIds,ids,sql);
return baseMapper.noPageCountDiy(searchVo, settleDomainIds, ids, sql);
}
@Override
......@@ -245,12 +245,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
tIncomeDetail.setCreateTime(new Date());
tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0));
tIncomeDetailService.save(tIncomeDetail);
// TODO-获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
// 获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
TIncome income = new TIncome();
income.setEmpIdcard(tIncomeDetail.getEmpIdcard());
income.setDeptId(tIncomeDetail.getDeptId());
List<TIncome> incomeList = baseMapper.getTIncomeList(income);
TIncomeDetail detail = new TIncomeDetail();
detail.setEmpIdcard(tIncomeDetail.getEmpIdcard());
detail.setDeptId(tIncomeDetail.getDeptId());
......@@ -272,6 +273,12 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
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) {
// 判断,比例,直接加
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getFeeMode())) {
......@@ -309,8 +316,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
+ CommonConstants.DOWN_LINE_STRING + income.getRedData(), CommonConstants.ZERO_INT);
}
// 金额人数、人次,需要判重
// 1:预估模式(管理费风险金的结算方式:1预估2实缴)
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getMrSettleType())) {
// 社保、公积金(收入来源:1社保2公积金3商险4薪资)
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getSourceType())
|| CommonConstants.TWO_STRING.equals(tIncomeDetail.getSourceType())) {
......@@ -342,13 +347,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return this.judgeMixModel(tIncomeDetail, numMap, incomeMap);
}
}
} else {
// 实缴
// TODO
}
}
return true;
}
......@@ -360,15 +358,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @return: boolean
**/
private boolean judgeMixModel(TIncomeDetail tIncomeDetail, Map<String, Integer> numMap, Map<String, Integer> incomeMap) {
Integer nums;
Integer maxNum;
nums = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
Integer nums = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()
+ 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());
// 当明细的次数大于总次数,才可以新增统计
if (nums > maxNum) {
if (Common.isEmpty(maxNum) || nums > maxNum) {
return this.saveIncome(tIncomeDetail);
}
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