提交 b1156ff4 authored 作者: hzh's avatar hzh

代码优化

上级 1c352dd5
......@@ -103,7 +103,16 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
//设置参数
Insure insure = new Insure();
BeanUtil.copyProperties(req, insure, true);
insure.setUserId(LoginHelper.getUserId()).setMemberId(LoginHelper.getMemberId()).setReqJson(JSONUtil.toJsonStr(req)).setResJson(JSONUtil.toJsonStr(res)).setProductJson(JSONUtil.toJsonStr(weishiService.productDetail(token, req.getProductId()))).setProductListJson(JSONUtil.toJsonStr(StreamUtils.findFirst(productList, p -> Objects.equals(p.getProductID(), req.getProductId())))).setOrderNum(res.getOrderNum()).setOrderUrl(res.getOrderUrl()).setOrderId(res.getOrderID()).setStatus(OrderStatus.P.getKey())
insure.setUserId(LoginHelper.getUserId())
.setMemberId(LoginHelper.getMemberId())
.setReqJson(JSONUtil.toJsonStr(req))
.setResJson(JSONUtil.toJsonStr(res))
.setProductJson(JSONUtil.toJsonStr(weishiService.productDetail(token, req.getProductId())))
.setProductListJson(JSONUtil.toJsonStr(StreamUtils.findFirst(productList, p -> Objects.equals(p.getProductID(), req.getProductId()))))
.setOrderNum(res.getOrderNum())
.setOrderUrl(res.getOrderUrl())
.setOrderId(res.getOrderID())
.setStatus(OrderStatus.P.getKey())
.setOrderTime(new Date());
insure.setCreateDept(LoginHelper.getDeptId());
baseMapper.insert(insure);
......@@ -122,19 +131,23 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
ApplyResponse.Unit unit = units.get(i);
InsureUnit iu = new InsureUnit();
BeanUtil.copyProperties(unit, iu, true);
iu.setOrderNum(res.getOrderNum());
iu.setOrderNum(res.getOrderNum())
.setStatus(insure.getStatus());
unitMapper.insert(iu);
//保存投保人信息
ApplyRequest.PolicyHolder ph = reqUnits.get(i).getPolicyHolder();
InsurePolicyHolder iph = BeanUtil.copyProperties(ph, InsurePolicyHolder.class);
iph.setOrderNum(res.getOrderNum()).setPolicyNum(unit.getPolicyNum());
iph.setOrderNum(res.getOrderNum())
.setPolicyNum(unit.getPolicyNum());
policyHolderMapper.insert(iph);
//保存被保人信息
List<ApplyRequest.Insurant> insureds = reqUnits.get(i).getInsureds();
for (ApplyRequest.Insurant insured : insureds) {
InsureInsureds ins = new InsureInsureds();
BeanUtil.copyProperties(insured, ins, true);
ins.setOrderNum(res.getOrderNum()).setPolicyNum(unit.getPolicyNum());
ins.setOrderNum(res.getOrderNum())
.setPolicyNum(unit.getPolicyNum())
.setStatus(insure.getStatus());
insuredsMapper.insert(ins);
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论