Commit 973cb510668555165da4fbedd7190a994566d7b5

Authored by 房远帅
1 parent f0403965

楚江ERP:延期发货相关修改

... ... @@ -157,7 +157,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
157 157 handleReplenishmentOrderStatus(flowStatus, businessId);
158 158 break;
159 159 case "DELAYED_SHIPMENT":
160   - handleDelayedShipmentData(flowStatus, businessId, variable.get("shipmentsOrderId"));
  160 + handleDelayedShipmentData(flowStatus, businessId);
161 161 break;
162 162 default:
163 163 break;
... ... @@ -494,6 +494,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
494 494 Object o = redisHandler.get("GET_SHIPMENTS_ORDER_ID_" + draftRequestCarTicket.getId());
495 495 if (o != null) {
496 496 ticketVo.setPurchaseOrderId(String.valueOf(o));
  497 + redisHandler.del("GET_SHIPMENTS_ORDER_ID_" + draftRequestCarTicket.getId());
497 498 }
498 499 return ticketVo;
499 500 }
... ... @@ -504,13 +505,14 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
504 505 * @param flowStatus
505 506 * @param businessId
506 507 */
507   - private void handleDelayedShipmentData(String flowStatus, String businessId, Object shipmentsOrderId) {
  508 + private void handleDelayedShipmentData(String flowStatus, String businessId) {
508 509 if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus)
509 510 || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) {
510 511 delayedShipmentService.updateStatus(businessId, "PASS");
511 512 QueryDelayedShipmentDetailVo vo = new QueryDelayedShipmentDetailVo();
512 513 vo.setDelayedShipmentId(businessId);
513 514 List<DelayedShipmentDetail> query = delayedShipmentDetailService.query(vo);
  515 + Object shipmentsOrderId = redisHandler.get("GET_SHIPMENTS_ORDER_ID_" + businessId);
514 516 if (shipmentsOrderId != null) {
515 517 QueryRequestCarTicketVo vo2 = new QueryRequestCarTicketVo();
516 518 vo2.setShipmentsOrderId(String.valueOf(shipmentsOrderId));
... ... @@ -528,9 +530,11 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
528 530 if (difference.compareTo(BigDecimal.ZERO) == 0) {
529 531 //删除要车单
530 532 requestCarTicketService.deleteById(requestCarTicketId);
  533 + redisHandler.del("GET_SHIPMENTS_ORDER_ID_" + businessId);
531 534 } else {
532 535 //更新计划吨位
533 536 requestCarTicketService.updateQuantity(requestCarTicketId, difference);
  537 + redisHandler.del("GET_SHIPMENTS_ORDER_ID_" + businessId);
534 538 }
535 539 }
536 540 }
... ...
... ... @@ -10,6 +10,7 @@ import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
10 10 import com.lframework.starter.common.utils.CollectionUtil;
11 11 import com.lframework.starter.common.utils.StringUtil;
12 12 import com.lframework.starter.mq.core.service.MqProducerService;
  13 +import com.lframework.starter.web.core.components.redis.RedisHandler;
13 14 import com.lframework.starter.web.core.components.security.SecurityUtil;
14 15 import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
15 16 import com.lframework.starter.web.core.utils.PageResultUtil;;
... ... @@ -43,6 +44,7 @@ import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentService;
43 44 import com.lframework.xingyun.sc.vo.shipments.car.QueryRequestCarTicketVo;
44 45 import com.lframework.xingyun.sc.vo.shipments.delay.*;
45 46 import org.apache.commons.collections.CollectionUtils;
  47 +import org.springframework.beans.factory.annotation.Autowired;
46 48 import org.springframework.transaction.annotation.Transactional;
47 49 import org.springframework.stereotype.Service;
48 50 import javax.annotation.Resource;
... ... @@ -78,6 +80,8 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen
78 80 private PurchaseOrderInfoService purchaseOrderInfoService;
79 81 @Resource
80 82 private RequestCarTicketService requestCarTicketService;
  83 + @Autowired
  84 + private RedisHandler redisHandler;
81 85
82 86
83 87 @Override
... ... @@ -210,6 +214,8 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen
210 214 if (delayedExceedOneDay && !hasAny) {
211 215 //开启审核
212 216 vo.setWorkshopCode(delayedShipmentDetail.getWorkshopCode());
  217 + String key = "GET_SHIPMENTS_ORDER_ID_" + data.getId();
  218 + redisHandler.set(key, vo.getShipmentsOrderId());
213 219
214 220 flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, vo);
215 221 } else {
... ...