|
@@ -1154,6 +1154,71 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public StoreInfoVo editNewStoreInfo(StoreInfoDto storeInfoDto) {
|
|
|
|
|
+
|
|
|
|
|
+ //获取经营板块id
|
|
|
|
|
+ Integer businessSection = storeInfoDto.getBusinessSection();
|
|
|
|
|
+ //查询经营板块名称
|
|
|
|
|
+ StoreDictionary businessSectionName = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessSection).eq(StoreDictionary::getTypeName, "business_section"));
|
|
|
|
|
+ //查询经营种类
|
|
|
|
|
+ List<String> businessTypes = storeInfoDto.getBusinessTypes();
|
|
|
|
|
+ List<String> businessTypeNames = new ArrayList<>();
|
|
|
|
|
+ //获取经营种类名称
|
|
|
|
|
+ for (String businessType : businessTypes) {
|
|
|
|
|
+ StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
|
|
|
|
|
+ businessTypeNames.add(storeDictionary.getDictDetail());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ StoreInfoVo result = new StoreInfoVo();
|
|
|
|
|
+ StoreInfo storeInfo = new StoreInfo();
|
|
|
|
|
+ BeanUtils.copyProperties(storeInfoDto, storeInfo);
|
|
|
|
|
+// List<String> storeTypeList = storeInfoDto.getStoreTypeList();
|
|
|
|
|
+// String storeType = String.join(",", storeTypeList);
|
|
|
|
|
+ //存入营运类型
|
|
|
|
|
+// storeInfo.setStoreType(storeType);
|
|
|
|
|
+
|
|
|
|
|
+ //板块及类型
|
|
|
|
|
+ storeInfo.setBusinessSection(businessSection);
|
|
|
|
|
+ storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
|
|
|
|
|
+ storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
|
|
|
+ storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
|
|
|
+
|
|
|
|
|
+ //处理分类信息
|
|
|
|
|
+ List<String> businessClassify = storeInfoDto.getBusinessClassify();
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(businessClassify)) {
|
|
|
|
|
+ List<String> businessClassifyNames = new ArrayList<>();
|
|
|
|
|
+ //批量查询分类名称
|
|
|
|
|
+ List<StoreDictionary> classifyDicts = storeDictionaryMapper.selectList(
|
|
|
|
|
+ new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
+ .in(StoreDictionary::getDictId, businessClassify)
|
|
|
|
|
+ .eq(StoreDictionary::getTypeName, "business_classify")
|
|
|
|
|
+ .eq(StoreDictionary::getDeleteFlag, 0)
|
|
|
|
|
+ );
|
|
|
|
|
+ //转为Map方便快速获取
|
|
|
|
|
+ Map<String, StoreDictionary> classifyDictMap = classifyDicts.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
|
+ dict -> dict.getDictId().toString(),
|
|
|
|
|
+ Function.identity(),
|
|
|
|
|
+ (existing, replacement) -> existing
|
|
|
|
|
+ ));
|
|
|
|
|
+ //提取分类名称
|
|
|
|
|
+ for (String classifyId : businessClassify) {
|
|
|
|
|
+ StoreDictionary dict = classifyDictMap.get(classifyId);
|
|
|
|
|
+ if (Objects.nonNull(dict)) {
|
|
|
|
|
+ businessClassifyNames.add(dict.getDictDetail());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("无效的分类id:" + classifyId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ storeInfo.setBusinessClassify(String.join(",", businessClassify));
|
|
|
|
|
+ storeInfo.setBusinessClassifyName(String.join(",", businessClassifyNames));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ storeInfoMapper.updateById(storeInfo);
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public String deleteStoreInfo(StoreInfoDto storeInfoDto) {
|
|
public String deleteStoreInfo(StoreInfoDto storeInfoDto) {
|
|
|
StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, storeInfoDto.getId()));
|
|
StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, storeInfoDto.getId()));
|
|
|
//判断是否有未完成的订单
|
|
//判断是否有未完成的订单
|