Commit 412709b9 authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

"feature-zhaJi:新增订单商险列表查询"

See merge request fangxinjiang/yifu!208
parents c9a7f6e2 325e1916
......@@ -1014,6 +1014,16 @@ public class InsurancesConstants {
*/
public static final String ORDER_NO_IS_EMPTY = "订单编号不能为空";
/**
* 购买类型为空
*/
public static final String BUY_TYPE_IS_EMPTY = "购买类型为空";
/**
* 购买类型错误
*/
public static final String BUY_TYPE_ERROR = "购买类型错误";
......
......@@ -170,6 +170,11 @@ public class InsuranceRefundListVo implements Serializable {
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
/**
* 购买月数
......
......@@ -232,8 +232,11 @@ public class InsuredListVo implements Serializable {
@Schema(description = "购买月数")
private Long buyMonth;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
//订单编号、姓名、身份证号、投保类型、项目、岗位、保单开始日期、保单结束日期、保险公司、险种、购买标准、医保、身故或残疾、预估保费、实际保费、保单号、发票号、保单生效日期、商险购买地、商险办理地、是否出险、是否过期、是否失效、派单日期、派单人
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 14:47:46
*/
@Data
public class InsuredOrderListVo implements Serializable {
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 医疗额度
*/
@Schema(description = "医疗额度")
private String medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
private String dieDisableQuota;
/**
* 创建人姓名
*/
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 创建人部门名称
*/
@Schema(description = "创建人部门名称(派单人)")
private String createUserDeptName;
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@Schema(description = "投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回,4减员成功")
private Integer reduceHandleStatus;
/**
* 减员ID
*/
@Schema(description = "减员ID")
private Integer refundId;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaji
* @description 订单商险列表查询
* @date 2022-08-29 14:44:25
*/
@Data
@Tag(name = "订单商险列表查询")
public class InsuredOrderParam implements Serializable {
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 开始日期
*/
@Schema(description = "开始日期")
private String startDate;
/**
* 结束日期
*/
@Schema(description = "结束日期")
private String endDate;
/**
* 项目编码列表
*/
@Schema(description = "项目编码列表")
private List<String> deptNoList;
}
......@@ -526,47 +526,47 @@ public class TInsuranceDetailController {
}
/**
* 商险新增
* 订单商险新增
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceAddParam>>}
*/
@Operation(summary = "投保新增", description = "投保新增")
@Operation(summary = "订单商险新增", description = "订单商险新增")
@PostMapping("/addOrderInsurance")
public R<List<InsuranceAddParam>> addOrderInsurance(@RequestBody InsuranceListOrderParam paramList ){
return tInsuranceDetailService.addOrderInsurance(paramList);
}
/**
* 商险批增
* 订单商险批增
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceBatchParam>>}
*/
@Operation(summary = "投保批增", description = "投保批增")
@Operation(summary = "订单商险批增", description = "订单商险批增")
@PostMapping("/batchOrderInsurance")
public R<List<InsuranceBatchParam>> batchOrderInsurance(@RequestBody InsuranceOrderBatchParam paramList){
return tInsuranceDetailService.batchOrderInsurance(paramList);
}
/**
* 商险替换
* 订单商险替换
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceReplaceParam>>}
*/
@Operation(summary = "投保替换", description = "投保替换")
@Operation(summary = "订单商险替换", description = "订单商险替换")
@PostMapping("/replaceOrderInsurance")
public R<List<InsuranceReplaceParam>> replaceOrderInsurance(@RequestBody InsuranceOrderReplaceParam paramList){
return tInsuranceDetailService.replaceOrderInsurance(paramList);
}
/**
* 导入减员校验
* @param paramList 导入减员校验
* 订单商险减员
* @param paramList 订单商险减员
* @author zhaji
* @date 2022-07-19
* @since v1.0
......@@ -576,5 +576,19 @@ public class TInsuranceDetailController {
return tInsuranceDetailService.refundOrderInsurance(paramList);
}
/**
* 订单商险列表查询
*
* @author zhaji
* @param page 分页参数
* @param param 查询条件
* @return {@link R<IPage<InsuredListVo>>}
*/
@Operation(summary = "订单商险列表查询", description = "订单商险列表查询")
@PostMapping("/getOrderInsuredListPage")
public R getOrderInsuredListPage(Page<InsuredOrderListVo> page, @RequestBody InsuredOrderParam param) {
return tInsuranceDetailService.getOrderInsuredListPage(page,param);
}
}
......@@ -204,15 +204,37 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @param empIdcardNo
* @return {@link List< TInsuranceDetail>}
*/
List<TInsuranceDetail> selectListByempIdcardNo(String empIdcardNo);
List<TInsuranceDetail> selectListByEmpIdcardNo(String empIdcardNo);
/**
* 查数据是否存在权限范围内
*
* @author zhaji
* @param regionSQL
* @param regionSql
* @param id
* @return {@link TInsuranceDetail}
*/
TInsuranceDetail selectByregionSQL(@Param("regionSql") String regionSQL,@Param("id") String id);
TInsuranceDetail selectByRegionSql(@Param("regionSql") String regionSql, @Param("id") String id);
/**
* 商险订单投保列表查询
*
* @author zhaji
* @param page
* @param param
* @return {@link IPage< InsuredOrderListVo>}
*/
IPage<InsuredOrderListVo> getOrderInsuredListPage(Page<InsuredOrderListVo> page,@Param("param") InsuredOrderParam param);
/**
* 商险订单减员列表查询
*
* @author zhaji
* @param page
* @param param
* @return {@link IPage< InsuredOrderListVo>}
*/
IPage<InsuredOrderListVo> getOrderRefundInsuredListPage(Page<InsuredOrderListVo> page,@Param("param") InsuredOrderParam param);
}
......@@ -383,4 +383,16 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
R<List<InsuranceReplaceParam>> replaceOrderInsurance(InsuranceOrderReplaceParam paramList);
R refundOrderInsurance(InsuranceOrderRefundParam paramList);
/**
* 订单商险列表查询
*
* @author zhaji
* @param page
* @param param
* @return {@link IPage< InsuredOrderListVo>}
*/
R getOrderInsuredListPage(Page<InsuredOrderListVo> page, InsuredOrderParam param);
SettleVo getInsuranceDetailSettleStatus(String detailId, String defaultSettleId);
}
......@@ -56,12 +56,14 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
List<TInsuranceEkp> ekpRefundList = this.baseMapper.getEkpRefundList();
List<TInsuranceEkp> failList = new ArrayList<>();
List<TInsuranceEkp> successLit = new ArrayList<>();
SettleVo settle = ekpSettleService.getSettle("12345");
String actualStatus = settle.getActualStatus();
log.info("settle:"+settle.toString());
log.info("actualStatus:"+actualStatus);
if (CollectionUtils.isNotEmpty(ekpRefundList)){
for (TInsuranceEkp tInsuranceEkp : ekpRefundList) {
//结算信息
SettleVo settleVo = tInsuranceDetailService.getInsuranceDetailSettleStatus(tInsuranceEkp.getDetailId(), tInsuranceEkp.getDefaultSettleId());
//实缴结算状态
String actualStatus = settleVo.getActualStatus();
//预缴结算状态
String estimateStatus = settleVo.getEstimateStatus();
Integer pushType = tInsuranceEkp.getPushType();
LambdaQueryWrapper<TInsuranceSettle> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId());
......@@ -80,10 +82,6 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
}
EKPInteractiveParam ekpParam = new EKPInteractiveParam();
BeanCopyUtils.copyProperties(tInsuranceEkp,ekpParam);
String detailId = ekpParam.getDetailId();
String defaultSettleId = ekpParam.getDefaultSettleId();
//查询当前结算状态
String status = CommonConstants.ONE_STRING;
if(actualStatus.equals(InsurancesConstants.SETTLE_ZERO)){
String s = EKPUtil.sendToEKP(ekpParam);
//如果发送成功
......
......@@ -57,7 +57,6 @@
<result property="createUserDeptId" column="CREATE_USER_DEPT_ID" jdbcType="VARCHAR"/>
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,EMP_NAME,
EMP_IDCARD_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,INSURANCE_TYPE_NAME,
......@@ -138,7 +137,6 @@
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<!--投保不分页查询-->
<select id="getInsuranceList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id,
......@@ -200,7 +198,6 @@
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<!--投保办理分页查询-->
<select id="getInsuranceHandleListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id,
......@@ -261,7 +258,6 @@
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO">
select
detail.id as id,
......@@ -393,13 +389,11 @@
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
<update id="updatePolicyNoBatch">
<foreach collection="details" index="index" item="item" separator=";">
update t_insurance_detail set POLICY_NO = #{item.policyNo} where ID = #{item.id}
</foreach>
</update>
<update id="updateInvoiceNoBatch">
<foreach collection="details" index="index" item="item" separator=";">
update t_insurance_detail set INVOICE_NO = #{item.invoiceNo} where ID = #{item.id}
......@@ -425,6 +419,7 @@
detail.IS_OVERDUE as isOverdue,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.CREATE_USER_DEPT_NAME as createUserDeptName,
detail.BUY_STANDARD as buyStandard
from
t_insurance_detail detail
......@@ -582,6 +577,7 @@
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.POLICY_NO as policyNo,
refund.CREATE_USER_DEPT_NAME as createUserDeptName,
refund.CREATE_TIME as refundCreateTime
from
t_insurance_detail detail,
......@@ -908,7 +904,7 @@
</where>
ORDER BY CREATE_TIME desc
</select>
<select id="selectListByempIdcardNo" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
<select id="selectListByEmpIdcardNo" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
<include refid="Base_Column_List"/>
FROM
......@@ -924,7 +920,8 @@
</where>
ORDER BY CREATE_TIME desc
</select>
<select id="selectByregionSQL" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
<!--查数据是否存在权限范围内-->
<select id="selectByRegionSql" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
<include refid="Base_Column_List"/>
FROM
......@@ -937,4 +934,130 @@
</where>
ORDER BY CREATE_TIME desc
</select>
<!--商险订单减员列表查询-->
<select id="getOrderRefundInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredOrderListVo">
(
select
detail.id as id,
detail.BUY_TYPE as buyType,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.CREATE_NAME as createName,
detail.CREATE_USER_DEPT_NAME as createUserDeptName,
detail.CREATE_TIME as createTime,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
detail.ORDER_NO = #{param.orderNo}
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if>
<if test="param.endDate != null and param.endDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.deptNoList != null">
and detail.DEPT_NO in
<foreach collection="param.deptNoList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>)
union all(
select
detail.id as id,
detail.BUY_TYPE as buyType,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
refund.CREATE_NAME as createName,
refund.CREATE_USER_DEPT_NAME as createUserDeptName,
refund.CREATE_TIME as createTime,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
refund.REDUCE_HANDLE_STATUS as reduceHandleStatus
from
t_insurance_detail detail,
t_insurance_refund refund
where
detail.DELETE_FLAG = 0
and
refund.ORDER_NO = #{param.orderNo}
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if>
<if test="param.endDate != null and param.endDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.deptNoList != null">
and detail.DEPT_NO in
<foreach collection="param.deptNoList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)order by createTime desc
</select>
<select id="getOrderInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredOrderListVo">
select
detail.id as id,
detail.BUY_TYPE as buyType,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.CREATE_NAME as createName,
detail.CREATE_USER_DEPT_NAME as createUserDeptName,
detail.CREATE_TIME as createTime,
detail.BUY_HANDLE_STATUS as buyHandleStatus
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
detail.ORDER_NO = #{param.orderNo}
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if>
<if test="param.endDate != null and param.endDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.deptNoList != null">
and detail.DEPT_NO in
<foreach collection="param.deptNoList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</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