Commit 1a3a290f authored by fangxinjiang's avatar fangxinjiang

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

parents 072cf365 f7156f0e
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @author huyc
* @description 发票号更新VO
* @date 2022-11-29 10:23:17
*/
@Data
@Schema(description = "发票号更新VO")
public class InsuranceUpdateVO implements Serializable {
private static final long serialVersionUID = 628032758008497542L;
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 发票号
*/
@Schema(description = "发票号")
private String invoiceNo;
/**
* 保单号
*/
@Schema(description = "保单号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单号")
private String policyNo;
}
......@@ -83,7 +83,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @param details
* @return void
*/
void updatePolicyNoBatch(@Param("details") List<TInsuranceDetail> details);
void updatePolicyNoBatch(@Param("details") List<InsuranceUpdateVO> details);
/**
* 批量更新发票号
......@@ -92,7 +92,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @param details
* @return void
*/
void updateInvoiceNoBatch(@Param("details") List<TInsuranceDetail> details);
void updateInvoiceNoBatch(@Param("details") List<InsuranceUpdateVO> details);
/***********************减员办理********************************/
......@@ -246,4 +246,13 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
List<TInsuranceDetail> selectByIdCardList(@Param("idCardList") List<String> idCardList
, @Param("idList") List<String> idList);
/**
* @param ids
* @Description: 根据id查找所有商险
* @Author: huyc
* @Date: 2022/11/29 10:17
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail>
**/
List<InsuranceUpdateVO> selectByIds(@Param("ids") List<String> ids);
}
......@@ -4,6 +4,9 @@ package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author licancan
......@@ -13,4 +16,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TInsuranceOperateMapper extends BaseMapper<TInsuranceOperate> {
int saveOperateInfo(@Param("list") List<TInsuranceOperate> list);
}
......@@ -4,6 +4,8 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import java.util.List;
/**
* @author licancan
* @description 针对表【t_insurance_operate(商险操作表)】的数据库操作Service
......@@ -11,4 +13,5 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
*/
public interface TInsuranceOperateService extends IService<TInsuranceOperate> {
int saveOperateInfo(List<TInsuranceOperate> list);
}
......@@ -6,6 +6,8 @@ import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceOperat
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceOperateService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author licancan
......@@ -15,4 +17,8 @@ import org.springframework.stereotype.Service;
@Service
public class TInsuranceOperateServiceImpl extends ServiceImpl<TInsuranceOperateMapper, TInsuranceOperate> implements TInsuranceOperateService {
@Override
public int saveOperateInfo(List<TInsuranceOperate> list) {
return baseMapper.saveOperateInfo(list);
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.util;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEkpService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleCancelService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInteractiveParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
/**
* 主要执行商险的异步推送
* @author huyc
* @Date 2022-11-30
* @Description 多线程的执行
*/
@Slf4j
@Component
public class DoJointInsuranceTask {
@Resource
private TInsuranceSettleService tInsuranceSettleService;
@Autowired
private EkpInsuranceUtil eKPInsuranceUtil;
@Autowired
private TInsuranceEkpService tInsuranceEkpService;
@Autowired
private ArchivesDaprUtil archivesDaprUtil;
@Autowired
private TInsuranceSettleCancelService tInsuranceSettleCancelService;
/**
* @Description: 商险明细推送
* @Author: huyc
* @Date: 2022-11-30
* @return: void
**/
@Async
public void asynchronousEkpInfo(TInsuranceDetail detail, TInsuranceSettle settle, Integer type) {
log.info("推送商险明细到EKP-线程开始");
try {
String s = pushEstimate(detail,type);
if(StringUtils.isNotBlank(s)){
if (type == CommonConstants.ONE_INT) {
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
} else {
settle.setIsActualPush(CommonConstants.ONE_INT);
settle.setActualPushTime(LocalDateTime.now());
}
tInsuranceSettleService.updateById(settle);
}
} catch (Exception e) {
log.error("推送商险明细到EKP错误", e);
}
log.info("推送商险明细到EKP结束");
}
/**
* 推送EKP
*
* @author zhaji
* @param
* @return {@link String}
*/
private String pushEstimate(TInsuranceDetail tInsuranceDetail,Integer type){
YifuUser user = SecurityUtils.getUser();
Integer pushType = null;
//1,推送预估保费,2,推送实际保费,3推送预估冲正保费,4更新实际保费
EkpInteractiveParam param = new EkpInteractiveParam();
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
BeanCopyUtils.copyProperties(tInsuranceDetail,param);
param.setDetailId(tInsuranceDetail.getId());
Integer settleType = tInsuranceDetail.getSettleType();
if(CommonConstants.ZERO_INT == settleType){
param.setEstimateStatus(EkpConstants.HAVE);
}else {
param.setEstimateStatus(EkpConstants.NOTHING);
}
if (Common.isNotNull(tInsuranceDetail.getUnitName())) {
param.setCustomerName(tInsuranceDetail.getUnitName());
}
if (Common.isNotNull(tInsuranceDetail.getUnitNo())) {
param.setCustomerCode(tInsuranceDetail.getUnitNo());
}
//1,推送预估保费(用户办理成功,推送预估保费)
if(CommonConstants.ONE_INT == type){
param.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
param.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
pushType = CommonConstants.ONE_INT;
}
//2,推送实际保费(用于登记保单保费未推送过实缴保费)
if(CommonConstants.TWO_INT == type){
param.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
param.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
pushType = CommonConstants.TWO_INT;
}
//3推送预估冲正保费(用于投保退回场景)
if(CommonConstants.THREE_INT == type){
String defaultSettleId = tInsuranceDetail.getDefaultSettleId();
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//冲正取负数
if(null != byId.getEstimatePremium()){
param.setEstimatePremium(byId.getEstimatePremium());
}
param.setInteractiveType(InsurancesConstants.CORRECT_SETTLE_BILL);
param.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
pushType = CommonConstants.FIVE_INT;
}
//6推送实缴红冲(用于投保退回场景)
if(CommonConstants.SIX_INT == type){
String defaultSettleId = tInsuranceDetail.getDefaultSettleId();
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//冲正取负数
if(null != byId.getActualPremium()){
param.setActualPremium(byId.getActualPremium());
}
param.setInteractiveType(InsurancesConstants.CORRECT_SETTLE_BILL);
param.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
pushType = CommonConstants.SIX_INT;
}
//4更新实际保费(用于登记保单保费场景推送过实缴保费)
if(CommonConstants.FOUR_INT == type){
param.setInteractiveType(InsurancesConstants.UPDATE_SETTLE_BILL);
param.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
pushType = CommonConstants.THREE_INT;
}
//作废
if(CommonConstants.FIVE_INT == type){
cancel.setDeptNo(tInsuranceDetail.getDeptNo());
cancel.setInsDetailId(tInsuranceDetail.getId());
cancel.setSettleId(tInsuranceDetail.getDefaultSettleId());
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(param.getDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
param.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL);
param.setSettleType(CommonConstants.EMPTY_STRING);
pushType = CommonConstants.FOUR_INT;
}
String s = eKPInsuranceUtil.sendToEkp(param);
if(StringUtils.isBlank(s)){
saveInsuranceEkp(param,pushType);
return null;
}else {
return s;
}
}
/**
* 保存失败信息
*
* @author zhaji
* @param
* @return {@link String}
*/
private void saveInsuranceEkp(EkpInteractiveParam param, Integer pushType){
TInsuranceEkp ekp = new TInsuranceEkp();
BeanCopyUtils.copyProperties(param,ekp);
ekp.setId(null);
ekp.setCreateTime(LocalDateTime.now());
ekp.setPushType(pushType);
tInsuranceEkpService.save(ekp);
}
}
......@@ -63,6 +63,11 @@
<result property="unitName" column="UNIT_NAME" jdbcType="VARCHAR"/>
<result property="unitNo" column="UNIT_NO" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="UpdateMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceUpdateVO">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="invoiceNo" column="INVOICE_NO" jdbcType="VARCHAR"/>
<result property="policyNo" column="POLICY_NO" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,EMP_NAME,
EMP_IDCARD_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,INSURANCE_TYPE_NAME,
......@@ -1209,4 +1214,18 @@
</if>
</select>
<select id="selectByIds" resultMap="UpdateMap">
SELECT
a.ID,
a.INVOICE_NO,
a.POLICY_NO
FROM
t_insurance_detail a
where
a.ID in
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
......@@ -19,4 +19,22 @@
ID,INSURANCE_DETAIL_ID,OPERATE_DESC,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME
</sql>
<insert id="saveOperateInfo" parameterType="java.util.List">
insert into t_insurance_operate
(ID,REMARK,DISPLAY_FLAG,CREATE_BY,CREATE_TIME,CREATE_NAME,OPERATE_DESC,INSURANCE_DETAIL_ID)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id,jdbcType=VARCHAR},
#{item.remark,jdbcType=VARCHAR},
#{item.displayFlag},
#{item.createBy,jdbcType=VARCHAR},
#{item.createTime},
#{item.createName,jdbcType=VARCHAR},
#{item.operateDesc,jdbcType=VARCHAR},
#{item.insuranceDetailId,jdbcType=VARCHAR},
)
</foreach>
</insert>
</mapper>
......@@ -93,7 +93,7 @@ public class DoJointSalaryAsyncTask {
if (s != null
&& (s.getStatus() == CommonConstants.dingleDigitIntArray[11]
|| s.getStatus() == CommonConstants.dingleDigitIntArray[12])) {
tSalaryStandard.setIncomeEndTime(new Date());
s.setIncomeEndTime(new Date());
if (isTrue) {
s.setStatus(CommonConstants.TWO_INT);
salaryStandardMapper.updateById(s);
......
......@@ -33,4 +33,12 @@ import java.util.List;
@Mapper
public interface TIncomeDetailMapper extends BaseMapper<TIncomeDetail> {
List<TIncomeDetail> getTIncomeDetailList(@Param("tIncomeDetail") TIncomeDetail tIncomeDetail);
/**
* @Description: 获取重复性
* @Author: hgw
* @Date: 2022/12/5 11:16
* @return: int
**/
int getTIncomeDetailRepeat(@Param("tIncomeDetail") TIncomeDetail detail);
}
......@@ -30,4 +30,13 @@ import java.util.List;
*/
public interface TIncomeDetailService extends IService<TIncomeDetail> {
List<TIncomeDetail> getTIncomeDetailList(TIncomeDetail detail);
/**
* @Description: 获取重复性
* @Author: hgw
* @Date: 2022/12/5 11:16
* @return: int
**/
int getTIncomeDetailRepeat(TIncomeDetail detail);
}
......@@ -39,4 +39,15 @@ public class TIncomeDetailServiceImpl extends ServiceImpl<TIncomeDetailMapper, T
public List<TIncomeDetail> getTIncomeDetailList(TIncomeDetail detail) {
return baseMapper.getTIncomeDetailList(detail);
}
/**
* @Description: 获取重复性
* @Author: hgw
* @Date: 2022/12/5 11:16
* @return: int
**/
@Override
public int getTIncomeDetailRepeat(TIncomeDetail detail) {
return baseMapper.getTIncomeDetailRepeat(detail);
}
}
......@@ -578,11 +578,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if (Common.isNotNull(tIncomeDetail.getSourceId())) {
// 如果该id、该类型的金额已存在,则不允许重复生成推送
TIncomeDetail a = new TIncomeDetail();
a.setId(tIncomeDetail.getId());
a.setSourceId(tIncomeDetail.getSourceId());
a.setMoney(tIncomeDetail.getMoney());
a.setRedData(tIncomeDetail.getRedData());
List<TIncomeDetail> aList = tIncomeDetailService.getTIncomeDetailList(a);
if (aList != null && !aList.isEmpty()) {
a.setFeeType(tIncomeDetail.getFeeType());
int repeatNums = tIncomeDetailService.getTIncomeDetailRepeat(a);
if (repeatNums > CommonConstants.ZERO_INT) {
return true;
}
}
......
......@@ -156,4 +156,16 @@
</where>
</select>
<!-- 获取重复性 -->
<select id="getTIncomeDetailRepeat" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_income_detail a
where a.ID != #{tIncomeDetail.id}
AND a.SOURCE_ID = #{tIncomeDetail.sourceId}
AND a.MONEY = #{tIncomeDetail.money}
AND a.RED_DATA = #{tIncomeDetail.redData}
AND a.FEE_TYPE = #{tIncomeDetail.feeType}
</select>
</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