Commit fb0f8553 by 翁国栋

8小时后台--

保单列表更新
parent 447cff48
......@@ -132,6 +132,7 @@ public class CallBackContorll {
CallBack callBack = JSONObject.parseObject(sb.toString(), CallBack.class);
/*1保全复核回调*/
if (callBack.getCallback_type().equals("1")) {
/*核保*/
} else {
/*到这就已经支付成功出单了*/
......@@ -228,20 +229,21 @@ public class CallBackContorll {
String data = HttpUtils.sendPost(getPolicyUrl, setParams(JSONObject.toJSONString(bodyMap), appid, secret), bodyMap);
Map dataMap = JSONObject.parseObject(data, Map.class);
if (dataMap.size() > 0) {
if ((dataMap.get("errcode").toString().equals("e25"))) {
if (dataMap.get("errcode").toString().equals("e25")) {
//TODO 如果是E25则将保单设为出单中,更新交由保单出单回调做,设为出单状态是因为之后可以手动校验
InsurePolicy insurePolicy = InsurePolicy.builder().id(insurePay.getPolicyId()).build().selectById();
insurePolicy.setStatus("2");
insurePolicy.setUpdateTime(new Date());
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)
.requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(data).requestPath(getPolicyUrl)
.returnCode(dataMap.get("errcode").toString()).returnMsg(dataMap.get("errmsg").toString()).build().insert();
}
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)
.returnCode(dataMap.get("errcode").toString()).returnMsg("请求出单中").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");
return map;
}
......
......@@ -556,7 +556,7 @@ public class InsureContorll {
insurePolicy.setStatus("4");/*支付中状态*/
insurePolicy.updateById();
Map returnMap = Maps.newHashMap();
returnMap.put("url",importPayInfo.get("pay_url").toString());
returnMap.put("url",importPayInfo.get("pay_url").toString()+"&jump_url"+base_api_url +"/callBack/policy/payStatus?policyId="+insurePolicy.getId());
returnMap.put("payId",insurePay.getId());
return ResultUtil.data(returnMap);
}else {
......@@ -1333,7 +1333,7 @@ public class InsureContorll {
.eq(YgglMainEmp::getName, insureUser.getInsuredEContact())
.eq(YgglMainEmp::getZjNum, insureUser.getInsuredNo())
.eq(YgglMainEmp::getOrgCode, insureUser.getOrgCode()));
if (ygglMainEmp != null) {
/*如果导入的人已经投保*/
if(ygglMainEmp.getIsInsure()==1){
......
......@@ -64,11 +64,6 @@ public class InsureUserController{
@ApiOperation(value = "3.保单列表--8小时端", httpMethod = "POST", notes = "保单列表")
public Result<Object> userPolicyList(@CurrentUser UserBean userBean, @RequestBody PolicyDto policyDto) {
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);
map.put("list", Optional.ofNullable(list).orElse(Lists.newArrayList()));
map.put("total", insureUserMapper.totalUser(policyDto));
......
......@@ -12,7 +12,7 @@ import java.util.Date;
*/
@Data
public class PolicyDto {
private long id;
private Integer id;
private String name;
private Integer zjType;
private String zjNum;
......@@ -42,5 +42,7 @@ public class PolicyDto {
private String productId;
private Integer policyPayType;
private Integer payId;
private Integer policyId;
private Integer applyType;
}
......@@ -280,16 +280,25 @@
<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,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.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
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_product io on io.id=ip.product_id
<where>
<if test="policyDto.orgCode !=null and policyDto.orgCode !=''">
and ip.org_code=#{policyDto.orgCode}
</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 !=''">
and ip.id=#{policyDto.id}
</if>
......@@ -311,11 +320,15 @@
<if test="policyDto.status !=null and policyDto.status !=''">
and iu.insure_status = #{policyDto.status}
</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>
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>
......@@ -327,6 +340,12 @@
<if test="policyDto.orgCode !=null and policyDto.orgCode !=''">
and ip.org_code=#{policyDto.orgCode}
</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 !=''">
and ip.id=#{policyDto.id}
</if>
......@@ -342,6 +361,15 @@
<if test="policyDto.policyDateStart !=null and policyDto.policyDateStart !=''">
and iu.policy_date_start <![CDATA[>=]]> #{policyDto.policyDateStart}
</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>
</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