Commit 589d6d81 by 翁国栋 Committed by 284718418@qq.com

8小时后台--

保单列表更新
parent ce04a123
...@@ -132,6 +132,7 @@ public class CallBackContorll { ...@@ -132,6 +132,7 @@ public class CallBackContorll {
CallBack callBack = JSONObject.parseObject(sb.toString(), CallBack.class); CallBack callBack = JSONObject.parseObject(sb.toString(), CallBack.class);
/*1保全复核回调*/ /*1保全复核回调*/
if (callBack.getCallback_type().equals("1")) { if (callBack.getCallback_type().equals("1")) {
/*核保*/
} else { } else {
/*到这就已经支付成功出单了*/ /*到这就已经支付成功出单了*/
...@@ -228,20 +229,21 @@ public class CallBackContorll { ...@@ -228,20 +229,21 @@ public class CallBackContorll {
String data = HttpUtils.sendPost(getPolicyUrl, setParams(JSONObject.toJSONString(bodyMap), appid, secret), bodyMap); String data = HttpUtils.sendPost(getPolicyUrl, setParams(JSONObject.toJSONString(bodyMap), appid, secret), bodyMap);
Map dataMap = JSONObject.parseObject(data, Map.class); Map dataMap = JSONObject.parseObject(data, Map.class);
if (dataMap.size() > 0) { if (dataMap.size() > 0) {
if ((dataMap.get("errcode").toString().equals("e25"))) { if (dataMap.get("errcode").toString().equals("e25")) {
//TODO 如果是E25则将保单设为出单中,更新交由保单出单回调做,设为出单状态是因为之后可以手动校验 //TODO 如果是E25则将保单设为出单中,更新交由保单出单回调做,设为出单状态是因为之后可以手动校验
InsurePolicy insurePolicy = InsurePolicy.builder().id(insurePay.getPolicyId()).build().selectById(); InsurePolicy insurePolicy = InsurePolicy.builder().id(insurePay.getPolicyId()).build().selectById();
insurePolicy.setStatus("2"); insurePolicy.setStatus("2");
insurePolicy.setUpdateTime(new Date()); insurePolicy.setUpdateTime(new Date());
insurePolicy.updateById(); insurePolicy.updateById();
} } else if (dataMap.get("errcode").toString().equals("suc")) {
InsureLog.builder().type(7).createTime(new Date()).requestType(1).requestPath(base_api_url + "/payCallBack")
.returnCode("suc").returnMsg("确认支付成功,支付方式:" + insurePay.getPayType() + ",支付金额:" + callBack.getAmount()).policyId(insurePay.getPolicyId()).build().insert();
} else {
InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(6) InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(6)
.requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(data).requestPath(getPolicyUrl) .requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(data).requestPath(getPolicyUrl)
.returnCode(dataMap.get("errcode").toString()).returnMsg("请求出单中").build().insert(); .returnCode(dataMap.get("errcode").toString()).returnMsg(dataMap.get("errmsg").toString()).build().insert();
map.put("status", "1"); }
} }
InsureLog.builder().type(7).createTime(new Date()).requestType(1).requestPath(base_api_url + "/payCallBack")
.returnCode("suc").returnMsg("确认支付成功,支付方式:" + insurePay.getPayType() + ",支付金额:" + callBack.getAmount()).policyId(insurePay.getPolicyId()).build().insert();
map.put("status", "1"); map.put("status", "1");
return map; return map;
} }
......
...@@ -64,11 +64,6 @@ public class InsureUserController{ ...@@ -64,11 +64,6 @@ public class InsureUserController{
@ApiOperation(value = "3.保单列表--8小时端", httpMethod = "POST", notes = "保单列表") @ApiOperation(value = "3.保单列表--8小时端", httpMethod = "POST", notes = "保单列表")
public Result<Object> userPolicyList(@CurrentUser UserBean userBean, @RequestBody PolicyDto policyDto) { public Result<Object> userPolicyList(@CurrentUser UserBean userBean, @RequestBody PolicyDto policyDto) {
Map map = Maps.newHashMap(); Map map = Maps.newHashMap();
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getId,policyDto.getId()));
if(insurePolicy==null){
return ResultUtil.error("保单号不存在");
}
policyDto.setId(insurePolicy.getId());
List<PolicyDto> list = insureUserMapper.selectPolicyList(policyDto); List<PolicyDto> list = insureUserMapper.selectPolicyList(policyDto);
map.put("list", Optional.ofNullable(list).orElse(Lists.newArrayList())); map.put("list", Optional.ofNullable(list).orElse(Lists.newArrayList()));
map.put("total", insureUserMapper.totalUser(policyDto)); map.put("total", insureUserMapper.totalUser(policyDto));
......
...@@ -12,7 +12,7 @@ import java.util.Date; ...@@ -12,7 +12,7 @@ import java.util.Date;
*/ */
@Data @Data
public class PolicyDto { public class PolicyDto {
private long id; private Integer id;
private String name; private String name;
private Integer zjType; private Integer zjType;
private String zjNum; private String zjNum;
...@@ -42,5 +42,7 @@ public class PolicyDto { ...@@ -42,5 +42,7 @@ public class PolicyDto {
private String productId; private String productId;
private Integer policyPayType; private Integer policyPayType;
private Integer payId; private Integer payId;
private Integer policyId;
private Integer applyType;
} }
...@@ -280,16 +280,25 @@ ...@@ -280,16 +280,25 @@
<select id="selectPolicyList" resultType="cn.timer.api.dto.insure.PolicyDto"> <select id="selectPolicyList" resultType="cn.timer.api.dto.insure.PolicyDto">
select select
iu.id,yme.`name`,yme.zj_type,yme.zj_num,iu.policy_no,iu.`status`,ip.scheme_name,iu.policy_date_start,iu.insure_status, iu.id,yme.`name`,yme.zj_type,yme.zj_num,iu.policy_no,iu.`status`,io.name as schemeName,iu.policy_date_start,iu.insure_status,
iu.policy_date_end,ip.create_time,iu.insured_name,iu.benefit_basic_plan AS benefitBasicPlan,iu.price AS price, iu.policy_date_end,ip.create_time,iu.insured_name,iu.benefit_basic_plan AS benefitBasicPlan,iu.price AS price,
iu.user_id as userId,iu.batch_no as batchNo,iu.benefit_occupation_category as benefitOccupationCategory iu.user_id as userId,iu.batch_no as batchNo,iu.benefit_occupation_category as benefitOccupationCategory,
iu.policy_id as policyId,
iu.apply_type as applyType
from insure_user iu from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id LEFT JOIN insure_policy ip on ip.id=iu.policy_id
LEFT JOIN insure_product io on io.id=ip.product_id
<where> <where>
<if test="policyDto.orgCode !=null and policyDto.orgCode !=''"> <if test="policyDto.orgCode !=null and policyDto.orgCode !=''">
and ip.org_code=#{policyDto.orgCode} and ip.org_code=#{policyDto.orgCode}
</if> </if>
<if test="policyDto.productId !=null and policyDto.productId !=''">
and ip.product_id=#{policyDto.productId}
</if>
<if test="policyDto.policyNo !=null and policyDto.policyNo !=''">
and ip.policy_no=#{policyDto.policyNo}
</if>
<if test="policyDto.id !=null and policyDto.id !=''"> <if test="policyDto.id !=null and policyDto.id !=''">
and ip.id=#{policyDto.id} and ip.id=#{policyDto.id}
</if> </if>
...@@ -311,11 +320,15 @@ ...@@ -311,11 +320,15 @@
<if test="policyDto.status !=null and policyDto.status !=''"> <if test="policyDto.status !=null and policyDto.status !=''">
and iu.insure_status = #{policyDto.status} and iu.insure_status = #{policyDto.status}
</if> </if>
<if test="policyDto.status !=null and policyDto.status !=''">
and iu.insure_status = #{policyDto.status}
</if>
<if test="policyDto.applyType !=null and policyDto.applyType !=''">
and iu.apply_type = #{policyDto.applyType}
</if>
</where> </where>
order by iu.policy_date_start desc order by iu.policy_date_start desc
<if test="policyDto.page.offset != null and policyDto.page.totalPage !=null">
LIMIT #{policyDto.page.offset},#{policyDto.page.totalPage}
</if>
</select> </select>
...@@ -327,6 +340,12 @@ ...@@ -327,6 +340,12 @@
<if test="policyDto.orgCode !=null and policyDto.orgCode !=''"> <if test="policyDto.orgCode !=null and policyDto.orgCode !=''">
and ip.org_code=#{policyDto.orgCode} and ip.org_code=#{policyDto.orgCode}
</if> </if>
<if test="policyDto.productId !=null and policyDto.productId !=''">
and ip.product_id=#{policyDto.productId}
</if>
<if test="policyDto.policyNo !=null and policyDto.policyNo !=''">
and ip.policy_no=#{policyDto.policyNo}
</if>
<if test="policyDto.id !=null and policyDto.id !=''"> <if test="policyDto.id !=null and policyDto.id !=''">
and ip.id=#{policyDto.id} and ip.id=#{policyDto.id}
</if> </if>
...@@ -342,6 +361,15 @@ ...@@ -342,6 +361,15 @@
<if test="policyDto.policyDateStart !=null and policyDto.policyDateStart !=''"> <if test="policyDto.policyDateStart !=null and policyDto.policyDateStart !=''">
and iu.policy_date_start <![CDATA[>=]]> #{policyDto.policyDateStart} and iu.policy_date_start <![CDATA[>=]]> #{policyDto.policyDateStart}
</if> </if>
<if test="policyDto.policyDateEnd !=null and policyDto.policyDateEnd !=''">
and iu.policy_date_end <![CDATA[<=]]> #{policyDto.policyDateEnd}
</if>
<if test="policyDto.status !=null and policyDto.status !=''">
and iu.insure_status = #{policyDto.status}
</if>
<if test="policyDto.applyType !=null and policyDto.applyType !=''">
and iu.apply_type = #{policyDto.applyType}
</if>
</where> </where>
</select> </select>
......
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