fix bug
This commit is contained in:
parent
109cc4ccca
commit
c58346349c
|
|
@ -127,7 +127,18 @@ public class OrderDetailController extends BaseController {
|
|||
@ResponseBody
|
||||
public TableDataInfo list(OrderDetail orderDetail) {
|
||||
if (orderDetail.getSearchAfterList() !=null && orderDetail.getSearchAfterList()) {
|
||||
return this.afterServiceList(orderDetail);
|
||||
List<?> rows = this.afterServiceList(orderDetail).getRows();
|
||||
StringBuilder detailIds = new StringBuilder();
|
||||
if(CollectionUtils.isNotEmpty(rows)){
|
||||
rows.forEach(model->{
|
||||
OrderListResponse response = (OrderListResponse)model;
|
||||
detailIds.append(response.getOrderDetailId()).append(",");
|
||||
});
|
||||
}
|
||||
String ids = detailIds.toString();
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(ids)) {
|
||||
orderDetail.setOrderDetailIds(ids.substring(0, ids.length() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(orderDetail.getWorkerName()) || StringUtils.isNotEmpty(orderDetail.getWorkerPhone())){
|
||||
|
|
|
|||
|
|
@ -131,6 +131,17 @@ public class OrderMasterController extends BaseController {
|
|||
@Resource
|
||||
private IInsuranceManagerService insuranceManagerService;
|
||||
|
||||
@PostMapping("/orderInsurance")
|
||||
@ResponseBody
|
||||
public AjaxResult orderInsurance(@RequestParam(value = "orderCode") String orderCode){
|
||||
try {
|
||||
insuranceService.orderInsurance(orderCode);
|
||||
return AjaxResult.success();
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error("保险未响应,请再次点击操作,或稍等再试【本单联通保险公司系统,操作此按键时开始投保,偶遇未响应,请间隔一两分钟再次点接单即可!】");
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/changePrice/{orderIds}")
|
||||
public String changePrice(@PathVariable("orderIds") String orderIds, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -1292,7 +1303,18 @@ public class OrderMasterController extends BaseController {
|
|||
@ResponseBody
|
||||
public TableDataInfo list(OrderMaster orderMaster) {
|
||||
if (orderMaster.getSearchAfterList() !=null && orderMaster.getSearchAfterList()) {
|
||||
return this.afterList(orderMaster);
|
||||
List<?> rows = this.afterList(orderMaster).getRows();
|
||||
StringBuilder masterIds = new StringBuilder();
|
||||
if(CollectionUtils.isNotEmpty(rows)){
|
||||
rows.forEach(model->{
|
||||
OrderListResponse response = (OrderListResponse)model;
|
||||
masterIds.append(response.getOrderMasterId()).append(",");
|
||||
});
|
||||
}
|
||||
String ids = masterIds.toString();
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(ids)) {
|
||||
orderMaster.setOrderMasterIds(ids.substring(0, ids.length() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
startPage();
|
||||
|
|
@ -1486,14 +1508,14 @@ public class OrderMasterController extends BaseController {
|
|||
// 下单
|
||||
if(orderMaster.getOrderStatus() != null && OrderStatus.PLAIN.code() == orderMaster.getOrderStatus()){
|
||||
OrderMaster model = orderMasterService.selectById(orderMaster.getId());
|
||||
try {
|
||||
if(model.getInsuranceId()!=null){
|
||||
insuranceService.orderInsurance(model.getCode());
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("下单报错:" + ExceptionUtils.getMessage(e));
|
||||
return AjaxResult.error("保险正生成中,可能需几秒或几分钟,请稍等即可!若超半小时可联系发单方或平台!");
|
||||
}
|
||||
// try {
|
||||
// if(model.getInsuranceId()!=null){
|
||||
// insuranceService.orderInsurance(model.getCode());
|
||||
// }
|
||||
// }catch (Exception e){
|
||||
// logger.error("下单报错:" + ExceptionUtils.getMessage(e));
|
||||
// return AjaxResult.error("保险正生成中,可能需几秒或几分钟,请稍等即可!若超半小时可联系发单方或平台!");
|
||||
// }
|
||||
// 判断是否是在线支付订单--如果是在线支付,且未付款,则需要提示支付后接单
|
||||
if(PayTypeEnum.WX_LITE.getCode().equals(model.getPayType())){
|
||||
// 查询财务信息
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|||
public void orderInsurance(String orderCode) throws Exception{
|
||||
InsuranceOrderReq req = new InsuranceOrderReq();
|
||||
OrderMaster master = orderMasterService.selectByCode(orderCode);
|
||||
if(master.getInsuranceId() == null){
|
||||
return;
|
||||
}
|
||||
req.setOrderNumber(master.getCode());
|
||||
req.setRequestNo(master.getCode() + System.currentTimeMillis());
|
||||
req.setSign(Md5Utils.hash(req.getRequestNo() + req.getChannelCode() + Key));
|
||||
|
|
@ -75,7 +78,7 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|||
log.info("调用保险请求url:{},内容:{}", baseUrl+"/platInterface/order", JSONUtil.toJsonStr(req));
|
||||
String result = HttpUtil.post(baseUrl+"/platInterface/order", JSONUtil.toJsonStr(req));
|
||||
log.info("调用保险返回内容:{}", result);
|
||||
if(!"1".equals(JSONObject.parseObject(result).getString("code"))){
|
||||
if(!"1".equals(JSONObject.parseObject(result).getString("code")) && !JSONObject.parseObject(result).getString("msg").contains("已存在该工单")){
|
||||
throw new Exception(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,6 +146,8 @@ public class AfterServiceRecordServiceImpl implements IAfterServiceRecordService
|
|||
Assert.notNull(afterServiceRecord, "售后记录不存在!");
|
||||
OrderDetail orderDetail = orderDetailService.selectById(afterServiceRecord.getOrderDetailId());
|
||||
boolean drawCash = orderDetail.getDrawCashTime() != null;
|
||||
// 更新为售后未超时
|
||||
orderDetailService.updateAfterTimeout(afterServiceRecord.getOrderDetailId(), 0, 0);
|
||||
if (one.equals(param.getCustomerFinalCheck()) && one.equals(afterServiceRecord.getWorkerFeedbackResult())) {
|
||||
// 师傅同意 且 客户同意退款
|
||||
afterServiceRecord.setCustomerFinalCheck(1L);
|
||||
|
|
@ -160,11 +162,8 @@ public class AfterServiceRecordServiceImpl implements IAfterServiceRecordService
|
|||
} else {
|
||||
agreeRefund(afterServiceRecord);
|
||||
}
|
||||
// 更新为售后未超时
|
||||
orderDetailService.updateAfterTimeout(afterServiceRecord.getOrderDetailId(), 0, 0);
|
||||
// orderDetailService.updateAfterTimeout(afterServiceRecord.getOrderDetailId(), 0, 0);
|
||||
} else if (one.equals(afterServiceRecord.getWorkerFeedbackResult()) && param.getCustomerFinalCheck() == null) {
|
||||
// 更新为售后未超时
|
||||
orderDetailService.updateAfterTimeout(afterServiceRecord.getOrderDetailId(), 0, 0);
|
||||
// 师傅同意 且 客户未处理
|
||||
afterServiceRecordMapper.updateAfterServiceRecord(param);
|
||||
return drawCash ? AjaxResult.error("本单银联已确认货款结算完毕(订单支付完成),款项已到达或即将到达您所绑定帐户,需同意退款的同意后您线下与客户另行操作,系统无法提供原路返回退款!") : AjaxResult.success();
|
||||
|
|
|
|||
|
|
@ -379,7 +379,8 @@
|
|||
<update id="updateAfterTimeout">
|
||||
UPDATE order_detail
|
||||
SET after_timeout = #{timeout},
|
||||
timeout_fine_times = #{timeoutFineTimes}
|
||||
timeout_fine_times = #{timeoutFineTimes},
|
||||
update_time = SYSDATE()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue