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

@@ -43,6 +43,6 @@ public interface CoolStoreStartFlowService {
* @Date: 2024/4/25 * @Date: 2024/4/25
* @description:获取订货金 * @description:获取订货金
*/ */
ResponseResult getFirstOrder(String shopCode); Boolean getFirstOrder(String shopCode);
} }

View File

@@ -130,7 +130,7 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
} }
@Override @Override
public ResponseResult getFirstOrder(String shopCode) { public Boolean getFirstOrder(String shopCode) {
log.info("getFirstOrder shopCode:{}", shopCode); log.info("getFirstOrder shopCode:{}", shopCode);
if (Objects.isNull(shopCode)) { if (Objects.isNull(shopCode)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR); throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -139,11 +139,8 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
String url = xfsgUrl + Constants.FRANCHISEE_STORE_NUM + "?storeCode=" + shopCode; String url = xfsgUrl + Constants.FRANCHISEE_STORE_NUM + "?storeCode=" + shopCode;
JSONObject jsonObject = httpRestTemplateService.getForObject(url, JSONObject.class, new HashMap<>()); JSONObject jsonObject = httpRestTemplateService.getForObject(url, JSONObject.class, new HashMap<>());
log.info("get url:{},jsonObject:{}", url, jsonObject); log.info("get url:{},jsonObject:{}", url, jsonObject);
String string = jsonObject.getString("data"); Boolean flag = (Boolean) jsonObject.get("data");
if (string == null) { return flag;
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
}
return ResponseResult.success(string);
} catch (Exception e) { } catch (Exception e) {
log.error("获取鲜丰订货金异常", e); log.error("获取鲜丰订货金异常", e);
throw new ServiceException(ErrorCodeEnum. GET_FIRST_ORDER); throw new ServiceException(ErrorCodeEnum. GET_FIRST_ORDER);

View File

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