This commit is contained in:
YiFei Kuang 2025-02-20 17:03:53 +08:00
parent e8fd8d49d2
commit 109cc4ccca
6 changed files with 63 additions and 5 deletions

View File

@ -29,6 +29,7 @@ import com.ghy.system.service.IWxMsgService;
import com.ghy.web.pojo.vo.OrderChangePriceRequest; import com.ghy.web.pojo.vo.OrderChangePriceRequest;
import com.ghy.web.pojo.vo.OrderListResponse; import com.ghy.web.pojo.vo.OrderListResponse;
import com.ghy.web.pojo.vo.OrderStandard; import com.ghy.web.pojo.vo.OrderStandard;
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;
@ -112,6 +113,8 @@ public class OrderDetailController extends BaseController {
@Resource @Resource
private IInsuranceManagerService insuranceManagerService; private IInsuranceManagerService insuranceManagerService;
@Autowired
private InsuranceService insuranceService;
@RequiresPermissions("order:detail:view") @RequiresPermissions("order:detail:view")
@GetMapping() @GetMapping()
@ -932,6 +935,13 @@ public class OrderDetailController extends BaseController {
if (StringUtils.isNotEmpty(orderDetail.getClockInLocation())) { if (StringUtils.isNotEmpty(orderDetail.getClockInLocation())) {
OrderDetail model = orderDetailService.selectById(orderDetail.getId()); OrderDetail model = orderDetailService.selectById(orderDetail.getId());
Customer customer = customerService.selectByCustomerId(model.getCustomerId()); Customer customer = customerService.selectByCustomerId(model.getCustomerId());
// 更新订单状态为上门
try {
insuranceService.clockInsurance(model.getId());
}catch (Exception e){
logger.error("订单上门返回异常:{}", e.getMessage());
e.printStackTrace();
}
// 通知师傅新订单 // 通知师傅新订单
try { try {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();

View File

@ -17,6 +17,7 @@ public class InsuranceOrderEditReq {
private String workerID; private String workerID;
private String shangmenTime;
private String shangmenNum;
} }

View File

@ -4,6 +4,8 @@ import com.ghy.order.domain.OrderDetailInsuranceUser;
public interface InsuranceService { public interface InsuranceService {
void clockInsurance(Long orderDetailId) throws Exception;
void orderInsurance(String orderCode) throws Exception; void orderInsurance(String orderCode) throws Exception;
void editInsurance(OrderDetailInsuranceUser orderDetailInsuranceUser) throws Exception ; void editInsurance(OrderDetailInsuranceUser orderDetailInsuranceUser) throws Exception ;

View File

@ -124,4 +124,27 @@ public class InsuranceServiceImpl implements InsuranceService {
throw new Exception(JSONObject.parseObject(result).getString("msg")); throw new Exception(JSONObject.parseObject(result).getString("msg"));
} }
} }
@Override
public void clockInsurance(Long orderDetailId) throws Exception {
// 查询子单
OrderDetail detail = orderDetailService.selectById(orderDetailId);
// 查询主单
OrderMaster master = orderMasterService.selectById(detail.getOrderMasterId());
if(master.getInsuranceId() != null){
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.setShangmenTime(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN));
editReq.setShangmenNum("1");
log.info("调用保险请求url:{},内容:{}", baseUrl+"/platInterface/service", JSONUtil.toJsonStr(editReq));
String result = HttpUtil.post(baseUrl+"/platInterface/service", JSONUtil.toJsonStr(editReq));
log.info("调用保险返回内容:{}", result);
if(!"1".equals(JSONObject.parseObject(result).getString("code"))){
throw new Exception(JSONObject.parseObject(result).getString("msg"));
}
}
}
} }

View File

@ -110,6 +110,9 @@ public class OrderDetailServiceImpl implements OrderDetailService {
@Resource @Resource
private IOrderAttachmentRecordService orderAttachmentRecordService; private IOrderAttachmentRecordService orderAttachmentRecordService;
@Resource
private IOrderCallRecordService orderCallRecordService;
// Adapay 手续费率 默认0.008 // Adapay 手续费率 默认0.008
@Value("${adapay.fee_rate:0.008}") @Value("${adapay.fee_rate:0.008}")
private String feeRate; private String feeRate;
@ -196,7 +199,26 @@ public class OrderDetailServiceImpl implements OrderDetailService {
@Override @Override
public List<OrderDetail> selectOrderDetailList(OrderDetail orderDetail) { public List<OrderDetail> selectOrderDetailList(OrderDetail orderDetail) {
return orderDetailMapper.selectOrderDetailList(orderDetail); List<OrderDetail> result = new ArrayList<>();
List<OrderDetail> orderDetails = orderDetailMapper.selectOrderDetailList(orderDetail);
orderDetails.forEach(model->{
if(StringUtils.isNotEmpty(orderDetail.getIsCall())){
OrderCallRecord param = new OrderCallRecord();
// param.setOrderType("02");
param.setOrderId(model.getId());
List<OrderCallRecord> list = orderCallRecordService.selectOrderCallRecordList(param);
// 用于判断是约 还是 排的问题
if("01".equals(orderDetail.getIsCall()) && CollectionUtils.isEmpty(list)){
result.add(model);
}
if("02".equals(orderDetail.getIsCall()) && CollectionUtils.isNotEmpty(list)){
result.add(model);
}
}else {
result.add(model);
}
});
return result;
} }
@Override @Override

View File

@ -211,9 +211,9 @@
<if test="timeout != null"> <if test="timeout != null">
AND od.timeout_ = #{timeout} AND od.timeout_ = #{timeout}
</if> </if>
<if test="isCall != null"> <!-- <if test="isCall != null">-->
AND om.is_call = #{isCall} <!-- AND om.is_call = #{isCall}-->
</if> <!-- </if>-->
</where> </where>
order by od.create_time order by od.create_time
<trim suffixOverrides=","> <trim suffixOverrides=",">