Commit da6a2372 by 翁国栋

8小时运营后台--

增加保单回调是查询保单信息
导入保单时判断批改
parent 9a41cd1e
......@@ -34,3 +34,6 @@ CREATE TABLE ` yggl_main_importLog ` (
` org_code ` int(11) NULL DEFAULT NULL,
PRIMARY KEY (` id `) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
ALTER TABLE `timer_test`.`insure_user`
MODIFY COLUMN `apply_type` int(11) NULL DEFAULT NULL COMMENT '申请类型:1新增 2投保 3批改' AFTER `replace_trans_id`;
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
......@@ -16,8 +17,9 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -152,7 +154,7 @@ public class InsureUser extends Model<InsureUser> {
@ApiModelProperty(value = "替换流水号,使用trans_id,RP_开头")
private String replaceTransId;
@ApiModelProperty(value = "申请类型:1新增 2投保 3批")
@ApiModelProperty(value = "申请类型:1新增 2投保 3批")
private Integer applyType;
@ApiModelProperty(value = "批改原因")
......@@ -161,5 +163,8 @@ public class InsureUser extends Model<InsureUser> {
@ApiModelProperty(value = "录单时间")
private Date createTime;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "导入备注")
private String remake;
}
......@@ -8,6 +8,7 @@ import cn.timer.api.utils.ResultUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.mysql.cj.util.StringUtils;
import io.swagger.annotations.Api;
......@@ -199,7 +200,10 @@ public class CallBackContorll {
paramsMap.put("timestamp", timestamp);
paramsMap.put("sign", sign);
CallBack callBack = JSONObject.parseObject(sb.toString(), CallBack.class);
List<InsureUser> list = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getBatchNo, callBack.getOrder_import_info().getUuid()).eq(InsureUser::getInsureStatus, 3));
List<InsureUser> list = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getTransId, callBack.getOrder_import_info().getThird_uuid()));
if(list.size()<=0){
list = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getBatchNo, callBack.getOrder_import_info().getUuid()));
}
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getPolicyNo, list.get(0).getPolicyNo()));
if (callBack.getStatus().equals("1")) {
list.forEach(i -> {
......
......@@ -1111,6 +1111,11 @@ public class InsureContorll {
case "总保费":
user.setPrice(ExcelUtils.getString(cell));
break;
case "备注":
if(!StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))){
user.setRemake(ExcelUtils.getString(cell));
}
break;
}
}
userList.add(user);
......@@ -1186,7 +1191,26 @@ public class InsureContorll {
insureUser.setStatus("1");
insureUser.setCreateTime(new Date());
insureUser.insert();
/*判断批改状态*/
if(insureUser.getApplyType()==3){
if(StringUtils.isNullOrEmpty(insureUser.getRemake())){
return ResultUtil.data("批改状态下备注不能为空");
}
if(insureUser.getRemake().indexOf("被保险人信息批改-原被保险人,")!=-1){
String newStr= insureUser.getRemake().substring(insureUser.getRemake().indexOf(",")+1,insureUser.getRemake().length());
String[] arr = newStr.split("/");
if(arr[0].equals(insureUser.getInsuredEContact())&&arr[2].equals(insureUser.getInsuredNo())){
return ResultUtil.data("批改状态下替换人和被替换人不能相同");
}
/*更新人员投保状态*/
InsureUser.builder().status("2").insureStatus(2).build().update(new QueryWrapper<InsureUser>()
.lambda().eq(InsureUser::getInsuredNo,arr[2]).eq(InsureUser::getInsuredEContact,arr[0]));
ygglMainEmp.builder().isInsure(2).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getId,insureUser.getUserId()));
}
}
}
InsureLog.builder().requestParam(JSONObject.toJSONString(map)).type(9).createTime(new Date()).requestType(2).returnBody(data).requestPath(policyDetailUrl)
.returnCode(returnMap.get("errcode").toString()).returnMsg(returnMap.get("errmsg").toString()).policyId(policy.getId()).build().insert();
} catch (IOException e) {
......
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