Commit 6703d4e4 authored by hongguangwu's avatar hongguangwu

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

parents 36f148cb 18bf42e6
......@@ -52,8 +52,7 @@ public class TAutoSocialRuleInfo extends BaseEntity {
/**
* 项目配置ID
*/
@ExcelAttribute(name = "项目配置ID", isNotEmpty = true, errorInfo = "项目配置ID不能为空", maxLength = 32)
@NotBlank(message = "项目配置ID不能为空")
@ExcelAttribute(name = "项目配置ID", isNotEmpty = false, errorInfo = "项目配置ID不能为空", maxLength = 32)
@Length(max = 32, message = "项目配置ID不能超过32个字符")
@ExcelProperty("项目配置ID")
@Schema(description = "项目配置ID")
......@@ -70,7 +69,7 @@ public class TAutoSocialRuleInfo extends BaseEntity {
/**
* 派单发起时间(字典::0:入职满1个月...入职满6个月)
*/
@ExcelAttribute(name = "派单发起时间", maxLength = 2,isNotEmpty = true, errorInfo = "派单发起时间不能为空")
@ExcelAttribute(name = "派单发起时间", maxLength = 2,isNotEmpty = false, errorInfo = "派单发起时间不能为空")
@Length(max = 2, message = "派单发起时间不能超过2个字符")
@ExcelProperty("派单发起时间")
@Schema(description = "派单发起时间(字典::0:入职满1个月...入职满6个月)")
......@@ -86,7 +85,7 @@ public class TAutoSocialRuleInfo extends BaseEntity {
/**
* 派单确认时间,字典:0:派单发起当日
*/
@ExcelAttribute(name = "派单确认时间", maxLength = 50,isNotEmpty = true, errorInfo = "派单发起时间不能为空")
@ExcelAttribute(name = "派单确认时间", maxLength = 50,isNotEmpty = false, errorInfo = "派单发起时间不能为空")
@Length(max = 50, message = "派单确认时间不能超过50个字符")
@ExcelProperty("派单确认时间")
@Schema(description = "派单确认时间,字典:0:派单发起当日")
......
......@@ -74,6 +74,15 @@ public class TAutoSocialRuleRel extends BaseEntity {
@ExcelProperty("社保户ID")
@Schema(description = "社保户ID")
private String configHouseId;
/**
* 社保户名称
*/
@ExcelAttribute(name = "社保户名称", maxLength = 50, isNotEmpty = true, errorInfo = "社保户名称不能为空")
@Length(max = 50, message = "社保户名称不能超过50个字符")
@ExcelProperty("社保户名称")
@Schema(description = "社保户名称")
private String configHouseName;
/**
* 社保起缴日期是否一致(0-是,1-否)
*/
......
......@@ -48,7 +48,7 @@ public class TAutoMainRelAddVo implements Serializable {
private List<TAutoContractScheme> contractSchemes;
//社保规则主表
private TAutoSocialRuleInfo autoSocialRuleInfo;
private TAutoSocialRuleInfo socialRuleInfo;
//社保规则明细表
private List<TAutoSocialRuleRel> socialRuleRels;
......
......@@ -50,9 +50,8 @@ public class TAutoSocialRuleInfoVo extends RowIndex implements Serializable {
/**
* 项目配置ID
*/
@NotBlank(message = "项目配置ID 不能为空")
@Length(max = 32, message = "项目配置ID 不能超过32 个字符")
@ExcelAttribute(name = "项目配置ID", isNotEmpty = true, errorInfo = "项目配置ID 不能为空", maxLength = 32)
@ExcelAttribute(name = "项目配置ID", isNotEmpty = false, errorInfo = "项目配置ID 不能为空", maxLength = 32)
@Schema(description = "项目配置ID")
@ExcelProperty("项目配置ID")
private String mainId;
......
......@@ -38,8 +38,12 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -48,6 +52,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
......@@ -103,6 +108,9 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
@Autowired
private TAutoSocialRuleRelMapper autoSocialRuleRelMapper;
@Autowired
private SocialDaprUtils socialDaprUtils;
public static final String itemsLabel = "label,description,disable";
public static final String itemsLabelRepeat = "同一项目岗位名称不可重复";
......@@ -366,7 +374,7 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
return PARAM_IS_NOT_ERROR;
}
//校验社保规则主表信息
TAutoSocialRuleInfo autoSocialRuleInfo = entity.getAutoSocialRuleInfo();
TAutoSocialRuleInfo autoSocialRuleInfo = entity.getSocialRuleInfo();
if (Common.isNotNull(autoSocialRuleInfo)){
ExcelUtil<TAutoSocialRuleInfo> excelUtil = new ExcelUtil<>(TAutoSocialRuleInfo.class);
ErrorMessage errorMessage = excelUtil.checkEntity(autoSocialRuleInfo,0);
......@@ -704,7 +712,7 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
}
//校验社保规则主表信息
TAutoSocialRuleInfo autoSocialRuleNew = entity.getAutoSocialRuleInfo();
TAutoSocialRuleInfo autoSocialRuleNew = entity.getSocialRuleInfo();
TAutoSocialRuleInfo autoSocialRuleOld = null;
if (Common.isNotNull(autoSocialRuleNew)){
// 检查社保规则信息的有效性
......@@ -797,6 +805,7 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
if (Common.isNotNull(autoSocialRuleNew.getId())){
autoSocialRuleNew.setUpdateBy(user.getId());
autoSocialRuleNew.setUpdateTime(LocalDateTime.now());
autoContractRuleNew.setMainId(autoMainRel.getId());
autoSocialRuleInfoMapper.updateById(autoSocialRuleNew);
}else {
autoSocialRuleNew.setDeptNo(autoMainRel.getDeptNo());
......@@ -1305,6 +1314,39 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
if (Common.isNotNull(errorMessage)){
return R.failed(errorMessage.getMessage());
}
//针对"备案基数类型"为"固定值"时,"备案基数"必填,"缴纳类型"为"最高或最低"
//时,配置提交时,会将"备案基数"同该社保户对应的最高或最低的基数进行对比,"备案基
//数"等于社保户的最高或最低基数
if (CommonConstants.ZERO_STRING.equals(rel.getRecordBaseType())){
if (!Common.isNotNull(rel.getRecordBase())){
return R.failed("备案基数不可空");
}
if ((CommonConstants.ZERO_STRING.equals(rel.getPaymentType())
|| CommonConstants.TWO_STRING.equals(rel.getPaymentType()))){
R<SysBaseSetInfoVo> resR = socialDaprUtils.getSocialHouseBaseSet(rel.getConfigHouseId());
if (Common.isNotNull(resR) && resR.getData() != null) {
SysBaseSetInfoVo setInfo = resR.getData();
if (Common.isNotNull(setInfo)) {
try {
// 添加了异常处理,避免 recordBase 不是合法数字格式时程序崩溃
if (CommonConstants.TWO_STRING.equals(rel.getPaymentType())) {
if (BigDecimal.valueOf(Double.valueOf(rel.getRecordBase())).compareTo(setInfo.getUpperLimit()) != 0) {
return R.failed("备案基数不等于社保户最高基数:"+setInfo.getUpperLimit());
}
} else if (CommonConstants.ZERO_STRING.equals(rel.getPaymentType())){
if (BigDecimal.valueOf(Double.valueOf(rel.getRecordBase())).compareTo(setInfo.getLowerLimit()) != 0) {
return R.failed("备案基数不等于社保户最低基数:"+setInfo.getLowerLimit());
}
}
} catch (NumberFormatException e) {
return R.failed("备案基数格式不正确");
}
}
}else {
return R.failed("获取社保配置信息失败!");
}
}
}
}
// 校验socialRuleRels 配置名称是否重复
Set<String> names = socialRuleRels.stream().map(TAutoSocialRuleRel::getConfigName).collect(Collectors.toSet());
......@@ -1353,8 +1395,20 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
if (null == autoMainRel){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
autoMainRel.setAutoFlag(autoFlag);
if (baseMapper.updateById(autoMainRel) >=0){
TAutoMainRel autoMainRelNew = new TAutoMainRel();
BeanUtils.copyProperties(autoMainRel,autoMainRelNew);
autoMainRelNew.setAutoFlag(autoFlag);
if (baseMapper.updateById(autoMainRelNew) >=0){
if (!autoMainRelNew.getAutoFlag().equals(autoMainRel.getAutoFlag())){
Map<String,String> diffKeyMap = new HashMap<>();
Map<String,Object> oldMap = new HashMap<>();
Map<String,Object> newMap = new HashMap<>();
diffKeyMap.put("autoMailRel","autoMailRel");
oldMap.put("oldAutoMailRel",autoMainRel);
newMap.put("newAutoMailRel",autoMainRelNew);
insertLog(autoMainRel, diffKeyMap, oldMap, newMap);
}
return R.ok();
}
return R.failed();
......
......@@ -28,6 +28,7 @@
<result property="mainId" column="MAIN_ID"/>
<result property="configName" column="CONFIG_NAME"/>
<result property="configHouseId" column="CONFIG_HOUSE_ID"/>
<result property="configHouseName" column="CONFIG_HOUSE_NAME"/>
<result property="socialDateFlag" column="SOCIAL_DATE_FLAG"/>
<result property="socialDateType" column="SOCIAL_DATE_TYPE"/>
<result property="paymentType" column="PAYMENT_TYPE"/>
......@@ -60,7 +61,8 @@
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_NAME,
a.UPDATE_TIME
a.UPDATE_TIME,
a.CONFIG_HOUSE_NAME
</sql>
<sql id="tAutoSocialRuleRel_where">
<if test="tAutoSocialRuleRel != null">
......
......@@ -10,8 +10,10 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
import lombok.extern.log4j.Log4j2;
......@@ -236,4 +238,19 @@ public class SocialDaprUtils {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),
"/tdispatchinfopre/saveSocialPreInfo", JSON.toJSONString(preVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @Author fxj
* @Description 获取社保配置信息
* @Date 12:11 2025/10/11
* @Param
* @return
**/
public R<SysBaseSetInfoVo> getSocialHouseBaseSet(String houseId) {
R<SysBaseSetInfoVo> res = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/sysbasesetinfo/inner/getSocialHouseBaseSet", houseId, SysBaseSetInfoVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("获取社保配置信息失败!");
}
return res;
}
}
......@@ -22,12 +22,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.bean.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion;
import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.SysPayProportionService;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -173,5 +176,22 @@ public class SysBaseSetInfoController {
public R<Boolean> disableOrEnableById(@RequestParam String id, @RequestParam Integer status) {
return sysBaseSetInfoService.updateByIdAsso(id,status);
}
/**
* 通过id查询基数设置表--内部接口
*
* @param houseId
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@Inner
@PostMapping("/inner/getSocialHouseBaseSet")
public SysBaseSetInfoVo getSocialHouseBaseSet(@RequestBody String houseId) {
SysBaseSetInfo baseSetInfo = sysBaseSetInfoService.getById(houseId);
if (null != baseSetInfo && CommonConstants.ONE_STRING.equals(baseSetInfo.getBaseType())){
baseSetInfo.setFundProList(sysPayProportionService.list(Wrappers.<SysPayProportion>query().lambda().eq(SysPayProportion::getSysBaseSetId,houseId)));
}
SysBaseSetInfoVo sysBaseSetInfoVo = new SysBaseSetInfoVo();
BeanCopyUtils.copyProperties(baseSetInfo,sysBaseSetInfoVo);
return sysBaseSetInfoVo;
}
}
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