| @@ -48,6 +48,7 @@ public class WxBrandController extends BaseController { | |||
| if (null == wxBrand) { | |||
| wxBrand = new WxBrand(); | |||
| } | |||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||
| wxBrand.setSortColumns(BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<WxBrand> page = wxBrandService.listAsPage(wxBrand, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| @@ -69,10 +70,11 @@ public class WxBrandController extends BaseController { | |||
| if(EnumDelFlag.YES.getCode().equals(wxBrand.getIsDel())){ | |||
| //判断是否解绑商户 | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.updateTenantInfo(wxBrand); | |||
| wxMerchant.setIsDel(0); | |||
| wxMerchant.setBrand(wxBrand.getId()); | |||
| WxMerchant wxMerchant = new WxMerchant() {{ | |||
| setIsDel(0); | |||
| setBrand(wxBrand.getId()); | |||
| updateTenantInfo(wxBrand); | |||
| }}; | |||
| List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant); | |||
| if(CollectionUtils.isNotEmpty(merchantList)){ | |||
| return new ResultData(Result.ERROR, "请先删除已绑定该品牌的商户。"); | |||
| @@ -101,7 +103,7 @@ public class WxBrandController extends BaseController { | |||
| @GetMapping("/queryBrand") | |||
| @SystemControllerLog(description = "品牌-租户-全部") | |||
| public ResultData queryBrand() { | |||
| List<Map<String,Object>> brandList = wxBrandService.queryBrand(getTenantId()); | |||
| List<Map<String,Object>> brandList = wxBrandService.queryBrand(getTenantInfo()); | |||
| return new ResultData(brandList); | |||
| } | |||
| @@ -114,7 +116,12 @@ public class WxBrandController extends BaseController { | |||
| @SystemControllerLog(description = "品牌-名称是否存在") | |||
| public ResultData hasBrand(String name, Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxBrandController::hasBrand"); | |||
| return wxBrandService.hasBrand(getTenantId(), name, id); | |||
| WxBrand wxBrand = new WxBrand() {{ | |||
| setName(name); | |||
| setId(id); | |||
| updateTenantInfo(getTenantInfo()); | |||
| }}; | |||
| return wxBrandService.hasBrand(wxBrand); | |||
| } | |||
| @@ -25,7 +25,7 @@ public class WxMallBuildingController extends BaseController { | |||
| @SystemControllerLog(description = "商城-楼座-获取楼层楼座数据") | |||
| public ResultData getbuildingfloorlist() { | |||
| logger.debug("[" + getIpAddr() + "] WxMallBuildingController::getbuildingfloorlist"); | |||
| return wxMallBuildingService.getbuildingfloorlist(getTenantId()); | |||
| return wxMallBuildingService.getBuildingFloorList(getTenantInfo()); | |||
| } | |||
| @ApiOperation("保存楼层楼座面积") | |||
| @@ -24,7 +24,7 @@ public class WxMerchantBUserController extends BaseController { | |||
| @ApiImplicitParam(name = "phone", value = "phone", dataType = "String", paramType = "query", required = true) | |||
| public ResultData hasphone(String phone) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantBUserController::hasphone"); | |||
| boolean has = wxMerchantBUserService.hasphone(phone, getTenantId()); | |||
| boolean has = wxMerchantBUserService.hasPhone(getTenantInfo(), phone); | |||
| return new ResultData(Result.SUCCESS, "查询成功", has); | |||
| } | |||
| @@ -202,7 +202,7 @@ public class WxMerchantController extends BaseController { | |||
| @SystemControllerLog(description = "查询当前租户下商户名称列表") | |||
| public ResultData nameList() { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::name_list"); | |||
| return new ResultData(wxMerchantService.findList(getTenantId())); | |||
| return new ResultData(wxMerchantService.findList(getTenantInfo())); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @@ -131,7 +131,7 @@ public class WxPropertyContractController extends BaseController { | |||
| @SystemControllerLog(description = "物业合同-下载") | |||
| public void download(HttpServletRequest request, HttpServletResponse response) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::download"); | |||
| wxPropertyContractService.download(request, response, getTenantId()); | |||
| wxPropertyContractService.download(request, response); | |||
| } | |||
| @GetMapping("/getPropertyContractStatusInfo") | |||
| @@ -266,7 +266,7 @@ public class WxRentContractController extends BaseController { | |||
| @RequestMapping("/download") | |||
| public void download(HttpServletRequest request, HttpServletResponse response){ | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::download"); | |||
| wxRentContractService.download(request,response,getTenantId()); | |||
| wxRentContractService.download(request,response); | |||
| } | |||
| @GetMapping("/getRentContractStatusInfo") | |||
| @@ -310,7 +310,7 @@ public class WxRentContractController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "租赁合同-导出合同") | |||
| public void exportContract(Long id,HttpServletRequest request, HttpServletResponse response){ | |||
| wxRentContractService.exportContract(request,response,getTenantId(),id); | |||
| wxRentContractService.exportContract(request,response,id); | |||
| } | |||
| @PostMapping("updateRentContractStatus") | |||
| @@ -324,7 +324,7 @@ public class WxRentContractController extends BaseController { | |||
| @SystemControllerLog(description = "租赁合同-获取甲方账户") | |||
| public ResultData getPayAccountInfo() { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentContractStatus"); | |||
| WxPayAccountBill payAccountBill = payAccountBillService.getByTenantId(getTenantInfo().getTenantId()); | |||
| WxPayAccountBill payAccountBill = payAccountBillService.getByTenantInfo(getTenantInfo()); | |||
| Map<String, String> map = new HashMap<>(); | |||
| if(StringUtils.isNotBlank(payAccountBill.getBankAccountName()) && StringUtils.isNotBlank(payAccountBill.getBankCardId())) { | |||
| map.put("bankAccountName", payAccountBill.getBankAccountName()); | |||
| @@ -351,7 +351,7 @@ public class WxRentContractController extends BaseController { | |||
| if (payAccountBill.getServiceChargeRate() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "手续费费率未填写"); | |||
| } | |||
| WxPayAccountBill payAccountBillNew = payAccountBillService.getByTenantId(getTenantInfo().getTenantId()); | |||
| WxPayAccountBill payAccountBillNew = payAccountBillService.getByTenantInfo(getTenantInfo()); | |||
| payAccountBillNew.setBankAccountName(payAccountBill.getBankAccountName()); | |||
| payAccountBillNew.setBankCardId(payAccountBill.getBankCardId()); | |||
| payAccountBillNew.setServiceChargeRate(payAccountBill.getServiceChargeRate()); | |||
| @@ -29,7 +29,7 @@ public class DataTowerController extends BaseController { | |||
| public ResultData queryRunningPotal() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunningPotal"); | |||
| Map<String, Object> data = dataTowerService.queryRunningPotal(getTenantId()); | |||
| Map<String, Object> data = dataTowerService.queryRunningPotal(getTenantInfo()); | |||
| return new ResultData(data); | |||
| } | |||
| @@ -40,7 +40,7 @@ public class DataTowerController extends BaseController { | |||
| public ResultData queryRunningMobile() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunningMobile"); | |||
| Map<String, Object> data = dataTowerService.queryRunningMobile(getTenantId()); | |||
| Map<String, Object> data = dataTowerService.queryRunningMobile(getTenantInfo()); | |||
| return new ResultData(data); | |||
| } | |||
| @@ -52,7 +52,7 @@ public class DataTowerController extends BaseController { | |||
| public ResultData queryRunning() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunning"); | |||
| Map<String, Object> data = dataTowerService.queryRunning(getTenantId()); | |||
| Map<String, Object> data = dataTowerService.queryRunning(getTenantInfo()); | |||
| return new ResultData(data); | |||
| } | |||
| @@ -64,7 +64,7 @@ public class DataTowerController extends BaseController { | |||
| public ResultData queryCar() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryCar"); | |||
| Map<String, Object> data = dataTowerService.queryCar(getTenantId()); | |||
| Map<String, Object> data = dataTowerService.queryCar(getTenantInfo()); | |||
| return new ResultData(data); | |||
| } | |||
| @@ -75,7 +75,7 @@ public class DataTowerController extends BaseController { | |||
| public ResultData queryCustomer() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryCustomer"); | |||
| Map<String, Object> data = dataTowerService.queryCustomer(getTenantId()); | |||
| Map<String, Object> data = dataTowerService.queryCustomer(getTenantInfo()); | |||
| return new ResultData(data); | |||
| } | |||
| @@ -86,7 +86,7 @@ public class DataTowerController extends BaseController { | |||
| public ResultData queryCustomerData(@RequestParam Map<String,String> params) { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryCustomer"); | |||
| return dataTowerService.queryCustomerData(getTenantId(), params); | |||
| return dataTowerService.queryCustomerData(getTenantInfo(), params); | |||
| } | |||
| @@ -73,7 +73,7 @@ public class WxMerchantTradeDailyController extends BaseController { | |||
| @SystemControllerLog(description = "商户-获得商场近30日解单") | |||
| public ResultData listMonth() { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::listMonth"); | |||
| return wxMerchantTradeDailyService.getVolumeTotalOfMonth(getTenantId()); | |||
| return wxMerchantTradeDailyService.getVolumeTotalOfMonth(getTenantInfo()); | |||
| } | |||
| @ApiOperation("更新解单数据") | |||
| @@ -26,7 +26,7 @@ public class PushLimitController extends BaseController { | |||
| @SystemControllerLog(description = "疲劳度-配置获取") | |||
| public ResultData list() { | |||
| logger.debug("[" + getIpAddr() + "] PushLimitController::list"); | |||
| PushLimit pushLimit = pushLimitService.getPushLimit(getTenantId()); | |||
| PushLimit pushLimit = pushLimitService.getPushLimit(getTenantInfo()); | |||
| return new ResultData(pushLimit); | |||
| } | |||
| @@ -171,9 +171,8 @@ public class WxCardPayController extends BaseController { | |||
| if (wxCardInfo.getId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件ID为空"); | |||
| } | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| wxCardInfo.updateTenantInfo(tenantEntity); | |||
| int remainShareAmount = wxCardSpendService.finishCard(tenantEntity, wxCardInfo.getId()); | |||
| wxCardInfo.updateTenantInfo(getTenantInfo()); | |||
| int remainShareAmount = wxCardSpendService.finishCard(wxCardInfo); | |||
| return new ResultData(remainShareAmount); | |||
| } | |||
| @@ -109,7 +109,7 @@ public class WxCouponChannelController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | |||
| String[] ids = wxCouponChannelDto.getCouponIds().split(","); | |||
| String[] channelId = wxCouponChannelDto.getChannelId().split(","); | |||
| ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantId(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); | |||
| ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantInfo(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); | |||
| return resultData; | |||
| } | |||
| @@ -91,7 +91,7 @@ public class WxCouponPresentController extends BaseController { | |||
| wxCouponPresent.setUserId(user.getId()); | |||
| wxCouponPresent.updateTenantInfo(user); | |||
| try { | |||
| pushLimitService.checkSendTime(user.getTenantId()); | |||
| pushLimitService.checkSendTime(user); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| @@ -78,7 +78,7 @@ public class WxCouponSendController extends BaseController { | |||
| return new ResultData(ErrorCode.COUPON_VALID_NOT_SUPPORTED); | |||
| } | |||
| try { | |||
| wxCouponSendService.saveOrUpdateConfig(beforeDays, sendType, getTenantId()); | |||
| wxCouponSendService.saveOrUpdateConfig(beforeDays, sendType, getTenantInfo()); | |||
| } catch (MallinkException e) { | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| @@ -93,7 +93,7 @@ public class WxCouponSendController extends BaseController { | |||
| @ApiImplicitParam(name = "sendType", value = "注券类型(生日券=8)", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "注券-获取配置") | |||
| public ResultData getConfig(Integer sendType) { | |||
| WxCouponSend wxCouponSend = wxCouponSendService.getConfig(sendType, getTenantId()); | |||
| WxCouponSend wxCouponSend = wxCouponSendService.getConfig(sendType, getTenantInfo()); | |||
| return new ResultData(Objects.isNull(wxCouponSend) ? null : wxCouponSend.getConditions()); | |||
| } | |||
| @@ -139,7 +139,7 @@ public class WxOrderController extends BaseController { | |||
| public ResultData queryOrderSummary() { | |||
| logger.debug("[" + getIpAddr() + "] WxOrderController::queryOrderSummary"); | |||
| Map<String, Object> data = wxOrderService.queryOrderSummary(getTenantId()); | |||
| Map<String, Object> data = wxOrderService.queryOrderSummary(getTenantInfo()); | |||
| return new ResultData(data); | |||
| } | |||
| @@ -60,7 +60,7 @@ public class WxPowerBillAutoConfigController extends BaseController { | |||
| @SystemControllerLog(description = "id查询") | |||
| public ResultData getConfig() { | |||
| logger.debug("[" + getIpAddr() + "] WxPowerBillAutoConfigController::getConfig"); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPowerBillAutoConfigService.getConfig(getTenantId())); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPowerBillAutoConfigService.getConfig(getTenantInfo())); | |||
| } | |||
| @@ -51,7 +51,7 @@ public class WxProfitSharingOrderController extends BaseController { | |||
| public ResultData queryOrderSummary() { | |||
| logger.debug("[" + getIpAddr() + "] WxProfitSharingOrderController::queryOrderSummary"); | |||
| Map<String, Object> data = wxProfitSharingOrderService.queryOrderSummary(getTenantId()); | |||
| Map<String, Object> data = wxProfitSharingOrderService.queryOrderSummary(getTenantInfo()); | |||
| return new ResultData(data); | |||
| } | |||
| @@ -60,7 +60,7 @@ public class WxCreditHistoryController extends BaseController { | |||
| } | |||
| try { | |||
| Map<String, Integer> result = wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId,getTenantId()) ; | |||
| Map<String, Integer> result = wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId, getTenantInfo()) ; | |||
| return new ResultData(result); | |||
| } catch (MallinkException e) { | |||
| return new ResultData(e.getErrorCode(),e.getMessage()); | |||
| @@ -83,7 +83,7 @@ public class WxMsgModelController extends BaseController { | |||
| @SystemControllerLog(description = "短信模板-获取所有数据") | |||
| public ResultData getmodellist() { | |||
| logger.debug("[" + getIpAddr() + "] WxMsgModelController::getmodellist"); | |||
| return wxMsgModelService.getmodellist(getTenantId()); | |||
| return wxMsgModelService.getModelList(getTenantInfo()); | |||
| } | |||
| @@ -84,7 +84,7 @@ public class WxMsgSignatureController extends BaseController { | |||
| @SystemControllerLog(description = "消息签名-获取所有") | |||
| public ResultData getmodellist() { | |||
| logger.debug("[" + getIpAddr() + "] WxMsgSignatureController::getmodellist"); | |||
| return wxMsgSignatureService.getsignaturelist(getTenantId()); | |||
| return wxMsgSignatureService.getSignatureList(getTenantInfo()); | |||
| } | |||
| @@ -118,7 +118,7 @@ public class WxBillDailyController extends BaseController { | |||
| @SystemControllerLog(description = "日常账单-导出模板") | |||
| public void exportTemplate(HttpServletRequest request, HttpServletResponse response) { | |||
| logger.debug("[" + getIpAddr() + "] wxBillDailyService::exportTemplate"); | |||
| wxBillDailyService.exportTemplate(request, response, getTenantId()); | |||
| wxBillDailyService.exportTemplate(request, response, getUser()); | |||
| } | |||
| @@ -111,7 +111,7 @@ public class WxBillPropertyController extends BaseController { | |||
| @SystemControllerLog(description = "物业账单-根据商户获取") | |||
| public ResultData findByPropertyContractId(Long propertyContractId, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillPropertyController::findByPropertyContractId"); | |||
| final PageInfo<WxBillProperty> page = wxBillPropertyService.findByPropertyContractId(propertyContractId, getTenantId(), pageNum, pageSize); | |||
| final PageInfo<WxBillProperty> page = wxBillPropertyService.findByPropertyContractId(propertyContractId, getTenantInfo(), pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -94,7 +94,10 @@ public class WxBillRentController extends BaseController { | |||
| @SystemControllerLog(description = "租赁押金账单-根据商户获取") | |||
| public ResultData findByRentContractId(Long rentContractId, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillRentController::findByRentContractId"); | |||
| final PageInfo<WxBillRent> page = wxBillRentService.findByRentContractId(rentContractId, getTenantId(), pageNum, pageSize); | |||
| WxBillRent record = new WxBillRent(); | |||
| record.setRentContractId(rentContractId); | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| final PageInfo<WxBillRent> page = wxBillRentService.findByRentContractId(record, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -183,7 +183,7 @@ public class WxCouponOrderController extends BaseController { | |||
| } | |||
| if(couponOrder != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder.getTenantId(), couponOrderId, wxMerchantBUser.getId()); | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder, couponOrderId, wxMerchantBUser.getId()); | |||
| } | |||
| return new ResultData(couponOrder); | |||
| @@ -65,7 +65,7 @@ public class WxCouponSendController extends BaseController { | |||
| final PageInfo<WxCouponSendVo> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | |||
| for (WxCouponSendVo cs : page.getList()) { | |||
| cs.setSendCount(wxCouponActionLogService.getCountByChannelId(getTenantId(), cs.getSendType(), cs.getId())); | |||
| cs.setSendCount(wxCouponActionLogService.getCountByChannelId(getTenantInfo(), cs.getSendType(), cs.getId())); | |||
| } | |||
| return new ResultData(page); | |||
| } | |||
| @@ -69,7 +69,7 @@ public class WxCreditHistoryController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL) ; | |||
| } | |||
| try { | |||
| Map<String, Integer> result = wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId, getTenantId()); | |||
| Map<String, Integer> result = wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId, getTenantInfo()); | |||
| return new ResultData(result); | |||
| } catch (MallinkException e) { | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| @@ -213,7 +213,7 @@ public class WxMerchantBUserController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "密码不能为空"); | |||
| } | |||
| return wxMerchantBUserService.updatepwd(appId, phone, code, pwd); | |||
| return wxMerchantBUserService.updatePwd(appId, phone, code, pwd); | |||
| } | |||
| } | |||
| @@ -33,7 +33,7 @@ public class WxMerchantController extends BaseController { | |||
| @GetMapping("/name_list") | |||
| public ResultData nameList() { | |||
| log.debug("[" + getIpAddr() + "] WxMerchantController::name_list"); | |||
| return new ResultData(wxMerchantService.findList(getTenantId())); | |||
| return new ResultData(wxMerchantService.findList(getTenantInfo())); | |||
| } | |||
| @ApiOperation("查询账户信息") | |||
| @@ -1,8 +1,6 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| import com.iformall.service.WxMallBuildingService; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| @@ -22,6 +20,6 @@ public class WxMallBuildingController extends BaseController { | |||
| @GetMapping("getbuildingfloorlist") | |||
| public ResultData getbuildingfloorlist() { | |||
| logger.debug("[" + getIpAddr() + "] WxMallBuildingController::getbuildingfloorlist"); | |||
| return wxMallBuildingService.getbuildingfloorlist(getTenantId()); | |||
| return wxMallBuildingService.getBuildingFloorList(getTenantInfo()); | |||
| } | |||
| } | |||
| @@ -2116,7 +2116,7 @@ public class PosServiceImpl implements PosService { | |||
| logger.error("交易核销积分异常:" + e.getMessage()); | |||
| } | |||
| // 3. 核销后处理 | |||
| couponOrderService.sendInsideCouponVerifyMsg(merchantBUser.getTenantId(), couponOrderId, merchantBUser.getId()); | |||
| couponOrderService.sendInsideCouponVerifyMsg(merchantBUser, couponOrderId, merchantBUser.getId()); | |||
| } | |||
| return payOrder; | |||
| } | |||
| @@ -186,7 +186,7 @@ public class CouponSendSchedule { | |||
| // 发放免费券 | |||
| try { | |||
| WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getCouponId(), null); | |||
| wxCouponActionLogService.addOne(l.getTenantId(), cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | |||
| wxCouponActionLogService.addOne(tenantEntity, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | |||
| } catch (Exception e) { | |||
| logger.error("定时发券:发券失败 levelId=" + l.getId() + " couponId=" + cs.getCouponId() + " userId=" + cu.getId() + e.getMessage()); | |||
| continue; | |||
| @@ -254,7 +254,7 @@ public class CouponSendSchedule { | |||
| return; | |||
| } | |||
| WxCouponSend birthdayConfig = wxCouponSendService.getConfig(EnumCouponSendSendType.BIRTHDAY.getCode(), mall.getTenantId()); | |||
| WxCouponSend birthdayConfig = wxCouponSendService.getConfig(EnumCouponSendSendType.BIRTHDAY.getCode(), tenantEntity); | |||
| String conditions = birthdayConfig.getConditions(); | |||
| JSONObject configJo = null; | |||
| try { | |||
| @@ -316,7 +316,7 @@ public class CouponSendSchedule { | |||
| // 发放生日券 | |||
| try { | |||
| WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getCouponId(), null); | |||
| wxCouponActionLogService.addOne(cu.getTenantId(), cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | |||
| wxCouponActionLogService.addOne(tenantEntity, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | |||
| couponSendedUsers.add(cu); | |||
| } catch (Exception e) { | |||
| logger.error("定时发券:发券失败 levelId=" + cu.getId() + " couponId=" + cs.getCouponId() + " userId=" + cu.getId() + e.getMessage()); | |||
| @@ -23,6 +23,7 @@ public class WxMall extends BaseEntity { | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商场名",name="name") | |||
| private String name; | |||
| @TableField(value = "`group`") | |||
| @io.swagger.annotations.ApiModelProperty(value="集团",name="group") | |||
| private String group; | |||
| @io.swagger.annotations.ApiModelProperty(value="国家",name="country") | |||
| @@ -113,4 +114,8 @@ public class WxMall extends BaseEntity { | |||
| return mul; | |||
| } | |||
| public void setTenantInfo(TenantEntity tenantInfo) { | |||
| setTenantId(tenantInfo.getTenantId()); | |||
| } | |||
| } | |||
| @@ -4,15 +4,22 @@ import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.dto.KwMerchantMeterDataDto; | |||
| import com.iformall.domain.dto.KwMerchantMeterDto; | |||
| import com.iformall.domain.po.KwMerchantMeter; | |||
| import com.iformall.domain.po.KwMeter; | |||
| import com.iformall.domain.vo.KwMerchantMeterDataVo; | |||
| import com.iformall.domain.vo.KwMerchantMeterVo; | |||
| import com.iformall.domain.vo.MerchantMeterVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface KwMerchantMeterMapper extends CommonMapper<KwMerchantMeter, Long> { | |||
| List<KwMerchantMeter> findList(KwMerchantMeter param); | |||
| List<KwMerchantMeter> findSimpleMeterList(@Param("merchantId") Long merchantId); | |||
| List<KwMeter> findMeterList(@Param("merchantId") Long merchantId); | |||
| List<KwMerchantMeterVo> findVoList(KwMerchantMeterDto param); | |||
| List<KwMerchantMeterDataVo> findDataVoList(KwMerchantMeterDataDto param); | |||
| @@ -21,6 +28,6 @@ public interface KwMerchantMeterMapper extends CommonMapper<KwMerchantMeter, Lon | |||
| int unbindBatch(@Param("merchantId")Long merchantId); | |||
| int unbind(@Param("meterId")Long meterId); | |||
| List<MerchantMeterVo> getMerchantMeter(String tenantId); | |||
| List<MerchantMeterVo> getMerchantMeter(@Param("tenantId") String tenantId); | |||
| } | |||
| @@ -10,6 +10,8 @@ public interface PosMallConfigMapper extends CommonMapper<PosMallConfig, Long> { | |||
| PosMallConfig getByTenantId(String tenantId); | |||
| PosMallConfig getByTenantInfo(String tenantId); | |||
| @@ -1,6 +1,5 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxBrand; | |||
| @@ -14,8 +13,7 @@ public interface WxBrandMapper extends CommonMapper<WxBrand, String> { | |||
| List<WxBrand> findList(WxBrand wxBrand); | |||
| List<Map<String,Object>> queryBrand(String tenantId); | |||
| List<Map<String,Object>> queryBrandByTenant(WxBrand wxBrand); | |||
| int hasBrand(WxBrand wxBrand); | |||
| @@ -1,21 +1,22 @@ | |||
| package com.iformall.service; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import java.util.Map; | |||
| public interface DataTowerService { | |||
| Map<String,Object> queryRunningMobile(String tenantId); | |||
| Map<String,Object> queryRunningMobile(TenantEntity tenantEntity); | |||
| Map<String,Object> queryRunningPotal(String tenantId); | |||
| Map<String,Object> queryRunningPotal(TenantEntity tenantEntity); | |||
| Map<String,Object> queryRunning(String tenantId); | |||
| Map<String,Object> queryRunning(TenantEntity tenantEntity); | |||
| Map<String,Object> queryCar(String tenantId); | |||
| Map<String,Object> queryCar(TenantEntity tenantEntity); | |||
| Map<String,Object> queryCustomer(String tenantId); | |||
| Map<String,Object> queryCustomer(TenantEntity tenantEntity); | |||
| ResultData queryCustomerData(String tenantId, Map<String, String> params); | |||
| ResultData queryCustomerData(TenantEntity tenantEntity, Map<String, String> params); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.PosMallConfig; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| public interface PosMallConfigService { | |||
| @@ -29,7 +30,10 @@ public interface PosMallConfigService { | |||
| * @param tenantId | |||
| * @return | |||
| */ | |||
| @Deprecated | |||
| PosMallConfig getByTenantId(String tenantId); | |||
| PosMallConfig getByTenantInfo(TenantEntity tenantEntity); | |||
| /** | |||
| * 保存或更新实体 | |||
| @@ -1,19 +1,17 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.PushLimit; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| public interface PushLimitService { | |||
| /** | |||
| * 获取租户的PushLimit | |||
| * | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @return | |||
| */ | |||
| PushLimit getPushLimit(String tenantId); | |||
| PushLimit getPushLimit(TenantEntity tenantEntity); | |||
| /** | |||
| * 保存或更新实体 | |||
| @@ -24,25 +22,25 @@ public interface PushLimitService { | |||
| /** | |||
| * 检查发送时间 | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @return | |||
| */ | |||
| boolean checkSendTime(String tenantId); | |||
| boolean checkSendTime(TenantEntity tenantEntity); | |||
| /** | |||
| * 发短信检查 | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @return | |||
| */ | |||
| boolean checkMsg(String tenantId); | |||
| boolean checkMsg(TenantEntity tenantEntity); | |||
| /** | |||
| * 主动发券检查 | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @param cUserId | |||
| * @param couponId | |||
| * @return | |||
| */ | |||
| boolean checkCoupon(String tenantId, Long cUserId, Long couponId); | |||
| boolean checkCoupon(TenantEntity tenantEntity, Long cUserId, Long couponId); | |||
| } | |||
| @@ -15,12 +15,12 @@ import java.util.Map; | |||
| */ | |||
| public interface WxBillDailyService { | |||
| /** | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param offset | |||
| * @param limit | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxBillDaily> listAsPage(WxBillDaily record, Integer pageIndex, Integer pageSize); | |||
| @@ -34,14 +34,14 @@ public interface WxBillDailyService { | |||
| * @return | |||
| */ | |||
| WxBillDaily getById(Long id); | |||
| /** | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| * @param user | |||
| */ | |||
| ResultData saveOrUpdate(WxBillDaily record, MallUserInfo user); | |||
| * @param record | |||
| * @param user | |||
| */ | |||
| ResultData saveOrUpdate(WxBillDaily record, MallUserInfo user); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -53,7 +53,7 @@ public interface WxBillDailyService { | |||
| ResultData updatePaid(Long id); | |||
| void exportTemplate(HttpServletRequest request, HttpServletResponse response, String tenantId); | |||
| void exportTemplate(HttpServletRequest request, HttpServletResponse response, MallUserInfo user); | |||
| void insertData(WxBillDailyVo billDaily, String importKey, MallUserInfo user); | |||
| @@ -3,13 +3,11 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| @@ -61,7 +59,7 @@ public interface WxBillPropertyService { | |||
| void deleteById(Long id); | |||
| PageInfo<WxBillProperty> findByPropertyContractId(Long id, String tenantId, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxBillProperty> findByPropertyContractId(Long id, TenantEntity tenantEntity, Integer pageIndex, Integer pageSize); | |||
| ResultData updatePaid(Long id); | |||
| @@ -57,7 +57,7 @@ public interface WxBillRentService { | |||
| void deleteById(Long id); | |||
| PageInfo<WxBillRent> findByRentContractId(Long id, String tenantId, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxBillRent> findByRentContractId(WxBillRent record, Integer pageIndex, Integer pageSize); | |||
| ResultData updatePaid(Long id); | |||
| @@ -2,8 +2,8 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxBrand; | |||
| import com.iformall.domain.po.WxShop; | |||
| import java.io.Serializable; | |||
| import java.util.Collection; | |||
| @@ -47,8 +47,13 @@ public interface WxBrandService { | |||
| ResultData update(WxBrand wxBrand); | |||
| List<Map<String,Object>> queryBrand(String id); | |||
| List<Map<String,Object>> queryBrand(TenantEntity tenantEntity); | |||
| ResultData hasBrand(String tenantId, String name, Long id); | |||
| /** | |||
| * 检查是否有重复的名称 | |||
| * @param wxBrand | |||
| * @return | |||
| */ | |||
| ResultData hasBrand(WxBrand wxBrand); | |||
| } | |||
| @@ -80,10 +80,9 @@ public interface WxCardSpendService { | |||
| /** | |||
| * 卡完结 | |||
| * | |||
| * @param tenantEntity | |||
| * @param cardId | |||
| * @param cardInfo | |||
| */ | |||
| int finishCard(TenantEntity tenantEntity, Long cardId); | |||
| int finishCard(WxCardInfo cardInfo); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -94,11 +93,11 @@ public interface WxCardSpendService { | |||
| /** | |||
| * cardPay分账 | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @param orderId | |||
| * @param cardSpendId | |||
| */ | |||
| void shareForCardPay(String tenantId, Long cardId, Long orderId, Long cardSpendId); | |||
| void shareForCardPay(TenantEntity tenantEntity, Long cardId, Long orderId, Long cardSpendId); | |||
| /** | |||
| * cardPay交易流水导出 | |||
| @@ -1,10 +1,10 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxCouponActionLog; | |||
| import com.iformall.domain.vo.WxCouponActionLogVo; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxCouponActionLogService { | |||
| @@ -13,8 +13,8 @@ public interface WxCouponActionLogService { | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param offset | |||
| * @param limit | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxCouponActionLog> listAsPage(WxCouponActionLog record, Integer pageIndex, Integer pageSize); | |||
| @@ -42,10 +42,10 @@ public interface WxCouponActionLogService { | |||
| void deleteById(Long id); | |||
| void addOne(String tenantId,Long couponId,Long coupon_order_id,int channelType,Long channelId); | |||
| void addOne(TenantEntity tenantEntity,Long couponId,Long coupon_order_id,int channelType,Long channelId); | |||
| int getCountByChannelId(String tenantId, int channelType, Long channelId); | |||
| int getCountByChannelId(TenantEntity tenantEntity, int channelType, Long channelId); | |||
| /** | |||
| * 查找注券记录 | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| @@ -68,9 +69,9 @@ public interface WxCouponChannelService { | |||
| */ | |||
| ResultData saveOrUpdate(WxCouponChannel record); | |||
| ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime); | |||
| ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date beginTime, Date endTime); | |||
| void updateStatusByCouponId(Long couponId,String tenantId,int status); | |||
| void updateStatusByCouponId(Long couponId,TenantEntity tenantEntity,int status); | |||
| ResultData change(WxCouponChannel wxCouponChannel); | |||
| @@ -58,7 +58,7 @@ public interface WxCouponOrderService { | |||
| /** | |||
| * 核销后发送消息 | |||
| */ | |||
| void sendInsideCouponVerifyMsg(String tenantId, Long couponOrderId, Long buUserId); | |||
| void sendInsideCouponVerifyMsg(TenantEntity tenantEntity, Long couponOrderId, Long buUserId); | |||
| /** | |||
| * 核销后处理 | |||
| @@ -77,11 +77,11 @@ public interface WxCouponOrderService { | |||
| /** | |||
| * B端刷卡支付发券 | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @param orderId | |||
| * @param cUserId | |||
| */ | |||
| boolean sendCouponAfterMicroPay(String tenantId, Long orderId, Long cUserId); | |||
| boolean sendCouponAfterMicroPay(TenantEntity tenantEntity, Long orderId, Long cUserId); | |||
| /** | |||
| * 核销分账 | |||
| @@ -1,13 +1,11 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxCouponSend; | |||
| import com.iformall.domain.vo.WxCouponSendVo; | |||
| import com.iformall.enums.EnumCouponSendSendType; | |||
| import javax.validation.constraints.NotNull; | |||
| public interface WxCouponSendService { | |||
| /** | |||
| @@ -56,22 +54,22 @@ public interface WxCouponSendService { | |||
| */ | |||
| boolean sendCouponToUser(EnumCouponSendSendType type, Object param); | |||
| void updateStatusByCouponId(Long couponId,String tenantId, int status); | |||
| void updateStatusByCouponId(Long couponId, TenantEntity tenantEntity, int status); | |||
| /** | |||
| * 添加或更新生日券配置 | |||
| * @param beforeDays | |||
| * @param sendType | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| */ | |||
| void saveOrUpdateConfig(Integer beforeDays, Integer sendType, String tenantId) ; | |||
| void saveOrUpdateConfig(Integer beforeDays, Integer sendType, TenantEntity tenantEntity) ; | |||
| /** | |||
| * 获取生日券配置 | |||
| * @param sendType | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @return | |||
| */ | |||
| WxCouponSend getConfig(Integer sendType,String tenantId) ; | |||
| WxCouponSend getConfig(Integer sendType,TenantEntity tenantEntity) ; | |||
| /** | |||
| * 商户注券 库存减少 | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxCreditHistory; | |||
| import com.iformall.domain.vo.WxCreditHistoryVo; | |||
| @@ -67,7 +68,7 @@ public interface WxCreditHistoryService { | |||
| */ | |||
| void deleteById(Long id); | |||
| Map<String, Integer> findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId,String tenantId); | |||
| Map<String, Integer> findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId, TenantEntity tenantEntity); | |||
| void clearCreditByYear(); | |||
| @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxLevelConfig; | |||
| import com.iformall.domain.po.WxLevelMerchant; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxLevelMerchantCVo; | |||
| import java.util.List; | |||
| @@ -25,7 +26,7 @@ public interface WxLevelConfigService { | |||
| List<WxLevelConfig> listByMerchantId(Long merchantId, WxLevelConfig record); | |||
| void batchSaveByMerchantId(String tenantId, Long merchantId, List<WxLevelConfig> records); | |||
| void batchSaveByMerchantId(TenantEntity tenantEntity, Long merchantId, List<WxLevelConfig> records); | |||
| /** | |||
| * getByTenantId | |||
| @@ -3,6 +3,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxMallBuildingFloorDto; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMallBuilding; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| @@ -40,10 +41,9 @@ public interface WxMallBuildingService { | |||
| */ | |||
| void deleteById(Long id); | |||
| ResultData getBuildingList(TenantEntity tenantEntity); | |||
| ResultData getbuildinglist(String tenantId); | |||
| ResultData getbuildingfloorlist(String tenantId); | |||
| ResultData getBuildingFloorList(TenantEntity tenantEntity); | |||
| /** | |||
| * 新增楼层楼座 | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| public interface WxMallFloorService { | |||
| @@ -10,8 +11,8 @@ public interface WxMallFloorService { | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param offset | |||
| * @param limit | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxMallFloor> listAsPage(WxMallFloor record, Integer pageIndex, Integer pageSize); | |||
| @@ -39,6 +40,6 @@ public interface WxMallFloorService { | |||
| void deleteById(Long id); | |||
| ResultData getfloorlist(String tenantId, Long buildingId); | |||
| ResultData getFloorList(TenantEntity tenantEntity, Long buildingId); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| public interface WxMerchantBUserService { | |||
| @@ -55,8 +56,8 @@ public interface WxMerchantBUserService { | |||
| void deleteById(Long id); | |||
| boolean hasphone(String phone, String tenantId); | |||
| boolean hasPhone(TenantEntity tenantEntity, String phone); | |||
| ResultData updatepwd(String appId, String phone, String code, String pwd); | |||
| ResultData updatePwd(String appId, String phone, String code, String pwd); | |||
| } | |||
| @@ -3,7 +3,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.po.WxBillOtherDeposit; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||
| @@ -87,10 +87,10 @@ public interface WxMerchantService { | |||
| /** | |||
| * 查询商户列表 | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @return | |||
| */ | |||
| List<WxMerchantSimpleVo> findList(String tenantId); | |||
| List<WxMerchantSimpleVo> findList(TenantEntity tenantEntity); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMerchantTradeDaily; | |||
| import com.iformall.domain.vo.WxMerchantTradeDailyVo; | |||
| @@ -72,7 +73,7 @@ public interface WxMerchantTradeDailyService { | |||
| /** | |||
| * 获取近30日解单数据(总额) ADMIN 端 | |||
| */ | |||
| ResultData getVolumeTotalOfMonth(String tenantId); | |||
| ResultData getVolumeTotalOfMonth(TenantEntity tenantEntity); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMsgModel; | |||
| public interface WxMsgModelService { | |||
| @@ -10,8 +11,8 @@ public interface WxMsgModelService { | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param offset | |||
| * @param limit | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxMsgModel> listAsPage(WxMsgModel record, Integer pageIndex, Integer pageSize); | |||
| @@ -40,7 +41,7 @@ public interface WxMsgModelService { | |||
| ResultData getmodellist(String tenantId); | |||
| ResultData getModelList(TenantEntity tenantEntity); | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMsgSignature; | |||
| public interface WxMsgSignatureService { | |||
| @@ -10,8 +11,8 @@ public interface WxMsgSignatureService { | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param offset | |||
| * @param limit | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxMsgSignature> listAsPage(WxMsgSignature record, Integer pageIndex, Integer pageSize); | |||
| @@ -39,6 +40,6 @@ public interface WxMsgSignatureService { | |||
| void deleteById(Long id); | |||
| ResultData getsignaturelist(String tenantId); | |||
| ResultData getSignatureList(TenantEntity tenantEntity); | |||
| } | |||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.OrderSaveDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxCouponSendVo; | |||
| import com.iformall.domain.vo.WxOrderCouponPressVo; | |||
| import com.iformall.domain.vo.WxOrderCouponVo; | |||
| @@ -140,11 +141,11 @@ public interface WxOrderService { | |||
| * @param orderId | |||
| * @param payOrderId | |||
| */ | |||
| void shareForMicroPay(String tenantId, Long orderId, Long payOrderId); | |||
| void shareForMicroPay(TenantEntity tenantEntity, Long orderId, Long payOrderId); | |||
| PageInfo<WxOrder> listOrderAsPage(WxOrderQueryVo wxOrder, Integer pageNum, Integer pageSize); | |||
| Map<String,Object> queryOrderSummary(String tenantId); | |||
| Map<String,Object> queryOrderSummary(TenantEntity tenantEntity); | |||
| /** | |||
| * 砍价订单 | |||
| @@ -153,13 +154,13 @@ public interface WxOrderService { | |||
| WxOrderCouponPressVo detailPressVo(WxOrder record); | |||
| void updateStatusByPressCouponId(Long couponId,String tenantId,int orderStatus); | |||
| void updateStatusByPressCouponId(Long couponId, TenantEntity tenantEntity,int orderStatus); | |||
| void updateOrderStatus(WxOrder order); | |||
| void updateOrderGroupStatusByCouponId(Long id, String tenantId, Integer code); | |||
| void updateOrderGroupStatusByCouponId(Long id, TenantEntity tenantEntity, Integer code); | |||
| void updateOrderGroupStatusByCouponChannelId(Long id, String tenantId, Integer code); | |||
| void updateOrderGroupStatusByCouponChannelId(Long id, TenantEntity tenantEntity, Integer code); | |||
| /** | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| public interface WxPayAccountBillService { | |||
| @@ -26,10 +27,10 @@ public interface WxPayAccountBillService { | |||
| /** | |||
| * 根据tenantId获得实体 | |||
| * | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @return | |||
| */ | |||
| WxPayAccountBill getByTenantId(String tenantId); | |||
| WxPayAccountBill getByTenantInfo(TenantEntity tenantEntity); | |||
| /** | |||
| * 保存或更新实体 | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxPowerBillAutoConfig; | |||
| /** | |||
| @@ -22,10 +23,10 @@ public interface WxPowerBillAutoConfigService { | |||
| /** | |||
| * 根据tenantId获得实体 | |||
| * | |||
| * @param tenantId | |||
| * @param tenantEntity | |||
| * @return | |||
| */ | |||
| WxPowerBillAutoConfig getConfig(String tenantId); | |||
| WxPowerBillAutoConfig getConfig(TenantEntity tenantEntity); | |||
| /** | |||
| * 保存或更新实体 | |||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxSharingOrderDto; | |||
| import com.iformall.domain.po.WxProfitSharingOrder; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxProfitSharingOrderQueryVo; | |||
| import com.iformall.domain.vo.WxProfitSharingOrderVo; | |||
| @@ -35,7 +36,7 @@ public interface WxProfitSharingOrderService { | |||
| PageInfo<WxProfitSharingOrderVo> listAsPage(WxProfitSharingOrderQueryVo order, Integer pageNum, Integer pageSize); | |||
| Map<String,Object> queryOrderSummary(String tenantId); | |||
| Map<String,Object> queryOrderSummary(TenantEntity tenantEntity); | |||
| ResultData findOrderDetails(Long id); | |||
| @@ -50,7 +50,7 @@ public interface WxPropertyContractService { | |||
| void deleteById(Long id); | |||
| void download(HttpServletRequest request, HttpServletResponse response, String tenantId); | |||
| void download(HttpServletRequest request, HttpServletResponse response); | |||
| Object getRentContractStatusInfo(WxPropertyContract record); | |||
| @@ -53,7 +53,7 @@ public interface WxRentContractService { | |||
| ResultData deleteById(String id); | |||
| void download(HttpServletRequest request, HttpServletResponse response, String tenantId); | |||
| void download(HttpServletRequest request, HttpServletResponse response); | |||
| Object getRentContractStatusInfo(WxRentContract record); | |||
| @@ -63,7 +63,7 @@ public interface WxRentContractService { | |||
| Object getRentContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize); | |||
| void exportContract(HttpServletRequest request, HttpServletResponse response, String tenantId, Long id); | |||
| void exportContract(HttpServletRequest request, HttpServletResponse response, Long id); | |||
| ResultData updateFile(WxRentContract wxRentContract, Long userId,String userName,Date oldRentStartDate); | |||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillAll; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -74,10 +75,10 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| //出租与未出租*********************************************** | |||
| private Map<String, Object> shopRunning(String tenantId) { | |||
| private Map<String, Object> shopRunning(TenantEntity tenantEntity) { | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.setTenantId(tenantId); | |||
| wxShop.updateTenantInfo(tenantEntity); | |||
| wxShop.setStatus(EnumShopStatus.RENT.getCode()); | |||
| List<WxShop> rentedList = wxShopMapper.findList(wxShop); | |||
| wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode()); | |||
| @@ -104,11 +105,11 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| //租金*********************************************** | |||
| private Map<String, Object> rentRunning(String tenantId) { | |||
| private Map<String, Object> rentRunning(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> rentMap = new HashMap<>(); | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.set(Calendar.DAY_OF_YEAR, 1); | |||
| @@ -144,16 +145,16 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| //上报解单*********************************************** | |||
| private Map<String, Object> reportRunning(String tenantId) { | |||
| private Map<String, Object> reportRunning(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> reportMap = new HashMap<>(); | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(tenantId); | |||
| wxMerchant.updateTenantInfo(tenantEntity); | |||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| List<WxMerchant> merchants = wxMerchantMapper.findList(wxMerchant); | |||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||
| wxMerchantTradeDaily.setTenantId(tenantId); | |||
| wxMerchantTradeDaily.updateTenantInfo(tenantEntity); | |||
| String reportDate = DateUtils.getTimeBefore(1, new Date()); | |||
| wxMerchantTradeDaily.setReportDate(reportDate); | |||
| List<WxMerchantTradeDaily> tradeList = wxMerchantTradeDailyMapper.findList(wxMerchantTradeDaily); | |||
| @@ -175,10 +176,10 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| //今日车流量*********************************************** | |||
| private Map<String, Object> carRunning(String tenantId) { | |||
| private Map<String, Object> carRunning(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> carMap = new HashMap<>(); | |||
| HashMap<String, Object> paramsCar = new HashMap<>(); | |||
| paramsCar.put("tenantId", tenantId); | |||
| paramsCar.put("tenantId", tenantEntity.getTenantId()); | |||
| paramsCar.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode()); | |||
| String startdate = DateUtils.getTimeBefore(30, new Date()); | |||
| String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); | |||
| @@ -235,7 +236,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| //今日券数据*********************************************** | |||
| private Map<String, Object> couponRunning(String tenantId) { | |||
| private Map<String, Object> couponRunning(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> couponMap = new HashMap<>(); | |||
| Calendar cal = Calendar.getInstance(); | |||
| @@ -249,7 +250,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| Date endTime = cal.getTime(); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.setTenantId(tenantId); | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| wxCouponOrder.setStartTime(startTime); | |||
| wxCouponOrder.setEndTime(endTime); | |||
| long orderedCount = wxCouponOrderMapper.findCount(wxCouponOrder); | |||
| @@ -258,7 +259,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| couponMap.put("verifiedCount", verifiedCount); | |||
| couponMap.put("orderedCount", orderedCount); | |||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | |||
| wxCouponChannel.setTenantId(tenantId); | |||
| wxCouponChannel.updateTenantInfo(tenantEntity); | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| long couponCount = wxCouponChannelMapper.countCoupon(wxCouponChannel); | |||
| couponMap.put("couponCount", couponCount); | |||
| @@ -267,7 +268,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| //今日客流*********************************************** | |||
| private Map<String, Object> visitorRunning(String tenantId) { | |||
| private Map<String, Object> visitorRunning(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> visitorMap = new HashMap<>(); | |||
| visitorMap.put("todayCount", "--"); | |||
| visitorMap.put("increasedPercent", "--"); | |||
| @@ -276,11 +277,11 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| //合同*********************************************** | |||
| private Map<String, Object> contractRunning(String tenantId) { | |||
| private Map<String, Object> contractRunning(TenantEntity tenantEntity) { | |||
| Map<String, Object> contractMap = new HashMap(); | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setTenantId(tenantId); | |||
| wxRentContract.updateTenantInfo(tenantEntity); | |||
| //待签约 | |||
| wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); | |||
| @@ -306,11 +307,11 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| //短信*********************************************** | |||
| private Map<String, Object> messageRunning(String tenantId) { | |||
| private Map<String, Object> messageRunning(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> messageMap = new HashMap<>(); | |||
| WxMsgConfig wxMsgConfig = new WxMsgConfig(); | |||
| wxMsgConfig.setTenantId(wxMsgConfig.getTenantId()); | |||
| wxMsgConfig.updateTenantInfo(tenantEntity); | |||
| List<WxMsgConfig> wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig); | |||
| long usedCount = 0; | |||
| @@ -331,10 +332,10 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| //账单*********************************************** | |||
| private Map<String, Object> billRunning(String tenantId) { | |||
| private Map<String, Object> billRunning(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> billMap = new HashMap<>(); | |||
| WxBillAll record = new WxBillAll(); | |||
| record.setTenantId(tenantId); | |||
| record.updateTenantInfo(tenantEntity); | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.set(Calendar.DAY_OF_YEAR, 1); | |||
| instance.set(Calendar.HOUR_OF_DAY, 0); | |||
| @@ -357,41 +358,41 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| //移动端首页 | |||
| @Override | |||
| public Map<String, Object> queryRunningMobile(String tenantId) { | |||
| public Map<String, Object> queryRunningMobile(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> dataMap = new HashMap<>(); | |||
| dataMap.put("shop", shopRunning(tenantId)); | |||
| dataMap.put("rent", rentRunning(tenantId)); | |||
| dataMap.put("report", reportRunning(tenantId)); | |||
| dataMap.put("car", carRunning(tenantId)); | |||
| dataMap.put("coupon", couponRunning(tenantId)); | |||
| dataMap.put("visitor", visitorRunning(tenantId)); | |||
| dataMap.put("shop", shopRunning(tenantEntity)); | |||
| dataMap.put("rent", rentRunning(tenantEntity)); | |||
| dataMap.put("report", reportRunning(tenantEntity)); | |||
| dataMap.put("car", carRunning(tenantEntity)); | |||
| dataMap.put("coupon", couponRunning(tenantEntity)); | |||
| dataMap.put("visitor", visitorRunning(tenantEntity)); | |||
| return dataMap; | |||
| } | |||
| //登陆页数据快速概览 | |||
| @Override | |||
| public Map<String, Object> queryRunningPotal(String tenantId) { | |||
| public Map<String, Object> queryRunningPotal(TenantEntity tenantEntity) { | |||
| HashMap<String, Object> dataMap = new HashMap<>(); | |||
| dataMap.put("shop", shopRunning(tenantId)); | |||
| dataMap.put("rent", rentRunning(tenantId)); | |||
| dataMap.put("report", reportRunning(tenantId)); | |||
| dataMap.put("car", carRunning(tenantId)); | |||
| dataMap.put("coupon", couponRunning(tenantId)); | |||
| dataMap.put("visitor", visitorRunning(tenantId)); | |||
| dataMap.put("contract", contractRunning(tenantId)); | |||
| dataMap.put("message", messageRunning(tenantId)); | |||
| dataMap.put("bill", billRunning(tenantId)); | |||
| dataMap.put("shop", shopRunning(tenantEntity)); | |||
| dataMap.put("rent", rentRunning(tenantEntity)); | |||
| dataMap.put("report", reportRunning(tenantEntity)); | |||
| dataMap.put("car", carRunning(tenantEntity)); | |||
| dataMap.put("coupon", couponRunning(tenantEntity)); | |||
| dataMap.put("visitor", visitorRunning(tenantEntity)); | |||
| dataMap.put("contract", contractRunning(tenantEntity)); | |||
| dataMap.put("message", messageRunning(tenantEntity)); | |||
| dataMap.put("bill", billRunning(tenantEntity)); | |||
| return dataMap; | |||
| } | |||
| @Override | |||
| public Map<String, Object> queryRunning(String tenantId) { | |||
| public Map<String, Object> queryRunning(TenantEntity tenantEntity) { | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.setTenantId(tenantId); | |||
| wxShop.updateTenantInfo(tenantEntity); | |||
| wxShop.setStatus(EnumShopStatus.RENT.getCode()); | |||
| List<WxShop> yczlist = wxShopMapper.findList(wxShop); | |||
| wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode()); | |||
| @@ -420,7 +421,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| //租金 | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.set(Calendar.DAY_OF_YEAR, 1); | |||
| instance.set(Calendar.HOUR_OF_DAY, 0); | |||
| @@ -454,12 +455,12 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| //上报 | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(tenantId); | |||
| wxMerchant.updateTenantInfo(tenantEntity); | |||
| wxMerchant.setStatus(1); | |||
| List<WxMerchant> merchants = wxMerchantMapper.findList(wxMerchant); | |||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||
| wxMerchantTradeDaily.setTenantId(tenantId); | |||
| wxMerchantTradeDaily.updateTenantInfo(tenantEntity); | |||
| String reportdate = DateUtils.getTimeBefore(1, new Date()); | |||
| wxMerchantTradeDaily.setReportDate(reportdate); | |||
| List<WxMerchantTradeDaily> tradelist = wxMerchantTradeDailyMapper.findList(wxMerchantTradeDaily); | |||
| @@ -480,10 +481,10 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| @Override | |||
| public Map<String, Object> queryCar(String tenantId) { | |||
| public Map<String, Object> queryCar(TenantEntity tenantEntity) { | |||
| logger.info("停车-月统计-开始"); | |||
| HashMap<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| params.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode()); | |||
| String startdate = DateUtils.getTimeBefore(30, new Date()); | |||
| String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); | |||
| @@ -517,7 +518,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| // 查询近一周的缴费车辆----start------ | |||
| logger.info("停车-查询近一周的缴费车辆-开始"); | |||
| HashMap<String, Object> weekParams = new HashMap<>(); | |||
| weekParams.put("tenantId", tenantId); | |||
| weekParams.put("tenantId", tenantEntity.getTenantId()); | |||
| String oneWeekStartdate = DateUtils.getTimeBefore(7, new Date()); | |||
| String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date()); | |||
| weekParams.put("startdate", oneWeekStartdate + " 00:00:00"); | |||
| @@ -576,7 +577,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| logger.info("停车-近一周新增停车会员数-开始"); | |||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |||
| WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | |||
| wxCUserBasicInfoDto.setTenantId(tenantId); | |||
| wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||
| try { | |||
| wxCUserBasicInfoDto.setStartTime(sdf.parse(oneWeekStartdate+ " 00:00:00")); | |||
| wxCUserBasicInfoDto.setEndTime(sdf.parse(oneWeekEndDate+ " 23:59:59")); | |||
| @@ -588,7 +589,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| //停车会员总数 | |||
| logger.info("停车-停车会员总数-开始"); | |||
| wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | |||
| wxCUserBasicInfoDto.setTenantId(tenantId); | |||
| wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||
| datamap.put("newCarUserSumCount",wxCUserCarMapper.countUser(wxCUserBasicInfoDto)); | |||
| logger.info("停车-停车会员总数-结束"); | |||
| @@ -687,7 +688,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| //绑定车牌 | |||
| logger.info("停车-绑定车牌-开始"); | |||
| Map<String,Object> carParams=new HashMap<>(); | |||
| carParams.put("tenantId",tenantId); | |||
| carParams.put("tenantId",tenantEntity.getTenantId()); | |||
| carParams.put("startdate",DateUtils.getSystemTime("yyyy-MM-dd 00:00:00")); | |||
| carParams.put("enddate",DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss")); | |||
| long todaybindcar = wxCUserCarMapper.queryCarCount(carParams); | |||
| @@ -721,9 +722,9 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| @Override | |||
| public Map<String, Object> queryCustomer(String tenantId) { | |||
| public Map<String, Object> queryCustomer(TenantEntity tenantEntity) { | |||
| WxWiWideInfo wiWideInfo = new WxWiWideInfo(); | |||
| wiWideInfo.setTenantId(tenantId); | |||
| wiWideInfo.updateTenantInfo(tenantEntity); | |||
| List<WxWiWideInfo> list = wxWiwideInfoMapper.findList(wiWideInfo); | |||
| Map<String, Object> datamap = new HashMap<>(2); | |||
| if(list.size()>0){ | |||
| @@ -770,9 +771,9 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| @Override | |||
| public ResultData queryCustomerData(String tenantId, Map<String, String> params) { | |||
| public ResultData queryCustomerData(TenantEntity tenantEntity, Map<String, String> params) { | |||
| WxWiWideInfo wiWideInfo = new WxWiWideInfo(); | |||
| wiWideInfo.setTenantId(tenantId); | |||
| wiWideInfo.updateTenantInfo(tenantEntity); | |||
| List<WxWiWideInfo> list = wxWiwideInfoMapper.findList(wiWideInfo); | |||
| if (list.isEmpty()){ | |||
| return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | |||
| @@ -88,7 +88,7 @@ public class MallPermissionServiceImpl implements MallPermissionService { | |||
| public List<Long> queryUserMenuIds(MallUserInfo userInfo, Long parentId, boolean boolNav) { | |||
| List<Long> mpList = new ArrayList<Long>(); | |||
| if(userInfo.isFmSuperAdmin() || | |||
| userInfo.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode())) { | |||
| userInfo.checkAdmin()) { | |||
| List<MallPermission> mps = getAllMenuListByParentId(parentId, null, boolNav); | |||
| mps.stream().forEach(mp->{ | |||
| mpList.add(mp.getId()); | |||
| @@ -110,7 +110,7 @@ public class MallPermissionServiceImpl implements MallPermissionService { | |||
| // 富茂系统管理员,返回所有菜单 | |||
| return getAllMenuListByParentId(parentId, null, boolNav); | |||
| } | |||
| else if(userInfo.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode())) { | |||
| else if(userInfo.checkAdmin()) { | |||
| // 租户超管 | |||
| String menus = wxMallMapper.queryMenusByTenantId(userInfo.getTenantId()); | |||
| JSONArray menuIdList = JSON.parseArray(menus); | |||
| @@ -217,7 +217,7 @@ public class MallUserInfoServiceImpl implements MallUserInfoService { | |||
| try { | |||
| MallUserInfo updateUser = new MallUserInfo(); | |||
| updateUser.setId(user.getId()); | |||
| updateUser.setTenantId(user.getTenantId()); | |||
| updateUser.updateTenantInfo(user); | |||
| updateUser.setPassword(user.getPassword()); | |||
| mallUserInfoMapper.updateById(updateUser); | |||
| } catch (Exception e) { | |||
| @@ -233,7 +233,7 @@ public class MallUserInfoServiceImpl implements MallUserInfoService { | |||
| @Override | |||
| public boolean checkCodeValid(MallUserInfo user, String code) { | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.setTenantId(user.getTenantId()); | |||
| wxMsgValidationcode.updateTenantInfo(user); | |||
| wxMsgValidationcode.setPhone(user.getPhone()); | |||
| wxMsgValidationcode.setCode(code); | |||
| List<WxMsgValidationcode> wxmsgvalidationcodelist = wxMsgValidationcodeMapper.findList(wxMsgValidationcode); | |||
| @@ -3,6 +3,7 @@ package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.PosMallConfig; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.mapper.PosMallConfigMapper; | |||
| import com.iformall.service.PosMallConfigService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -32,6 +33,12 @@ public class PosMallConfigServiceImpl implements PosMallConfigService { | |||
| return config; | |||
| } | |||
| @Override | |||
| public PosMallConfig getByTenantInfo(TenantEntity tenantEntity) { | |||
| PosMallConfig config = posMallConfigMapper.getByTenantInfo(tenantEntity.getTenantId()); | |||
| return config; | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(PosMallConfig record) { | |||
| if (record.getId() == null) { | |||
| @@ -3,11 +3,13 @@ package com.iformall.service.impl; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.PushLimit; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumEnableType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.PushLimitMapper; | |||
| import com.iformall.mapper.WxCouponActionLogMapper; | |||
| import com.iformall.service.PushLimitService; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| @@ -25,7 +27,6 @@ import java.util.Map; | |||
| public class PushLimitServiceImpl implements PushLimitService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| private String keyPrev = "setting:pushlimit:"; | |||
| @Autowired | |||
| PushLimitMapper pushLimitMapper; | |||
| @@ -36,10 +37,16 @@ public class PushLimitServiceImpl implements PushLimitService { | |||
| @Qualifier("pushLimitRedisTemplate") | |||
| private RedisTemplate<String, PushLimit> pushLimitRedisTemplate; | |||
| private String getKey(TenantEntity tenantEntity) { | |||
| StringBuilder sb = new StringBuilder(); | |||
| sb.append(Constant.PUSH_LIMIT_KEY_PREV).append(tenantEntity.getTenantId()); | |||
| return sb.toString(); | |||
| } | |||
| @Override | |||
| public PushLimit getPushLimit(String tenantId) { | |||
| public PushLimit getPushLimit(TenantEntity tenantEntity) { | |||
| // get pushLime from cache | |||
| String key = keyPrev + tenantId; | |||
| String key = getKey(tenantEntity); | |||
| // 缓存存在 | |||
| boolean hasKey = pushLimitRedisTemplate.hasKey(key); | |||
| @@ -50,7 +57,7 @@ public class PushLimitServiceImpl implements PushLimitService { | |||
| } | |||
| PushLimit pushLimit = new PushLimit(); | |||
| pushLimit.setTenantId(tenantId); | |||
| pushLimit.updateTenantInfo(tenantEntity); | |||
| List<PushLimit> list = pushLimitMapper.findList(pushLimit); | |||
| if (list.size() > 0) { | |||
| pushLimit = list.get(0); | |||
| @@ -82,7 +89,7 @@ public class PushLimitServiceImpl implements PushLimitService { | |||
| pushLimitMapper.updateById(record); | |||
| // 缓存存在,删除缓存 | |||
| String key = keyPrev + record.getTenantId(); | |||
| String key = getKey(record); | |||
| boolean hasKey = pushLimitRedisTemplate.hasKey(key); | |||
| if (hasKey) { | |||
| pushLimitRedisTemplate.delete(key); | |||
| @@ -91,10 +98,10 @@ public class PushLimitServiceImpl implements PushLimitService { | |||
| } | |||
| @Override | |||
| public boolean checkSendTime(String tenantId) { | |||
| public boolean checkSendTime(TenantEntity tenantEntity) { | |||
| Date curDate = new Date(); | |||
| // 1. get tenant limit | |||
| PushLimit pushLimit = getPushLimit(tenantId); | |||
| PushLimit pushLimit = getPushLimit(tenantEntity); | |||
| // 1.1 疲劳度是否启用 | |||
| if(pushLimit.getEnable().equals(EnumEnableType.Disable.getCode())) { | |||
| return true; | |||
| @@ -114,10 +121,10 @@ public class PushLimitServiceImpl implements PushLimitService { | |||
| } | |||
| @Override | |||
| public boolean checkMsg(String tenantId) { | |||
| public boolean checkMsg(TenantEntity tenantEntity) { | |||
| Date curDate = new Date(); | |||
| // 1. get tenant limit | |||
| PushLimit pushLimit = getPushLimit(tenantId); | |||
| PushLimit pushLimit = getPushLimit(tenantEntity); | |||
| // 1.1 疲劳度是否启用 | |||
| if(pushLimit.getEnable().equals(EnumEnableType.Disable.getCode())) { | |||
| return true; | |||
| @@ -137,10 +144,10 @@ public class PushLimitServiceImpl implements PushLimitService { | |||
| } | |||
| @Override | |||
| public boolean checkCoupon(String tenantId, Long cUserId, Long couponId) { | |||
| public boolean checkCoupon(TenantEntity tenantEntity, Long cUserId, Long couponId) { | |||
| Date curDate = new Date(); | |||
| // 1. get tenant limit | |||
| PushLimit pushLimit = getPushLimit(tenantId); | |||
| PushLimit pushLimit = getPushLimit(tenantEntity); | |||
| // 1.1 疲劳度是否启用 | |||
| if(pushLimit.getEnable().equals(EnumEnableType.Disable.getCode())) { | |||
| return true; | |||
| @@ -156,7 +163,7 @@ public class PushLimitServiceImpl implements PushLimitService { | |||
| // 3. check 每人每天多少张券 | |||
| Map params = new HashMap<String, Object>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| params.put("cUserId", cUserId); | |||
| int countForUser = wxCouponActionLogMapper.getCountByUser(params); | |||
| if (countForUser >= pushLimit.getCouponAmount()) { | |||
| @@ -58,7 +58,7 @@ public class WxBillActionServiceImpl implements WxBillActionService { | |||
| wxBillAction.setUserId(user.getId()); | |||
| wxBillAction.setUserName(user.getName()); | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| wxBillAction.setTenantId(user.getTenantId()); | |||
| wxBillAction.updateTenantInfo(user); | |||
| wxBillAction.setPayDate(action.getPayDate()); | |||
| Date date = new Date(); | |||
| wxBillAction.setCreatetime(date); | |||
| @@ -136,7 +136,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| @Override | |||
| public Map<String, Object> listAsPage(WxBillAll record, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| if (StringUtils.isNotEmpty(record.getTypeStr())) { | |||
| List<Integer> typeList = JSONArray.parseArray(record.getTypeStr(), Integer.class); | |||
| @@ -375,7 +375,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| datalist.add(wxBillAllVo); | |||
| } | |||
| } | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillAll.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillAll); | |||
| datalist.stream().forEach(e -> { | |||
| //手续费 = 合同应收+手续费+滞纳金 | |||
| cmputeTotalMoney(wxPayAccountBill, e); | |||
| @@ -1867,7 +1867,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| @Override | |||
| public List<WxBillAllVo> allDepositList(WxBillAll wxBillAll) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillAll.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillAll); | |||
| List<WxBillAllVo> wxBillAllVos = wxBillAllMapper.allDepositList(wxBillAll); | |||
| wxBillAllVos.stream().forEach(e -> { | |||
| cmputeTotalMoney(wxPayAccountBill, e); | |||
| @@ -58,7 +58,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| @Override | |||
| public PageInfo<WxBillDaily> listAsPage(WxBillDaily record, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| //分页对象设置页数和条数 | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| //查询 | |||
| @@ -135,7 +135,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| WxBillDaily record = new WxBillDaily(); | |||
| record.setId(id); | |||
| WxBillDaily wxBillDaily = wxBillDailyMapper.queryBillDailyList(record).get(0); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillDaily.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillDaily); | |||
| computeTotalMoney(wxPayAccountBill, wxBillDaily); | |||
| wxBillDaily.setOwe(wxBillDaily.getRealReceivePay() - wxBillDaily.getPay()); | |||
| if (wxBillDaily.getShopId() != null) { | |||
| @@ -277,7 +277,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| } | |||
| @Override | |||
| public void exportTemplate(HttpServletRequest request, HttpServletResponse response, String tenantId) { | |||
| public void exportTemplate(HttpServletRequest request, HttpServletResponse response, MallUserInfo user) { | |||
| List<WxBillDailyVo> list = new ArrayList<>(); | |||
| WxBillDailyVo v1 = new WxBillDailyVo(); | |||
| WxBillDailyVo v2 = new WxBillDailyVo(); | |||
| @@ -359,7 +359,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| @Override | |||
| public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillDaily record) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| List<WxBillDaily> billDailyList = wxBillDailyMapper.queryBillDailyList(record); | |||
| billDailyList.stream().forEach(e->{ | |||
| //手续费 = 合同应收+手续费+滞纳金 | |||
| @@ -50,7 +50,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| @Override | |||
| public PageInfo<WxBillDeposit> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) { | |||
| //WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| //WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<WxBillDeposit> billDepositList = wxBillDepositMapper.queryBillDepositList(record); | |||
| /* billDepositList.stream().forEach(e->{ | |||
| @@ -250,7 +250,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| wxBillAction.setUserId(user.getId()); | |||
| wxBillAction.setUserName(user.getName()); | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| wxBillAction.setTenantId(wxBillDeposit.getTenantId()); | |||
| wxBillAction.updateTenantInfo(wxBillDeposit); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -52,7 +52,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||
| @Override | |||
| public PageInfo<WxBillOtherDeposit> listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| //分页对象设置页数和条数 | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| //查询 | |||
| @@ -130,7 +130,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||
| WxBillOtherDeposit record = new WxBillOtherDeposit(); | |||
| record.setId(id); | |||
| WxBillOtherDeposit wxBillOther = wxBillOtherDepositMapper.queryBillList(record).get(0); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillOther.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillOther); | |||
| computeTotalMoney(wxPayAccountBill, wxBillOther); | |||
| wxBillOther.setOwe(wxBillOther.getRealReceivePay() - wxBillOther.getPay()); | |||
| if (wxBillOther.getShopId() != null) { | |||
| @@ -333,7 +333,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||
| @Override | |||
| public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillOtherDeposit wxBillDeposit) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillDeposit.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillDeposit); | |||
| List<WxBillOtherDeposit> datalist = wxBillOtherDepositMapper.queryBillList(wxBillDeposit); | |||
| datalist.stream().forEach(e->{ | |||
| //手续费 = 合同应收+手续费+滞纳金 | |||
| @@ -52,7 +52,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| @Override | |||
| public PageInfo<WxBillOther> listAsPage(WxBillOther record, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| //分页对象设置页数和条数 | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| //查询 | |||
| @@ -130,7 +130,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| WxBillOther record = new WxBillOther(); | |||
| record.setId(id); | |||
| WxBillOther wxBillOther = wxBillOtherMapper.queryBillList(record).get(0); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillOther.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillOther); | |||
| computeTotalMoney(wxPayAccountBill, wxBillOther); | |||
| wxBillOther.setOwe(wxBillOther.getRealReceivePay() - wxBillOther.getPay()); | |||
| if (wxBillOther.getShopId() != null) { | |||
| @@ -277,7 +277,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| @Override | |||
| public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillOther wxBillOther) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillOther.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillOther); | |||
| List<WxBillOther> datalist = wxBillOtherMapper.queryBillList(wxBillOther); | |||
| datalist.stream().forEach(e->{ | |||
| //手续费 = 合同应收+手续费+滞纳金 | |||
| @@ -48,7 +48,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||
| @Override | |||
| public PageInfo<WxBillPropertyDeposit> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<WxBillPropertyDeposit> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(record); | |||
| /*billDepositList.stream().forEach(e->{ | |||
| @@ -9,6 +9,7 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillActionMapper; | |||
| @@ -58,7 +59,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| @Override | |||
| public PageInfo<WxBillProperty> listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<WxBillProperty> billRentList = wxBillPropertyMapper.queryBillPropertyList(record); | |||
| billRentList.stream().forEach(e -> { | |||
| @@ -139,7 +140,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| record.setId(id); | |||
| WxBillProperty property = wxBillPropertyMapper.queryBillPropertyList(record).get(0); | |||
| //手续费 = 合同应收+手续费+滞纳金 | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(property.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(property); | |||
| computeTotalMoney(wxPayAccountBill, property); | |||
| property.setOwe(property.getRealReceivePay() - property.getPay()); | |||
| return property; | |||
| @@ -247,11 +248,11 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| } | |||
| @Override | |||
| public PageInfo<WxBillProperty> findByPropertyContractId(Long id, String tenantId, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(tenantId); | |||
| public PageInfo<WxBillProperty> findByPropertyContractId(Long id, TenantEntity tenantEntity, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(tenantEntity); | |||
| WxBillProperty record = new WxBillProperty(); | |||
| record.setPropertyContractId(id); | |||
| record.setTenantId(tenantId); | |||
| record.updateTenantInfo(tenantEntity); | |||
| record.setSortColumns(BaseEntity.SortField.Id_ASC); | |||
| updateBillStatus(record); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| @@ -322,7 +323,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| @Override | |||
| public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillProperty wxBillProperty) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillProperty.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillProperty); | |||
| String billName = wxBillProperty.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) ? "商铺物业账单" : "多经点位物业账单"; | |||
| List<WxBillProperty> billPropertyList = wxBillPropertyMapper.queryBillPropertyList(wxBillProperty); | |||
| @@ -61,7 +61,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| @Override | |||
| public PageInfo<WxBillRent> listAsPage(WxBillRent record, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(record); | |||
| @@ -140,7 +140,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| WxBillRent record = new WxBillRent(); | |||
| record.setId(id); | |||
| WxBillRent rent = wxBillRentMapper.queryBillRentList(record).get(0); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| //手续费 = 合同应收+手续费+滞纳金 | |||
| computeTotalMoney(wxPayAccountBill, rent); | |||
| rent.setOwe(rent.getRealReceivePay() - rent.getPay()); | |||
| @@ -229,7 +229,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| wxBillAction.setUserId(user.getId()); | |||
| wxBillAction.setUserName(user.getName()); | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| wxBillAction.setTenantId(wxBillRent.getTenantId()); | |||
| wxBillAction.updateTenantInfo(wxBillRent); | |||
| wxBillAction.setPayDate(wxBillRent.getPayDate()); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| @@ -247,12 +247,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| } | |||
| @Override | |||
| public PageInfo<WxBillRent> findByRentContractId(Long id, String tenantId, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(tenantId); | |||
| WxBillRent record = new WxBillRent(); | |||
| record.setRentContractId(id); | |||
| record.setTenantId(tenantId); | |||
| record.setSortColumns(BaseEntity.SortField.Id_ASC); | |||
| public PageInfo<WxBillRent> findByRentContractId(WxBillRent record, Integer pageIndex, Integer pageSize) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(record); | |||
| billRentList.stream().forEach(e->{ | |||
| @@ -407,7 +403,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| wxBillAction.setUserId(user.getId()); | |||
| wxBillAction.setUserName(user.getName()); | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| wxBillAction.setTenantId(wxBillRent.getTenantId()); | |||
| wxBillAction.updateTenantInfo(wxBillRent); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -433,7 +429,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| @Override | |||
| public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillRent wxBillRent) { | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillRent.getTenantId()); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillRent); | |||
| String billName = wxBillRent.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) ? "商铺租金账单" : "多经点位租金账单"; | |||
| List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(wxBillRent); | |||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxBrand; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.enums.EnumDelFlag; | |||
| @@ -97,16 +98,15 @@ public class WxBrandServiceImpl implements WxBrandService { | |||
| } | |||
| @Override | |||
| public List<Map<String,Object>> queryBrand(String tenantId) { | |||
| return wxBrandMapper.queryBrand(tenantId); | |||
| public List<Map<String,Object>> queryBrand(TenantEntity tenantEntity) { | |||
| WxBrand wxBrand = new WxBrand() {{ | |||
| updateTenantInfo(tenantEntity); | |||
| }}; | |||
| return wxBrandMapper.queryBrandByTenant(wxBrand); | |||
| } | |||
| @Override | |||
| public ResultData hasBrand(String tenantId, String name, Long id) { | |||
| WxBrand wxBrand = new WxBrand(); | |||
| wxBrand.setTenantId(tenantId); | |||
| wxBrand.setName(name); | |||
| wxBrand.setId(id); | |||
| public ResultData hasBrand(WxBrand wxBrand) { | |||
| int count = wxBrandMapper.hasBrand(wxBrand); | |||
| return new ResultData(ResultData.SUCCESS, "查询成功", count > 0 ? true : false); | |||
| } | |||
| @@ -18,6 +18,7 @@ import com.iformall.mapper.WxCouponChannelMapper; | |||
| import com.iformall.service.QrCodeService; | |||
| import com.iformall.service.WxCampaignService; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.utils.Constant; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| @@ -255,7 +256,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||
| wxCouponChannel.setCouponId(couponId); | |||
| wxCouponChannel.setType(wxCoupon.getType()); | |||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | |||
| wxCouponChannel.setTenantId(wxCoupon.getTenantId()); | |||
| wxCouponChannel.updateTenantInfo(wxCoupon); | |||
| wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | |||
| wxCouponChannel.setSubBusiness(wxCoupon.getSubBusiness()); | |||
| wxCouponChannel.setTitle(wxCoupon.getTitle()); | |||
| @@ -264,7 +265,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||
| wxCouponChannel.setId(idWorker.nextId()); | |||
| wxCouponChannelMapper.insert(wxCouponChannel); | |||
| String pageUrl = "pages/index/index"; | |||
| String pageUrl = Constant.mainPageUrl; | |||
| WxCouponChannel couponChannel = new WxCouponChannel(); | |||
| couponChannel.setId(wxCouponChannel.getId()); | |||
| couponChannel.setType(wxCouponChannel.getType()); | |||
| @@ -78,7 +78,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| public WxCouponMerchant checkMerchantInCoupon(WxCardInfo cardInfo, Long merchantId) { | |||
| WxCouponMerchant couponMerchant = null; | |||
| WxCouponMerchant couponMerchantQ = new WxCouponMerchant(); | |||
| couponMerchantQ.setTenantId(cardInfo.getTenantId()); | |||
| couponMerchantQ.updateTenantInfo(cardInfo); | |||
| couponMerchantQ.setProductId(cardInfo.getCouponId()); | |||
| couponMerchantQ.setMerchantId(merchantId); | |||
| couponMerchantQ.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||
| @@ -116,7 +116,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // 3. get pay account | |||
| WxPayAccount payAccount = null; | |||
| WxPayAccount payAccountQ = new WxPayAccount(); | |||
| payAccountQ.setTenantId(record.getTenantId()); | |||
| payAccountQ.updateTenantInfo(record); | |||
| try { | |||
| payAccount = payAccountMapper.selectOne(new QueryWrapper(payAccountQ)); | |||
| } catch (Exception e) { | |||
| @@ -139,7 +139,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // 5 insert card_spend | |||
| record.setId(idWorker.nextId()); | |||
| record.setTenantId(cardInfo.getTenantId()); | |||
| record.updateTenantInfo(cardInfo); | |||
| record.setPayFrom(EnumCardSpendFrom.C.getCode()); | |||
| record.setPayment(payment); | |||
| record.setRealPayment(real_payment); | |||
| @@ -160,7 +160,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // 6. update order status | |||
| WxOrder orderUpdate = new WxOrder(); | |||
| orderUpdate.setId(order.getId()); | |||
| orderUpdate.setTenantId(record.getTenantId()); | |||
| orderUpdate.updateTenantInfo(record); | |||
| orderUpdate.setCUserId(record.getOwnerId()); | |||
| orderUpdate.setPaymentTime(curDate); | |||
| orderUpdate.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); | |||
| @@ -211,7 +211,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| Integer realSubsidyFee = subsidyFee - iSubChargeFee; | |||
| WxMerchantSubsidy merchantSubsidy = new WxMerchantSubsidy(); | |||
| merchantSubsidy.setId(idWorker.nextId()); | |||
| merchantSubsidy.setTenantId(record.getTenantId()); | |||
| merchantSubsidy.updateTenantInfo(record); | |||
| merchantSubsidy.setOrderId(order.getId()); | |||
| merchantSubsidy.setOrderType(EnumOrderType.PREPAIDCARD.getCode()); | |||
| merchantSubsidy.setMerchantId(record.getMerchantId()); | |||
| @@ -248,7 +248,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| if (payAccount.checkShare()) { | |||
| // 9. 分账 | |||
| try { | |||
| shareForCardPay(record.getTenantId(), record.getCardId(), record.getOrderId(), record.getId()); | |||
| shareForCardPay(record, record.getCardId(), record.getOrderId(), record.getId()); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| if (ErrorCode.PROFIT_SHARING_NUM_UP_LIMIT.getCode() == e.getErrorCode()) { | |||
| @@ -289,7 +289,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| creditHistory.setOperatorId(record.getOwnerId()); | |||
| creditHistory.setCUserId(record.getOwnerId()); | |||
| creditHistory.setCreateDate(new Date()); | |||
| creditHistory.setTenantId(record.getTenantId()); | |||
| creditHistory.updateTenantInfo(record); | |||
| creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); | |||
| creditHistory.setBusinessId(coupon.getBusiness()); | |||
| creditHistory.setSpend(real_payment); | |||
| @@ -306,7 +306,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| public void creteMerchantSubsidy(WxCardSpend record, Date curDate, IdWorker idWorker, WxCoupon coupon, Integer payment) { | |||
| WxMerchantSubsidy merchantSubsidy = new WxMerchantSubsidy(); | |||
| merchantSubsidy.setId(idWorker.nextId()); | |||
| merchantSubsidy.setTenantId(record.getTenantId()); | |||
| merchantSubsidy.updateTenantInfo(record); | |||
| merchantSubsidy.setOrderId(record.getOrderId()); | |||
| merchantSubsidy.setOrderType(EnumOrderType.PREPAIDCARD.getCode()); | |||
| merchantSubsidy.setMerchantId(record.getMerchantId()); | |||
| @@ -394,11 +394,11 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| } | |||
| @Override | |||
| public int finishCard(TenantEntity tenantEntity, Long cardId) { | |||
| public int finishCard(WxCardInfo wxCardInfo) { | |||
| // admin用户手动帮已用卡消费用户退卡, 此卡需要分账完结, 买卡的钱进商场账户 | |||
| WxCardInfo cardInfo = null; | |||
| try { | |||
| cardInfo = wxCardInfoMapper.selectById(cardId); | |||
| cardInfo = wxCardInfoMapper.selectById(wxCardInfo.getId()); | |||
| } catch (Exception e) { | |||
| logger.error("微信分账: " + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), e.getMessage()); | |||
| @@ -426,7 +426,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // 分账完结 | |||
| WxSharingOrderDto shareOrder = new WxSharingOrderDto(); | |||
| shareOrder.setCUserId(couponOrder.getOwnerId()); | |||
| shareOrder.updateTenantInfo(tenantEntity); | |||
| shareOrder.updateTenantInfo(wxCardInfo); | |||
| shareOrder.setMerchantId(0L); // 卡完结,默认给0 | |||
| shareOrder.setTransactionId(cardInfo.getTransactionId()); | |||
| cardShareFinished(cardInfo, shareOrder); | |||
| @@ -448,12 +448,12 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| @Override | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| public void shareForCardPay(String tenantId, Long cardId, Long orderId, Long cardSpendId) { | |||
| // 微信已分账检查次数 | |||
| public void shareForCardPay(TenantEntity tenantEntity, Long cardId, Long orderId, Long cardSpendId) { | |||
| // 微信已分账检查次数 | |||
| int psNum = 0; | |||
| try { | |||
| WxCardSpend cardSpendQ = new WxCardSpend(); | |||
| cardSpendQ.setTenantId(tenantId); | |||
| cardSpendQ.updateTenantInfo(tenantEntity); | |||
| cardSpendQ.setCardId(cardId); | |||
| psNum = wxCardSpendMapper.selectCount(new QueryWrapper(cardSpendQ)); | |||
| if (psNum > 20) { | |||
| @@ -470,7 +470,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // 微信分账 | |||
| try { | |||
| WxCardSpend cardSpend = new WxCardSpend(); | |||
| cardSpend.setTenantId(tenantId); | |||
| cardSpend.updateTenantInfo(tenantEntity); | |||
| cardSpend.setId(cardSpendId); | |||
| cardSpend.setCardId(cardId); | |||
| cardSpend.setOrderId(orderId); | |||
| @@ -493,7 +493,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| shareOrder.setOrderId(cardSpendId); | |||
| shareOrder.setPayTimeStart(cardSpend.getCreateDate()); | |||
| shareOrder.setPayTimeEnd(cardSpend.getUpdateDate()); | |||
| shareOrder.setTenantId(tenantId); | |||
| shareOrder.updateTenantInfo(tenantEntity); | |||
| shareOrder.setTransactionId(cardInfo.getTransactionId()); | |||
| shareOrder.setShareAmount(cardSpend.getRealPayment()); | |||
| ResultData resultData = profitSharingOrderService.createSharingOrder(shareOrder); | |||
| @@ -543,7 +543,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // card spend 添加一条 记录] | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxCardSpend cardSpend = new WxCardSpend(); | |||
| cardSpend.setTenantId(cardInfo.getTenantId()); | |||
| cardSpend.updateTenantInfo(cardInfo); | |||
| cardSpend.setId(idWorker.nextId()); | |||
| cardSpend.setCardId(cardInfo.getId()); | |||
| cardSpend.setOrderId(null); | |||
| @@ -660,7 +660,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // 5 insert card_spend | |||
| record.setId(idWorker.nextId()); | |||
| record.setTenantId(cardInfo.getTenantId()); | |||
| record.updateTenantInfo(cardInfo); | |||
| record.setPayment(payment); | |||
| record.setRealPayment(real_payment); | |||
| record.setCardBeforeAmount(cardInfo.getRemainingAmount()); | |||
| @@ -754,7 +754,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| } | |||
| // 100. delete prev card_spend | |||
| record.setTenantId(cardInfo.getTenantId()); | |||
| record.updateTenantInfo(cardInfo); | |||
| try { | |||
| wxCardSpendMapper.deleteForPrevCancel(record); | |||
| } catch (Exception e) { | |||
| @@ -807,7 +807,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // 3. get pay account | |||
| WxPayAccount payAccount = null; | |||
| WxPayAccount payAccountQ = new WxPayAccount(); | |||
| payAccountQ.setTenantId(record.getTenantId()); | |||
| payAccountQ.updateTenantInfo(record); | |||
| try { | |||
| payAccount = payAccountMapper.selectOne(new QueryWrapper(payAccountQ)); | |||
| } catch (Exception e) { | |||
| @@ -826,7 +826,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| Integer realSubsidyFee = subsidyFee - iSubChargeFee; | |||
| WxMerchantSubsidy merchantSubsidy = new WxMerchantSubsidy(); | |||
| merchantSubsidy.setId(idWorker.nextId()); | |||
| merchantSubsidy.setTenantId(record.getTenantId()); | |||
| merchantSubsidy.updateTenantInfo(record); | |||
| merchantSubsidy.setOrderId(record.getOrderId()); | |||
| merchantSubsidy.setOrderType(EnumOrderType.PREPAIDCARD.getCode()); | |||
| merchantSubsidy.setMerchantId(record.getMerchantId()); | |||
| @@ -859,7 +859,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| // 9. 分账 | |||
| try { | |||
| shareForCardPay(record.getTenantId(), record.getCardId(), record.getOrderId(), record.getId()); | |||
| shareForCardPay(record, record.getCardId(), record.getOrderId(), record.getId()); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| if (ErrorCode.PROFIT_SHARING_NUM_UP_LIMIT.getCode() == e.getErrorCode()) { | |||
| @@ -874,7 +874,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| try { | |||
| WxOrder orderUpdate = new WxOrder(); | |||
| orderUpdate.setId(record.getOrderId()); | |||
| orderUpdate.setTenantId(record.getTenantId()); | |||
| orderUpdate.updateTenantInfo(record); | |||
| orderUpdate.setCUserId(record.getOwnerId()); | |||
| orderUpdate.setPayment(record.getRealPayment()); | |||
| orderUpdate.setPaymentTime(record.getUpdateDate()); | |||
| @@ -893,7 +893,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| creditHistory.setOperatorId(buUser.getId()); | |||
| creditHistory.setCUserId(record.getOwnerId()); | |||
| creditHistory.setCreateDate(new Date()); | |||
| creditHistory.setTenantId(record.getTenantId()); | |||
| creditHistory.updateTenantInfo(record); | |||
| creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); | |||
| creditHistory.setBusinessId(merchant.getBusinessId()); | |||
| creditHistory.setSpend(record.getRealPayment()); | |||
| @@ -2020,8 +2020,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| HashMap<String, Object> datamap = new HashMap<>(); | |||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||
| dto.updateTenantInfo(tenantEntity); | |||
| dto.setStartTime(DateUtils.stringToDate(startdate + " 00:00:00")); | |||
| dto.setEndTime(DateUtils.stringToDate(enddate + " 23:59:59")); | |||
| dto.setStartTime(DateUtils.stringToDate(startdate)); | |||
| dto.setEndTime(DateUtils.stringToDate(enddate)); | |||
| long all = wxCUserBasicInfoMapper.findCount(dto); | |||
| List<UserStructureVo> vos = new ArrayList<>(); | |||
| Calendar c = Calendar.getInstance(); | |||
| @@ -2047,8 +2047,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| private ResultData getMemberBindCar(TenantEntity tenantEntity, String startdate, String enddate) { | |||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||
| dto.updateTenantInfo(tenantEntity); | |||
| dto.setStartTime(DateUtils.stringToDate(startdate + " 00:00:00")); | |||
| dto.setEndTime(DateUtils.stringToDate(enddate + " 23:59:59")); | |||
| dto.setStartTime(DateUtils.stringToDate(startdate)); | |||
| dto.setEndTime(DateUtils.stringToDate(enddate)); | |||
| long total = wxCUserBasicInfoMapper.findCount(dto); | |||
| long userCountWithCar = wxCUserCarMapper.countUser(dto); | |||
| Map userWithCar = new HashMap(); | |||
| @@ -2084,8 +2084,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| HashMap<String, Object> datamap = new HashMap<>(); | |||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||
| dto.updateTenantInfo(tenantEntity); | |||
| dto.setStartTime(DateUtils.stringToDate(startdate + " 00:00:00")); | |||
| dto.setEndTime(DateUtils.stringToDate(enddate + " 23:59:59")); | |||
| dto.setStartTime(DateUtils.stringToDate(startdate)); | |||
| dto.setEndTime(DateUtils.stringToDate(enddate)); | |||
| long all = wxCUserBasicInfoMapper.findCount(dto); | |||
| List<UserStructureVo> vos = new ArrayList<>(); | |||
| Calendar c = Calendar.getInstance(); | |||
| @@ -2117,8 +2117,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| for (int i = 0; i < levelList.size(); i++) { | |||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||
| dto.updateTenantInfo(tenantEntity); | |||
| dto.setStartTime(DateUtils.stringToDate(startdate + " 00:00:00")); | |||
| dto.setEndTime(DateUtils.stringToDate(enddate + " 23:59:59")); | |||
| dto.setStartTime(DateUtils.stringToDate(startdate)); | |||
| dto.setEndTime(DateUtils.stringToDate(enddate)); | |||
| if (i + 1 < levelList.size()) { | |||
| dto.setLevelStartScore(levelList.get(i).getPoints()); | |||
| dto.setLevelEndScore(levelList.get(i + 1).getPoints()); | |||
| @@ -2150,8 +2150,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| private ResultData getMobileBrandAnalysis(TenantEntity tenantEntity, String startdate, String enddate) { | |||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||
| dto.updateTenantInfo(tenantEntity); | |||
| Date startTime = DateUtils.stringToDate(startdate + " 00:00:00"); | |||
| Date endTime = DateUtils.stringToDate(enddate + " 23:59:59"); | |||
| Date startTime = DateUtils.stringToDate(startdate); | |||
| Date endTime = DateUtils.stringToDate(enddate); | |||
| dto.setStartTime(startTime); | |||
| dto.setEndTime(endTime); | |||
| long total = wxCUserBasicInfoMapper.findCount(dto); | |||
| @@ -2187,8 +2187,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| private ResultData getMemActivity(TenantEntity tenantEntity, String startdate, String enddate) { | |||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||
| dto.updateTenantInfo(tenantEntity); | |||
| Date startTime = DateUtils.stringToDate(startdate + " 00:00:00"); | |||
| Date endTime = DateUtils.stringToDate(enddate + " 23:59:59"); | |||
| Date startTime = DateUtils.stringToDate(startdate); | |||
| Date endTime = DateUtils.stringToDate(enddate); | |||
| dto.setStartTime(startTime); | |||
| dto.setEndTime(endTime); | |||
| long total = wxCUserBasicInfoMapper.findCount(dto); | |||
| @@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxCouponActionLog; | |||
| import com.iformall.domain.vo.WxCouponActionLogVo; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -55,23 +56,23 @@ public class WxCouponActionLogServiceImpl implements WxCouponActionLogService { | |||
| } | |||
| @Override | |||
| public void addOne(String tenantId, Long couponId, Long coupon_order_id, int channelType, Long channelId) { | |||
| public void addOne(TenantEntity tenantEntity, Long couponId, Long coupon_order_id, int channelType, Long channelId) { | |||
| Date curDate = new Date(); | |||
| WxCouponActionLog actionLog = new WxCouponActionLog(); | |||
| actionLog.setTenantId(tenantId); | |||
| actionLog.setCouponId(couponId); | |||
| actionLog.setChannelId(channelId); | |||
| actionLog.setCouponOrderId(coupon_order_id); | |||
| actionLog.setChannelType(channelType); | |||
| actionLog.setCreateTime(curDate); | |||
| actionLog.setCreateTimeMd(new SimpleDateFormat("MM/dd").format(curDate)); | |||
| ; | |||
| WxCouponActionLog actionLog = new WxCouponActionLog() {{ | |||
| updateTenantInfo(tenantEntity); | |||
| setCouponId(couponId); | |||
| setChannelId(channelId); | |||
| setCouponOrderId(coupon_order_id); | |||
| setChannelType(channelType); | |||
| setCreateTime(curDate); | |||
| setCreateTimeMd(new SimpleDateFormat("MM/dd").format(curDate)); | |||
| }}; | |||
| saveOrUpdate(actionLog); | |||
| } | |||
| @Override | |||
| public int getCountByChannelId(String tenantId, int channelType, Long channelId) { | |||
| return wxCouponActionLogMapper.getCountByChannelId(tenantId, channelType, channelId); | |||
| public int getCountByChannelId(TenantEntity tenantEntity, int channelType, Long channelId) { | |||
| return wxCouponActionLogMapper.getCountByChannelId(tenantEntity.getTenantId(), channelType, channelId); | |||
| } | |||
| @Override | |||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| @@ -15,6 +16,7 @@ import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.JsonUtil; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -95,7 +97,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| //查找是否该券 在该频道有其他上架 | |||
| WxCouponChannel query = new WxCouponChannel(); | |||
| query.setTenantId(orignal.getTenantId()); | |||
| query.updateTenantInfo(orignal); | |||
| query.setCouponId(orignal.getCouponId()); | |||
| query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());//已上架 | |||
| query.setTargetAd(orignal.getTargetAd()); | |||
| @@ -111,7 +113,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| && record.getStatus().equals(EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode())) { | |||
| wxScreenAdService.updateStatusByCouponChannelId(record.getId(),record,EnumScreenAdStatus.INVALID.getCode()); | |||
| //下架拼团券 | |||
| wxOrderService.updateOrderGroupStatusByCouponChannelId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||
| wxOrderService.updateOrderGroupStatusByCouponChannelId(record.getId(), record, EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||
| //修改卡状态 | |||
| wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId()); | |||
| //浮层下架 | |||
| @@ -139,13 +141,13 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| } | |||
| @Override | |||
| public ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime) { | |||
| public ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date beginTime, Date endTime) { | |||
| List<WxCouponChannelAddVo> errorList = new ArrayList<>(); | |||
| for (String targetIdstr:channelId) { | |||
| Integer targetId = Integer.parseInt(targetIdstr); | |||
| for (String couponidstr:ids) { | |||
| Long couponid = Long.parseLong(couponidstr); | |||
| WxCouponChannelAddVo vo = addCouponChannel(couponid,targetId,tanantId,beginTime,endTime); | |||
| WxCouponChannelAddVo vo = addCouponChannel(couponid,targetId,tenantEntity,beginTime,endTime); | |||
| if(!vo.isSuc()){ | |||
| errorList.add(vo); | |||
| } | |||
| @@ -159,9 +161,9 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| } | |||
| @Override | |||
| public void updateStatusByCouponId(Long couponId, String tenantId, int status) { | |||
| public void updateStatusByCouponId(Long couponId, TenantEntity tenantEntity, int status) { | |||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | |||
| wxCouponChannel.setTenantId(tenantId); | |||
| wxCouponChannel.updateTenantInfo(tenantEntity); | |||
| wxCouponChannel.setStatus(status); | |||
| wxCouponChannel.setCouponId(couponId); | |||
| wxCouponChannel.setUpdateDate(new Date()); | |||
| @@ -207,7 +209,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| return false; | |||
| } | |||
| public WxCouponChannelAddVo addCouponChannel(Long couponid,Integer channelId,String tanantId,Date beginTime,Date endTime){ | |||
| public WxCouponChannelAddVo addCouponChannel(Long couponid,Integer channelId, TenantEntity tenantEntity,Date beginTime,Date endTime){ | |||
| WxCouponChannelAddVo vo = new WxCouponChannelAddVo(); | |||
| @@ -220,7 +222,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| } | |||
| WxCouponChannel wxCouponChannelQuery = new WxCouponChannel(); | |||
| wxCouponChannelQuery.setTenantId(tanantId); | |||
| wxCouponChannelQuery.updateTenantInfo(tenantEntity); | |||
| wxCouponChannelQuery.setCouponId(couponid); | |||
| wxCouponChannelQuery.setTargetAd(channelId); | |||
| wxCouponChannelQuery.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| @@ -274,7 +276,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| wxCouponChannel.setCouponId(couponid); | |||
| wxCouponChannel.setType(wxCoupon.getType()); | |||
| wxCouponChannel.setTargetAd(channelId); | |||
| wxCouponChannel.setTenantId(tanantId); | |||
| wxCouponChannel.updateTenantInfo(tenantEntity); | |||
| wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | |||
| wxCouponChannel.setSubBusiness(wxCoupon.getSubBusiness()); | |||
| wxCouponChannel.setTitle(wxCoupon.getTitle()); | |||
| @@ -284,7 +286,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| vo.setType(channel.getType()); | |||
| vo.setSuc(true); | |||
| String pageUrl = "pages/index/index"; | |||
| String pageUrl = Constant.mainPageUrl; | |||
| WxCouponChannel couponChannel = new WxCouponChannel(); | |||
| couponChannel.setId(vo.getId()); | |||
| couponChannel.setType(vo.getType()); | |||
| @@ -95,7 +95,7 @@ public class WxCouponInjectServiceImpl implements WxCouponInjectService { | |||
| public ResultData add(WxCouponInject record) { | |||
| try { | |||
| pushLimitService.checkSendTime(record.getTenantId()); | |||
| pushLimitService.checkSendTime(record); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(),e.getMessage()); | |||
| @@ -261,7 +261,7 @@ public class WxCouponInjectServiceImpl implements WxCouponInjectService { | |||
| boolean checkLimit = false; | |||
| // 检查疲劳度 | |||
| try { | |||
| checkLimit = pushLimitService.checkCoupon(tempCUser.getTenantId(), tempCUser.getId(), wxCoupon.getId()); | |||
| checkLimit = pushLimitService.checkCoupon(wxCoupon, tempCUser.getId(), wxCoupon.getId()); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| @@ -273,7 +273,7 @@ public class WxCouponInjectServiceImpl implements WxCouponInjectService { | |||
| try { | |||
| couponOrder = wxOrderService.sendFreeCouponToUser(tempCUser.getId(), wxCoupon.getId(),null); | |||
| if (couponOrder != null) { | |||
| wxCouponActionLogService.addOne(tempCUser.getTenantId(), wxCoupon.getId(), couponOrder.getId(), EnumCouponSendSendType.INJECT.getCode(), couponInjectId); | |||
| wxCouponActionLogService.addOne(couponOrder, wxCoupon.getId(), couponOrder.getId(), EnumCouponSendSendType.INJECT.getCode(), couponInjectId); | |||
| } | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| @@ -24,6 +24,7 @@ import com.iformall.mapper.*; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.pay.WxPayConstant; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.PayUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @@ -420,7 +421,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| creditHistory.setOperatorId(cuUser.getId()); | |||
| creditHistory.setCUserId(couponOrder.getcUserId()); | |||
| creditHistory.setCreateDate(new Date()); | |||
| creditHistory.setTenantId(couponOrder.getTenantId()); | |||
| creditHistory.updateTenantInfo(couponOrder); | |||
| creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); | |||
| creditHistory.setCouponId(wxCoupon.getId()); | |||
| creditHistory.setBusinessId(wxCoupon.getBusiness()); | |||
| @@ -432,10 +433,10 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| } | |||
| @Override | |||
| public void sendInsideCouponVerifyMsg(String tenantId, Long couponOrderId, Long buUserId) { | |||
| public void sendInsideCouponVerifyMsg(TenantEntity tenantEntity, Long couponOrderId, Long buUserId) { | |||
| FmInsideCouponVerifyMsg verifyMsg = new FmInsideCouponVerifyMsg(); | |||
| verifyMsg.setMsgType(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode()); | |||
| verifyMsg.setTenantId(tenantId); | |||
| verifyMsg.updateTenantInfo(tenantEntity); | |||
| verifyMsg.setCouponOrderId(couponOrderId); | |||
| verifyMsg.setBUserId(buUserId); | |||
| mqBaseProducer.sendMessage(verifyMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| @@ -652,7 +653,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| } | |||
| @Override | |||
| public boolean sendCouponAfterMicroPay(String tenantId, Long orderId, Long cUserId) { | |||
| public boolean sendCouponAfterMicroPay(TenantEntity tenantEntity, Long orderId, Long cUserId) { | |||
| // B端刷卡支付发券 | |||
| WxOrder wxOrder = wxOrderMapper.selectById(orderId); | |||
| if (wxOrder != null) { | |||
| @@ -707,10 +708,10 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| } | |||
| boolean bUsed = false; | |||
| String gotopage = "pages/index/index"; | |||
| String gotopage = Constant.mainPageUrl; | |||
| if (couponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()) { | |||
| if (hadSentCoupon) { | |||
| gotopage = "pages/index/index?type=mc"; | |||
| gotopage = Constant.mainPageUrl + "?type=mc"; | |||
| } | |||
| bUsed = true; | |||
| } | |||
| @@ -1063,7 +1064,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| WxCardTransferInfo wxCardTransferInfo = new WxCardTransferInfo(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxCardTransferInfo.setId(idWorker.nextId()); | |||
| wxCardTransferInfo.setTenantId(cardCVo.getTenantId()); | |||
| wxCardTransferInfo.updateTenantInfo(couponOrder); | |||
| wxCardTransferInfo.setCouponOrderId(couponOrder.getId()); | |||
| wxCardTransferInfo.setFromUser(couponOrder.getCUserId()); | |||
| wxCardTransferInfo.setToUser(couponOrder.getOwnerId()); | |||
| @@ -33,7 +33,6 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||
| @Autowired | |||
| ExcelService excelService; | |||
| @Override | |||
| public PageInfo<WxCouponPassword> listAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponPasswordMapper.findList(record)); | |||
| @@ -9,6 +9,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.msg.AppUniformMsg; | |||
| import com.iformall.domain.po.msg.MpAppMsg; | |||
| import com.iformall.domain.po.msg.WxMsgRecord; | |||
| @@ -18,6 +19,7 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @@ -102,7 +104,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| record.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendMapper.findListVo(record)); | |||
| for (WxCouponSendVo cs:pageInfo.getList()) | |||
| cs.setSendCount(wxCouponActionLogService.getCountByChannelId(record.getTenantId(), cs.getSendType(), cs.getId())); | |||
| cs.setSendCount(wxCouponActionLogService.getCountByChannelId(record, cs.getSendType(), cs.getId())); | |||
| } | |||
| return pageInfo; | |||
| } | |||
| @@ -117,7 +119,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| public void saveOrUpdate(WxCouponSend record) { | |||
| //会员生日券配置 | |||
| if (Objects.equals(record.getSendType(), EnumCouponSendSendType.BIRTHDAY.getCode())) { | |||
| WxCouponSend config = getConfig(record.getSendType(), record.getTenantId()); | |||
| WxCouponSend config = getConfig(record.getSendType(), record); | |||
| if (Objects.nonNull(config)) { | |||
| record.setConditions(config.getConditions()); | |||
| } | |||
| @@ -288,7 +290,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| public boolean sendCouponToUser(EnumCouponSendSendType type, Object param) { | |||
| String tenantId; | |||
| TenantEntity tenantEntity; | |||
| Long cUserId; | |||
| switch (type) { | |||
| case CAR_STOP: | |||
| @@ -296,7 +298,8 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| return false; | |||
| WxCUserCar wxCUserCar = (WxCUserCar) param; | |||
| cUserId = wxCUserCar.getCUserId(); | |||
| tenantId = wxCUserCar.getTenantId(); | |||
| tenantEntity = new TenantEntity(); | |||
| tenantEntity.updateTenantInfo(wxCUserCar); | |||
| break; | |||
| case COUPON_VERIFY: | |||
| case B_MICROPAY: | |||
| @@ -305,7 +308,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| return false; | |||
| WxOrder order = (WxOrder) param; | |||
| cUserId = order.getCUserId(); | |||
| tenantId = order.getTenantId(); | |||
| tenantEntity = order; | |||
| break; | |||
| default: | |||
| return false; | |||
| @@ -320,7 +323,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| //查询开关是否打开 | |||
| WxCouponSendConfig wxCouponSendConfig = new WxCouponSendConfig(); | |||
| wxCouponSendConfig.setSendType(type.getCode()); | |||
| wxCouponSendConfig.setTenantId(tenantId); | |||
| wxCouponSendConfig.updateTenantInfo(tenantEntity); | |||
| List<WxCouponSendConfig> configList = wxCouponSendConfigMapper.findList(wxCouponSendConfig); | |||
| if (configList.size() > 0) { | |||
| WxCouponSendConfig config = configList.get(0); | |||
| @@ -332,7 +335,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| boolean checkTime = false; | |||
| try { | |||
| checkTime = pushLimitService.checkSendTime(tenantId); | |||
| checkTime = pushLimitService.checkSendTime(tenantEntity); | |||
| if (!checkTime) | |||
| return false; | |||
| } catch (MallinkException e) { | |||
| @@ -343,7 +346,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| boolean bRet = false; | |||
| WxCouponSend wxCouponSendQuery = new WxCouponSend(); | |||
| wxCouponSendQuery.setTenantId(tenantId); | |||
| wxCouponSendQuery.updateTenantInfo(tenantEntity); | |||
| wxCouponSendQuery.setSendType(type.getCode()); | |||
| wxCouponSendQuery.setStatus(EnumCouponSendStatus.VALID.getCode()); | |||
| @@ -352,7 +355,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| boolean checkLimit = false; | |||
| // 检查疲劳度 | |||
| try { | |||
| checkLimit = pushLimitService.checkCoupon(tenantId, cUserId, send.getCouponId()); | |||
| checkLimit = pushLimitService.checkCoupon(tenantEntity, cUserId, send.getCouponId()); | |||
| } catch (MallinkException e) { | |||
| logger.error("券达到limit: " + e.getMessage()); | |||
| } | |||
| @@ -371,7 +374,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| if (couponOrder != null) { | |||
| bRet = true; | |||
| wxCouponActionLogService.addOne(tenantId, send.getCouponId(), couponOrder.getId(), type.getCode(), send.getId()); | |||
| wxCouponActionLogService.addOne(couponOrder, send.getCouponId(), couponOrder.getId(), type.getCode(), send.getId()); | |||
| // 查找cUser | |||
| WxCUser user = wxCUserMapper.selectById(cUserId); | |||
| @@ -381,7 +384,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| // 发送消息 | |||
| if (couponOrder != null) { | |||
| sendMsgForSendCoupon(tenantId, send, couponOrder, user); | |||
| sendMsgForSendCoupon(couponOrder, send, couponOrder, user); | |||
| } | |||
| bRet = true; | |||
| @@ -396,7 +399,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| return bRet; | |||
| } | |||
| private void sendMsgForSendCoupon(String tenantId, WxCouponSend send, WxCouponOrder couponOrder, WxCUser user) { | |||
| private void sendMsgForSendCoupon(TenantEntity tenantEntity, WxCouponSend send, WxCouponOrder couponOrder, WxCUser user) { | |||
| // 发送微信模板消息(公众号模板消息/小程序统一消息/小程序模板消息) | |||
| sendMpMsgForSendCoupon(send, couponOrder, user); | |||
| @@ -411,7 +414,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| String phone = user.getPhone(); | |||
| //小程序名称 | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(tenantId); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(tenantEntity.getTenantId()); | |||
| String appName = appInfo.getName(); | |||
| Map<String, String> msgReplaceMap = new HashMap(); | |||
| msgReplaceMap.put("title", title); | |||
| @@ -421,7 +424,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.COUPON_SEND.getCode()); | |||
| wxMsgRecord.setReceiver(phone); | |||
| wxMsgRecord.setTenantId(tenantId); | |||
| wxMsgRecord.updateTenantInfo(tenantEntity); | |||
| wxMsgRecord.setDynamicContentMap(msgReplaceMap); | |||
| mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| logger.info("》》》》》》》》》》》"); | |||
| @@ -433,7 +436,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| private boolean sendMpMsgForSendCoupon(WxCouponSend send, WxCouponOrder couponOrder, WxCUser user) { | |||
| // 发送 公众号 模板消息 | |||
| SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); | |||
| String gotopage = "pages/index/index?type=mc"; | |||
| String gotopage = Constant.mainPageUrl + "?type=mc"; | |||
| // 7. 公众号消息 | |||
| if (StringUtils.isNotBlank(user.getMpAppId()) && | |||
| StringUtils.isNotBlank(user.getMpOpenId()) && | |||
| @@ -530,9 +533,9 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| } | |||
| @Override | |||
| public void updateStatusByCouponId(Long couponId, String tenantId, int status) { | |||
| public void updateStatusByCouponId(Long couponId, TenantEntity tenantEntity, int status) { | |||
| WxCouponSend wxCouponSend = new WxCouponSend(); | |||
| wxCouponSend.setTenantId(tenantId); | |||
| wxCouponSend.updateTenantInfo(tenantEntity); | |||
| wxCouponSend.setCouponId(couponId); | |||
| wxCouponSend.setStatus(status); | |||
| wxCouponSend.setUpdateDate(new Date()); | |||
| @@ -540,10 +543,10 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| } | |||
| @Override | |||
| public void saveOrUpdateConfig(Integer beforeDays, Integer sendType, String tenantId) { | |||
| WxCouponSend config = getConfig(sendType, tenantId); | |||
| public void saveOrUpdateConfig(Integer beforeDays, Integer sendType, TenantEntity tenantEntity) { | |||
| WxCouponSend config = getConfig(sendType, tenantEntity); | |||
| if (Objects.isNull(config)) { | |||
| WxCouponSend couponSendQuery = createCouponSendQuery(sendType, tenantId) ; | |||
| WxCouponSend couponSendQuery = createCouponSendQuery(sendType, tenantEntity) ; | |||
| insertCouponSend(beforeDays, couponSendQuery); | |||
| } else { | |||
| JSONObject couponSendJo = JSONObject.parseObject(config.getConditions()); | |||
| @@ -569,8 +572,8 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| } | |||
| @Override | |||
| public WxCouponSend getConfig(Integer sendType, String tenantId) { | |||
| WxCouponSend couponSendQuery = createCouponSendQuery(sendType, tenantId) ; | |||
| public WxCouponSend getConfig(Integer sendType, TenantEntity tenantEntity) { | |||
| WxCouponSend couponSendQuery = createCouponSendQuery(sendType, tenantEntity) ; | |||
| //读取会员生日券配置信息 | |||
| List<WxCouponSend> wxCouponSendList = wxCouponSendMapper.selectList(new QueryWrapper(couponSendQuery)); | |||
| if (CollectionUtils.isEmpty(wxCouponSendList)) { | |||
| @@ -581,10 +584,10 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| return wxCouponSendList.get(0); | |||
| } | |||
| private WxCouponSend createCouponSendQuery(Integer sendType, String tenantId) { | |||
| private WxCouponSend createCouponSendQuery(Integer sendType, TenantEntity tenantEntity) { | |||
| WxCouponSend couponSendQuery = new WxCouponSend(); | |||
| couponSendQuery.setSendType(sendType); | |||
| couponSendQuery.setTenantId(tenantId); | |||
| couponSendQuery.updateTenantInfo(tenantEntity); | |||
| couponSendQuery.setCouponId(0L); | |||
| couponSendQuery.setStatus(EnumCouponSendStatus.INVALID.getCode()); | |||
| return couponSendQuery ; | |||
| @@ -631,8 +634,8 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| // 发放免费券 | |||
| WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getCouponId(), cs); | |||
| if (couponOrder != null) { | |||
| wxCouponActionLogService.addOne(cu.getTenantId(), cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | |||
| sendMsgForSendCoupon(cs.getTenantId(), cs, couponOrder, cu); | |||
| wxCouponActionLogService.addOne(couponOrder, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | |||
| sendMsgForSendCoupon(couponOrder, cs, couponOrder, cu); | |||
| } else { | |||
| logger.warn("handSel couponOrder is null"); | |||
| } | |||
| @@ -417,16 +417,16 @@ import java.util.stream.Collectors; | |||
| //下架所有投放频道 | |||
| wxCouponChannelService | |||
| .updateStatusByCouponId(record.getId(), record.getTenantId(), EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()); | |||
| .updateStatusByCouponId(record.getId(), record, EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()); | |||
| //下架所有场景投放 | |||
| wxCouponSendService | |||
| .updateStatusByCouponId(record.getId(), record.getTenantId(), EnumCouponSendStatus.INVALID.getCode()); | |||
| .updateStatusByCouponId(record.getId(), record, EnumCouponSendStatus.INVALID.getCode()); | |||
| //下架所有已砍价券 | |||
| wxOrderService.updateStatusByPressCouponId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_PRESS_CANCEL.getCode()); | |||
| wxOrderService.updateStatusByPressCouponId(record.getId(), record, EnumOrderStatus.ORDER_STATUS_PRESS_CANCEL.getCode()); | |||
| //下架所有相关广告 | |||
| wxScreenAdService.updateStatusByCouponId(record.getId(), record, EnumScreenAdStatus.INVALID.getCode()); | |||
| //下架拼团券 | |||
| wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||
| wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record, EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||
| // 卡下架后,转赠找不到卡相关信息,所以修改卡转赠状态为不可转赠 | |||
| wxCardInfoMapper.updateTransferStatusByCouponId(record.getId()); | |||
| // 卡券下架,未使用的卡密要下架 | |||
| @@ -10,6 +10,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxCreditHistoryVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -330,13 +331,13 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||
| } | |||
| @Override | |||
| public Map<String, Integer> findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId,String tenantId) { | |||
| public Map<String, Integer> findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId, TenantEntity tenantEntity) { | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectById(merchantId); | |||
| Map<String, Integer> creditMap = Maps.newHashMap(); | |||
| if (wxMerchant != null && wxMerchant.getBusinessId() != null) { | |||
| WxCreditHistory wxCreditHistory = new WxCreditHistory(); | |||
| wxCreditHistory.setBusinessId(wxMerchant.getBusinessId()); | |||
| wxCreditHistory.setTenantId(tenantId); | |||
| wxCreditHistory.updateTenantInfo(tenantEntity); | |||
| int credit; | |||
| int creditNew = 0 ; | |||
| if (StringUtils.isNotBlank(spendStr)) { | |||
| @@ -460,7 +461,7 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| //根据商户id和花费金额计算需要新增的积分 | |||
| Map<String, Integer> map = findByMerchantIdAndSpend(record.getMerchantId(), record.getSpendStr(), null,record.getTenantId()); | |||
| Map<String, Integer> map = findByMerchantIdAndSpend(record.getMerchantId(), record.getSpendStr(), null,record); | |||
| return map.get("credit"); | |||
| } | |||
| @@ -936,7 +936,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| // 发送短信 | |||
| Map<String,String> msgReplaceMap; | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.setTenantId(tenantEntity.getTenantId()); | |||
| wxMsgValidationcode.updateTenantInfo(tenantEntity); | |||
| Map<String,Object> userMap = (Map<String,Object>)mapInfo.get("starter"); | |||
| Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); | |||
| String email = (String)userMap.get("email"); | |||
| @@ -980,7 +980,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); | |||
| wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):""); | |||
| wxMsgRecord.setTenantId(tenantEntity.getTenantId()); | |||
| wxMsgRecord.updateTenantInfo(tenantEntity); | |||
| if(isContract(flowType)){ | |||
| msgReplaceMap.put("bustype","合同"); | |||
| }else if(isBill(flowType)){ | |||
| @@ -1007,7 +1007,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| mailMsg.setModelType(EnumMailMsgModel.MAIL_APPLY_NODIFY.getCode()); | |||
| mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); | |||
| mailMsg.setTo(new String[]{email}); | |||
| mailMsg.setTenantId(tenantEntity.getTenantId()); | |||
| mailMsg.updateTenantInfo(tenantEntity); | |||
| if(isContract(flowType)){ | |||
| msgReplaceMap.put("bustype","合同"); | |||
| }else if(isBill(flowType)){ | |||
| @@ -1044,7 +1044,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.FLOW_PASS_NODIFY.getCode()); | |||
| wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):""); | |||
| wxMsgRecord.setTenantId(tenantEntity.getTenantId()); | |||
| wxMsgRecord.updateTenantInfo(tenantEntity); | |||
| if(isContract(flowType)){ | |||
| msgReplaceMap.put("bustype","合同"); | |||
| }else if(isBill(flowType)){ | |||
| @@ -1071,7 +1071,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| mailMsg.setModelType(EnumMailMsgModel.MAIL_PASS_NODIFY.getCode()); | |||
| mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); | |||
| mailMsg.setTo(new String[]{email}); | |||
| mailMsg.setTenantId(tenantEntity.getTenantId()); | |||
| mailMsg.updateTenantInfo(tenantEntity); | |||
| if(isContract(flowType)){ | |||
| msgReplaceMap.put("bustype","合同"); | |||
| }else if(isBill(flowType)){ | |||
| @@ -1197,7 +1197,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.FLOW_REJECT_NODIFY.getCode()); | |||
| wxMsgRecord.setReceiver(userMap != null ? (String) userMap.get("phone") : ""); | |||
| wxMsgRecord.setTenantId(tenantEntity.getTenantId()); | |||
| wxMsgRecord.updateTenantInfo(tenantEntity); | |||
| if (isContract(flowType)) { | |||
| msgReplaceMap.put("bustype", "合同"); | |||
| } else if (isBill(flowType)) { | |||
| @@ -1232,7 +1232,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| mailMsg.setModelType(EnumMailMsgModel.MAIL_REJECT_NODIFY.getCode()); | |||
| mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); | |||
| mailMsg.setTo(new String[]{email}); | |||
| mailMsg.setTenantId(tenantEntity.getTenantId()); | |||
| mailMsg.updateTenantInfo(tenantEntity); | |||
| if(isContract(flowType)){ | |||
| msgReplaceMap.put("bustype","合同"); | |||
| }else if(isBill(flowType)){ | |||
| @@ -9,6 +9,7 @@ import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxLevelConfig; | |||
| import com.iformall.domain.po.WxLevelMerchant; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxLevelMerchantCVo; | |||
| import com.iformall.mapper.WxCUserBasicInfoMapper; | |||
| import com.iformall.mapper.WxLevelConfigMapper; | |||
| @@ -81,7 +82,7 @@ public class WxLevelConfigServiceImpl implements WxLevelConfigService { | |||
| } | |||
| @Override | |||
| public void batchSaveByMerchantId(String tenantId, Long merchantId, List<WxLevelConfig> records) { | |||
| public void batchSaveByMerchantId(TenantEntity tenantEntity, Long merchantId, List<WxLevelConfig> records) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| records.stream().forEach(l->{ | |||
| @@ -96,7 +97,7 @@ public class WxLevelConfigServiceImpl implements WxLevelConfigService { | |||
| }else { | |||
| wxLevelMerchantParam.setId(idWorker.nextId()); | |||
| wxLevelMerchantParam.setCreateDate(new Date()); | |||
| wxLevelMerchantParam.setTenantId(tenantId); | |||
| wxLevelMerchantParam.updateTenantInfo(tenantEntity); | |||
| wxLevelMerchantParam.setDiscount(l.getCount().intValue()); | |||
| wxLevelMerchantapper.insert(wxLevelMerchantParam); | |||
| } | |||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxMallBuildingFloorDto; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMallBuilding; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| import com.iformall.mapper.WxMallBuildingMapper; | |||
| @@ -57,17 +58,17 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { | |||
| } | |||
| @Override | |||
| public ResultData getbuildinglist(String tenantId) { | |||
| public ResultData getBuildingList(TenantEntity tenantEntity) { | |||
| WxMallBuilding wxMallBuilding = new WxMallBuilding(); | |||
| wxMallBuilding.setTenantId(tenantId); | |||
| wxMallBuilding.updateTenantInfo(tenantEntity); | |||
| List<WxMallBuilding> list = wxMallBuildingMapper.findList(wxMallBuilding); | |||
| return new ResultData(list); | |||
| } | |||
| @Override | |||
| public ResultData getbuildingfloorlist(String tenantId) { | |||
| public ResultData getBuildingFloorList(TenantEntity tenantEntity) { | |||
| WxMallBuilding wxMallBuilding = new WxMallBuilding(); | |||
| wxMallBuilding.setTenantId(tenantId); | |||
| wxMallBuilding.updateTenantInfo(tenantEntity); | |||
| List<WxMallBuilding> buildings = wxMallBuildingMapper.findList(wxMallBuilding); | |||
| List<WxMallBuilding> wxMallBuildings = buildings.stream().map(b -> { | |||
| WxMallBuilding tempb = new WxMallBuilding(); | |||
| @@ -105,36 +106,39 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { | |||
| String [] floors = record.getFloors().split(","); | |||
| // 楼座 | |||
| WxMallBuilding mallBuilding = new WxMallBuilding(); | |||
| mallBuilding.setId(idWorker.nextId()); | |||
| mallBuilding.setTenantId(record.getTenantId()); | |||
| mallBuilding.setName(record.getBuilding()); | |||
| mallBuilding.setFloorNumber(floors.length); | |||
| WxMallBuilding mallBuilding = new WxMallBuilding() {{ | |||
| setId(idWorker.nextId()); | |||
| updateTenantInfo(record); | |||
| setName(record.getBuilding()); | |||
| setFloorNumber(floors.size()); | |||
| }}; | |||
| wxMallBuildingMapper.insert(mallBuilding); | |||
| // 楼层 | |||
| for(String floor: floors) { | |||
| WxMallFloor mallFloor = new WxMallFloor(); | |||
| mallFloor.setId(idWorker.nextId()); | |||
| mallFloor.setTenantId(record.getTenantId()); | |||
| mallFloor.setBuildingId(mallBuilding.getId()); | |||
| mallFloor.setFloorName(floor); | |||
| mallFloor.setBackgroundImg(Constant.floor_back_img); | |||
| WxMallFloor mallFloor = new WxMallFloor() {{ | |||
| setId(idWorker.nextId()); | |||
| updateTenantInfo(record); | |||
| setBuildingId(mallBuilding.getId()); | |||
| setFloorName(floor); | |||
| setBackgroundImg(Constant.floor_back_img); | |||
| }}; | |||
| wxMallFloorMapper.insert(mallFloor); | |||
| } | |||
| } | |||
| @Override | |||
| public void saveFloorArea(WxMallFloor record) { | |||
| WxMallFloor mallFloor = new WxMallFloor(); | |||
| mallFloor.setId(record.getId()); | |||
| mallFloor.setTenantId(record.getTenantId()); | |||
| if (record.getTotalArea() != null) { | |||
| mallFloor.setTotalArea(record.getTotalArea()); | |||
| } | |||
| if (record.getOperatingArea() != null) { | |||
| mallFloor.setOperatingArea(record.getOperatingArea()); | |||
| } | |||
| WxMallFloor mallFloor = new WxMallFloor() {{ | |||
| setId(record.getId()); | |||
| updateTenantInfo(record); | |||
| if (record.getTotalArea() != null) { | |||
| setTotalArea(record.getTotalArea()); | |||
| } | |||
| if (record.getOperatingArea() != null) { | |||
| setOperatingArea(record.getOperatingArea()); | |||
| } | |||
| }}; | |||
| wxMallFloorMapper.updateById(mallFloor); | |||
| } | |||
| @@ -4,6 +4,7 @@ import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| import com.iformall.mapper.WxMallFloorMapper; | |||
| import com.iformall.service.WxMallFloorService; | |||
| @@ -50,9 +51,9 @@ public class WxMallFloorServiceImpl implements WxMallFloorService { | |||
| @Override | |||
| public ResultData getfloorlist(String tenantId,Long buildingId) { | |||
| public ResultData getFloorList(TenantEntity tenantEntity, Long buildingId) { | |||
| WxMallFloor wxMallFloor = new WxMallFloor(); | |||
| wxMallFloor.setTenantId(tenantId); | |||
| wxMallFloor.updateTenantInfo(tenantEntity); | |||
| wxMallFloor.setBuildingId(buildingId); | |||
| List<WxMallFloor> list = wxMallFloorMapper.findList(wxMallFloor); | |||
| return new ResultData(list); | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.service.impl; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| @@ -8,6 +9,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxMsgValidationcode; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumMerchantBUserStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxAppinfoMapper; | |||
| @@ -88,27 +90,27 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { | |||
| } | |||
| @Override | |||
| public boolean hasphone(String phone, String tenantId) { | |||
| public boolean hasPhone(TenantEntity tenantEntity, String phone) { | |||
| WxMerchantBUser bUser = new WxMerchantBUser(); | |||
| bUser.setTenantId(tenantId); | |||
| bUser.updateTenantInfo(tenantEntity); | |||
| bUser.setPhone(phone); | |||
| bUser.setStatus(EnumMerchantBUserStatus.VALID.getCode()); | |||
| List<WxMerchantBUser> list = wxMerchantBUserMapper.findList(bUser); | |||
| return list.size() >= 1 ? true : false; | |||
| Integer buSize = wxMerchantBUserMapper.selectCount(new QueryWrapper<>(bUser)); | |||
| return buSize >= 1 ? true : false; | |||
| } | |||
| @Override | |||
| public ResultData updatepwd(String appId, String phone, String code, String pwd) { | |||
| public ResultData updatePwd(String appId, String phone, String code, String pwd) { | |||
| WxAppinfo appinfo = wxAppinfoMapper.findByAppId(appId); | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.setTenantId(appinfo.getTenantId()); | |||
| wxMsgValidationcode.setPhone(phone); | |||
| wxMsgValidationcode.setCode(code); | |||
| List<WxMsgValidationcode> wxmsgvalidationcodelist = wxMsgValidationcodeMapper.findList(wxMsgValidationcode); | |||
| List<WxMsgValidationcode> msgValidationCodeList = wxMsgValidationcodeMapper.findList(wxMsgValidationcode); | |||
| Date currentdate = new Date(); | |||
| wxmsgvalidationcodelist = wxmsgvalidationcodelist.stream().filter(validationcode -> | |||
| msgValidationCodeList = msgValidationCodeList.stream().filter(validationcode -> | |||
| validationcode.getExpiretime().after(currentdate)).collect(Collectors.toList()); | |||
| if (wxmsgvalidationcodelist.size() > 0) { | |||
| if (msgValidationCodeList.size() > 0) { | |||
| //更新 | |||
| WxMerchantBUser bUser = new WxMerchantBUser(); | |||
| bUser.setTenantId(appinfo.getTenantId()); | |||
| @@ -11,6 +11,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| @@ -135,9 +136,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| } | |||
| @Override | |||
| public List<WxMerchantSimpleVo> findList(String tenantId) { | |||
| public List<WxMerchantSimpleVo> findList(TenantEntity tenantEntity) { | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(tenantId); | |||
| wxMerchant.updateTenantInfo(tenantEntity); | |||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| List<WxMerchant> wxMerchantList = wxMerchantMapper.findList(wxMerchant); | |||
| List<WxMerchantSimpleVo> collect = wxMerchantList.stream().map(x -> { | |||
| @@ -273,7 +274,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| //解绑商铺-没有租赁合同或物业合同才可以 | |||
| if (countRentContract == 0 || countPropertyContract == 0) { | |||
| WxMerchantShop wxMerchantShopQuery = new WxMerchantShop(); | |||
| wxMerchantShopQuery.setTenantId(wxMerchant.getTenantId()); | |||
| wxMerchantShopQuery.updateTenantInfo(wxMerchant); | |||
| wxMerchantShopQuery.setMerchantId(wxMerchant.getId()); | |||
| wxMerchantShopQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShopQuery); | |||
| @@ -282,7 +283,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| wxMerchantShopMapper.updateById(wxMerchantShop); | |||
| //更新商铺状态 | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.setTenantId(wxMerchant.getTenantId()); | |||
| wxShop.updateTenantInfo(wxMerchant); | |||
| wxShop.setId(wxMerchantShop.getShopId()); | |||
| wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode()); | |||
| wxShopMapper.updateById(wxShop); | |||
| @@ -298,7 +299,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| } | |||
| //作废卡券 | |||
| WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); | |||
| wxCouponMerchant.setTenantId(wxMerchant.getTenantId()); | |||
| wxCouponMerchant.updateTenantInfo(wxMerchant); | |||
| wxCouponMerchant.setMerchantId(wxMerchant.getId()); | |||
| wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||
| List<WxCouponMerchant> wxCouponMerchantList = wxCouponMerchantMapper.findList(wxCouponMerchant); | |||
| @@ -307,7 +308,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| couponIds.stream().filter(cid->!isCouponMerchantValid(cid)).forEach(cid->{ | |||
| WxCoupon wxCoupon = new WxCoupon(); | |||
| wxCoupon.setId(cid); | |||
| wxCoupon.setTenantId(wxMerchant.getTenantId()); | |||
| wxCoupon.updateTenantInfo(wxMerchant); | |||
| wxCoupon.setStatus(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()); | |||
| wxCouponService.saveOrUpdate(wxCoupon); | |||
| }); | |||
| @@ -349,7 +350,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| //关联表插入 | |||
| wxMerchantShop.setId(idWorker.nextId()); | |||
| wxMerchantShop.setMerchantId(merchantId); | |||
| wxMerchantShop.setTenantId(wxMerchant.getTenantId()); | |||
| wxMerchantShop.updateTenantInfo(wxMerchant); | |||
| wxMerchantShop.setShopId(shopid); | |||
| wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| Date shopdate = new Date(); | |||
| @@ -500,7 +501,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxMerchantCorp record = wxMerchant.getWxMerchantCorp(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setTenantId(wxMerchant.getTenantId()); | |||
| record.updateTenantInfo(wxMerchant); | |||
| record.setMerchantId(wxMerchant.getId()); | |||
| Date date = new Date(); | |||
| record.setCreateDate(date); | |||
| @@ -534,7 +535,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxMerchantTax record = wxMerchant.getWxMerchantTax(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setTenantId(wxMerchant.getTenantId()); | |||
| record.updateTenantInfo(wxMerchant); | |||
| record.setMerchantId(wxMerchant.getId()); | |||
| Date date = new Date(); | |||
| record.setCreateDate(date); | |||
| @@ -586,7 +587,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| long id = idWorker.nextId(); | |||
| user.setId(id); | |||
| user.setMerchantId(wxMerchant.getId()); | |||
| user.setTenantId(wxMerchant.getTenantId()); | |||
| user.updateTenantInfo(wxMerchant); | |||
| user.setAppId(wxAppinfo.getAppId()); | |||
| Date date = new Date(); | |||
| user.setCreateDate(date); | |||
| @@ -595,7 +596,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| wxMerchantBUserMapper.insert(user); | |||
| } else {//有id的更新 | |||
| user.setMerchantId(wxMerchant.getId()); | |||
| user.setTenantId(wxMerchant.getTenantId()); | |||
| user.updateTenantInfo(wxMerchant); | |||
| user.setAppId(wxAppinfo.getAppId()); | |||
| Date date = new Date(); | |||
| user.setUpdateDate(date); | |||
| @@ -617,7 +618,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| wxMerchantMapper.updateById(wxMerchant); | |||
| wxLevelConfigService.batchSaveByMerchantId(wxMerchant.getTenantId(), wxMerchant.getId(), wxMerchant.getLevelConfigList()); | |||
| wxLevelConfigService.batchSaveByMerchantId(wxMerchant, wxMerchant.getId(), wxMerchant.getLevelConfigList()); | |||
| } catch (Exception e) { | |||
| logger.error("db failed: 账号操作失败, e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| @@ -10,6 +10,7 @@ import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxMerchantTradeDaily; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxMerchantTradeDailyVo; | |||
| import com.iformall.mapper.WxMerchantTradeDailyMapper; | |||
| import com.iformall.mapper.WxShopMapper; | |||
| @@ -117,7 +118,7 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxMerchantTradeDaily.setId(idWorker.nextId()); | |||
| wxMerchantTradeDaily.setTenantId(merchant.getTenantId()); | |||
| wxMerchantTradeDaily.updateTenantInfo(merchant); | |||
| wxMerchantTradeDaily.setMerchantId(merchant.getId()); | |||
| wxMerchantTradeDaily.setbUserId(userId); | |||
| wxMerchantTradeDaily.setTradeAmt(volume + ""); | |||
| @@ -156,7 +157,7 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxMerchantTradeDaily.setId(idWorker.nextId()); | |||
| wxMerchantTradeDaily.setTenantId(tradeDaily.getTenantId()); | |||
| wxMerchantTradeDaily.updateTenantInfo(tradeDaily); | |||
| wxMerchantTradeDaily.setMerchantId(tradeDaily.getMerchantId()); | |||
| wxMerchantTradeDaily.setTradeAmt(tradeDaily.getTradeAmt() + ""); | |||
| wxMerchantTradeDaily.setCreateDate(new Date()); | |||
| @@ -245,11 +246,11 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||
| } | |||
| @Override | |||
| public ResultData getVolumeTotalOfMonth(String tenantId) { | |||
| public ResultData getVolumeTotalOfMonth(TenantEntity tenantEntity) { | |||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||
| wxMerchantTradeDaily.setTenantId(tenantId); | |||
| wxMerchantTradeDaily.updateTenantInfo(tenantEntity);; | |||
| List<WxMerchantTradeDaily> recordList = wxMerchantTradeDailyMapper.findTotalListOfMonth(wxMerchantTradeDaily); | |||
| Map<String, WxMerchantTradeDaily> recordMap = recordList.stream().collect(Collectors.toMap(WxMerchantTradeDaily::getReportDate, r -> r)); | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxMsgConfig; | |||
| import com.iformall.domain.po.WxMsgModel; | |||
| import com.iformall.enums.EnumMsgModelStatus; | |||
| @@ -123,9 +124,9 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { | |||
| } | |||
| @Override | |||
| public ResultData getmodellist(String tenantId) { | |||
| public ResultData getModelList(TenantEntity tenantEntity) { | |||
| WxMsgModel wxMsgModel = new WxMsgModel(); | |||
| wxMsgModel.setTenantId(tenantId); | |||
| wxMsgModel.updateTenantInfo(tenantEntity); | |||
| wxMsgModel.setStatus(1); | |||
| List<WxMsgModel> list = wxMsgModelMapper.findList(wxMsgModel); | |||
| return new ResultData(list); | |||
| @@ -10,6 +10,7 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoFilterListDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.msg.WxMsg; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -177,17 +178,20 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| @Override | |||
| public ResultData add(WxMsg wxMsg){ | |||
| //不是草稿检验疲劳度 | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(wxMsg.getTenantId()); | |||
| }}; | |||
| //不是草稿检验疲劳度 | |||
| if (!wxMsg.getStatus().equals(EnumMsgStatus.MSG_STATUS_DRAFT.getCode())) { | |||
| if (wxMsg.getIsright().equals(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode())) { | |||
| try { | |||
| pushLimitService.checkSendTime(wxMsg.getTenantId()); | |||
| pushLimitService.checkSendTime(tenantEntity); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| } else { | |||
| PushLimit pushLimit = pushLimitService.getPushLimit(wxMsg.getTenantId()); | |||
| PushLimit pushLimit = pushLimitService.getPushLimit(tenantEntity); | |||
| if(pushLimit.getEnable().equals(EnumEnableType.Enable.getCode())) { | |||
| // 1.2 疲劳度时间是否启用 | |||
| if(pushLimit.getTimeEnable().equals(EnumEnableType.Enable.getCode())) { | |||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMsgSignature; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.mapper.WxMsgSignatureMapper; | |||
| import com.iformall.service.WxMsgSignatureService; | |||
| import org.slf4j.Logger; | |||
| @@ -50,9 +51,9 @@ public class WxMsgSignatureServiceImpl implements WxMsgSignatureService { | |||
| } | |||
| @Override | |||
| public ResultData getsignaturelist(String tenantId) { | |||
| public ResultData getSignatureList(TenantEntity tenantEntity) { | |||
| WxMsgSignature wxMsgSignature = new WxMsgSignature(); | |||
| wxMsgSignature.setTenantId(tenantId); | |||
| wxMsgSignature.updateTenantInfo(tenantEntity); | |||
| List<WxMsgSignature> list = wxMsgSignatureMapper.findList(wxMsgSignature); | |||
| return new ResultData(list); | |||
| } | |||
| @@ -110,7 +110,7 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.VALIDATION_CODE.getCode()); | |||
| wxMsgRecord.setReceiver(wxMsgValidationcode.getPhone()); | |||
| wxMsgRecord.setTenantId(wxMsgValidationcode.getTenantId()); | |||
| wxMsgRecord.updateTenantInfo(wxMsgValidationcode); | |||
| wxMsgRecord.setDynamicContentMap(msgReplaceMap); | |||
| mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); | |||
| return new ResultData(Result.SUCCESS,"发送成功"); | |||
| @@ -17,6 +17,7 @@ import com.iformall.mapper.WxOrderPressMapper; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.service.WxMsgLimitService; | |||
| import com.iformall.service.WxOrderPressService; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.PressUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @@ -186,14 +187,14 @@ public class WxOrderPressServiceImpl implements WxOrderPressService { | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| String gotopage = "pages/index/index?type=mb"; | |||
| String gotopage = Constant.mainPageUrl + "?type=mb"; | |||
| // 小程序 消息 | |||
| String formId = null; | |||
| Date curDate = new Date(); | |||
| Date dateAfter7Day = DateUtils.getHourTimeAfter(7, order.getCreateDate()); | |||
| if(StringUtils.isNotBlank(order.getFormId()) && curDate.before(dateAfter7Day) | |||
| && !order.getFormId().equalsIgnoreCase("undefined")) { | |||
| && !order.getFormId().equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| formId = order.getFormId(); | |||
| } | |||
| int formType = EnumMsgLimitType.WEAPP_FORMID.getCode(); | |||
| @@ -207,7 +207,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| // + Order 待支付 | |||
| try { | |||
| WxOrder orderQ = new WxOrder(); | |||
| orderQ.setTenantId(user.getTenantId()); | |||
| orderQ.updateTenantInfo(counpon); | |||
| orderQ.setProductId(counpon.getId()); | |||
| orderQ.setType(EnumOrderType.COUPON.getCode()); | |||
| orderQ.setCUserId(user.getId()); | |||
| @@ -232,7 +232,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| // + Order 待支付 | |||
| try { | |||
| WxOrder orderQ = new WxOrder(); | |||
| orderQ.setTenantId(user.getTenantId()); | |||
| orderQ.updateTenantInfo(counpon); | |||
| orderQ.setProductId(counpon.getId()); | |||
| orderQ.setType(EnumOrderType.COUPON.getCode()); | |||
| orderQ.setCUserId(user.getId()); | |||
| @@ -261,7 +261,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| // + Order 待支付 | |||
| try { | |||
| WxOrder orderQ = new WxOrder(); | |||
| orderQ.setTenantId(user.getTenantId()); | |||
| orderQ.updateTenantInfo(counpon); | |||
| orderQ.setProductId(counpon.getId()); | |||
| orderQ.setType(EnumOrderType.COUPON.getCode()); | |||
| orderQ.setCUserId(user.getId()); | |||
| @@ -324,7 +324,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| // + couponOrder ---待使用 | |||
| try { | |||
| WxCouponOrder couponOrderQ = new WxCouponOrder(); | |||
| couponOrderQ.setTenantId(user.getTenantId()); | |||
| couponOrderQ.updateTenantInfo(counpon); | |||
| couponOrderQ.setCouponId(counpon.getId()); | |||
| couponOrderQ.setCUserId(user.getId()); | |||
| if (counpon.getSendType().equals(EnumCouponSendType.PASSIVE)) { | |||
| @@ -652,6 +652,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| record.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| record.setPayment(payment); | |||
| record.setTotalPayment(payment); | |||
| record.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode()); | |||
| record.setDetail(bodyStr); | |||
| record.setCreateDate(curr); | |||
| @@ -681,13 +682,14 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| WxOrder record = new WxOrder(); | |||
| record.setId(orderNumber); | |||
| record.setTenantId(merchant.getTenantId()); | |||
| record.updateTenantInfo(merchant); | |||
| record.setOrderNumber(orderNumber); | |||
| record.setType(EnumOrderType.PREPAIDCARD.getCode()); | |||
| record.setProductId(merchant.getId()); | |||
| record.setCUserId(cUserId); | |||
| record.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| record.setPayment(payment); | |||
| record.setTotalPayment(payment); | |||
| record.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode()); | |||
| record.setDetail(bodyStr); | |||
| record.setCreateDate(curr); | |||
| @@ -744,7 +746,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| WxCouponOrder couponOrder = new WxCouponOrder(); | |||
| couponOrder.setId(idWorker.nextId()); | |||
| couponOrder.setTenantId(user.getTenantId()); | |||
| couponOrder.updateTenantInfo(order); | |||
| couponOrder.setCouponId(order.getProductId()); | |||
| couponOrder.setCouponType(coupon.getType()); | |||
| couponOrder.setCUserId(user.getId()); | |||
| @@ -769,7 +771,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| Integer fee = 0; | |||
| WxCardInfo cardInfo = new WxCardInfo(); | |||
| cardInfo.setId(couponOrder.getId()); | |||
| cardInfo.setTenantId(user.getTenantId()); | |||
| cardInfo.updateTenantInfo(order); | |||
| cardInfo.setCouponId(order.getProductId()); | |||
| cardInfo.setAmount(coupon.getPrice()); | |||
| cardInfo.setSaleAmount(coupon.getSalePrice()); | |||
| @@ -779,7 +781,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| // 有价卡 | |||
| try { | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.setTenantId(user.getTenantId()); | |||
| payOrderQ.updateTenantInfo(order); | |||
| payOrderQ.setOrderId(order.getId()); | |||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| payOrder = wxPayOrderMapper.selectOne(new QueryWrapper(payOrderQ)); | |||
| @@ -797,7 +799,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| // 未开启分账 | |||
| WxPayAccount payAccount = null; | |||
| WxPayAccount payAccountQ = new WxPayAccount(); | |||
| payAccountQ.setTenantId(cardInfo.getTenantId()); | |||
| payAccountQ.updateTenantInfo(order); | |||
| try { | |||
| payAccount = wxPayAccountMapper.selectOne(new QueryWrapper<>(payAccountQ)); | |||
| fee = PayUtils.getPayRate(payOrder.getPayAmount(), payAccount.getRate(), false); | |||
| @@ -895,7 +897,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| WxOrder record = new WxOrder(); | |||
| record.setId(orderNumber); | |||
| record.setTenantId(user.getTenantId()); | |||
| record.updateTenantInfo(coupon); | |||
| record.setOrderNumber(orderNumber); | |||
| record.setProductId(couponId); | |||
| record.setType(EnumOrderType.COUPON.getCode()); | |||
| @@ -978,7 +980,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| private void sendInsideOrderSuccessMsg(WxOrder updateOrder, WxCoupon coupon, WxCUser user) { | |||
| FmInsideOrderSuccessMsg orderSuccess = new FmInsideOrderSuccessMsg(); | |||
| orderSuccess.setMsgType(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode()); | |||
| orderSuccess.setTenantId(updateOrder.getTenantId()); | |||
| orderSuccess.updateTenantInfo(updateOrder); | |||
| orderSuccess.setOrderId(updateOrder.getId()); | |||
| orderSuccess.setCUserId(user.getId()); | |||
| orderSuccess.setCouponId(coupon.getId()); | |||
| @@ -1134,7 +1136,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| creditHistory.setOperatorId(user.getId()); | |||
| creditHistory.setCUserId(user.getId()); | |||
| creditHistory.setCreateDate(new Date()); | |||
| creditHistory.setTenantId(user.getTenantId()); | |||
| creditHistory.updateTenantInfo(wxMerchant); | |||
| creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); | |||
| if (updateOrder.getCouponChannelId() != null) { | |||
| WxCouponChannel wxCouponChannel = wxCouponChannelMapper.selectById(updateOrder.getCouponChannelId()); | |||
| @@ -1227,9 +1229,9 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| @Override | |||
| public void updateOrderGroupStatusByCouponId(Long couponId, String tenantId, Integer orderStatus) { | |||
| public void updateOrderGroupStatusByCouponId(Long couponId, TenantEntity tenantEntity, Integer orderStatus) { | |||
| WxOrder updateOrder = new WxOrder(); | |||
| updateOrder.setTenantId(tenantId); | |||
| updateOrder.updateTenantInfo(tenantEntity); | |||
| updateOrder.setOrderStatus(orderStatus); | |||
| updateOrder.setProductId(couponId); | |||
| updateOrder.setUpdateDate(new Date()); | |||
| @@ -1237,9 +1239,9 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| @Override | |||
| public void updateOrderGroupStatusByCouponChannelId(Long couponChannelId, String tenantId, Integer orderStatus) { | |||
| public void updateOrderGroupStatusByCouponChannelId(Long couponChannelId, TenantEntity tenantEntity, Integer orderStatus) { | |||
| WxOrder updateOrder = new WxOrder(); | |||
| updateOrder.setTenantId(tenantId); | |||
| updateOrder.updateTenantInfo(tenantEntity); | |||
| updateOrder.setOrderStatus(orderStatus); | |||
| updateOrder.setCouponChannelId(couponChannelId); | |||
| updateOrder.setUpdateDate(new Date()); | |||
| @@ -1255,7 +1257,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order.getTenantId()); | |||
| // 2. get pay order | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.setTenantId(order.getTenantId()); | |||
| payOrderQ.updateTenantInfo(order); | |||
| payOrderQ.setOrderId(order.getId()); | |||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | |||
| List<WxPayOrder> payOrders = wxPayOrderMapper.selectList(new QueryWrapper(payOrderQ)); | |||
| @@ -1312,11 +1314,11 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| @Override | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| public void shareForMicroPay(String tenantId, Long orderId, Long payOrderId) { | |||
| public void shareForMicroPay(TenantEntity tenantEntity, Long orderId, Long payOrderId) { | |||
| // 微信分账 | |||
| try { | |||
| WxPayOrder wxPayOrder = new WxPayOrder(); | |||
| wxPayOrder.setTenantId(tenantId); | |||
| wxPayOrder.updateTenantInfo(tenantEntity); | |||
| wxPayOrder.setId(payOrderId); | |||
| wxPayOrder.setOrderId(orderId); | |||
| wxPayOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| @@ -1335,7 +1337,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| sharingOrder.setOrderId(wxPayOrder.getId()); | |||
| sharingOrder.setPayTimeStart(wxPayOrder.getPayTimeStart()); | |||
| sharingOrder.setPayTimeEnd(wxPayOrder.getPayTimeEnd()); | |||
| sharingOrder.setTenantId(wxPayOrder.getTenantId()); | |||
| sharingOrder.updateTenantInfo(wxPayOrder); | |||
| sharingOrder.setTransactionId(wxPayOrder.getTransactionId()); | |||
| sharingOrder.setShareAmount(wxPayOrder.getShareAmount()); | |||
| ResultData resultData = wxProfitSharingOrderService.createSharingOrder(sharingOrder); | |||
| @@ -1353,18 +1355,19 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| @Override | |||
| public Map<String, Object> queryOrderSummary(String tenantId) { | |||
| public Map<String, Object> queryOrderSummary(TenantEntity tenantEntity) { | |||
| Map<String, Object> result = new HashMap<>(); | |||
| queryOrderCount(tenantId, result); | |||
| queryOrderSummary(tenantId, result); | |||
| queryOrderCount(tenantEntity, result); | |||
| queryOrderSummary(tenantEntity, result); | |||
| return result; | |||
| } | |||
| public void queryMerchantCount(String tenantId, Map<String, Object> result) { | |||
| @Deprecated | |||
| public void queryMerchantCount(TenantEntity tenantEntity, Map<String, Object> result) { | |||
| String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); | |||
| //全部商户个数 | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| String thirtyTime = DateUtils.getTimeBefore(29, new Date()); | |||
| params.put("startdate", thirtyTime + " 00:00:00"); | |||
| params.put("enddate", systemTime + " 23:59:59"); | |||
| @@ -1405,11 +1408,11 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| } | |||
| public void queryOrderSummary(String tenantId, Map<String, Object> result) { | |||
| public void queryOrderSummary(TenantEntity tenantEntity, Map<String, Object> result) { | |||
| String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); | |||
| //总数 | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| String thirtyTime = DateUtils.getTimeBefore(29, new Date()); | |||
| params.put("startdate", thirtyTime + " 00:00:00"); | |||
| params.put("enddate", systemTime + " 23:59:59"); | |||
| @@ -1467,11 +1470,11 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| } | |||
| public void queryOrderCount(String tenantId, Map<String, Object> result) { | |||
| public void queryOrderCount(TenantEntity tenantEntity, Map<String, Object> result) { | |||
| String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); | |||
| //总数 | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| String thirtyTime = DateUtils.getTimeBefore(29, new Date()); | |||
| params.put("startdate", thirtyTime + " 00:00:00"); | |||
| params.put("enddate", systemTime + " 23:59:59"); | |||
| @@ -1526,9 +1529,9 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| @Override | |||
| public void updateStatusByPressCouponId(Long couponId, String tenantId, int orderStatus) { | |||
| public void updateStatusByPressCouponId(Long couponId, TenantEntity tenantEntity, int orderStatus) { | |||
| WxOrder updateOrder = new WxOrder(); | |||
| updateOrder.setTenantId(tenantId); | |||
| updateOrder.updateTenantInfo(tenantEntity); | |||
| updateOrder.setOrderStatus(orderStatus); | |||
| updateOrder.setProductId(couponId); | |||
| updateOrder.setUpdateDate(new Date()); | |||
| @@ -1557,7 +1560,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| // couponActionLog | |||
| try { | |||
| wxCouponActionLogService.addOne(user.getTenantId(), order.getProductId(), order.getOrderNumber(), EnumCouponSendSendType.ACTIVE.getCode(), orderSaveDto.getCouponChannelId()); | |||
| wxCouponActionLogService.addOne(order, order.getProductId(), order.getOrderNumber(), EnumCouponSendSendType.ACTIVE.getCode(), orderSaveDto.getCouponChannelId()); | |||
| } catch (Exception e) { | |||
| // 库存恢复 | |||
| stockBack(order); | |||
| @@ -1643,7 +1646,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long orderNumber = idWorker.nextId(); | |||
| record.setId(orderNumber); | |||
| record.setTenantId(user.getTenantId()); | |||
| record.updateTenantInfo(coupon); | |||
| record.setOrderNumber(orderNumber); | |||
| record.setProductId(coupon.getId()); | |||
| record.setCUserId(user.getId()); | |||
| @@ -1696,7 +1699,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| creditHistory.setCreditNum(coupon.getCreditPrice()); | |||
| creditHistory.setCUserId(user.getId()); | |||
| creditHistory.setTenantId(user.getTenantId()); | |||
| creditHistory.updateTenantInfo(coupon); | |||
| creditHistory.setCreditType(EnumScoreType.CHANGE_CREDIT.getCode()); | |||
| creditHistory.setCouponId(coupon.getId()); | |||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | |||
| @@ -1826,7 +1829,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| orderNumber = idWorker.nextId(); | |||
| record.setId(orderNumber); | |||
| record.setTenantId(user.getTenantId()); | |||
| record.updateTenantInfo(coupon); | |||
| record.setOrderNumber(orderNumber); | |||
| record.setProductId(coupon.getId()); | |||
| //record.setType(EnumOrderType.COUPON.getCode()); | |||