Compare commits
No commits in common. "e398ad7e25becf5e5013792cbcaece90aed9e3cd" and "d44591330a3ad3d65818215854e39e16fd004d96" have entirely different histories.
e398ad7e25
...
d44591330a
|
|
@ -39,7 +39,6 @@ import com.ghy.payment.service.OrderFineRecordService;
|
||||||
import com.ghy.system.domain.SysArea;
|
import com.ghy.system.domain.SysArea;
|
||||||
import com.ghy.system.service.ISysAreaService;
|
import com.ghy.system.service.ISysAreaService;
|
||||||
import com.ghy.web.pojo.vo.*;
|
import com.ghy.web.pojo.vo.*;
|
||||||
import com.ghy.web.service.InsuranceService;
|
|
||||||
import com.ghy.worker.domain.Worker;
|
import com.ghy.worker.domain.Worker;
|
||||||
import com.ghy.worker.domain.WorkerCertification;
|
import com.ghy.worker.domain.WorkerCertification;
|
||||||
import com.ghy.worker.service.IWorkerCertificationService;
|
import com.ghy.worker.service.IWorkerCertificationService;
|
||||||
|
|
@ -123,9 +122,6 @@ public class OrderMasterController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private CustomerAddressService customerAddressService;
|
private CustomerAddressService customerAddressService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private InsuranceService insuranceService;
|
|
||||||
|
|
||||||
@GetMapping("/changePrice/{orderIds}")
|
@GetMapping("/changePrice/{orderIds}")
|
||||||
public String changePrice(@PathVariable("orderIds") String orderIds, ModelMap mmap)
|
public String changePrice(@PathVariable("orderIds") String orderIds, ModelMap mmap)
|
||||||
{
|
{
|
||||||
|
|
@ -1380,11 +1376,6 @@ public class OrderMasterController extends BaseController {
|
||||||
orderDetailService.updateOrderDetail(orderDetail);
|
orderDetailService.updateOrderDetail(orderDetail);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 下单
|
|
||||||
if(OrderStatus.PLAIN.code() == orderMaster.getOrderStatus()){
|
|
||||||
OrderMaster model = orderMasterService.selectById(orderMaster.getId());
|
|
||||||
insuranceService.orderInsurance(model.getCode());
|
|
||||||
}
|
|
||||||
return AjaxResult.success("");
|
return AjaxResult.success("");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
package com.ghy.web.pojo.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class InsuranceOrderReq {
|
|
||||||
|
|
||||||
private String requestNo;
|
|
||||||
|
|
||||||
private String channelCode = "NNDD0806QH";
|
|
||||||
|
|
||||||
private String sign;
|
|
||||||
|
|
||||||
private String orderNumber;
|
|
||||||
|
|
||||||
private String orderProductType = "0002";
|
|
||||||
|
|
||||||
private String orderStatus = "1";
|
|
||||||
|
|
||||||
private String orderStartat;
|
|
||||||
|
|
||||||
private String orderEndat;
|
|
||||||
|
|
||||||
private String customerAddress;
|
|
||||||
|
|
||||||
private String customerPhone;
|
|
||||||
|
|
||||||
private String workName;
|
|
||||||
|
|
||||||
private String workerID;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
package com.ghy.web.service;
|
|
||||||
|
|
||||||
public interface InsuranceService {
|
|
||||||
|
|
||||||
public void orderInsurance(String orderCode);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.ghy.web.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateField;
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.http.HttpUtil;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.ghy.common.utils.security.Md5Utils;
|
|
||||||
import com.ghy.customer.domain.CustomerAddress;
|
|
||||||
import com.ghy.customer.service.CustomerAddressService;
|
|
||||||
import com.ghy.order.domain.OrderMaster;
|
|
||||||
import com.ghy.order.service.OrderMasterService;
|
|
||||||
import com.ghy.web.pojo.vo.InsuranceOrderReq;
|
|
||||||
import com.ghy.web.service.InsuranceService;
|
|
||||||
import com.ghy.worker.domain.WorkerCertification;
|
|
||||||
import com.ghy.worker.service.IWorkerCertificationService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class InsuranceServiceImpl implements InsuranceService {
|
|
||||||
|
|
||||||
private final static String Key = "96ndsd26k25jm";
|
|
||||||
|
|
||||||
private final static String baseUrl = "https://pre-hbhp-xianding.hzins.com/api/external/";
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private OrderMasterService orderMasterService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CustomerAddressService customerAddressService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IWorkerCertificationService workerCertificationService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void orderInsurance(String orderCode) {
|
|
||||||
InsuranceOrderReq req = new InsuranceOrderReq();
|
|
||||||
OrderMaster master = orderMasterService.selectByCode(orderCode);
|
|
||||||
req.setOrderNumber(master.getCode());
|
|
||||||
req.setRequestNo(master.getCode() + System.currentTimeMillis());
|
|
||||||
req.setSign(Md5Utils.hash(req.getRequestNo() + req.getChannelCode() + Key));
|
|
||||||
// 查询客户地址信息
|
|
||||||
CustomerAddress customerAddress = customerAddressService.selectByCustomerAddressId(master.getAddressId());
|
|
||||||
req.setCustomerAddress(customerAddress.getAddress());
|
|
||||||
req.setCustomerPhone(customerAddress.getPhone());
|
|
||||||
// 查询师傅信息
|
|
||||||
WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(master.getWorkerId());
|
|
||||||
req.setWorkerID(workerCertification.getIdCardNum());
|
|
||||||
req.setWorkName(workerCertification.getLegalPersionName());
|
|
||||||
req.setOrderStartat(DateUtil.format(DateUtil.offset(new Date(), DateField.SECOND, 30), DatePattern.NORM_DATETIME_PATTERN));
|
|
||||||
req.setOrderEndat(DateUtil.format(DateUtil.offset(new Date(), DateField.DAY_OF_YEAR, 30),DatePattern.NORM_DATETIME_PATTERN));
|
|
||||||
log.info("调用保险请求url:{},内容:{}", baseUrl+"/platInterface/order", JSONUtil.toJsonStr(req));
|
|
||||||
String result = HttpUtil.post(baseUrl+"/platInterface/order", JSONUtil.toJsonStr(req));
|
|
||||||
log.info("调用保险返回内容:{}", result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue