Commit 624b9fb1 authored by fangxinjiang's avatar fangxinjiang

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

# Conflicts:
#	yifu-social/yifu-social-biz/src/main/resources/mapper/TDispatchInfoMapper.xml
parents 1efdfcd4 042086ce
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @author licancan
* @description 商险模块dapr属性
* @date 2022-08-03 10:25:48
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.insurances", ignoreInvalidFields = false)
public class DaprInsurancesProperties {
/**
* dapr sidercar url 如:http://localhost:3511/v1.0/invoke/
*/
String appUrl;
/**
* app_id 如:"yifu_insurances_sider"
*/
String appId;
}
......@@ -12,3 +12,6 @@ dapr.check.appId=yifu-check
dapr.archives.appUrl=http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.archives.appId=yifu-archives
dapr.insurances.appUrl=http://yifu-insurances.qas-mvp.svc.cluster.local:3511/v1.0/invoke/
dapr.insurances.appId=yifu-insurances
......@@ -400,6 +400,11 @@ public class InsurancesConstants {
*/
public static final String INSURANCE_BUY_STATUS_TWO_ERROR = "商险投保中,无法减员";
/**
* 商险投保退回,无法减员
*/
public static final String INSURANCE_BUY_STATUS_FOUR_ERROR = "商险投保退回,无法减员";
/**
* 商险无效,无法减员
*/
......@@ -674,6 +679,74 @@ public class InsurancesConstants {
*/
public static final String MONTH_CHANGE = "变更结算月";
/**
* 新增的保险公司信息为空
*/
public static final String NEW_COMPANY_IS_EMPTY = "新增的保险公司信息为空";
/**
* 计费方式格式不正确
*/
public static final String COMPANY_BILLING_TYPE_IS_ERROR = "计费方式格式不正确";
/**
* 保险公司名称格式不正确
*/
public static final String COMPANY_NAME_IS_ERROR = "保险公司名称格式不正确";
/**
* 保险公司地址格式不正确
*/
public static final String COMPANY_ADDRESS_IS_ERROR = "保险公司地址格式不正确";
/**
* 保险公司名称不能重复添加
*/
public static final String COMPANY_NAME_IS_USE = "保险公司名称不能重复添加";
/**
* 新增保险公司成功
*/
public static final String NEW_COMPANY_SUCCESS = "新增保险公司成功";
/**
* 修改保险信息公司成功
*/
public static final String UPDATE_COMPANY_SUCCESS = "修改保险信息公司成功";
/**
* 要修改的保险公司id为空
*/
public static final String UPDATE_COMPANY_ID_IS_EMPTY = "要修改的保险公司id为空";
/**
* 要修改的保险公司不存在或已被删除
*/
public static final String COMPANY_IS_DELETE = "要修改的保险公司不存在或已被删除";
/**
* 要修改的保险公司名称格式不正确
*/
public static final String CHANGE_COMPANY_NAME_IS_ERROR = "要修改的保险公司名称格式不正确";
/**
* 当前保险公司的名称已存在对应的商险信息,不能进行修改
*/
public static final String COMPANY_IS_USED = "当前保险公司的名称已存在对应的商险信息,不能进行修改";
......
......@@ -47,10 +47,9 @@ public class TInsuranceDetailController {
* @param
* @return void
*/
@Operation(summary = "每日定时刷新商险到期数据", description = "每日定时刷新商险到期数据")
@SysLog("每日定时刷新商险到期数据")
@Inner
@GetMapping("/inner/updateOverdueByTask")
@PostMapping("/inner/updateOverdueByTask")
public void updateOverdueByTask() {
tInsuranceDetailService.updateOverdueByTask();
}
......
......@@ -67,18 +67,18 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
@Override
public R saveInsuranceCompany(TInsuranceCompany insuranceCompany) {
if(Common.isEmpty(insuranceCompany)){
return R.failed("新增的信息为空");
return R.failed(InsurancesConstants.NEW_COMPANY_IS_EMPTY);
}
YifuUser user = SecurityUtils.getUser();
String billingType = insuranceCompany.getBillingType();
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确");
return R.failed(InsurancesConstants.COMPANY_BILLING_TYPE_IS_ERROR);
}
if (!ValidityUtil.validate60(insuranceCompany.getCompanyName())){
return R.failed("保险公司名称格式不正确");
return R.failed(InsurancesConstants.COMPANY_NAME_IS_ERROR);
}
if (!ValidityUtil.validate50(insuranceCompany.getCompanyAddress())){
return R.failed("保险公司地址格式不正确");
return R.failed(InsurancesConstants.COMPANY_ADDRESS_IS_ERROR);
}
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if (!b){
......@@ -88,9 +88,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
insuranceCompany.setDeleteFlag(CommonConstants.ZERO_INT);
save(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.NEW_INSURANCE_COMPANY);
return R.ok("新增成功");
return R.ok(InsurancesConstants.NEW_COMPANY_SUCCESS);
}else{
return R.failed("保险公司名称不能重复添加");
return R.failed(InsurancesConstants.COMPANY_NAME_IS_USE);
}
}
......@@ -106,25 +106,25 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
YifuUser user = SecurityUtils.getUser();
String id = insuranceCompany.getId();
if (StringUtils.isEmpty(id)){
return R.failed("要修改的保险公司id为空");
return R.failed(InsurancesConstants.UPDATE_COMPANY_ID_IS_EMPTY);
}
String billingType = insuranceCompany.getBillingType();
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确");
return R.failed(InsurancesConstants.COMPANY_BILLING_TYPE_IS_ERROR);
}
if (!ValidityUtil.validate50(insuranceCompany.getCompanyAddress())){
return R.failed("保险公司地址格式不正确");
return R.failed(InsurancesConstants.COMPANY_ADDRESS_IS_ERROR);
}
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getId,id).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany one = this.getOne(queryWrapper);
if (Common.isEmpty(one)){
return R.failed("要修改的保险公司不存在或已被删除");
return R.failed(InsurancesConstants.COMPANY_IS_DELETE);
}
String companyName = one.getCompanyName();
String newCompanyName = insuranceCompany.getCompanyName();
if (!ValidityUtil.validate60(newCompanyName)){
return R.failed("要修改的保险公司名称格式不正确");
return R.failed(InsurancesConstants.CHANGE_COMPANY_NAME_IS_ERROR);
}
//如果当前保险公司名称和修改后的名称不同
if (!companyName.equals(insuranceCompany.getCompanyName())){
......@@ -134,24 +134,26 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = tInsuranceDetailService.list(detailQueryWrapper);
if (Common.isNotEmpty(list)){
return R.failed("当前保险公司的名称已存在对应的商险信息,不能进行修改");
return R.failed(InsurancesConstants.COMPANY_IS_USED);
}else{
//校验新的保险公司名称在数据库中是否存在
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if(b){
return R.failed("保险公司名称不能重复");
return R.failed(InsurancesConstants.COMPANY_NAME_IS_USE);
}else {
insuranceCompany.setUpdateBy(user.getId());
insuranceCompany.setUpdateTime(LocalDateTime.now());
updateById(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.NEW_INSURANCE_COMPANY);
return R.ok("修改保险信息公司成功");
return R.ok(InsurancesConstants.UPDATE_COMPANY_SUCCESS);
}
}
}else{
insuranceCompany.setUpdateBy(user.getId());
insuranceCompany.setUpdateTime(LocalDateTime.now());
updateById(insuranceCompany);
addOperate(one,user, InsurancesConstants.UPDATE_INSURANCE_COMPANY);
return R.ok("修改保险信息公司成功");
addOperate(insuranceCompany,user, InsurancesConstants.UPDATE_INSURANCE_COMPANY);
return R.ok(InsurancesConstants.UPDATE_COMPANY_SUCCESS);
}
}
/**
......
......@@ -3195,6 +3195,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
//排除投保退回的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FOUR_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......@@ -3222,6 +3224,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//商险投保退回,无法减员
if (CommonConstants.FOUR_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_FOUR_ERROR);
errorList.add(param);
continue;
}
Integer reduceHandleStatus = one.getReduceHandleStatus();
if ( null != reduceHandleStatus){
//当前保单信息的减员状态不为空且不为减员退回时时不能进行导入
......@@ -3449,6 +3457,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FOUR_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......@@ -3668,6 +3677,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
//排除投保退回的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FOUR_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......
package com.yifu.cloud.plus.v1.job.compont;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @author licancan
* @description 商险模块到期定时任务
* @date 2022-08-03 10:39:14
*/
@Component(value = "updateOverdueTask")
@Slf4j
@EnableConfigurationProperties(DaprInsurancesProperties.class)
public class UpdateOverdueTask {
@Resource
private DaprInsurancesProperties daprInsurancesProperties;
/**
* 更新商险到期定时任务
*
* @author licancan
* @param
* @return void
*/
public void updateOverdueTask() throws Exception {
log.info("-------------更新商险到期-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId(),"/insuranceDetail/inner/updateOverdueByTask","", Void.class, SecurityConstants.FROM_IN);
log.info("------------更新商险到期-定时任务结束------------");
}
}
......@@ -49,10 +49,15 @@ public class TDispatchInfoSearchVo extends TDispatchInfo {
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
* 申请时间起
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
@Schema(description = "申请时间起")
private LocalDateTime createTimeStart;
/**
* 申请时间止
*/
@Schema(description = "申请时间止")
private LocalDateTime createTimeEnd;
/**
* @Author fxj
* 查询数据起
......
......@@ -57,7 +57,7 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
/**
* @param socialFundInfo
* @Description: 批量调基,同步预估库
* @Description: 人员批量调基,同步预估库
* @Author: hgw
* @Date: 2022/7/25 17:33
* @return: void
......
......@@ -210,15 +210,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
idList = searchVo.getIdList();
wrapper.in(TDispatchInfo::getId, idList);
}
if (Common.isNotNull(searchVo.getCreateTimeStart())) {
wrapper.ge(TDispatchInfo::getCreateTime, searchVo.getCreateTimeStart());
}
if (Common.isNotNull(searchVo.getCreateTimeEnd())) {
wrapper.le(TDispatchInfo::getCreateTime, searchVo.getCreateTimeEnd());
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TDispatchInfoSearchVo entity) {
LambdaQueryWrapper<TDispatchInfo> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TDispatchInfo::getCreateTime, entity.getCreateTimes()[0])
.le(TDispatchInfo::getCreateTime,
entity.getCreateTimes()[1]);
if (Common.isNotNull(entity.getCreateTimeStart())) {
wrapper.ge(TDispatchInfo::getCreateTime, entity.getCreateTimeStart());
}
if (Common.isNotNull(entity.getCreateTimeEnd())) {
wrapper.le(TDispatchInfo::getCreateTime, entity.getCreateTimeEnd());
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TDispatchInfo::getCreateName, entity.getCreateName());
......
......@@ -1376,6 +1376,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
social.setPersonalBigailmentMoney(socialSet.getPayPersonal());
}
}
} else {
social.setUnitBigailmentCardinal(BigDecimal.ZERO);
social.setUnitBigailmentPer(BigDecimal.ZERO);
social.setUnitBigailmentMoney(BigDecimal.ZERO);
social.setPersonalBigailmentCardinal(BigDecimal.ZERO);
social.setPersonalBigailmentPer(BigDecimal.ZERO);
social.setPersonalBigailmentMoney(BigDecimal.ZERO);
}
} else if (social.getUnitWorkInjuryCardinal() != null) {
social.setUnitWorkUnjuryPer(socialSet.getUnitInjuryPro());
......
......@@ -394,16 +394,18 @@
AND a.BELONG_UNIT_NAME = #{tDispatchInfo.belongUnitName}
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND s.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
</if>
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
AND f.PROVIDENT_HOUSEHOLD_NAME = #{tDispatchInfo.providentHouseholdName}
</if>
<if test="tDispatchInfo.createTimes != null and tDispatchInfo.createTimes.length>0">
AND a.CREATE_TIME <![CDATA[ >= ]]> #{tDispatchInfo.createTimes[0]}
AND a.CREATE_TIME <![CDATA[ <= ]]> #{tDispatchInfo.createTimes[1]}
</if>
<if test="tDispatchInfo.createTimeStart != null and tDispatchInfo.createTimeStart.trim() != ''">
AND a.CREATE_TIME <![CDATA[ >= ]]> #{tDispatchInfo.createTimeStart}
</if>
<if test="tDispatchInfo.createTimeEnd != null and tDispatchInfo.createTimeEnd.trim() != ''">
AND a.CREATE_TIME <![CDATA[ <= ]]> #{tDispatchInfo.createTimeEnd}
</if>
</if>
</sql>
<!--tDispatchInfo简单分页查询-->
......
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