| @@ -106,7 +106,7 @@ public class KwMerchantMeterController extends BaseController { | |||||
| @GetMapping("getMechantMeter") | @GetMapping("getMechantMeter") | ||||
| @SystemControllerLog(description = "商户列表") | @SystemControllerLog(description = "商户列表") | ||||
| public ResultData getMechantMeter() { | public ResultData getMechantMeter() { | ||||
| return new ResultData(kwMerchantMeterService.getMerchantMeter(getTenantId())); | |||||
| return new ResultData(kwMerchantMeterService.getMerchantMeter(getTenantInfo())); | |||||
| } | } | ||||
| } | } | ||||
| @@ -61,7 +61,7 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||||
| List<WxRentContract> selectRentContractByShopId(WxRentContract record); | List<WxRentContract> selectRentContractByShopId(WxRentContract record); | ||||
| List<WxRentContract> selectRentContractByShopIds(@Param("shopIds") Collection<Long> shopIds, | List<WxRentContract> selectRentContractByShopIds(@Param("shopIds") Collection<Long> shopIds, | ||||
| @Param("shopIdsRegexp") String shopIdsRegexp,@Param("tenantId") String tenantId); | |||||
| @Param("shopIdsRegexp") String shopIdsRegexp); | |||||
| int hasContractNumber(WxRentContract wxRentContract); | int hasContractNumber(WxRentContract wxRentContract); | ||||
| @@ -94,7 +94,7 @@ public interface WxRentContractService { | |||||
| WxRentContract getByBill(WxBillRent billRent); | WxRentContract getByBill(WxBillRent billRent); | ||||
| Map<Long,WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp,String tenantId); | |||||
| Map<Long,WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp); | |||||
| int selectContractCountByShopId(WxRentContract wxRentContract); | int selectContractCountByShopId(WxRentContract wxRentContract); | ||||
| @@ -1396,8 +1396,6 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "订单更新"); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "订单更新"); | ||||
| } | } | ||||
| // TODO B端收银台支付,核销券相关操作 | |||||
| // B端刷卡支付发券 | // B端刷卡支付发券 | ||||
| logger.info("订单刷卡发券 开始"); | logger.info("订单刷卡发券 开始"); | ||||
| try { | try { | ||||
| @@ -1520,7 +1518,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void handlePayOrderFail(WxPayOrder record, int status) { | public void handlePayOrderFail(WxPayOrder record, int status) { | ||||
| // 判断支付状态 | // 判断支付状态 | ||||
| if (record.getPayOrderStatus() == EnumPayStatus.PAY_STATUS_WAIT.getCode()) { | |||||
| if (record.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_WAIT.getCode())) { | |||||
| logger.error("pay handle, payOrder " + record.getPayOrderNo() + | logger.error("pay handle, payOrder " + record.getPayOrderNo() + | ||||
| "is complete, orderId : " + record.getOrderId()); | "is complete, orderId : " + record.getOrderId()); | ||||
| return; | return; | ||||
| @@ -2497,8 +2497,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Map<Long, WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp,String tenantId) { | |||||
| List<WxRentContract> list = wxRentContractMapper.selectRentContractByShopIds(shopIds, shopIdsRegexp,tenantId); | |||||
| public Map<Long, WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp) { | |||||
| List<WxRentContract> list = wxRentContractMapper.selectRentContractByShopIds(shopIds, shopIdsRegexp); | |||||
| List<String> shopIdArr = Arrays.asList(StringUtils.split(shopIdsRegexp,"|")) ; | List<String> shopIdArr = Arrays.asList(StringUtils.split(shopIdsRegexp,"|")) ; | ||||
| Map<Long, WxRentContract> allShopContract = new HashMap<>(); | Map<Long, WxRentContract> allShopContract = new HashMap<>(); | ||||
| for (WxRentContract wxRentContract : list) { | for (WxRentContract wxRentContract : list) { | ||||
| @@ -95,9 +95,10 @@ public class InvestBaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceIm | |||||
| } | } | ||||
| void checkUserAndTenant(T input, Consumer<T> consumer) { | void checkUserAndTenant(T input, Consumer<T> consumer) { | ||||
| MallUserInfo userInfo = InvestUserContext.getUser(); | |||||
| InvestHelper.notNull(input, "参数 " + input); | InvestHelper.notNull(input, "参数 " + input); | ||||
| InvestHelper.notNull(InvestUserContext.getUser(), ErrorCode.USER_IS_EMPTY); | |||||
| ((InvestBaseEntity) input).setTenantId(InvestUserContext.getUser().getTenantId()); | |||||
| InvestHelper.notNull(userInfo, ErrorCode.USER_IS_EMPTY); | |||||
| ((InvestBaseEntity) input).updateTenantInfo(userInfo); | |||||
| if (consumer != null) { | if (consumer != null) { | ||||
| consumer.accept(input); | consumer.accept(input); | ||||
| } | } | ||||
| @@ -553,8 +553,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| if (CollectionUtils.isNotEmpty(shops)) { | if (CollectionUtils.isNotEmpty(shops)) { | ||||
| Collection<Long> shopPointIds = buildShopContractQuery(shops, EnumRentShopType.POINT); | Collection<Long> shopPointIds = buildShopContractQuery(shops, EnumRentShopType.POINT); | ||||
| Collection<Long> shopIds = buildShopContractQuery(shops, EnumRentShopType.SHOP); | Collection<Long> shopIds = buildShopContractQuery(shops, EnumRentShopType.SHOP); | ||||
| shopContractMap = rentContractService.selectRentContractByShopIds(shopPointIds, StringUtils.join(shopIds, "|"), | |||||
| InvestUserContext.getUser().getTenantId()); | |||||
| shopContractMap = rentContractService.selectRentContractByShopIds(shopPointIds, StringUtils.join(shopIds, "|")); | |||||
| } | } | ||||
| for (WxShop shop : shops) { | for (WxShop shop : shops) { | ||||
| WxRentContract contract = shopContractMap.get(shop.getId()); | WxRentContract contract = shopContractMap.get(shop.getId()); | ||||
| @@ -767,7 +766,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| WxShop shop = shopService.getById(shopId); | WxShop shop = shopService.getById(shopId); | ||||
| InvestHelper.notNull(shop, "shop 不存在"); | InvestHelper.notNull(shop, "shop 不存在"); | ||||
| //3、商品合同信息 | //3、商品合同信息 | ||||
| Map<Long, WxRentContract> shopContractMap = rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId()), InvestUserContext.getUser().getTenantId()); | |||||
| Map<Long, WxRentContract> shopContractMap = rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId())); | |||||
| WxRentContract contract = shopContractMap.get(shop.getId()); | WxRentContract contract = shopContractMap.get(shop.getId()); | ||||
| InvestHelper.notNull(contract, "合同信息不存在"); | InvestHelper.notNull(contract, "合同信息不存在"); | ||||
| Map<String, Object> map = new HashMap<>(); | Map<String, Object> map = new HashMap<>(); | ||||
| @@ -918,8 +917,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| if (Objects.isNull(shop)) { | if (Objects.isNull(shop)) { | ||||
| return new HashMap<>(); | return new HashMap<>(); | ||||
| } | } | ||||
| return rentContractService.selectRentContractByShopIds(Collections.singletonList(shop.getId()), StringUtils.join(shop.getId(), ""), | |||||
| InvestUserContext.getUser().getTenantId()); | |||||
| return rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId(), "")); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.dto.KwMerchantMeterDataDto; | import com.iformall.domain.dto.KwMerchantMeterDataDto; | ||||
| import com.iformall.domain.dto.KwMerchantMeterDto; | import com.iformall.domain.dto.KwMerchantMeterDto; | ||||
| import com.iformall.domain.po.KwMerchantMeter; | import com.iformall.domain.po.KwMerchantMeter; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.KwMerchantMeterDataVo; | import com.iformall.domain.vo.KwMerchantMeterDataVo; | ||||
| import com.iformall.domain.vo.KwMerchantMeterVo; | import com.iformall.domain.vo.KwMerchantMeterVo; | ||||
| import com.iformall.domain.vo.MerchantMeterVo; | import com.iformall.domain.vo.MerchantMeterVo; | ||||
| @@ -54,7 +55,7 @@ public interface KwMerchantMeterService { | |||||
| int unbind(Long meterId); | int unbind(Long meterId); | ||||
| int unbindBatch(Long merchantId); | int unbindBatch(Long merchantId); | ||||
| List<MerchantMeterVo> getMerchantMeter(String tenantId); | |||||
| List<MerchantMeterVo> getMerchantMeter(TenantEntity tenantEntity); | |||||
| } | } | ||||
| @@ -109,7 +109,7 @@ public class KwBoxServiceImpl implements KwBoxService { | |||||
| KwMeterData kwMeterData = new KwMeterData(); | KwMeterData kwMeterData = new KwMeterData(); | ||||
| kwMeterData.setId(idWorker.nextId()); | kwMeterData.setId(idWorker.nextId()); | ||||
| kwMeterData.setTenantId(kwBox.getTenantId()); | |||||
| kwMeterData.updateTenantInfo(kwBox); | |||||
| kwMeterData.setAddress(address); | kwMeterData.setAddress(address); | ||||
| kwMeterData.setBoxId(kwBox.getId()); | kwMeterData.setBoxId(kwBox.getId()); | ||||
| kwMeterData.setCreateTime(recordTime); | kwMeterData.setCreateTime(recordTime); | ||||
| @@ -7,6 +7,7 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.dto.KwMerchantMeterDataDto; | import com.iformall.domain.dto.KwMerchantMeterDataDto; | ||||
| import com.iformall.domain.dto.KwMerchantMeterDto; | import com.iformall.domain.dto.KwMerchantMeterDto; | ||||
| import com.iformall.domain.po.KwMerchantMeter; | import com.iformall.domain.po.KwMerchantMeter; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.KwMerchantMeterDataVo; | import com.iformall.domain.vo.KwMerchantMeterDataVo; | ||||
| import com.iformall.domain.vo.KwMerchantMeterVo; | import com.iformall.domain.vo.KwMerchantMeterVo; | ||||
| import com.iformall.domain.vo.MerchantMeterVo; | import com.iformall.domain.vo.MerchantMeterVo; | ||||
| @@ -88,8 +89,8 @@ public class KwMerchantMeterServiceImpl implements KwMerchantMeterService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<MerchantMeterVo> getMerchantMeter(String tenantId) { | |||||
| return kwMerchantMeterMapper.getMerchantMeter(tenantId); | |||||
| public List<MerchantMeterVo> getMerchantMeter(TenantEntity tenantEntity) { | |||||
| return kwMerchantMeterMapper.getMerchantMeter(tenantEntity.getTenantId()); | |||||
| } | } | ||||
| } | } | ||||