This commit is contained in:
苏竹红
2024-04-25 20:23:24 +08:00
parent 1e170ebe7c
commit df6226abe7
3 changed files with 11 additions and 26 deletions

View File

@@ -58,38 +58,26 @@ public class OpenPreparationController {
private OpeningOperationPlanAuditService openingOperationPlanAuditService;
@GetMapping("/flush")
public ResponseResult flush(@RequestParam("shopId") Long shopId) {
ShopStageInfoDO planStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_14);
log.info("flush shopStageInfo:{}", planStageInfo);
public ResponseResult<Boolean> flush(@RequestParam("shopId") Long shopId) {
ShopStageInfoDO orderStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
try {
if (!orderStageInfo.getShopSubStageStatus().
equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus())) {
if (orderStageInfo.getShopSubStageStatus().
equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus())) {
ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
String shopCode = shopInfo.getShopCode();
String data = coolStoreStartFlowService.getFirstOrder(shopCode).getData().toString();
log.info("saveOrder,data:{}", data);
if (data == null) {
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
}
if (data.equals("true")) {
Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
log.info("saveOrder,flag:{}", firstOrder);
if (firstOrder) {
//更改子阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId,
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151, null);
preparationService.whetherToOpenForAcceptance(shopId);
}
}
} catch (Exception e) {
log.error("获取鲜丰订货金异常", e);
}
ShopStageInfoDO firstOrderStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
log.info("flush orderStageInfo:{}", orderStageInfo);
OpenPreparationFlushVO flushVO = new OpenPreparationFlushVO();
flushVO.setShopId(shopId);
flushVO.setOpenPlanState(planStageInfo.getShopSubStageStatus());
flushVO.setFirstOderState(firstOrderStageInfo.getShopSubStageStatus());
return ResponseResult.success(flushVO);
return ResponseResult.success(Boolean.TRUE);
}
@PostMapping("/openingOperationPlan/submit")