Compare commits

..

No commits in common. "ec5fcacf64a8166889e662cf476cb8c33e78eccc" and "a0aefb48507cb411f280ece941c75a3f5e5ceabf" have entirely different histories.

6 changed files with 8 additions and 99 deletions

View File

@ -267,7 +267,6 @@ public class OrderController extends BaseController {
orderMaster.setGoodsBrand(request.getGoodsBrand());
orderMaster.setGoodsSpecification(request.getGoodsSpecification());
orderMaster.setConsultMode(request.getConsultMode());
orderMaster.setRemark(request.getRemark());
if("01".equalsIgnoreCase(orderMaster.getConsultMode())){
orderMaster.setOrderMode("02");
orderMaster.setPayMode("01");
@ -1549,9 +1548,9 @@ public class OrderController extends BaseController {
List<OrderGoods> orderStandardList = orderGoodsService.selectByOrderDetailId(detail.getId());
// 商品信息
// GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId());
GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId());
Goods goods = goodsService.selectById(orderMaster.getGoodsId());
Goods goods = goodsService.selectById(goodsStandard.getGoodsId());
// 填充商品三级类目
if(goods.getDeptGoodsCategoryId() != null){
Long categoryId = null;

View File

@ -338,7 +338,7 @@ public class OrderDetailController extends BaseController {
List<OrderGoods> orderStandardList = orderGoodsService.selectByOrderDetailId(detail.getId());
// 商品信息
// GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId());
GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId());
Goods goods = goodsService.selectById(orderMaster.getGoodsId());
if (goods != null) {

View File

@ -4,7 +4,6 @@ import java.util.List;
import com.ghy.web.pojo.vo.CertNoTwoElementReq;
import com.ghy.web.service.AliCloudService;
import com.ghy.web.service.InsuranceService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@ -39,9 +38,6 @@ public class OrderDetailInsuranceUserController extends BaseController
@Autowired
private AliCloudService aliCloudService;
@Autowired
private InsuranceService insuranceService;
@RequiresPermissions("worker:user:view")
@GetMapping()
public String user()
@ -112,13 +108,6 @@ public class OrderDetailInsuranceUserController extends BaseController
log.error("身份证二要素校验失败:{}", e.getMessage(), e);
return AjaxResult.error(e.getMessage(), "身份证二要素校验失败!");
}
// 将保险人员增员到原保险订单上去
try {
insuranceService.editInsurance(orderDetailInsuranceUser);
}catch (Exception e){
log.error("保险增员失败:{}", e.getMessage(), e);
return AjaxResult.error(e.getMessage(), "保险增员失败!");
}
return toAjax(orderDetailInsuranceUserService.insertOrderDetailInsuranceUser(orderDetailInsuranceUser));
}

View File

@ -1,22 +0,0 @@
package com.ghy.web.pojo.vo;
import lombok.Data;
@Data
public class InsuranceOrderEditReq {
private String requestNo;
private String channelCode = "NNDD0806QH";
private String sign;
private String orderNumber;
private String workName;
private String workerID;
}

View File

@ -1,11 +1,9 @@
package com.ghy.web.service;
import com.ghy.order.domain.OrderDetailInsuranceUser;
public interface InsuranceService {
void orderInsurance(String orderCode) throws Exception;
public void orderInsurance(String orderCode) throws Exception;
void editInsurance(OrderDetailInsuranceUser orderDetailInsuranceUser) throws Exception ;
}

View File

@ -9,14 +9,9 @@ import com.alibaba.fastjson.JSONObject;
import com.ghy.common.utils.security.Md5Utils;
import com.ghy.customer.domain.CustomerAddress;
import com.ghy.customer.service.CustomerAddressService;
import com.ghy.order.domain.OrderDetail;
import com.ghy.order.domain.OrderDetailInsuranceUser;
import com.ghy.order.domain.OrderMaster;
import com.ghy.order.service.IOrderDetailInsuranceUserService;
import com.ghy.order.service.OrderDetailService;
import com.ghy.order.service.OrderMasterService;
import com.ghy.web.pojo.vo.CertNoTwoElementReq;
import com.ghy.web.pojo.vo.InsuranceOrderEditReq;
import com.ghy.web.pojo.vo.InsuranceOrderReq;
import com.ghy.web.service.InsuranceService;
import com.ghy.worker.domain.Worker;
@ -26,10 +21,8 @@ import com.ghy.worker.service.WorkerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@ -45,15 +38,12 @@ public class InsuranceServiceImpl implements InsuranceService {
@Autowired
private CustomerAddressService customerAddressService;
@Autowired
private IWorkerCertificationService workerCertificationService;
@Autowired
private WorkerService workerService;
@Autowired
private OrderDetailService orderDetailService;
@Autowired
private IOrderDetailInsuranceUserService orderDetailInsuranceUserService;
@Override
public void orderInsurance(String orderCode) throws Exception{
InsuranceOrderReq req = new InsuranceOrderReq();
@ -79,49 +69,4 @@ public class InsuranceServiceImpl implements InsuranceService {
throw new Exception(JSONObject.parseObject(result).getString("msg"));
}
}
@Override
public void editInsurance(OrderDetailInsuranceUser orderDetailInsuranceUser) throws Exception {
// 查询子单
OrderDetail detail = orderDetailService.selectById(orderDetailInsuranceUser.getOrderDetailId());
// 查询主单
OrderMaster master = orderMasterService.selectById(detail.getOrderMasterId());
// 查师傅信息
Worker worker = workerService.selectById(master.getWorkerId());
CertNoTwoElementReq certNoTwoElementReq = JSONUtil.toBean(worker.getRemark(), CertNoTwoElementReq.class);
// 查询主单下的所有子单
List<OrderDetail> detailList = orderDetailService.selectByOrderMasterId(detail.getOrderMasterId());
StringBuilder workerName = new StringBuilder();
StringBuilder workerId = new StringBuilder();
// 拼上主单信息
workerName.append(certNoTwoElementReq.getCertName());
workerId.append(certNoTwoElementReq.getCertNo());
detailList.forEach(model->{
OrderDetailInsuranceUser param = new OrderDetailInsuranceUser();
param.setOrderDetailId(model.getId());
List<OrderDetailInsuranceUser> users = orderDetailInsuranceUserService.selectOrderDetailInsuranceUserList(param);
if(!CollectionUtils.isEmpty(users)){
users.forEach(user->{
workerName.append(",").append(user.getName());
workerId.append(",").append(user.getIdCardNum());
});
}
});
// 再拼上 现在要加入的师傅的信息
workerName.append(",").append(orderDetailInsuranceUser.getName());
workerId.append(",").append(orderDetailInsuranceUser.getIdCardNum());
InsuranceOrderEditReq editReq = new InsuranceOrderEditReq();
editReq.setOrderNumber(master.getCode());
editReq.setRequestNo(master.getCode() + System.currentTimeMillis());
editReq.setSign(Md5Utils.hash(editReq.getRequestNo() + editReq.getChannelCode() + Key));
editReq.setOrderNumber(master.getCode());
editReq.setWorkName(workerName.toString());
editReq.setWorkerID(workerId.toString());
log.info("调用保险请求url:{},内容:{}", baseUrl+"/platInterface/updateOrder", JSONUtil.toJsonStr(editReq));
String result = HttpUtil.post(baseUrl+"/platInterface/updateOrder", JSONUtil.toJsonStr(editReq));
log.info("调用保险返回内容:{}", result);
if(!"1".equals(JSONObject.parseObject(result).getString("code"))){
throw new Exception(JSONObject.parseObject(result).getString("msg"));
}
}
}