fix:建店时候调用创建门店接口;流水接口新增收入支出字段;新增账户详情接口、交易详情接口
This commit is contained in:
@@ -1,20 +1,16 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.PaymentMethodEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.FranchiseFeeMapper;
|
||||
import com.cool.store.mapper.SignFranchiseMapper;
|
||||
import com.cool.store.enums.wallet.YztStoreModel;
|
||||
import com.cool.store.mq.producer.SimpleMessageService;
|
||||
import com.cool.store.request.StoreMasterDTO;
|
||||
import com.cool.store.request.StoreRequestBody;
|
||||
import com.cool.store.service.OperationLogService;
|
||||
import com.cool.store.request.wallet.CreateStoreRequest;
|
||||
import com.cool.store.service.SyncMainSysServer;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.service.wallet.WalletApiService;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -25,12 +21,6 @@ import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cool.store.enums.AuditExecuteEnum.FRANCHISEES;
|
||||
import static com.cool.store.enums.ExtendFieldTypeEnum.*;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
@@ -48,39 +38,27 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
|
||||
@Resource
|
||||
private SimpleMessageService simpleMessageService;
|
||||
@Resource
|
||||
private SignFranchiseMapper signFranchiseMapper;
|
||||
@Resource
|
||||
private BuildInformationDAO buildInformationDAO;
|
||||
@Resource
|
||||
private PointInfoDAO pointInfoDAO;
|
||||
@Resource
|
||||
FranchiseFeeMapper franchiseFeeMapper;
|
||||
@Resource
|
||||
private OperationLogDAO operationLogDAO;
|
||||
@Resource
|
||||
private OrderSysInfoDAO orderSysInfoDAO;
|
||||
@Resource
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Resource
|
||||
private PreparationServiceImpl preparationService;
|
||||
@Resource
|
||||
private UserAuthMappingService userAuthMappingService;
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
@Value("${mybatis.configuration.variables.enterpriseId}")
|
||||
private String eid;
|
||||
@Resource
|
||||
private StoreDao storeDao;
|
||||
private SignFranchiseDAO signFranchiseDAO;
|
||||
@Resource
|
||||
SignFranchiseDAO signFranchiseDAO;
|
||||
private PointDetailInfoDAO pointDetailDAO;
|
||||
@Resource
|
||||
PointDetailInfoDAO pointDetailDAO;
|
||||
private QualificationsInfoDAO qualificationsInfoDAO;
|
||||
@Resource
|
||||
QualificationsInfoDAO qualificationsInfoDAO;
|
||||
private RegionDao regionDao;
|
||||
@Resource
|
||||
private WalletApiService walletApiService;
|
||||
|
||||
@Override
|
||||
@Async
|
||||
@@ -207,10 +185,35 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
|
||||
}
|
||||
storeMasterDTO.setSignerInfo(signerInfo);
|
||||
simpleMessageService.send(JSONObject.toJSONString(storeMasterDTO), RocketMqTagEnum.ZXJP_CREATE_STORE);
|
||||
// 推送营帐通
|
||||
pushStoreToYzt(shopInfo, lineInfoDO);
|
||||
} catch (Exception e) {
|
||||
log.info("asdStore_error:{},shopId:{}", e.getMessage(), shopId.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 钱包推送营帐通创建门店
|
||||
*/
|
||||
public void pushStoreToYzt(ShopInfoDO shopInfoDO, LineInfoDO lineInfoDO) {
|
||||
try {
|
||||
RegionDO regionDO = regionDao.getRegionById(shopInfoDO.getRegionId());
|
||||
CreateStoreRequest createStoreRequest = CreateStoreRequest.builder()
|
||||
.outStoreId(shopInfoDO.getStoreId())
|
||||
.storeSn(shopInfoDO.getShopCode())
|
||||
.storeName(shopInfoDO.getShopName())
|
||||
.orgCode(String.valueOf(regionDO.getId()))
|
||||
.orgName(regionDO.getName())
|
||||
.phoneNumber(lineInfoDO.getMobile())
|
||||
.storeMode(YztStoreModel.getYztStoreModel(Integer.valueOf(shopInfoDO.getFranchiseBrand())))
|
||||
.province(shopInfoDO.getProvinceCode())
|
||||
.city(shopInfoDO.getCityCode())
|
||||
.district(shopInfoDO.getDistrictCode())
|
||||
.address(shopInfoDO.getDetailAddress())
|
||||
.build();
|
||||
walletApiService.createStore(createStoreRequest);
|
||||
} catch (Exception e) {
|
||||
log.error("推送营帐通钱包创建门店失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,17 +83,31 @@ public interface WalletService {
|
||||
|
||||
/**
|
||||
* 查询账户列表
|
||||
* @param request 门店idRequest
|
||||
* @param request 账户查询Request
|
||||
* @return 账户信息VO列表
|
||||
*/
|
||||
List<AccountInfoVO> getAccountList(StoreShopRequest request);
|
||||
List<AccountInfoVO> getAccountList(AccountQueryRequest request);
|
||||
|
||||
/**
|
||||
* 根据账户编号查询账户信息
|
||||
* @param request 账户查询Request
|
||||
* @return 账户信息VO
|
||||
*/
|
||||
AccountInfoVO getAccountInfo(AccountQueryRequest request);
|
||||
|
||||
/**
|
||||
* 交易流水
|
||||
* @param request 交易流水查询Request
|
||||
* @return 账户交易列表VO列表
|
||||
*/
|
||||
PageInfo<AccountBillListVO> getBillPage(AccountBillQueryRequest request);
|
||||
AccountBillPageVO getBillPage(AccountBillQueryRequest request);
|
||||
|
||||
/**
|
||||
* 账户交易详情
|
||||
* @param request 交易详情查询Request
|
||||
* @return 交易详情VO
|
||||
*/
|
||||
BillDetailDTO getBillDetail(BillDetailRequest request);
|
||||
|
||||
/**
|
||||
* 密码维护
|
||||
|
||||
@@ -59,7 +59,6 @@ public class WalletServiceImpl implements WalletService {
|
||||
private final ShopStageInfoDAO shopStageInfoDAO;
|
||||
private final ApplyLicenseMapper applyLicenseMapper;
|
||||
private final WalletApiService walletApiService;
|
||||
private final RegionDao regionDao;
|
||||
private final WalletPaymentOrderDAO walletPaymentOrderDAO;
|
||||
private final LineInfoDAO lineInfoDAO;
|
||||
private final RedisUtilPool redisUtilPool;
|
||||
@@ -250,7 +249,7 @@ public class WalletServiceImpl implements WalletService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccountInfoVO> getAccountList(StoreShopRequest request) {
|
||||
public List<AccountInfoVO> getAccountList(AccountQueryRequest request) {
|
||||
String storeId = getStoreId(request);
|
||||
List<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(storeId));
|
||||
return accountInfo.stream()
|
||||
@@ -264,7 +263,15 @@ public class WalletServiceImpl implements WalletService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<AccountBillListVO> getBillPage(AccountBillQueryRequest request) {
|
||||
public AccountInfoVO getAccountInfo(AccountQueryRequest request) {
|
||||
String storeId = getStoreId(request);
|
||||
List<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(storeId));
|
||||
AccountInfoDTO accountInfoDTO = accountInfo.stream().filter(v -> v.getAccountNo().equals(request.getAccountNo())).findFirst().get();
|
||||
return BeanUtil.toBean(accountInfoDTO, AccountInfoVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountBillPageVO getBillPage(AccountBillQueryRequest request) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -286,7 +293,13 @@ public class WalletServiceImpl implements WalletService {
|
||||
.pageSize(request.getPageSize())
|
||||
.build();
|
||||
BillPageDTO billPage = walletApiService.getBillPage(billPageRequest);
|
||||
return toPageInfo(billPage.getPageData(), AccountBillListVO.class, billPage.getPage());
|
||||
PageInfo<AccountBillListVO> data = toPageInfo(billPage.getPageData(), AccountBillListVO.class, billPage.getPage());
|
||||
return new AccountBillPageVO(data, billPage.getGetAmount(), billPage.getUseAmount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BillDetailDTO getBillDetail(BillDetailRequest request) {
|
||||
return walletApiService.getBillDetail(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user