Commit 29ec3eae authored by 李灿灿's avatar 李灿灿

商险优化部分接口

parent bd086211
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
/**
* @author licancan
* @description 商险操作(加审批意见)请求参数
* @date 2022-08-22 13:58:58
*/
@Data
@Schema(description = "商险操作(加审批意见)请求参数")
public class InsuranceHandleParam implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 集合不能为空
*/
@Size(min = 1,message = "集合不能为空")
@Schema(description = "主键集合")
private List<String> idList;
/**
* 审批意见
*/
@Schema(description = "审批意见")
private String remark;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo; 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.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.util.List; import java.util.List;
/** /**
...@@ -75,4 +77,30 @@ public class InsuranceListParam implements Serializable { ...@@ -75,4 +77,30 @@ public class InsuranceListParam implements Serializable {
*/ */
@Schema(description = "保单办理人") @Schema(description = "保单办理人")
private String updateBy; private String updateBy;
/**
* 购买类型, 1新增、3批增、4替换
*/
@Schema(description = " 购买类型(派单类型), 1新增、3批增、4替换")
private Integer buyType;
/**
* 创建者-姓名
*/
@Schema(description = "派单人")
private String createName;
/**
* 派单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "派单开始时间")
private LocalDate startDate;
/**
* 派单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "派单结束时间")
private LocalDate endDate;
} }
...@@ -116,8 +116,6 @@ public class TInsuranceDetailController { ...@@ -116,8 +116,6 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.getInsuranceList(param)); return R.ok(tInsuranceDetailService.getInsuranceList(param));
} }
/** /**
* 商险新增 * 商险新增
* *
...@@ -215,26 +213,26 @@ public class TInsuranceDetailController { ...@@ -215,26 +213,26 @@ public class TInsuranceDetailController {
* 投保退回 * 投保退回
* *
* @author licancan * @author licancan
* @param idList * @param param
* @return {@link R<List<InsuranceListVO>>} * @return {@link R<List<InsuranceListVO>>}
*/ */
@Operation(summary = "投保退回", description = "投保退回") @Operation(summary = "投保退回", description = "投保退回")
@PostMapping("/rollBackInsurance") @PostMapping("/rollBackInsurance")
public R<List<InsuranceListVO>> rollBackInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){ public R<List<InsuranceListVO>> rollBackInsurance(@RequestBody @Valid InsuranceHandleParam param){
return tInsuranceDetailService.rollBackInsurance(idList); return tInsuranceDetailService.rollBackInsurance(param.getIdList(),param.getRemark());
} }
/** /**
* 办理成功 * 办理成功
* *
* @author licancan * @author licancan
* @param idList * @param param
* @return {@link R<List<InsuranceListVO>>} * @return {@link R<List<InsuranceListVO>>}
*/ */
@Operation(summary = "办理成功", description = "办理成功") @Operation(summary = "办理成功", description = "办理成功")
@PostMapping("/successfulInsurance") @PostMapping("/successfulInsurance")
public R<List<InsuranceListVO>> successfulInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){ public R<List<InsuranceListVO>> successfulInsurance(@RequestBody @Valid InsuranceHandleParam param){
return tInsuranceDetailService.successfulInsurance(idList); return tInsuranceDetailService.successfulInsurance(param.getIdList(),param.getRemark());
} }
/** /**
......
...@@ -143,18 +143,20 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -143,18 +143,20 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* *
* @author licancan * @author licancan
* @param idList * @param idList
* @param remark
* @return {@link R<List<InsuranceListVO>>} * @return {@link R<List<InsuranceListVO>>}
*/ */
R<List<InsuranceListVO>> rollBackInsurance(List<String> idList); R<List<InsuranceListVO>> rollBackInsurance(List<String> idList,String remark);
/** /**
* 办理成功 * 办理成功
* *
* @author licancan * @author licancan
* @param idList * @param idList
* @param remark
* @return {@link R<List<InsuranceListVO>>} * @return {@link R<List<InsuranceListVO>>}
*/ */
R<List<InsuranceListVO>> successfulInsurance(List<String> idList); R<List<InsuranceListVO>> successfulInsurance(List<String> idList,String remark);
/** /**
* 登记保单保费 * 登记保单保费
......
...@@ -866,6 +866,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -866,6 +866,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Optional.ofNullable(byId).isPresent()){ if (Optional.ofNullable(byId).isPresent()){
InsuranceExportListVO vo = new InsuranceExportListVO(); InsuranceExportListVO vo = new InsuranceExportListVO();
BeanCopyUtils.copyProperties(byId,vo); BeanCopyUtils.copyProperties(byId,vo);
if (StringUtils.isNotBlank(byId.getPolicyNo())){
listVO.setPolicyNo(byId.getPolicyNo());
}
//购买月数 //购买月数
vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyStart().toString(),vo.getPolicyEnd().toString())); vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyStart().toString(),vo.getPolicyEnd().toString()));
//购买天数 //购买天数
...@@ -902,11 +905,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -902,11 +905,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* 投保退回 * 投保退回
* *
* @param idList * @param idList
* @param remark
* @return {@link R<List<InsuranceListVO>>} * @return {@link R<List<InsuranceListVO>>}
* @author licancan * @author licancan
*/ */
@Override @Override
public R<List<InsuranceListVO>> rollBackInsurance(List<String> idList) { public R<List<InsuranceListVO>> rollBackInsurance(List<String> idList,String remark) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN); return R.failed(CommonConstants.PLEASE_LOG_IN);
...@@ -1008,7 +1012,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1008,7 +1012,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码获取项目名称 //根据项目编码获取项目名称
setProjectNameByDeptNo(errorList); setProjectNameByDeptNo(errorList);
//操作记录 //操作记录
addOperate(successList,user,InsurancesConstants.ROLLBACK,null); addOperate(successList,user,InsurancesConstants.ROLLBACK,remark);
return R.ok(errorList,InsurancesConstants.OPERATE_SUCCESS); return R.ok(errorList,InsurancesConstants.OPERATE_SUCCESS);
} }
...@@ -1016,11 +1020,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1016,11 +1020,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* 办理成功 * 办理成功
* *
* @param idList * @param idList
* @param remark
* @return {@link R<List<InsuranceListVO>>} * @return {@link R<List<InsuranceListVO>>}
* @author licancan * @author licancan
*/ */
@Override @Override
public R<List<InsuranceListVO>> successfulInsurance(List<String> idList) { public R<List<InsuranceListVO>> successfulInsurance(List<String> idList,String remark) {
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10)); ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
...@@ -1168,7 +1173,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1168,7 +1173,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码获取项目名称 //根据项目编码获取项目名称
setProjectNameByDeptNo(errorList); setProjectNameByDeptNo(errorList);
//操作记录 //操作记录
addOperate(successList,user,InsurancesConstants.SUCCESSFUL,null); addOperate(successList,user,InsurancesConstants.SUCCESSFUL,remark);
return R.ok(errorList, InsurancesConstants.OPERATE_SUCCESS); return R.ok(errorList, InsurancesConstants.OPERATE_SUCCESS);
} }
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
CREATE_BY,CREATE_NAME,CREATE_TIME, CREATE_BY,CREATE_NAME,CREATE_TIME,
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME
</sql> </sql>
<!--投保办理分页查询--> <!--投保分页查询-->
<select id="getInsuranceListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO"> <select id="getInsuranceListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id, select detail.id as id,
detail.EMP_NAME as empName, detail.EMP_NAME as empName,
...@@ -119,6 +119,15 @@ ...@@ -119,6 +119,15 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="param.buyType != null">
and detail.BUY_TYPE = #{param.buyType}
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
...@@ -171,10 +180,19 @@ ...@@ -171,10 +180,19 @@
<if test="param.updateBy != null and param.updateBy.trim() != ''"> <if test="param.updateBy != null and param.updateBy.trim() != ''">
and detail.HANDLED_BY = #{param.updateBy} and detail.HANDLED_BY = #{param.updateBy}
</if> </if>
<if test="param.buyType != null">
and detail.BUY_TYPE = #{param.buyType}
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
<!--投保办理不分页查询--> <!--投保不分页查询-->
<select id="getInsuranceList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO"> <select id="getInsuranceList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id, select detail.id as id,
detail.EMP_NAME as empName, detail.EMP_NAME as empName,
...@@ -224,6 +242,15 @@ ...@@ -224,6 +242,15 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="param.buyType != null">
and detail.BUY_TYPE = #{param.buyType}
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
...@@ -276,7 +303,15 @@ ...@@ -276,7 +303,15 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="param.buyType != null">
and detail.BUY_TYPE = #{param.buyType}
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
<select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO"> <select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO">
......
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