fix
This commit is contained in:
@@ -21,7 +21,7 @@ public enum FileTypeEnum {
|
|||||||
IMPORT_OA_OLD_SHOP_DATA_ERROR("OaOldShopDataError", "导入OA旧数据错误列表"),
|
IMPORT_OA_OLD_SHOP_DATA_ERROR("OaOldShopDataError", "导入OA旧数据错误列表"),
|
||||||
IMPORT_OA_OLD_SHOP_DATA("importOaOldShopData", "导入OA旧数据"),
|
IMPORT_OA_OLD_SHOP_DATA("importOaOldShopData", "导入OA旧数据"),
|
||||||
ZXJP_OPEN_SHOP_REPORT("zxjpOpenShopReport","正新鸡排开店"),
|
ZXJP_OPEN_SHOP_REPORT("zxjpOpenShopReport","正新鸡排开店"),
|
||||||
IMPORT_OA_OLD_SHOP_STAGE_DATA("importOaOldShopStageData", "导入OA旧数据"),
|
IMPORT_OA_OLD_SHOP_STAGE_DATA("importOaOldShopStageData", "导入OA旧阶段数据"),
|
||||||
IMPORT_OA_OLD_SHOP_STAGE_DATA_ERROR("OaOldShopStageDataError", "导入OA旧数据阶段错误列表"),
|
IMPORT_OA_OLD_SHOP_STAGE_DATA_ERROR("OaOldShopStageDataError", "导入OA旧数据阶段错误列表"),
|
||||||
;
|
;
|
||||||
private String fileType;
|
private String fileType;
|
||||||
|
|||||||
@@ -192,7 +192,7 @@
|
|||||||
<foreach collection="list" item="shopId" open="(" close=")" separator=",">
|
<foreach collection="list" item="shopId" open="(" close=")" separator=",">
|
||||||
#{shopId}
|
#{shopId}
|
||||||
</foreach>
|
</foreach>
|
||||||
and system_name in ('火码POS','云流水','新掌柜')
|
and system_name in ('火码POS','云流水','新掌柜') and status !=5
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -574,7 +574,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
|||||||
ImportOaOldShopDataDTO dto = buildColumn(data);
|
ImportOaOldShopDataDTO dto = buildColumn(data);
|
||||||
list.add(dto);
|
list.add(dto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("importOaOldShopData 转化dto error:{}", JSONObject.toJSONString(data));
|
log.info("dataHandlerV20241012 转化dto error:{}", JSONObject.toJSONString(data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
log.info("导入数据条数:{}", list.size());
|
log.info("导入数据条数:{}", list.size());
|
||||||
@@ -640,10 +640,10 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
|||||||
Map<Long, PosAndOrderInfoDO> posSysInfoDOMap = posSysInfoDOList.stream().collect(Collectors.toMap(PosAndOrderInfoDO::getShopId, Function.identity()));
|
Map<Long, PosAndOrderInfoDO> posSysInfoDOMap = posSysInfoDOList.stream().collect(Collectors.toMap(PosAndOrderInfoDO::getShopId, Function.identity()));
|
||||||
//新发系统
|
//新发系统
|
||||||
List<PosAndOrderInfoDO> xfSysDOList = posAndOrderInfoDAO.selectListByShopIdAndType(shopIds, PosAndOrderEnum.XIN_FA_SYS.getCode());
|
List<PosAndOrderInfoDO> xfSysDOList = posAndOrderInfoDAO.selectListByShopIdAndType(shopIds, PosAndOrderEnum.XIN_FA_SYS.getCode());
|
||||||
Map<Long, PosAndOrderInfoDO> xfSysInfoDOMap = posSysInfoDOList.stream().collect(Collectors.toMap(PosAndOrderInfoDO::getShopId, Function.identity()));
|
Map<Long, PosAndOrderInfoDO> xfSysInfoDOMap = xfSysDOList.stream().collect(Collectors.toMap(PosAndOrderInfoDO::getShopId, Function.identity()));
|
||||||
//营帐通系统
|
//营帐通系统
|
||||||
List<PosAndOrderInfoDO> tentPassInfoDOList = posAndOrderInfoDAO.selectListByShopIdAndType(shopIds, PosAndOrderEnum.TENT_PASS.getCode());
|
List<PosAndOrderInfoDO> tentPassInfoDOList = posAndOrderInfoDAO.selectListByShopIdAndType(shopIds, PosAndOrderEnum.TENT_PASS.getCode());
|
||||||
Map<Long, PosAndOrderInfoDO> tentPassInfoDOMap = posSysInfoDOList.stream().collect(Collectors.toMap(PosAndOrderInfoDO::getShopId, Function.identity()));
|
Map<Long, PosAndOrderInfoDO> tentPassInfoDOMap = tentPassInfoDOList.stream().collect(Collectors.toMap(PosAndOrderInfoDO::getShopId, Function.identity()));
|
||||||
//装修阶段需要变更的shopId
|
//装修阶段需要变更的shopId
|
||||||
List<Long> fitmentFhopIdList = new ArrayList<>();
|
List<Long> fitmentFhopIdList = new ArrayList<>();
|
||||||
//建店阶段完成时间
|
//建店阶段完成时间
|
||||||
@@ -825,19 +825,25 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
|||||||
addPosAndOrderInfoList.add(posDO);
|
addPosAndOrderInfoList.add(posDO);
|
||||||
}
|
}
|
||||||
//xf
|
//xf
|
||||||
//订货系统
|
PosAndOrderInfoDO xf = xfSysInfoDOMap.get(shopId);
|
||||||
PosAndOrderInfoDO xf = orderSysInfoDOMap.get(shopId);
|
if (Objects.isNull(xf)) {
|
||||||
if (StringUtil.isNotBlank(dto.getYlsAccount())) {
|
|
||||||
if (Objects.isNull(order)) {
|
|
||||||
order = new PosAndOrderInfoDO();
|
order = new PosAndOrderInfoDO();
|
||||||
order.setShopId(shopId);
|
order.setShopId(shopId);
|
||||||
order.setType(PosAndOrderEnum.ORDER.getCode());
|
order.setType(PosAndOrderEnum.XIN_FA_SYS.getCode());
|
||||||
order.setRemark("已为您开通订货系统账号和密码,密码已加密,初始密码为888888,可通过加盟小程序修改密码!");
|
order.setRemark("已为您开通信发系统账号和授权码请妥善保管");
|
||||||
order.setAccount(dto.getYlsAccount().trim());
|
order.setAccount(dto.getShopCode().trim());
|
||||||
order.setPassword("888888");
|
|
||||||
order.setCreateTime(new Date());
|
order.setCreateTime(new Date());
|
||||||
addPosAndOrderInfoList.add(order);
|
addPosAndOrderInfoList.add(order);
|
||||||
}
|
}
|
||||||
|
//营帐通
|
||||||
|
PosAndOrderInfoDO yzt = tentPassInfoDOMap.get(shopId);
|
||||||
|
if (Objects.isNull(yzt)) {
|
||||||
|
order = new PosAndOrderInfoDO();
|
||||||
|
order.setShopId(shopId);
|
||||||
|
order.setType(PosAndOrderEnum.TENT_PASS.getCode());
|
||||||
|
order.setRemark("已为您开通营帐通");
|
||||||
|
order.setCreateTime(new Date());
|
||||||
|
addPosAndOrderInfoList.add(order);
|
||||||
}
|
}
|
||||||
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoMap.get(shopId);
|
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoMap.get(shopId);
|
||||||
if (Objects.isNull(acceptanceInfoDO)) {
|
if (Objects.isNull(acceptanceInfoDO)) {
|
||||||
@@ -853,21 +859,28 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
|||||||
orderSysInfoDAO.batchInsertSpecific(addOrderSysInfoList);
|
orderSysInfoDAO.batchInsertSpecific(addOrderSysInfoList);
|
||||||
franchiseFeeDAO.updateBill(franchiseFeeByShopIds);
|
franchiseFeeDAO.updateBill(franchiseFeeByShopIds);
|
||||||
buildInformationDAO.batchInsertSpecific(addBuildList);
|
buildInformationDAO.batchInsertSpecific(addBuildList);
|
||||||
if (CollectionUtils.isNotEmpty(updateBuildStageList)) {
|
|
||||||
List<Long> updateStageShopIds = updateBuildStageList.stream().map(BuildStageDTO::getShopId).collect(Collectors.toList());
|
List<Long> updateStageShopIds = updateBuildStageList.stream().map(BuildStageDTO::getShopId).collect(Collectors.toList());
|
||||||
//pos阶段完成
|
//pos阶段完成
|
||||||
shopStageInfoDAO.dataUpdateStatus(updateStageShopIds, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_163);
|
shopStageInfoDAO.dataUpdateStatus(updateStageShopIds, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_163);
|
||||||
|
//xf
|
||||||
|
shopStageInfoDAO.dataUpdateStatus(updateStageShopIds, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_235);
|
||||||
|
//yzt
|
||||||
|
shopStageInfoDAO.dataUpdateStatus(updateStageShopIds, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_245);
|
||||||
// 订货阶段 完成
|
// 订货阶段 完成
|
||||||
shopStageInfoDAO.dataUpdateStatus(updateStageShopIds, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_173);
|
shopStageInfoDAO.dataUpdateStatus(updateStageShopIds, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_173);
|
||||||
//数据处理用平台账号 火马,云流水,新掌柜状态改为已完成
|
//数据处理用平台账号 火马,云流水,新掌柜状态改为已完成
|
||||||
shopAccountDAO.updateStatusDataHandle(updateStageShopIds);
|
shopAccountDAO.updateStatusDataHandle(updateStageShopIds);
|
||||||
}
|
//装修stage
|
||||||
//表中4月20号后的数据,数据录入系统,新店装修阶段状态不变更 其他时间的数据状态改为已完成 不包括装修验收
|
|
||||||
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_863);
|
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_863);
|
||||||
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91);
|
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91);
|
||||||
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_112);
|
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_112);
|
||||||
//装修验收初始化
|
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123);
|
||||||
shopStageInfoDAO.dataUpdateAcceptanceStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121);
|
//train
|
||||||
|
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_51);
|
||||||
|
//openPlan
|
||||||
|
shopStageInfoDAO.dataUpdateStatus(fitmentFhopIdList, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_143);
|
||||||
|
//装修表初始化
|
||||||
|
acceptanceInfoDAO.initAcceptanceInfo(initFitmentShopIdList);
|
||||||
if (!errorList.isEmpty()) {
|
if (!errorList.isEmpty()) {
|
||||||
task.setStatus(ImportTaskStatusEnum.ERROR.getCode());
|
task.setStatus(ImportTaskStatusEnum.ERROR.getCode());
|
||||||
String url = null;
|
String url = null;
|
||||||
|
|||||||
@@ -99,4 +99,29 @@ public class DataHandlerController {
|
|||||||
dataHandlerServer.decorationDataInit();
|
dataHandlerServer.decorationDataInit();
|
||||||
return ResponseResult.success(true);
|
return ResponseResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/dataHandlerV20241012")
|
||||||
|
@ApiOperation("导入OA旧数据")
|
||||||
|
public ResponseResult<Boolean> dataHandlerV20241012(MultipartFile file) {
|
||||||
|
ExcelReader reader = null;
|
||||||
|
try {
|
||||||
|
reader = ExcelUtil.getReader(file.getInputStream());
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("read file error:", e);
|
||||||
|
}
|
||||||
|
assert reader != null;
|
||||||
|
log.info("----------------------:{}", file.getOriginalFilename());
|
||||||
|
List<Map<String, Object>> dataMapList = reader.read(0, 1, Integer.MAX_VALUE);
|
||||||
|
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||||
|
importTaskDO.setFileName(file.getOriginalFilename());
|
||||||
|
importTaskDO.setFileType(FileTypeEnum.IMPORT_OA_OLD_SHOP_DATA.getFileType());
|
||||||
|
importTaskDO.setIsImport(true);
|
||||||
|
importTaskDO.setStatus(ImportTaskStatusEnum.PROGRESS.getCode());
|
||||||
|
importTaskDO.setCreateUserId(CurrentUserHolder.getUserId());
|
||||||
|
importTaskDO.setCreateName(CurrentUserHolder.getUser().getName());
|
||||||
|
importTaskDO.setCreateTime(System.currentTimeMillis());
|
||||||
|
importTaskMapper.insert(eid, importTaskDO);
|
||||||
|
dataHandlerServer.dataHandlerV20241012(dataMapList, file.getOriginalFilename(), CurrentUserHolder.getUser(), importTaskDO);
|
||||||
|
return ResponseResult.success(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user