Commit a3ab7bc5 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.6.4' into MVP1.6.4

parents d0da3162 196babd1
...@@ -347,6 +347,7 @@ public interface CommonConstants { ...@@ -347,6 +347,7 @@ public interface CommonConstants {
public static final String JAR_TYPE = "jar"; public static final String JAR_TYPE = "jar";
int BATCH_COUNT = 100; int BATCH_COUNT = 100;
int BATCH_COUNT_TAX = 400;
int BATCH_COUNT1 = 2000; int BATCH_COUNT1 = 2000;
String IMPORT_DATA_ANALYSIS_ERROR = "数据导入解析异常,请检查表数据格式(常见错误:1.日期格式:yyyy-MM-dd,2.比例为整数且不含%)"; String IMPORT_DATA_ANALYSIS_ERROR = "数据导入解析异常,请检查表数据格式(常见错误:1.日期格式:yyyy-MM-dd,2.比例为整数且不含%)";
......
...@@ -1317,6 +1317,15 @@ public class DateUtil { ...@@ -1317,6 +1317,15 @@ public class DateUtil {
return cal.getTime(); return cal.getTime();
} }
public static Date getDateOfThisMonth(Date date){
Calendar cal = Calendar.getInstance();
if (date != null) {
cal.setTime(date);
}
cal.set(Calendar.MONTH,Integer.valueOf(DateUtil.getMonth(new Date()))-1);
return cal.getTime();
}
/** /**
* @Description: 增减(日) * @Description: 增减(日)
* @Author: hgw * @Author: hgw
......
...@@ -393,13 +393,6 @@ public class TPaymentInfo extends BaseEntity { ...@@ -393,13 +393,6 @@ public class TPaymentInfo extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位养老基数") @ExcelProperty("单位养老基数")
private BigDecimal unitPensionSet; private BigDecimal unitPensionSet;
/**
* 单位医疗基数
*/
@ExcelAttribute(name = "单位医疗基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位医疗基数")
private BigDecimal unitMedicalSet;
/** /**
* 单位失业基数 * 单位失业基数
*/ */
...@@ -407,6 +400,13 @@ public class TPaymentInfo extends BaseEntity { ...@@ -407,6 +400,13 @@ public class TPaymentInfo extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位失业基数") @ExcelProperty("单位失业基数")
private BigDecimal unitUnemploymentSet; private BigDecimal unitUnemploymentSet;
/**
* 单位医疗基数
*/
@ExcelAttribute(name = "单位医疗基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位医疗基数")
private BigDecimal unitMedicalSet;
/** /**
* 工伤基数 * 工伤基数
*/ */
...@@ -547,13 +547,6 @@ public class TPaymentInfo extends BaseEntity { ...@@ -547,13 +547,6 @@ public class TPaymentInfo extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人医疗金额") @ExcelProperty("个人医疗金额")
private BigDecimal personalMedicalMoney; private BigDecimal personalMedicalMoney;
/**
* 个人失业金额
*/
@ExcelAttribute(name = "个人失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人失业金额")
private BigDecimal personalUnemploymentMoney;
/** /**
* 个人大病金额 * 个人大病金额
*/ */
...@@ -561,6 +554,13 @@ public class TPaymentInfo extends BaseEntity { ...@@ -561,6 +554,13 @@ public class TPaymentInfo extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人大病金额") @ExcelProperty("个人大病金额")
private BigDecimal personalBigmailmentMoney; private BigDecimal personalBigmailmentMoney;
/**
* 个人失业金额
*/
@ExcelAttribute(name = "个人失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人失业金额")
private BigDecimal personalUnemploymentMoney;
/** /**
* 公积金编号 * 公积金编号
*/ */
......
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import com.yifu.cloud.plus.v1.yifu.social.util.BigDecimalConverter;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @ClassName TPaymentHeFeiVo
* @Description 税务社保明细
* @author huyc
* @date 2024-5-9 10:35:22
*/
@Data
public class TPaymentTaxSocialVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@Length(max = 20, message = "姓名不能超过20个字符")
@ExcelAttribute(name = "姓名", maxLength = 20,isNotEmpty = true)
@Schema(description = "姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "姓名")
private String empName;
/**
* 证件类型
*/
@Length(max = 30, message = "证件类型不能超过30个字符")
@ExcelAttribute(name = "证件类型", maxLength = 30)
@Schema(description = "证件类型")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "证件类型")
private String cardType;
/**
* 证件号码
*/
@Length(max = 50, message = "不能超过50个字符")
@ExcelAttribute(name = "证件号码", isNotEmpty = true, maxLength = 50,errorInfo = "证件号码字段不可为空!")
@Schema(description = "证件号码")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "证件号码")
private String empIdcard;
/**
* 缴费工资
*/
@ExcelAttribute(name = "缴费工资", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description = "缴费工资")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "缴费工资", converter = BigDecimalConverter.class)
private BigDecimal paymentSalary;
/**
* 缴费基数
*/
@ExcelAttribute(name = "缴费基数", isFloat = true,max = "999999999.99")
@Schema(description = "缴费基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "缴费基数", converter = BigDecimalConverter.class)
private BigDecimal paymentSet;
/**
* 费率
*/
@ExcelAttribute(name = "费率")
@Schema(description = "费率")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "费率")
private String paymentPer;
/**
* 应缴费额
*/
@ExcelAttribute(name = "应缴费额", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description = "应缴费额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "应缴费额", converter = BigDecimalConverter.class)
private BigDecimal paymentMoney;
/**
* 人员编号
*/
@ExcelAttribute(name = "人员编号")
@Schema(description = "人员编号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "人员编号")
private String empNo;
/**
* 险种
*/
@ExcelAttribute(name = "险种")
@Schema(description = "险种")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "险种")
private String riskType;
/**
* 社保缴纳地
*/
@Length(max = 50, message = "社保缴纳地不能超过50个字符")
@ExcelAttribute(name = "社保缴纳地", isNotEmpty = true, errorInfo = "社保缴纳地不可为空", maxLength = 50)
@Schema(description = "社保缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "社保缴纳地")
private String socialPayAddr;
/**
* 社保缴纳地-省
*/
@Length(max = 32, message = "不能超过32个字符")
@ExcelAttribute(name = "社保缴纳地-省", maxLength = 32, isDataId = true, isArea = true, parentField = "")
@Schema(description = "社保缴纳地-省")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "社保缴纳地-省")
private Integer socialProvince;
/**
* 社保缴纳地-市
*/
@Length(max = 32, message = "不能超过32个字符")
@ExcelAttribute(name = "社保缴纳地-市", maxLength = 32, isDataId = true, isArea = true, parentField = "socialProvince")
@Schema(description = "社保缴纳地-市")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "社保缴纳地-市")
private Integer socialCity;
/**
* 社保缴纳地-县
*/
@Length(max = 32, message = "不能超过32个字符")
@ExcelAttribute(name = "社保缴纳地-县", maxLength = 32, isDataId = true, isArea = true, parentField = "socialCity")
@Schema(description = "社保缴纳地-县")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "社保缴纳地-县")
private Integer socialTown;
/**
* 社保缴纳月份
*/
@ExcelAttribute(name = "社保缴纳月份", isNotEmpty = true, errorInfo = "社保缴纳月份不可为空", maxLength = 6, min = 6, isInteger = true)
@Schema(description = "社保缴纳月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "社保缴纳月份")
private String socialPayMonth;
/**
* 社保生成月份
*/
@Length(max = 6, message = "社保生成月份不能超过6个字符")
@ExcelAttribute(name = "社保生成月份", isNotEmpty = true, errorInfo = "社保生成月份不可为空", maxLength = 6, min = 6,isInteger = true)
@Schema(description = "社保生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "社保生成月份")
private String socialCreateMonth;
/**
* 社保户
*/
@Length(max = 32, message = "社保户不能超过32个字符")
@ExcelAttribute(name = "社保户", maxLength = 32)
@Schema(description = "社保户")
private String socialHousehold;
}
...@@ -11,7 +11,20 @@ public class PaymentConstants { ...@@ -11,7 +11,20 @@ public class PaymentConstants {
public static final String UNEMPLOYEEMENT_RISK = "失业保险"; public static final String UNEMPLOYEEMENT_RISK = "失业保险";
public static final String INJURY_RISK = "工伤保险"; public static final String INJURY_RISK = "工伤保险";
public static final String MEDICAL = "医疗"; public static final String MEDICAL = "医疗";
public static final String BIG = "大病";
public static final String BIRTH = "生育";
public static final String EXPORT = "缴费库合并导出"; public static final String EXPORT = "缴费库合并导出";
public static final String SEARCH_EXPORT = "缴费库查询合并导出"; public static final String SEARCH_EXPORT = "缴费库查询合并导出";
public static final String PAYMENT_SEARCH_EXPORT = "实缴查询批量导出"; public static final String PAYMENT_SEARCH_EXPORT = "实缴查询批量导出";
public static final String COMPANY_YL = "单位养老";
public static final String PENSION_YL = "个人养老";
public static final String COMPANY_MEDICAL = "单位医疗";
public static final String PENSION_MEDICAL = "个人医疗";
public static final String COMPANY_UNEMPLOYEEMENT = "单位失业";
public static final String PENSION_UNEMPLOYEEMENT = "个人失业";
public static final String COMPANY_INJURY_RISK = "单位工伤";
public static final String COMPANY_BIG = "单位大病救助金";
public static final String PENSION_BIG = "个人大病救助金";
public static final String COMPANY_BIRTH = "单位生育";
public static final String PENSION_BIRTH = "个人生育";
} }
...@@ -86,6 +86,13 @@ public class FailReasonConfigController { ...@@ -86,6 +86,13 @@ public class FailReasonConfigController {
@SysLog("修改失败原因配置" ) @SysLog("修改失败原因配置" )
@PutMapping @PutMapping
public R<Boolean> updateById(@RequestBody FailReasonConfig failReasonConfig) { public R<Boolean> updateById(@RequestBody FailReasonConfig failReasonConfig) {
FailReasonConfig failReasonCount = failReasonConfigService.getOne(Wrappers.<FailReasonConfig>query().lambda()
.eq(FailReasonConfig::getReasonKey,failReasonConfig.getReasonKey())
.ne(FailReasonConfig::getId,failReasonConfig.getId())
.last(CommonConstants.LAST_ONE_SQL));
if(Optional.ofNullable(failReasonCount).isPresent()) {
return R.failed("已存在对应的关键字的失败原因配置!");
}
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (Common.isNotNull(user)) { if (Common.isNotNull(user)) {
failReasonConfig.setUpdateName(user.getNickname()); failReasonConfig.setUpdateName(user.getNickname());
......
...@@ -603,4 +603,40 @@ public class TPaymentInfoController { ...@@ -603,4 +603,40 @@ public class TPaymentInfoController {
public Boolean updateSocialSettleStatus(@RequestBody List<EkpSocialViewVo> viewVo) { public Boolean updateSocialSettleStatus(@RequestBody List<EkpSocialViewVo> viewVo) {
return tPaymentInfoService.updateSocialSettleStatus(viewVo); return tPaymentInfoService.updateSocialSettleStatus(viewVo);
} }
/**
* 税务社保明细导入
*
* @author huyc
* @date 2024-5-9
**/
@SneakyThrows
@Operation(description = "税务社保明细导入")
@SysLog("税务社保明细导入")
@PostMapping("/importTaxSocialInfoList")
public R<List<ErrorDetailVO>> importTaxSocialInfoList(@RequestBody MultipartFile file) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
// 获取redis分布式事务锁
String key = CacheConstants.PAYMENT_SOCIAL_THREE_IMPORT + CommonConstants.DOWN_LINE_STRING + user.getId();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key,"10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}
try {
if (Common.isNotNull(requestId)) {
return tPaymentInfoService.importTaxSocialInfoDiy(file.getInputStream());
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
}finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}
} }
...@@ -74,6 +74,13 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> { ...@@ -74,6 +74,13 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
*/ */
R<List<ErrorDetailVO>> importSocialHeFeiDiy(InputStream inputStream, String random, String type); R<List<ErrorDetailVO>> importSocialHeFeiDiy(InputStream inputStream, String random, String type);
/**
* 税务社保明细导入
* @param inputStream
* @return
*/
R<List<ErrorDetailVO>> importTaxSocialInfoDiy(InputStream inputStream);
/** /**
* 批量导入公积金 * 批量导入公积金
* @param inputStream * @param inputStream
......
...@@ -288,14 +288,22 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI ...@@ -288,14 +288,22 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
} }
} }
TSocialDeadlineInfo save; TSocialDeadlineInfo save;
LambdaQueryWrapper<TSocialDeadlineInfo> queryWrapper;
for (TSocialDeadlineInfo sd:baseLists){ for (TSocialDeadlineInfo sd:baseLists){
queryWrapper= null;
save = new TSocialDeadlineInfo(); save = new TSocialDeadlineInfo();
BeanUtil.copyProperties(sd,save); BeanUtil.copyProperties(sd,save);
save.setId(null); save.setId(null);
save.setMonth(Integer.parseInt(DateUtil.getThisMonth())); save.setMonth(Integer.parseInt(DateUtil.getThisMonth()));
save.setType(CommonConstants.ZERO_STRING); save.setType(CommonConstants.ZERO_STRING);
save.setSocialEndDate(DateUtil.getDateOfThisMonth(save.getSocialEndDate()));
save.setMedicalEndDate(DateUtil.getDateOfThisMonth(save.getMedicalEndDate()));
initSocialEndDate(holidayMap, save); initSocialEndDate(holidayMap, save);
initMedicalEndDate(holidayMap, save); initMedicalEndDate(holidayMap, save);
queryWrapper = initCountQuery(save,queryWrapper);
if (baseMapper.selectCount(queryWrapper) > 0){
continue;
}
saveList.add(save); saveList.add(save);
} }
if (Common.isNotNull(saveList)){ if (Common.isNotNull(saveList)){
...@@ -303,6 +311,24 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI ...@@ -303,6 +311,24 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
} }
} }
} }
private LambdaQueryWrapper<TSocialDeadlineInfo> initCountQuery(TSocialDeadlineInfo save,LambdaQueryWrapper<TSocialDeadlineInfo> queryWrapper) {
queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(TSocialDeadlineInfo::getMonth, save.getMonth());
queryWrapper.eq(TSocialDeadlineInfo::getProvince, save.getProvince());
if (Common.isNotNull(save.getCity())){
queryWrapper.eq(TSocialDeadlineInfo::getCity, save.getCity());
if (Common.isNotNull(save.getTown())){
queryWrapper.eq(TSocialDeadlineInfo::getTown, save.getTown());
}else {
queryWrapper.isNull(TSocialDeadlineInfo::getTown);
}
}else {
queryWrapper.isNull(TSocialDeadlineInfo::getCity);
}
return queryWrapper;
}
@Transactional @Transactional
@Override @Override
public R<Boolean> updateByIdAsso(TSocialDeadlineInfo tSocialDeadlineInfo) { public R<Boolean> updateByIdAsso(TSocialDeadlineInfo tSocialDeadlineInfo) {
...@@ -375,9 +401,8 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI ...@@ -375,9 +401,8 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
private void initMedicalEndDate(Map<String, String> holidayMap, TSocialDeadlineInfo save) { private void initMedicalEndDate(Map<String, String> holidayMap, TSocialDeadlineInfo save) {
// type 0 休假 1 补班 // type 0 休假 1 补班
String type; String day = holidayMap.get(DateUtil.getDay(save.getMedicalEndDate()));
type = holidayMap.get(DateUtil.getDay(save.getMedicalEndDate())); if (Common.isNotNull(day)){
if (Common.isNotNull(type) && CommonConstants.ZERO_STRING.equals(type)){
save.setMedicalEndDate(DateUtil.addDayByDate(save.getMedicalEndDate(),CommonConstants.ONE_INT_NEGATE)); save.setMedicalEndDate(DateUtil.addDayByDate(save.getMedicalEndDate(),CommonConstants.ONE_INT_NEGATE));
}else { }else {
return; return;
...@@ -387,9 +412,8 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI ...@@ -387,9 +412,8 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
private void initSocialEndDate(Map<String, String> holidayMap, TSocialDeadlineInfo save) { private void initSocialEndDate(Map<String, String> holidayMap, TSocialDeadlineInfo save) {
// type 0 休假 1 补班 // type 0 休假 1 补班
String type; String day= holidayMap.get(DateUtil.getDay(save.getSocialEndDate()));
type = holidayMap.get(DateUtil.getDay(save.getSocialEndDate())); if (Common.isNotNull(day)){
if (Common.isNotNull(type)&& CommonConstants.ZERO_STRING.equals(type)){
save.setSocialEndDate(DateUtil.addDayByDate(save.getSocialEndDate(),CommonConstants.ONE_INT_NEGATE)); save.setSocialEndDate(DateUtil.addDayByDate(save.getSocialEndDate(),CommonConstants.ONE_INT_NEGATE));
}else { }else {
return; return;
......
...@@ -120,5 +120,6 @@ ...@@ -120,5 +120,6 @@
1=1 1=1
<include refid="tSocialDeadlineInfo_where"/> <include refid="tSocialDeadlineInfo_where"/>
</where> </where>
order by a.month DESC
</select> </select>
</mapper> </mapper>
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