Commit c09f9213 authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents 0b238397 55cb66c2
......@@ -370,6 +370,13 @@ public interface CommonConstants {
// 是否
String IS_CHANGE = "划转";
// 年
String YEAR = "年";
// 月
String MONTH = "月";
// 日
String DAY = "日";
/**
* 省市
* @Author fxj
......
package com.yifu.cloud.plus.v1.yifu.common.core.util;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.sms.MonthObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
......@@ -287,7 +288,9 @@ public class DateUtil {
// setLenient avoids allowing dates like 9/32/2001
// which would otherwise parse to 10/2/2001
df.setLenient(false);
return df.parse( dateText.replace("/","").replace("-",""));
return df.parse( dateText.replace("/","").replace("-","")
.replace(CommonConstants.YEAR,"").replace(CommonConstants.MONTH,"")
.replace(CommonConstants.DAY,""));
} catch (ParseException e) {
return null;
......
......@@ -240,4 +240,20 @@ public class TSalaryStandard extends BaseEntity {
@ExcelProperty("客户编码")
private String unitNo;
/**
* 推送时间
*/
@ExcelAttribute(name = "推送时间", isDate = true)
@ExcelProperty("推送时间")
private Date sendTime;
/**
* 推送月份(YYYYMM)
*/
@ExcelAttribute(name = "推送月份(YYYYMM)", isNotEmpty = true, errorInfo = "推送月份(YYYYMM)不能为空", maxLength = 6)
@NotBlank(message = "推送月份(YYYYMM)不能为空")
@Length(max = 6, message = "推送月份(YYYYMM)不能超过6个字符")
@ExcelProperty("推送月份(YYYYMM)")
private String sendMonth;
}
package com.yifu.cloud.plus.v1.yifu.salary;
\ No newline at end of file
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 统计-全年一次性奖金
*
* @author huyc
* @date 2022-08-05 11:40:15
*/
@Data
public class TStatisticsAnnualBonusImportVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@Length(max = 50, message = "员工姓名 不能超过50 个字符")
@NotNull(message = "员工姓名不可为空")
@ExcelAttribute(name = "员工姓名", maxLength = 50, isNotEmpty = true)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Length(max = 25, message = "身份证号不能超过25个字符")
@NotNull(message = "身份证号不可为空")
@ExcelAttribute(name = "身份证号", maxLength = 25, isNotEmpty = true)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 年终奖
*/
@ExcelAttribute(name = "待发年终奖", isNotEmpty = true)
@NotNull(message = "待发年终奖不可为空")
@Schema(description = "待发年终奖")
@ExcelProperty("待发年终奖")
private BigDecimal preAnnualBonus;
/**
* 年终奖单独税
*/
@ExcelAttribute(name = "待发12月工资", isNotEmpty = true)
@NotNull(message = "待发12月工资不可为空")
@Schema(description = "待发12月工资")
@ExcelProperty("待发12月工资")
private BigDecimal preDecSalary;
/**
* 年终奖单独扣税12月税费
*/
@ExcelAttribute(name = "年终奖单独扣税12月税费")
@Schema(description = "年终奖单独扣税12月税费")
@ExcelProperty("年终奖单独扣税12月税费")
private BigDecimal onlyTax;
/**
* 年终奖合并扣税12月税费
*/
@ExcelAttribute(name = "年终奖合并扣税12月税费")
@Schema(description = "年终奖合并扣税12月税费")
@ExcelProperty("年终奖合并扣税12月税费")
private BigDecimal sumTax;
/**
* 最优方案-年终奖
*/
@ExcelAttribute(name = "最优方案-年终奖")
@Schema(description = "最优方案-年终奖")
@ExcelProperty("最优方案-年终奖")
private BigDecimal bestSolutionTax;
/**
* 最优方案-12月扣税
*/
@ExcelAttribute(name = "最优方案-12月扣税")
@Schema(description = "最优方案-12月扣税")
@ExcelProperty("最优方案-12月扣税")
private BigDecimal bestSolutionDecTax;
}
......@@ -38,16 +38,6 @@ import java.math.BigDecimal;
@Data
public class TStatisticsAnnualBonusVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 32, message = "id 不能超过32 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 32)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 税务主体(封面抬头)
*/
......
......@@ -127,4 +127,17 @@ public class TSalaryStandardController {
public void export(HttpServletResponse response, @RequestBody TSalaryStandardSearchVo searchVo) {
tSalaryStandardService.listExport(response, searchVo);
}
/**
* 审核页面简单分页查询
*
* @param page 分页对象
* @param tSalaryStandard 标准薪酬工资表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/auditPage")
public R<IPage<TSalaryStandard>> getTSalaryStandardAuditPage(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) {
return new R<>(tSalaryStandardService.getTSalaryStandardAuditPage(page, tSalaryStandard));
}
}
......@@ -19,7 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsAnnualBonus;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsAnnualBonusService;
......@@ -27,10 +27,13 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsAnnualBonusSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......@@ -44,11 +47,11 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/tstatisticsannualbonus")
@Tag(name = "统计-全年一次性奖金管理")
@Slf4j
public class TStatisticsAnnualBonusController {
private final TStatisticsAnnualBonusService tStatisticsAnnualBonusService;
/**
* 简单分页查询
*
......@@ -70,7 +73,6 @@ public class TStatisticsAnnualBonusController {
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('salary_tstatisticsannualbonus_get')" )
public R<List<TStatisticsAnnualBonus>> getTStatisticsAnnualBonusNoPage(@RequestBody TStatisticsAnnualBonusSearchVo tStatisticsAnnualBonus) {
return R.ok(tStatisticsAnnualBonusService.noPageDiy(tStatisticsAnnualBonus));
}
......@@ -81,7 +83,7 @@ public class TStatisticsAnnualBonusController {
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tstatisticsannualbonus_get')")
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<TStatisticsAnnualBonus> getById(@PathVariable("id") String id) {
return R.ok(tStatisticsAnnualBonusService.getById(id));
......@@ -128,4 +130,19 @@ public class TStatisticsAnnualBonusController {
public void export(HttpServletResponse response, @RequestBody TStatisticsAnnualBonusSearchVo searchVo) {
tStatisticsAnnualBonusService.listExport(response, searchVo);
}
/**
* 年终奖分配方案导入导出
*
* @author huyc
* @date 2022-08-08
**/
@Operation(description = "年终奖分配方案导入导出 hasPermission('salary_tstatisticsannualbonus_import')")
@PostMapping("/bestSolutionExport")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsannualbonus_import')")
public R<List<ErrorMessage>> bestSolutionExport(@RequestBody MultipartFile file
, HttpServletResponse response, List<String> exportFields) throws IOException {
return tStatisticsAnnualBonusService.bestSendExport(file.getInputStream(), response, exportFields);
}
}
package com.yifu.cloud.plus.v1.yifu.salary.controller;
\ No newline at end of file
......@@ -37,4 +37,11 @@ public interface TSalaryStandardMapper extends BaseMapper<TSalaryStandard> {
* @return
*/
IPage<TSalaryStandard> getTSalaryStandardPage(Page<TSalaryStandard> page, @Param("tSalaryStandard") TSalaryStandard tSalaryStandard);
/**
* 标准薪酬工资表审核页面简单分页查询
* @param tSalaryStandard 标准薪酬工资表
* @return
*/
IPage<TSalaryStandard> getTSalaryStandardAuditPage(Page<TSalaryStandard> page, @Param("tSalaryStandard") TSalaryStandard tSalaryStandard);
}
......@@ -48,4 +48,11 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
void listExport(HttpServletResponse response, TSalaryStandardSearchVo searchVo);
List<TSalaryStandard> noPageDiy(TSalaryStandardSearchVo searchVo);
/**
* 标准薪酬工资表审核页面简单分页查询
* @param tSalaryStandard 标准薪酬工资表
* @return
*/
IPage<TSalaryStandard> getTSalaryStandardAuditPage(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard);
}
......@@ -41,11 +41,19 @@ public interface TStatisticsAnnualBonusService extends IService<TStatisticsAnnua
* @param tStatisticsAnnualBonus 统计-全年一次性奖金
* @return
*/
IPage<TStatisticsAnnualBonus> getTStatisticsAnnualBonusPage(Page<TStatisticsAnnualBonus> page, TStatisticsAnnualBonusSearchVo tStatisticsAnnualBonus);
IPage<TStatisticsAnnualBonus> getTStatisticsAnnualBonusPage(Page<TStatisticsAnnualBonus> page,
TStatisticsAnnualBonusSearchVo tStatisticsAnnualBonus);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TStatisticsAnnualBonusSearchVo searchVo);
List<TStatisticsAnnualBonus> noPageDiy(TStatisticsAnnualBonusSearchVo searchVo);
/**
* 年终奖分配方案导入导出
* @param inputStream
* @return
*/
R<List<ErrorMessage>> bestSendExport(InputStream inputStream, HttpServletResponse response,List<String> exportFields);
}
......@@ -250,4 +250,9 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
@Override
public IPage<TSalaryStandard> getTSalaryStandardAuditPage(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) {
return baseMapper.getTSalaryStandardAuditPage(page, tSalaryStandard);
}
}
......@@ -29,11 +29,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsAnnualBonus;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsAnnualBonusMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsAnnualBonusService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsAnnualBonusImportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsAnnualBonusSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsAnnualBonusVo;
import lombok.extern.log4j.Log4j2;
......@@ -145,6 +149,100 @@ public class TStatisticsAnnualBonusServiceImpl extends ServiceImpl<TStatisticsAn
return baseMapper.selectList(wrapper);
}
@Override
public R<List<ErrorMessage>> bestSendExport(InputStream inputStream, HttpServletResponse response,
List<String> exportFields) {
YifuUser user = SecurityUtils.getUser();
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TStatisticsAnnualBonusImportVo> util1 = new ExcelUtil<>(TStatisticsAnnualBonusImportVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TStatisticsAnnualBonusImportVo.class, new ReadListener<TStatisticsAnnualBonusImportVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TStatisticsAnnualBonusImportVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TStatisticsAnnualBonusImportVo 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());
importBestSendTax(cachedDataList, errorMessageList, user, response, exportFields);
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 importBestSendTax(List<TStatisticsAnnualBonusImportVo> list, List<ErrorMessage> errorMessageList,
YifuUser user, HttpServletResponse response, List<String> exportFields) {
if (errorMessageList.size() == CommonConstants.ZERO_INT) {
String fileName = "年终奖测算导出" + DateUtil.getThisTime() + ".xlsx";
ServletOutputStream out = null;
for (TStatisticsAnnualBonusImportVo infoVo : list) {
//todo
}
try {
out = response.getOutputStream();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, TStatisticsAnnualBonusImportVo.class).includeColumnFiledNames(exportFields).sheet("年终奖测算")
.doWrite(list);
out.flush();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
}
private Long noPageCountDiy(TStatisticsAnnualBonusSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsAnnualBonus> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
package com.yifu.cloud.plus.v1.yifu.salary.service;
\ No newline at end of file
......@@ -56,7 +56,8 @@
<result property="updateTime" column="UPDATE_TIME"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="sendTime" column="SEND_TIME"/>
<result property="sendMonth" column="SEND_MONTH"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -91,7 +92,9 @@
a.UPDATE_TIME,
a.UNIT_ID,
a.UNIT_NAME,
a.UNIT_NO
a.UNIT_NO,
a.SEND_TIME,
a.SEND_MONTH
</sql>
<sql id="tSalaryStandard_where">
<if test="tSalaryStandard != null">
......@@ -194,6 +197,9 @@
<if test="tSalaryStandard.unitNo != null and tSalaryStandard.unitNo.trim() != ''">
AND a.UNIT_NO = #{tSalaryStandard.unitNo}
</if>
<if test="tSalaryStandard.sendMonth != null and tSalaryStandard.sendMonth.trim() != ''">
AND a.SEND_MONTH = #{tSalaryStandard.sendMonth}
</if>
</if>
</sql>
<!--tSalaryStandard简单分页查询-->
......@@ -206,4 +212,30 @@
<include refid="tSalaryStandard_where"/>
</where>
</select>
<!--tSalaryStandard简单分页查询-->
<select id="getTSalaryStandardAuditPage" resultMap="tSalaryStandardMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_standard a
<where>
1=1
<if test="tSalaryStandard != null">
<if test="tSalaryStandard.deptName != null and tSalaryStandard.deptName.trim() != ''">
AND a.DEPT_NAME like concat(#{'%',#{tSalaryStandard.deptName},'%')
</if>
<if test="tSalaryStandard.deptNo != null and tSalaryStandard.deptNo.trim() != ''">
AND a.DEPT_NO = #{tSalaryStandard.deptNo}
</if>
<if test="tSalaryStandard.salaryMonth != null and tSalaryStandard.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{tSalaryStandard.salaryMonth}
</if>
<if test="tSalaryStandard.status == null">
AND a.STATUS = 1 OR a.STATUS = 2
</if>
<if test="tSalaryStandard.status != null">
AND a.STATUS = #{tSalaryStandard.status}
</if>
</if>
</where>
</select>
</mapper>
......@@ -260,7 +260,7 @@ public class TForecastLibraryExportVo {
private BigDecimal personalFundProp;
@ExcelAttribute(name = "同步状态", readConverterExp = "0=未同步,1=已同步")
@ExcelProperty("同步状态:0未同步;1已同步")
@ExcelProperty("同步状态")
private String dataPush;
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
......
......@@ -215,6 +215,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(searchVo.getCreateTimeEnd())) {
wrapper.le(TDispatchInfo::getCreateTime, searchVo.getCreateTimeEnd());
}
wrapper.eq(TDispatchInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL);
return baseMapper.selectCount(wrapper);
}
......
......@@ -1272,9 +1272,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
lib.setProvidentId(providentFund.getId());
lib.setUnitId(providentFund.getUnitIdFund());
lib.setSettleDomainId(providentFund.getSettleDomainFund());
lib.setUnitName(providentFund.getUnitName());
lib.setDeptName(providentFund.getSettleDomainName());
lib.setDeptNo(providentFund.getSettleDomainCode());
lib.setUnitName(providentFund.getUnitNameFund());
lib.setDeptName(providentFund.getSettleDomainNameFund());
lib.setDeptNo(providentFund.getSettleDomainCodeFund());
//判断是否允许补缴 是否可补缴 0:是
Integer monthT = null;
......@@ -1497,7 +1497,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (Common.isNotNull(library.getSocialPayMonth())) {
if (socialReduceDate != null) {
// 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据
if (DateUtil.formatDateInt(socialReduceDate) < Integer.parseInt(library.getSocialPayMonth())) {
if (DateUtil.formatDateInt(socialReduceDate) <= Integer.parseInt(library.getSocialPayMonth())) {
this.calculateSocialType(zero, library);
}
} else {
......@@ -1520,7 +1520,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (Common.isNotNull(library.getProvidentPayMonth())) {
if (fundReduceDate != null) {
// 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据
if (DateUtil.formatDateInt(fundReduceDate) < Integer.parseInt(library.getProvidentPayMonth())) {
if (DateUtil.formatDateInt(fundReduceDate) <= Integer.parseInt(library.getProvidentPayMonth())) {
this.calculateFundType(zero, library);
}
} else {
......@@ -1540,6 +1540,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 加负数
TForecastLibrary negateLib = new TForecastLibrary();
BeanUtil.copyProperties(library, negateLib);
negateLib.setId(null);
negateLib.setUnitPensionFee(BigDecimalUtils.safeSubtract( false, zero, library.getUnitPensionFee()));
negateLib.setUnitMedicalFee(BigDecimalUtils.safeSubtract( false, zero, library.getUnitMedicalFee()));
negateLib.setUnitBirthFee(BigDecimalUtils.safeSubtract( false, zero, library.getUnitBirthFee()));
......@@ -1569,6 +1570,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 加负数
TForecastLibrary negateLib = new TForecastLibrary();
BeanUtil.copyProperties(library, negateLib);
negateLib.setId(null);
// 单位公积金
negateLib.setUnitFundSum(BigDecimalUtils.safeSubtract(false, zero, library.getUnitFundSum()));
// 个人公积金
......
......@@ -369,7 +369,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
errorMessageList = handleFileAddress(1, preInfo, areaMap, areaIdMap, importVo, errorMessageList);
}
// 档案地市没问题 开始派单处理
if (Common.isEmpty(errorMessageList)) {
if (errorMessageList.size() == CommonConstants.ZERO_INT) {
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
}
// 处理派增结果
......@@ -456,8 +456,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
.eq(TPreDispatchInfo::getDispatchFlag, CommonConstants.ZERO_STRING)
.eq(TPreDispatchInfo::getPreStatus, CommonConstants.ZERO_STRING));
}
if (Common.isEmpty(preList)) {
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
if (!Common.isNotNull(preList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
// 找出所有需要派减的社保或公积金数据 主要用于派减是获取项目相关数据
HashMap<String, TSocialInfo> socialMap = new HashMap<>();
......@@ -501,7 +501,10 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
resetMessageList(pre, errorMessageList, errorMsgList, i + 1);
}
}
return R.ok(errorMsgList);
if (Common.isNotNull(errorMsgList)) {
return R.failed(errorMsgList);
}
return R.ok();
}
@Override
......@@ -2094,27 +2097,24 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
* @Date 2022-07-18
**/
private R<Boolean> handleDispatchAddRes(TPreDispatchInfo preInfo, List<ErrorMessage> errorMessageList) {
if (Common.isEmpty(errorMessageList)) {
return R.failed(preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
PreDispatchConstants.PREDISPATCH_EXCEPTION);
}
ErrorMessage errorMessage = errorMessageList.get(CommonConstants.ZERO_INT);
if (null != errorMessage) {
if (errorMessage.getMessage().indexOf(PreDispatchConstants.DISPATCH_ADD_SUCCESS) >= CommonConstants.ZERO_INT) {
preInfo.setPreStatus(CommonConstants.TWO_STRING);
preInfo.setExceptionContent(CommonConstants.EMPTY_STRING);
baseMapper.updatePreStatusById(preInfo);
return R.ok(null, preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
PreDispatchConstants.DISPATCH_ADD_SUCCESS);
} else {
preInfo.setPreStatus(CommonConstants.ONE_STRING);
preInfo.setExceptionContent(errorMessage.getMessage());
baseMapper.updatePreStatusById(preInfo);
return R.failed(preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
errorMessage.getMessage());
if (errorMessageList.size() > CommonConstants.ZERO_INT) {
ErrorMessage errorMessage = errorMessageList.get(CommonConstants.ZERO_INT);
if (null != errorMessage) {
if (errorMessage.getMessage().indexOf(PreDispatchConstants.DISPATCH_ADD_SUCCESS) >= CommonConstants.ZERO_INT) {
preInfo.setPreStatus(CommonConstants.TWO_STRING);
preInfo.setExceptionContent(CommonConstants.EMPTY_STRING);
baseMapper.updatePreStatusById(preInfo);
return R.ok(null, preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
PreDispatchConstants.DISPATCH_ADD_SUCCESS);
} else {
preInfo.setPreStatus(CommonConstants.ONE_STRING);
preInfo.setExceptionContent(errorMessage.getMessage());
baseMapper.updatePreStatusById(preInfo);
return R.failed(preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
errorMessage.getMessage());
}
}
}
return null;
......@@ -2371,7 +2371,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
errorMessageList = handleFileAddress(i, pre, areaMap, areaIdMap, importVo, errorMessageList);
}
// 档案地市没问题 开始派单处理
if (Common.isEmpty(errorMessageList)){
if (!Common.isNotNull(errorMessageList)){
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
}
// 处理派增结果
......
......@@ -358,9 +358,9 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
errorMessageList.add(new ErrorMessage(i, "未找到公积金基数配置!"));
continue;
}
/*if (!ServiceUtil.checkFundPercentByList(fundSetInfo.getFundProList(), history)) {
errorMessageList.add(new ErrorMessage(i, "无对应公积金比例,请查验公积金户+缴纳地+缴纳月份的公积金比例配置!"));
continue;
/* if (!ServiceUtil.checkFundPercentByList(fundSetInfo.getFundProList(), history)) {
errorMessageList.add(new ErrorMessage(i, "无对应公积金比例,请查验公积金户+缴纳地+缴纳月份的公积金比例配置!"))
continue
}*/
history.setUnitFundMoney(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(history.getUnitFundBase()
, history.getUnitFundProp(), CommonConstants.ONE_OF_PERCENT), Integer.parseInt(socialFundInfo.getFundPayPoint())));
......@@ -431,10 +431,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
}
} else if (CommonConstants.ZERO_INT == baseSetVo.getPaymentType()) {
BigDecimal limitBase = socialSetInfo.getLowerLimit();
this.setLimtBase(socialFundInfo, limitBase);
this.setLimtBase(socialFundInfo, limitBase, socialSetInfo);
} else if (CommonConstants.TWO_INT == baseSetVo.getPaymentType()) {
BigDecimal limitBase = socialSetInfo.getUpperLimit();
this.setLimtBase(socialFundInfo, limitBase);
this.setLimtBase(socialFundInfo, limitBase, socialSetInfo);
}
// 金额计算
......@@ -469,7 +469,7 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
* @Date: 2022/7/25 16:15
* @return: void
**/
private void setLimtBase(TSocialFundInfo socialFundInfo, BigDecimal limitBase) {
private void setLimtBase(TSocialFundInfo socialFundInfo, BigDecimal limitBase, SysBaseSetInfo sysBaseSetInfo) {
socialFundInfo.setUnitPensionCardinal(limitBase);
socialFundInfo.setUnitMedicalCardinal(limitBase);
socialFundInfo.setUnitBirthCardinal(limitBase);
......@@ -479,6 +479,45 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
socialFundInfo.setPersonalPensionCardinal(limitBase);
socialFundInfo.setPersonalMedicalCardinal(limitBase);
socialFundInfo.setPersonalUnemploymentCardinal(limitBase);
// 大病处理: 0 收取 按派单的社保里的基数和比例来
if (CommonConstants.ZERO_STRING.equals(sysBaseSetInfo.getIsIllness())) {
// 大病收取方式 0.按年 判断当前月份是否收取大病 按年收大病起缴月份收取一次,非当年的 大病 按实际收取月份收取大病金额
this.setBigMoney(socialFundInfo, sysBaseSetInfo, limitBase);
// 大病处理: 1 不收取
} else {
socialFundInfo.setUnitBigailmentMoney(BigDecimal.ZERO);
socialFundInfo.setPersonalBigailmentMoney(BigDecimal.ZERO);
}
}
private void setBigMoney(TSocialFundInfo socialInfo, SysBaseSetInfo sysBaseSetInfo
, BigDecimal limitBase) {
if (CommonConstants.ZERO_STRING.equals(sysBaseSetInfo.getCollectType())) {
socialInfo.setUnitBigailmentMoney(BigDecimalUtils.isNullToZero(sysBaseSetInfo.getPayCompany()));
socialInfo.setPersonalBigailmentMoney(BigDecimalUtils.isNullToZero(sysBaseSetInfo.getPayPersonal()));
//大病收取方式 : 1.按月
} else if (CommonConstants.ONE_STRING.equals(sysBaseSetInfo.getCollectType())) {
// 大病取值方式:1 按比例 按派单的基数和比例来
if (CommonConstants.ONE_STRING.equals(sysBaseSetInfo.getValueType())) {
socialInfo.setUnitBigailmentCardinal(limitBase);
socialInfo.setUnitBigailmentPer(sysBaseSetInfo.getPayCompanyPro());
socialInfo.setPersonalBigailmentCardinal(limitBase);
socialInfo.setPersonalBigailmentPer(sysBaseSetInfo.getPayPersonalPro());
socialInfo.setPersonalBigailmentMoney(BigDecimalUtils.safeMultiply(
limitBase,
sysBaseSetInfo.getPayPersonalPro(),
CommonConstants.ONE_OF_PERCENT));
socialInfo.setUnitBigailmentMoney(BigDecimalUtils.safeMultiply(
limitBase,
sysBaseSetInfo.getPayCompanyPro(),
CommonConstants.ONE_OF_PERCENT));
} else {
// 大病取值方式:0按定值
socialInfo.setUnitBigailmentMoney(BigDecimalUtils.isNullToZero(sysBaseSetInfo.getPayCompany()));
socialInfo.setPersonalBigailmentMoney(BigDecimalUtils.isNullToZero(sysBaseSetInfo.getPayPersonal()));
}
}
}
/**
......
......@@ -465,7 +465,7 @@
left join t_social_info s on s.id=a.SOCIAL_ID
left join t_provident_fund f on f.id=a.FUND_ID
<where>
1=1
a.DELETE_FLAG = '0'
<include refid="tDispatchInfo_where"/>
</where>
order by a.CREATE_TIME desc
......
......@@ -79,7 +79,7 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Mapper, ${c
*/
@Override
public void listExport(HttpServletResponse response, ${className}SearchVo searchVo){
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "${comments}批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<${className}> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......
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