feat:云流水
This commit is contained in:
@@ -69,6 +69,13 @@ public interface ShopAccountService {
|
||||
*/
|
||||
Boolean pushData(AccountAuditDTO accountAuditDTO);
|
||||
|
||||
/**
|
||||
* shopCode
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
String shopCodeToYlsCode(Long shopId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user