Commit 65b8f536 by 翁国栋 Committed by 284718418@qq.com

运营后台--

更改投保业务逻辑
parent 239e9daf
...@@ -43,9 +43,31 @@ public class CallBackContorll { ...@@ -43,9 +43,31 @@ public class CallBackContorll {
@PostMapping(value = "/insuredCallBack") @PostMapping(value = "/insuredCallBack")
@ApiOperation(value = "6.投保申请回调", httpMethod = "Post", notes = "投保申请回调") @ApiOperation(value = "6.投保申请回调", httpMethod = "Post", notes = "投保申请回调")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
private String insuredCallBack(@RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp, @RequestBody CallBack callBack){ private Map insuredCallBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) throws IOException {
log.info(String.valueOf(callBack)); Map map = Maps.newHashMap();
return "1"; map.put("status","error");
if(StringUtils.isNullOrEmpty(pid)||StringUtils.isNullOrEmpty(sign)&&StringUtils.isNullOrEmpty(timestamp)){
return map;
}
if(!pid.equals(appidq)){
return map;
}
InputStream is = null;
is = request.getInputStream();
StringBuilder sb = new StringBuilder();
byte[] b = new byte[4096];
for (int n; (n = is.read(b)) != -1;)
{
sb.append(new String(b, 0, n));
}
String value = DigestUtils.md5Hex(appidq + secretq + timestamp + sb.toString());
if(!value.equals(sign)){
return map;
}
CallBack callBack=JSONObject.parseObject(sb.toString(), CallBack.class);
Map trueMap = Maps.newHashMap();
trueMap.put("status","1");
return trueMap;
} }
@PostMapping(value = "/CallBack") @PostMapping(value = "/CallBack")
...@@ -85,6 +107,7 @@ public class CallBackContorll { ...@@ -85,6 +107,7 @@ public class CallBackContorll {
if(oldlist!=null||oldlist.size()>0) { if(oldlist!=null||oldlist.size()>0) {
oldlist.forEach(i -> { oldlist.forEach(i -> {
i.setInsureStatus(4); i.setInsureStatus(4);
i.setStatus("2");
i.updateById(); i.updateById();
YgglMainEmp.builder().isInsure(3).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getId, i.getUserId())); YgglMainEmp.builder().isInsure(3).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getId, i.getUserId()));
}); });
......
...@@ -36,5 +36,5 @@ public class PolicyDto { ...@@ -36,5 +36,5 @@ public class PolicyDto {
private String policyFile; private String policyFile;
private String benefitOccupationCategory; private String benefitOccupationCategory;
private Integer userId; private Integer userId;
private Integer insureStatus;
} }
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
</delete> </delete>
<select id="selectPolicyList" resultType="cn.timer.api.dto.insure.PolicyDto"> <select id="selectPolicyList" resultType="cn.timer.api.dto.insure.PolicyDto">
select iu.id,yme.`name`,yme.zj_type,yme.zj_num,iu.policy_no,iu.`status`,ip.scheme_name,iu.policy_date_start, 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.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.user_id as userId
from insure_user iu from insure_user iu
......
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