feat:发票回传数据处理
This commit is contained in:
@@ -106,6 +106,7 @@ public enum ShopSubStageEnum {
|
|||||||
case SHOP_STAGE_3:
|
case SHOP_STAGE_3:
|
||||||
case SHOP_STAGE_4:
|
case SHOP_STAGE_4:
|
||||||
case SHOP_STAGE_8:
|
case SHOP_STAGE_8:
|
||||||
|
case SHOP_STAGE_8_5:
|
||||||
case SHOP_STAGE_9:
|
case SHOP_STAGE_9:
|
||||||
case SHOP_STAGE_11:
|
case SHOP_STAGE_11:
|
||||||
case SHOP_STAGE_12:
|
case SHOP_STAGE_12:
|
||||||
|
|||||||
@@ -336,4 +336,14 @@ public class ShopStageInfoDAO {
|
|||||||
}
|
}
|
||||||
return shopStageInfoMapper.getPlatformBuildStage(shopIds);
|
return shopStageInfoMapper.getPlatformBuildStage(shopIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据处理 查询所有子阶段 通过子阶段对应的阶段状态 做对应的数据处理
|
||||||
|
* @param shopSubStage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ShopStageInfoDO> getSubStages(Integer shopSubStage){
|
||||||
|
return shopStageInfoMapper.getSubStageList(null,shopSubStage);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package com.cool.store.controller.webc;
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
import com.cool.store.dto.OpenCityDTO;
|
import com.cool.store.dto.OpenCityDTO;
|
||||||
import com.cool.store.dto.ocr.InvoiceDTO;
|
import com.cool.store.dto.ocr.InvoiceDTO;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.enums.IDCardSideEnum;
|
import com.cool.store.enums.IDCardSideEnum;
|
||||||
|
import com.cool.store.enums.WorkflowSubStageEnum;
|
||||||
|
import com.cool.store.enums.point.ShopStageEnum;
|
||||||
|
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||||
|
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||||
import com.cool.store.exception.ApiException;
|
import com.cool.store.exception.ApiException;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.job.XxlJobHandler;
|
import com.cool.store.job.XxlJobHandler;
|
||||||
@@ -26,10 +31,14 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@@ -60,6 +69,9 @@ public class TestController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private XxlJobHandler xxlJobHandler;
|
private XxlJobHandler xxlJobHandler;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ShopStageInfoDAO shopStageInfoDAO;
|
||||||
@PostMapping("/getFirstOrders")
|
@PostMapping("/getFirstOrders")
|
||||||
public ResponseResult<xfsgFirstOderListResponse> getFirstOrders(@RequestBody xfsgFirstOrderListRequest storeCodeList) {
|
public ResponseResult<xfsgFirstOderListResponse> getFirstOrders(@RequestBody xfsgFirstOrderListRequest storeCodeList) {
|
||||||
xfsgFirstOderListResponse firstOrderList = coolStoreStartFlowService.getFirstOrderList(storeCodeList);
|
xfsgFirstOderListResponse firstOrderList = coolStoreStartFlowService.getFirstOrderList(storeCodeList);
|
||||||
@@ -200,4 +212,53 @@ public class TestController {
|
|||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/stageDataHandler")
|
||||||
|
public ResponseResult stageDataHandler(){
|
||||||
|
|
||||||
|
//查询所有完成初始化铺位加盟合同的完成情况
|
||||||
|
List<ShopStageInfoDO> subStages = shopStageInfoDAO.getSubStages(ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||||
|
|
||||||
|
List<ShopStageInfoDO> existSubStages = shopStageInfoDAO.getSubStages(ShopSubStageEnum.SHOP_STAGE_8_5.getShopSubStage());
|
||||||
|
|
||||||
|
//existSubStages
|
||||||
|
List<Long> shopIds = existSubStages.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//-100 800 840 如果是-100或者800直接 发票回传是-100 如果是840 发票回传是直接完成 890
|
||||||
|
List<ShopStageInfoDO> list = new ArrayList<>();
|
||||||
|
for (ShopStageInfoDO x : subStages) {
|
||||||
|
if (shopIds.contains(x.getShopId())) {
|
||||||
|
log.info("已存在");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
|
||||||
|
shopStageInfo.setLineId(x.getLineId());
|
||||||
|
shopStageInfo.setShopId(x.getShopId());
|
||||||
|
//发票回传 是2
|
||||||
|
ShopStageEnum shopStageEnum = ShopStageEnum.SHOP_STAGE_2;
|
||||||
|
shopStageInfo.setShopStage(shopStageEnum.getShopStage());
|
||||||
|
ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_8_5;
|
||||||
|
shopStageInfo.setShopSubStage(shopSubStageEnum.getShopSubStage());
|
||||||
|
//默认是已完成
|
||||||
|
ShopSubStageStatusEnum initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85_3;
|
||||||
|
//如果加盟合同没完成 则发票回传是未开始
|
||||||
|
if (x.getShopSubStageStatus() == -100 || x.getShopSubStageStatus() == 800) {
|
||||||
|
initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
|
||||||
|
}
|
||||||
|
shopStageInfo.setShopSubStageStatus(initStatus.getShopSubStageStatus());
|
||||||
|
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR + initStatus.getShopSubStageStatusName());
|
||||||
|
shopStageInfo.setIsTerminated(Boolean.FALSE);
|
||||||
|
LocalDate localDate = LocalDate.parse(x.getPlanCompleteTime()).plusDays(1);
|
||||||
|
shopStageInfo.setPlanCompleteTime(shopSubStageEnum.getPlanCompleteTime(localDate));
|
||||||
|
list.add(shopStageInfo);
|
||||||
|
}
|
||||||
|
log.info("list:{}",JSONObject.toJSONString(list));
|
||||||
|
shopStageInfoDAO.batchInsert(list);
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user