feat:云流水

This commit is contained in:
苏竹红
2025-04-16 19:23:33 +08:00
parent 3785dd9f6f
commit 834a330acd
3 changed files with 31 additions and 1 deletions

View File

@@ -69,6 +69,13 @@ public interface ShopAccountService {
*/
Boolean pushData(AccountAuditDTO accountAuditDTO);
/**
* shopCode
* @param shopId
* @return
*/
String shopCodeToYlsCode(Long shopId);

View File

@@ -19,6 +19,7 @@ import com.cool.store.request.PostAndOrderRequest;
import com.cool.store.request.ZxjpApiRequest;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.service.*;
import com.cool.store.utils.StringUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -228,5 +229,23 @@ public class ShopAccountServiceImpl implements ShopAccountService {
return Boolean.TRUE;
}
@Override
public String shopCodeToYlsCode(Long shopId) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (Objects.isNull(shopInfo)){
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
List<ShopAccountDO> accountDOS = shopAccountDAO.selectByShopId(shopId);
if (CollectionUtils.isEmpty(accountDOS)){
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
Map<String, ShopAccountDO> map = accountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, data -> data));
ShopAccountDO shopAccountDO = map.get(ShopAccountEnum.YLS.getSystemName());
if (Objects.isNull(shopAccountDO)){
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
return StringUtil.isEmpty(shopAccountDO.getAccount())?shopInfo.getShopCode():shopAccountDO.getAccount();
}
}

View File

@@ -73,7 +73,11 @@ public class ShopAccountController {
return ResponseResult.success(accountService.accountEntryStatusChange(dto));
}
@ApiOperation("门店编码换云流水编码")
@PostMapping("/shopCodeToYlsCode")
public ResponseResult<String> shopCodeToYlsCode(@RequestParam(value = "shopId",required = true) Long shopId) {
return ResponseResult.success(accountService.shopCodeToYlsCode(shopId));
}
}