| @@ -70,11 +70,11 @@ public class WxBrandController extends BaseController { | |||
| if(EnumDelFlag.YES.getCode().equals(wxBrand.getIsDel())){ | |||
| //判断是否解绑商户 | |||
| WxMerchant wxMerchant = new WxMerchant() {{ | |||
| setIsDel(0); | |||
| setBrand(wxBrand.getId()); | |||
| updateTenantInfo(wxBrand); | |||
| }}; | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.updateTenantInfo(wxBrand); | |||
| wxMerchant.setIsDel(0); | |||
| wxMerchant.setBrand(wxBrand.getId()); | |||
| List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant); | |||
| if(CollectionUtils.isNotEmpty(merchantList)){ | |||
| return new ResultData(Result.ERROR, "请先删除已绑定该品牌的商户。"); | |||
| @@ -116,10 +116,10 @@ public class WxBrandController extends BaseController { | |||
| @SystemControllerLog(description = "品牌-名称是否存在") | |||
| public ResultData hasBrand(String name, Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxBrandController::hasBrand"); | |||
| WxBrand wxBrand = new WxBrand() {{ | |||
| setName(name); | |||
| updateTenantInfo(getTenantInfo()); | |||
| }}; | |||
| WxBrand wxBrand = new WxBrand(); | |||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||
| wxBrand.setName(name); | |||
| wxBrand.setId(id); | |||
| return wxBrandService.hasBrand(wxBrand); | |||
| } | |||
| @@ -116,10 +116,10 @@ public class WxShopController extends BaseController { | |||
| @SystemControllerLog(description = "店铺管理-查询商铺号是否存在") | |||
| public ResultData hasShopNumber(String shopNumber, Long id, Integer type) { | |||
| logger.debug("[" + getIpAddr() + "] WxShopController::hasShopNumber"); | |||
| WxShop wxShop = new WxShop() {{ | |||
| setShopNumber(shopNumber); | |||
| setType(type); | |||
| }}; | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.setShopNumber(shopNumber); | |||
| wxShop.setType(type); | |||
| wxShop.setId(id); | |||
| wxShop.updateTenantInfo(getTenantInfo()); | |||
| return wxShopService.hasShopNumber(wxShop); | |||
| @@ -236,15 +236,14 @@ public class WxCarController extends BaseController { | |||
| } | |||
| // Save to wx_coupon_car | |||
| WxCouponCar couponCar = new WxCouponCar() {{ | |||
| setId(coupon.getId()); | |||
| updateTenantInfo(tenantEntity); | |||
| setParkId(park.getId()); | |||
| setVendorType(park.getVendorType()); | |||
| setVendorParams(coupon.getVendorParams()); | |||
| setCreateDate(curDate); | |||
| setUpdateDate(curDate); | |||
| }}; | |||
| WxCouponCar couponCar = new WxCouponCar(); | |||
| couponCar.setId(coupon.getId()); | |||
| couponCar.updateTenantInfo(tenantEntity); | |||
| couponCar.setParkId(park.getId()); | |||
| couponCar.setVendorType(park.getVendorType()); | |||
| couponCar.setVendorParams(coupon.getVendorParams()); | |||
| couponCar.setCreateDate(curDate); | |||
| couponCar.setUpdateDate(curDate); | |||
| WxCouponCar newCouponCar = wxCouponCarService.getById(couponCar.getId()); | |||
| if (newCouponCar == null) { | |||
| wxCouponCarService.save(couponCar); | |||
| @@ -109,21 +109,19 @@ public class MemCouponController extends BaseController { | |||
| if (coupon == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券不存在:" + memCouponFromDsp.getCouponId()); | |||
| } | |||
| MemCouponFromDsp couponQ = new MemCouponFromDsp() {{ | |||
| updateTenantInfo(memCouponFromDsp); | |||
| setCouponId(memCouponFromDsp.getCouponId()); | |||
| setStatus(0); | |||
| }}; | |||
| MemCouponFromDsp couponQ = new MemCouponFromDsp(); | |||
| couponQ.updateTenantInfo(memCouponFromDsp); | |||
| couponQ.setCouponId(memCouponFromDsp.getCouponId()); | |||
| couponQ.setStatus(0); | |||
| Integer couponCount = memCouponFromDspService.countByInfo(couponQ); | |||
| if (coupon.getRemainInventory() <= couponCount) { | |||
| return new ResultData(ErrorCode.REMAIN_IS_EMPTY); | |||
| } | |||
| // 2. 检查此会员是否已超限, 达到券购买限制 | |||
| couponQ = new MemCouponFromDsp() {{ | |||
| updateTenantInfo(memCouponFromDsp); | |||
| setPhone(memCouponFromDsp.getPhone()); | |||
| setCouponId(memCouponFromDsp.getCouponId()); | |||
| }}; | |||
| couponQ = new MemCouponFromDsp(); | |||
| couponQ.updateTenantInfo(memCouponFromDsp); | |||
| couponQ.setPhone(memCouponFromDsp.getPhone()); | |||
| couponQ.setCouponId(memCouponFromDsp.getCouponId()); | |||
| couponCount = memCouponFromDspService.countByInfo(couponQ); | |||
| if (coupon.getUseLimitQuantity() <= couponCount) { | |||
| return new ResultData(ErrorCode.ORDER_IS_LIMITED); | |||
| @@ -152,21 +150,19 @@ public class MemCouponController extends BaseController { | |||
| if (coupon == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券不存在:" + memCouponFromDsp.getCouponId()); | |||
| } | |||
| MemCouponFromDsp couponQ = new MemCouponFromDsp() {{ | |||
| updateTenantInfo(memCouponFromDsp); | |||
| setCouponId(memCouponFromDsp.getCouponId()); | |||
| setStatus(0); | |||
| }}; | |||
| MemCouponFromDsp couponQ = new MemCouponFromDsp(); | |||
| couponQ.updateTenantInfo(memCouponFromDsp); | |||
| couponQ.setCouponId(memCouponFromDsp.getCouponId()); | |||
| couponQ.setStatus(0); | |||
| Integer couponCount = memCouponFromDspService.countByInfo(couponQ); | |||
| if (coupon.getRemainInventory() <= couponCount) { | |||
| return new ResultData(ErrorCode.REMAIN_IS_EMPTY); | |||
| } | |||
| // 2. 检查此会员是否已超限, 达到券购买限制 | |||
| couponQ = new MemCouponFromDsp() {{ | |||
| updateTenantInfo(memCouponFromDsp); | |||
| setPhone(memCouponFromDsp.getPhone()); | |||
| setCouponId(memCouponFromDsp.getCouponId()); | |||
| }}; | |||
| couponQ = new MemCouponFromDsp(); | |||
| couponQ.updateTenantInfo(memCouponFromDsp); | |||
| couponQ.setPhone(memCouponFromDsp.getPhone()); | |||
| couponQ.setCouponId(memCouponFromDsp.getCouponId()); | |||
| couponCount = memCouponFromDspService.countByInfo(couponQ); | |||
| if (coupon.getUseLimitQuantity() <= couponCount) { | |||
| return new ResultData(ErrorCode.ORDER_IS_LIMITED); | |||
| @@ -186,10 +182,10 @@ public class MemCouponController extends BaseController { | |||
| if (StringUtils.isEmpty(phone)) { | |||
| return new ResultData(new ArrayList<MemCouponFromDsp>()); | |||
| } | |||
| MemCouponFromDsp memQ = new MemCouponFromDsp() {{ | |||
| updateTenantInfo(getTenantInfo()); | |||
| setPhone(phone); | |||
| }}; | |||
| MemCouponFromDsp memQ = new MemCouponFromDsp(); | |||
| memQ.updateTenantInfo(getTenantInfo()); | |||
| memQ.setPhone(phone); | |||
| List<MemCouponFromDsp> memCouponFromDsps = memCouponFromDspService.getList(memQ); | |||
| return new ResultData(memCouponFromDsps); | |||
| } | |||
| @@ -83,10 +83,8 @@ public class WxMsgValidationcodeController extends BaseController { | |||
| public ResultData sendvalidationcode(String tenantId, String parentTenantId, String phone, Integer type, String appid) { | |||
| logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeController::sendvalidationcode"); | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.updateTenantInfo(new TenantEntity(){{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}); | |||
| wxMsgValidationcode.setTenantId(tenantId); | |||
| wxMsgValidationcode.setParentTenantId(parentTenantId); | |||
| wxMsgValidationcode.setPhone(phone); | |||
| wxMsgValidationcode.setType(type); | |||
| wxMsgValidationcode.setAppid(appid); | |||
| @@ -104,10 +102,8 @@ public class WxMsgValidationcodeController extends BaseController { | |||
| public ResultData hasvalidationcode(String tenantId, String parentTenantId, String phone, Integer type, String code, String appid) { | |||
| logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeController::hasvalidationcode"); | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.updateTenantInfo(new TenantEntity(){{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}); | |||
| wxMsgValidationcode.setTenantId(tenantId); | |||
| wxMsgValidationcode.setParentTenantId(parentTenantId); | |||
| wxMsgValidationcode.setPhone(phone); | |||
| wxMsgValidationcode.setType(type); | |||
| wxMsgValidationcode.setCode(code); | |||
| @@ -241,9 +241,9 @@ public class HomeController extends BaseController { | |||
| logger.error("appid未找到"); | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| } | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(appinfo.getTenantId()); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(appinfo.getTenantId()); | |||
| if (StringUtils.isNotBlank(user.getPhone())) { | |||
| // 领导登录 | |||
| user = mallUserInfoService.getByPhone(user.getPhone(), tenantEntity); | |||
| @@ -5,7 +5,7 @@ INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permissio | |||
| --销售类型加权限 | |||
| update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' where id=1; | |||
| update mall_sale_type set menus = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 209, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 420, 421, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 961, 60701, 60702]' where id=2; | |||
| @@ -0,0 +1,5 @@ | |||
| ALTER TABLE `wx_msg_config` | |||
| ADD COLUMN `product` varchar(50) AFTER `sms_channel`, | |||
| ADD COLUMN `domain` varchar(100) AFTER `product`, | |||
| ADD COLUMN `region_id` varchar(50) AFTER `domain`, | |||
| ADD COLUMN `endpoint_name` varchar(50) AFTER `region_id`; | |||
| @@ -0,0 +1,5 @@ | |||
| --加地图看板菜单 | |||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (109, '地图看板', 1, 'Y', NULL, 1, NULL, NULL, 'mapban', 'icon-shuju', 0, 102); | |||
| --销售类型加权限 | |||
| update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' where id=1; | |||
| @@ -244,9 +244,9 @@ public class WxInfoController extends BaseController { | |||
| if (wxAppinfo == null) { | |||
| return new ResultData(Result.ERROR, "APP无权限"); | |||
| } | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(wxAppinfo.getTenantId()); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(wxAppinfo.getTenantId()); | |||
| try { | |||
| Map<String, String> retMap = getOpenIdInfo(appId, code); | |||
| String openId = retMap.get("openId"); | |||
| @@ -362,9 +362,9 @@ public class WxInfoController extends BaseController { | |||
| WxMaService wxMaService = getWeappService(appId); | |||
| WxAppinfo wxAppinfo = getAppInfo(appId); | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(wxAppinfo.getTenantId()); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(wxAppinfo.getTenantId()); | |||
| try { | |||
| // 解密 | |||
| WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(session_key, encryptedData, iv); | |||
| @@ -87,10 +87,8 @@ public class WxMsgValidationcodeController extends BaseController { | |||
| @ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData hasvalidationcode(String tenantId, String parentTenantId, String phone, Integer type, String code, String appid) { | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.updateTenantInfo(new TenantEntity(){{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}); | |||
| wxMsgValidationcode.setTenantId(tenantId); | |||
| wxMsgValidationcode.setParentTenantId(parentTenantId); | |||
| wxMsgValidationcode.setPhone(phone); | |||
| wxMsgValidationcode.setType(EnumMsgModel.VALIDATION_CODE.getCode()); | |||
| wxMsgValidationcode.setCode(code); | |||
| @@ -160,6 +160,8 @@ public class WxCouponOrderController extends BaseController { | |||
| wxCouponOrderCVo.setTailPrice(wxCouponCVo.getTailPrice()); | |||
| wxCouponOrderCVo.setOrigPrice(wxCouponCVo.getOrigPrice()); | |||
| wxCouponOrderCVo.setContentType(wxCouponCVo.getContentType()); | |||
| wxCouponOrderCVo.setUnit(wxCouponCVo.getUnit()); | |||
| wxCouponOrderCVo.setDetail(wxCouponCVo.getDetail()); | |||
| wxCouponOrderCVo.setRemark(wxCouponCVo.getRemark()); | |||
| @@ -2089,36 +2089,36 @@ public class PosServiceImpl implements PosService { | |||
| WxMerchantBUser merchantBUser, | |||
| WxOrder order, Long memId, | |||
| Long posPayOrderId, Integer neuPaymentAmount, Date neuPosPayOrderTime) { | |||
| WxPayOrder payOrder = new WxPayOrder() {{ | |||
| Date curDate = new Date(); | |||
| setTenantId(merchantBUser.getTenantId()); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long id = idWorker.nextId(); | |||
| setId(id); | |||
| updateTenantInfo(merchantBUser); | |||
| setCUserId(memId); | |||
| setOrderId(order.getId()); | |||
| setCreateTime(curDate); | |||
| setUpdateTime(curDate); | |||
| setPayTimeStart(curDate); | |||
| setPayTimeEnd(curDate); | |||
| setPayOrderNo(String.valueOf(id)); | |||
| setPayAmount(neuPaymentAmount); | |||
| setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| setShare(EnumPayShare.NO.getCode()); | |||
| setPosPayOrderId(posPayOrderId); | |||
| setPosPayOrderTime(neuPosPayOrderTime.getTime()); | |||
| /// TODO | |||
| /// setPosPaymentType(EnumNeuPosPamentType.MEM_DISCOUNT.getCode()); | |||
| setPosPayDes("POS会员折扣支付"); | |||
| }}; | |||
| Date curDate = new Date(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxPayOrder payOrder = new WxPayOrder(); | |||
| payOrder.setId(idWorker.nextId()); | |||
| payOrder.updateTenantInfo(merchantBUser); | |||
| payOrder.setCUserId(memId); | |||
| payOrder.setOrderId(order.getId()); | |||
| payOrder.setCreateTime(curDate); | |||
| payOrder.setUpdateTime(curDate); | |||
| payOrder.setPayTimeStart(curDate); | |||
| payOrder.setPayTimeEnd(curDate); | |||
| payOrder.setPayOrderNo(String.valueOf(payOrder.getId())); | |||
| payOrder.setPayAmount(neuPaymentAmount); | |||
| payOrder.setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| payOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| payOrder.setShare(EnumPayShare.NO.getCode()); | |||
| payOrder.setPosPayOrderId(posPayOrderId); | |||
| payOrder.setPosPayOrderTime(neuPosPayOrderTime.getTime()); | |||
| /// TODO | |||
| /// setPosPaymentType(EnumNeuPosPamentType.MEM_DISCOUNT.getCode()); | |||
| payOrder.setPosPayDes("POS会员折扣支付"); | |||
| int sqlRow = payOrderMapper.insert(payOrder); | |||
| if (sqlRow != 1) { | |||
| logger.error("pay order insert error: " + payOrder.toString()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL); | |||
| } | |||
| return payOrder; | |||
| } | |||
| /** | |||
| @@ -2143,30 +2143,28 @@ public class PosServiceImpl implements PosService { | |||
| if (null == payOrderList || payOrderList.size()<=0) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long payOrderId = idWorker.nextId(); | |||
| payOrder = new WxPayOrder() {{ | |||
| Date curDate = new Date(); | |||
| setId(payOrderId); | |||
| setTenantId(merchantBUser.getTenantId()); | |||
| updateTenantInfo(merchantBUser); | |||
| setCUserId(memId); | |||
| setBUserId(merchantBUser.getId()); | |||
| setOrderId(order.getId()); | |||
| setCreateTime(curDate); | |||
| setUpdateTime(curDate); | |||
| setPayTimeStart(curDate); | |||
| setPayTimeEnd(curDate); | |||
| setPayOrderNo(String.valueOf(payOrderId)); | |||
| setPayAmount(neuPaymentAmount); | |||
| setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| setShare(EnumPayShare.NO.getCode()); | |||
| setPayFrom(EnumPayFrom.POS.getCode()); | |||
| setPosPayOrderId(posPayOrderId); | |||
| setPosPayOrderTime(neuPosPayOrderTime.getTime()); | |||
| setPosPaymentType(EnumNeuPosPamentType.MEM_COUPON.getCode()); | |||
| setPosPayDes("POS优惠券支付"); | |||
| setPosPayOrderNo(posPayOrderNo); | |||
| }}; | |||
| payOrder = new WxPayOrder(); | |||
| Date curDate = new Date(); | |||
| payOrder.setId(payOrderId); | |||
| payOrder.updateTenantInfo(merchantBUser); | |||
| payOrder.setCUserId(memId); | |||
| payOrder.setBUserId(merchantBUser.getId()); | |||
| payOrder.setOrderId(order.getId()); | |||
| payOrder.setCreateTime(curDate); | |||
| payOrder.setUpdateTime(curDate); | |||
| payOrder.setPayTimeStart(curDate); | |||
| payOrder.setPayTimeEnd(curDate); | |||
| payOrder.setPayOrderNo(String.valueOf(payOrderId)); | |||
| payOrder.setPayAmount(neuPaymentAmount); | |||
| payOrder.setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| payOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| payOrder.setShare(EnumPayShare.NO.getCode()); | |||
| payOrder.setPayFrom(EnumPayFrom.POS.getCode()); | |||
| payOrder.setPosPayOrderId(posPayOrderId); | |||
| payOrder.setPosPayOrderTime(neuPosPayOrderTime.getTime()); | |||
| payOrder.setPosPaymentType(EnumNeuPosPamentType.MEM_COUPON.getCode()); | |||
| payOrder.setPosPayDes("POS优惠券支付"); | |||
| payOrder.setPosPayOrderNo(posPayOrderNo); | |||
| int sqlRow = payOrderMapper.insert(payOrder); | |||
| if (sqlRow != 1) { | |||
| logger.error("pay order insert error: " + payOrder.toString()); | |||
| @@ -2240,31 +2238,29 @@ public class PosServiceImpl implements PosService { | |||
| if (null == payOrderList || payOrderList.size()<=0) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long payOrderId = idWorker.nextId(); | |||
| payOrder = new WxPayOrder() {{ | |||
| Date curDate = new Date(); | |||
| setId(payOrderId); | |||
| setTenantId(buUser.getTenantId()); | |||
| updateTenantInfo(buUser); | |||
| setCUserId(memId); | |||
| setBUserId(buUser.getId()); | |||
| setOrderId(order.getId()); | |||
| setCreateTime(curDate); | |||
| setUpdateTime(curDate); | |||
| setPayTimeStart(curDate); | |||
| setPayTimeEnd(curDate); | |||
| setPayOrderNo(String.valueOf(payOrderId)); | |||
| setPayAmount(neuPaymentAmount); | |||
| setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| setShare(EnumPayShare.NO.getCode()); | |||
| setPayFrom(EnumPayFrom.POS.getCode()); | |||
| setPosPayOrderId(posPayOrderId); | |||
| setPosPayOrderTime(neuPosPayOrderTime.getTime()); | |||
| setPosPaymentType(EnumNeuPosPamentType.MEM_CARD.getCode()); | |||
| setPosPayDes("POS富茂卡支付"); | |||
| setPosPayOrderNo(posPayOrderNo); | |||
| }}; | |||
| payOrder = new WxPayOrder(); | |||
| Date curDate = new Date(); | |||
| payOrder.setId(payOrderId); | |||
| payOrder.setTenantId(buUser.getTenantId()); | |||
| payOrder.updateTenantInfo(buUser); | |||
| payOrder.setCUserId(memId); | |||
| payOrder.setBUserId(buUser.getId()); | |||
| payOrder.setOrderId(order.getId()); | |||
| payOrder.setCreateTime(curDate); | |||
| payOrder.setUpdateTime(curDate); | |||
| payOrder.setPayTimeStart(curDate); | |||
| payOrder.setPayTimeEnd(curDate); | |||
| payOrder.setPayOrderNo(String.valueOf(payOrderId)); | |||
| payOrder.setPayAmount(neuPaymentAmount); | |||
| payOrder.setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| payOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| payOrder.setShare(EnumPayShare.NO.getCode()); | |||
| payOrder.setPayFrom(EnumPayFrom.POS.getCode()); | |||
| payOrder.setPosPayOrderId(posPayOrderId); | |||
| payOrder.setPosPayOrderTime(neuPosPayOrderTime.getTime()); | |||
| payOrder.setPosPaymentType(EnumNeuPosPamentType.MEM_CARD.getCode()); | |||
| payOrder.setPosPayDes("POS富茂卡支付"); | |||
| payOrder.setPosPayOrderNo(posPayOrderNo); | |||
| int sqlRow = payOrderMapper.insert(payOrder); | |||
| if (sqlRow != 1) { | |||
| logger.error("pay order insert error: " + payOrder.toString()); | |||
| @@ -2317,30 +2313,29 @@ public class PosServiceImpl implements PosService { | |||
| if (null == payOrderList || payOrderList.size()<=0) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long payOrderId = idWorker.nextId(); | |||
| payOrder = new WxPayOrder() {{ | |||
| Date curDate = new Date(); | |||
| setId(payOrderId); | |||
| setTenantId(buUser.getTenantId()); | |||
| updateTenantInfo(buUser); | |||
| setCUserId(memId); | |||
| setOrderId(order.getId()); | |||
| setCreateTime(curDate); | |||
| setUpdateTime(curDate); | |||
| setPayTimeStart(curDate); | |||
| setPayTimeEnd(curDate); | |||
| setPayOrderNo(String.valueOf(payOrderId)); | |||
| setPayAmount(neuPaymentAmount); | |||
| setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| setShare(EnumPayShare.NO.getCode()); | |||
| setPayFrom(EnumPayFrom.POS.getCode()); | |||
| setPosPayOrderId(neuPayOrderId); | |||
| setPosPayOrderTime(neuPosPayOrderTime.getTime()); | |||
| setPosPaymentType(neuPayOrderType); | |||
| setPosPayDes("POS支付"); | |||
| setPosPayOrderNo(neuPayThirdNo); | |||
| }}; | |||
| payOrder = new WxPayOrder(); | |||
| Date curDate = new Date(); | |||
| payOrder.setId(payOrderId); | |||
| payOrder.setTenantId(buUser.getTenantId()); | |||
| payOrder.updateTenantInfo(buUser); | |||
| payOrder.setCUserId(memId); | |||
| payOrder.setOrderId(order.getId()); | |||
| payOrder.setCreateTime(curDate); | |||
| payOrder.setUpdateTime(curDate); | |||
| payOrder.setPayTimeStart(curDate); | |||
| payOrder.setPayTimeEnd(curDate); | |||
| payOrder.setPayOrderNo(String.valueOf(payOrderId)); | |||
| payOrder.setPayAmount(neuPaymentAmount); | |||
| payOrder.setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| payOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| payOrder.setShare(EnumPayShare.NO.getCode()); | |||
| payOrder.setPayFrom(EnumPayFrom.POS.getCode()); | |||
| payOrder.setPosPayOrderId(neuPayOrderId); | |||
| payOrder.setPosPayOrderTime(neuPosPayOrderTime.getTime()); | |||
| payOrder.setPosPaymentType(neuPayOrderType); | |||
| payOrder.setPosPayDes("POS支付"); | |||
| payOrder.setPosPayOrderNo(neuPayThirdNo); | |||
| int sqlRow = payOrderMapper.insert(payOrder); | |||
| if (sqlRow != 1) { | |||
| logger.error("pay order insert error: " + payOrder.toString()); | |||
| @@ -2386,13 +2381,12 @@ public class PosServiceImpl implements PosService { | |||
| String neuRefundThirdNo) { | |||
| // 1. pay order | |||
| // 查找支付订单 | |||
| WxPayOrder payOrderQ = new WxPayOrder() {{ | |||
| updateTenantInfo(refundOrder); | |||
| setCUserId(refundOrder.getCUserId()); | |||
| setOrderId(refundOrder.getId()); | |||
| setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| setPosPayOrderId(posPayOrderId); | |||
| }}; | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.updateTenantInfo(refundOrder); | |||
| payOrderQ.setCUserId(refundOrder.getCUserId()); | |||
| payOrderQ.setOrderId(refundOrder.getId()); | |||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| payOrderQ.setPosPayOrderId(posPayOrderId); | |||
| try { | |||
| payOrderQ = payOrderMapper.selectOne(new QueryWrapper<>(payOrderQ)); | |||
| @@ -2406,31 +2400,30 @@ public class PosServiceImpl implements PosService { | |||
| // 2. insert into refund order | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long refundId = idWorker.nextId(); | |||
| WxRefundOrder refundPayOrder = new WxRefundOrder() {{ | |||
| Date curDate = new Date(); | |||
| setId(refundId); | |||
| setRefundId(String.valueOf(refundId)); | |||
| setTenantId(buUser.getTenantId()); | |||
| updateTenantInfo(buUser); | |||
| setCUserId(memId); | |||
| setOrderId(refundOrder.getId()); | |||
| setCreateTime(curDate); | |||
| setUpdateTime(curDate); | |||
| setRefundTimeStart(curDate); | |||
| setRefundTimeEnd(curDate); | |||
| setTotalFee(posRefundAmount); | |||
| setRefundFee(posRefundAmount); | |||
| setRefundFrom(EnumPayFrom.POS.getCode()); | |||
| setRefundOrderStatus(EnumRefundStatus.REFUND_SUCCESS.getCode()); | |||
| setPosPayOrderId(posPayOrderId); | |||
| setPosRefundOrderId(posRefundOrderId); | |||
| setPosRefundOrderTime(posRefundOrderTime.getTime()); | |||
| setPosRefundOrderStatus(posRefundOrderStatus); | |||
| setPosRefundType(posRefundType); | |||
| setPosRefundDes("POS退款"); | |||
| setPosRefundOrderNo(neuRefundThirdNo); | |||
| }}; | |||
| WxRefundOrder refundPayOrder = new WxRefundOrder(); | |||
| Date curDate = new Date(); | |||
| refundPayOrder.setId(refundId); | |||
| refundPayOrder.setRefundId(String.valueOf(refundId)); | |||
| refundPayOrder.setTenantId(buUser.getTenantId()); | |||
| refundPayOrder.updateTenantInfo(buUser); | |||
| refundPayOrder.setCUserId(memId); | |||
| refundPayOrder.setOrderId(refundOrder.getId()); | |||
| refundPayOrder.setCreateTime(curDate); | |||
| refundPayOrder.setUpdateTime(curDate); | |||
| refundPayOrder.setRefundTimeStart(curDate); | |||
| refundPayOrder.setRefundTimeEnd(curDate); | |||
| refundPayOrder.setTotalFee(posRefundAmount); | |||
| refundPayOrder.setRefundFee(posRefundAmount); | |||
| refundPayOrder.setRefundFrom(EnumPayFrom.POS.getCode()); | |||
| refundPayOrder.setRefundOrderStatus(EnumRefundStatus.REFUND_SUCCESS.getCode()); | |||
| refundPayOrder.setPosPayOrderId(posPayOrderId); | |||
| refundPayOrder.setPosRefundOrderId(posRefundOrderId); | |||
| refundPayOrder.setPosRefundOrderTime(posRefundOrderTime.getTime()); | |||
| refundPayOrder.setPosRefundOrderStatus(posRefundOrderStatus); | |||
| refundPayOrder.setPosRefundType(posRefundType); | |||
| refundPayOrder.setPosRefundDes("POS退款"); | |||
| refundPayOrder.setPosRefundOrderNo(neuRefundThirdNo); | |||
| refundPayOrder.setPayOrderNo(String.valueOf(payOrderQ.getId())); | |||
| int sqlRow = refundOrderMapper.insert(refundPayOrder); | |||
| @@ -2457,12 +2450,12 @@ public class PosServiceImpl implements PosService { | |||
| final Long posOrderId, final Integer posAmount, final Date posOrderTime, final String orderCreateSn | |||
| ) { | |||
| boolean isExist = true; | |||
| WxOrder orderQ = new WxOrder() {{ | |||
| setType(EnumOrderType.POSPAY.getCode()); | |||
| setCUserId(memId); | |||
| setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| setPosOrderId(posOrderId); | |||
| }}; | |||
| WxOrder orderQ = new WxOrder(); | |||
| orderQ.setType(EnumOrderType.POSPAY.getCode()); | |||
| orderQ.setCUserId(memId); | |||
| orderQ.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| orderQ.setPosOrderId(posOrderId); | |||
| try { | |||
| orderQ = orderMapper.selectOne(new QueryWrapper<>(orderQ)); | |||
| } catch (Exception e) { | |||
| @@ -2475,25 +2468,25 @@ public class PosServiceImpl implements PosService { | |||
| } | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long orderId = idWorker.nextId(); | |||
| WxOrder order = new WxOrder() {{ | |||
| Date curr = new Date(); | |||
| String bodyStr = "POS支付, 金额: " + posAmount; | |||
| setId(orderId); | |||
| updateTenantInfo(merchantBUser); | |||
| setOrderNumber(orderId); | |||
| setType(EnumOrderType.POSPAY.getCode()); | |||
| setProductId(merchantBUser.getId()); | |||
| setCUserId(memId); | |||
| setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| setPayment(posAmount); | |||
| setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); | |||
| setDetail(bodyStr); | |||
| setCreateDate(curr); | |||
| setUpdateDate(curr); | |||
| setPosOrderId(posOrderId); | |||
| setPosOrderCreateTime(posOrderTime.getTime()); | |||
| setPosOrderCreateSn(orderCreateSn); | |||
| }}; | |||
| WxOrder order = new WxOrder(); | |||
| Date curr = new Date(); | |||
| String bodyStr = "POS支付, 金额: " + posAmount; | |||
| order.setId(orderId); | |||
| order.updateTenantInfo(merchantBUser); | |||
| order.setOrderNumber(orderId); | |||
| order.setType(EnumOrderType.POSPAY.getCode()); | |||
| order.setProductId(merchantBUser.getId()); | |||
| order.setCUserId(memId); | |||
| order.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| order.setPayment(posAmount); | |||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); | |||
| order.setDetail(bodyStr); | |||
| order.setCreateDate(curr); | |||
| order.setUpdateDate(curr); | |||
| order.setPosOrderId(posOrderId); | |||
| order.setPosOrderCreateTime(posOrderTime.getTime()); | |||
| order.setPosOrderCreateSn(orderCreateSn); | |||
| try { | |||
| orderMapper.insert(order); | |||
| @@ -2519,12 +2512,12 @@ public class PosServiceImpl implements PosService { | |||
| final Long posOrderId, final Integer orderAmount, final Date posOrderTime, final String orderCreateSn | |||
| ) { | |||
| // 1. 查找正向订单 | |||
| WxOrder orderQ = new WxOrder() {{ | |||
| setType(EnumOrderType.POSPAY.getCode()); | |||
| setCUserId(memId); | |||
| setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| setPosOrderId(posOrderId); | |||
| }}; | |||
| WxOrder orderQ = new WxOrder(); | |||
| orderQ.setType(EnumOrderType.POSPAY.getCode()); | |||
| orderQ.setCUserId(memId); | |||
| orderQ.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| orderQ.setPosOrderId(posOrderId); | |||
| try { | |||
| orderQ = orderMapper.selectOne(new QueryWrapper<>(orderQ)); | |||
| } catch (Exception e) { | |||
| @@ -2536,11 +2529,10 @@ public class PosServiceImpl implements PosService { | |||
| } | |||
| // 2. 查找是否有退款订单 | |||
| WxOrder refundQ = new WxOrder() {{ | |||
| setType(EnumOrderType.POSPAY.getCode()); | |||
| setCUserId(memId); | |||
| setPosOrderId(posOrderId); | |||
| }}; | |||
| WxOrder refundQ = new WxOrder(); | |||
| refundQ.setType(EnumOrderType.POSPAY.getCode()); | |||
| refundQ.setCUserId(memId); | |||
| refundQ.setPosOrderId(posOrderId); | |||
| refundQ.setOrderNumber(orderQ.getOrderNumber()); | |||
| try { | |||
| refundQ = orderMapper.selectOne(new QueryWrapper<>(refundQ)); | |||
| @@ -2555,24 +2547,24 @@ public class PosServiceImpl implements PosService { | |||
| // 3. 创建退款订单 | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long orderId = idWorker.nextId(); | |||
| WxOrder order = new WxOrder() {{ | |||
| Date curr = new Date(); | |||
| String bodyStr = "POS退款, 金额: " + orderAmount; | |||
| setId(orderId); | |||
| updateTenantInfo(buUser); | |||
| setType(EnumOrderType.POSPAY.getCode()); | |||
| setProductId(buUser.getId()); | |||
| setCUserId(memId); | |||
| setPaymentType(EnumPayType.PAY_POS_REFUND.getCode()); | |||
| setPayment(orderAmount); | |||
| setOrderStatus(EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS.getCode()); | |||
| setDetail(bodyStr); | |||
| setCreateDate(curr); | |||
| setUpdateDate(curr); | |||
| setPosOrderId(posOrderId); | |||
| setPosOrderCreateTime(posOrderTime.getTime()); | |||
| setPosOrderCreateSn(orderCreateSn); | |||
| }}; | |||
| WxOrder order = new WxOrder(); | |||
| Date curr = new Date(); | |||
| String bodyStr = "POS退款, 金额: " + orderAmount; | |||
| order.setId(orderId); | |||
| order.updateTenantInfo(buUser); | |||
| order.setType(EnumOrderType.POSPAY.getCode()); | |||
| order.setProductId(buUser.getId()); | |||
| order.setCUserId(memId); | |||
| order.setPaymentType(EnumPayType.PAY_POS_REFUND.getCode()); | |||
| order.setPayment(orderAmount); | |||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS.getCode()); | |||
| order.setDetail(bodyStr); | |||
| order.setCreateDate(curr); | |||
| order.setUpdateDate(curr); | |||
| order.setPosOrderId(posOrderId); | |||
| order.setPosOrderCreateTime(posOrderTime.getTime()); | |||
| order.setPosOrderCreateSn(orderCreateSn); | |||
| order.setOrderNumber(orderQ.getOrderNumber()); | |||
| try { | |||
| @@ -56,8 +56,8 @@ public class AppTest { | |||
| // paramMap.put("shopName","百丽");//门店名称 | |||
| paramMap.put("userNumber","516625539215818752");//***会员Id | |||
| // paramMap.put("userPhone","18872592633");//会员手机号 | |||
| paramMap.put("timeEnd","2021-07-20 14:18:00");//***付款时间(yyyy-MM-dd HH:mm:ss) | |||
| paramMap.put("amount","1800");//***付款金额(分) | |||
| paramMap.put("timeEnd","2021-07-20 15:19:00");//***付款时间(yyyy-MM-dd HH:mm:ss) | |||
| paramMap.put("amount","17900");//***付款金额(分) | |||
| // paramMap.put("summary","");//付款摘要 | |||
| /** | |||
| @@ -107,7 +107,7 @@ public class AppTest { | |||
| /** | |||
| * 创建交易信息 接口 | |||
| */ | |||
| String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/thirdCircle/order", headMap, JSON.toJSONString(paramMap)); | |||
| String s = HttpUtil.doPost("https://openapi.malls.iformall.com/api/thirdCircle/order", headMap, JSON.toJSONString(paramMap)); | |||
| // String s = HttpUtil.doPost("http://localhost:7070/public/api/thirdCircle/order", headMap, JSON.toJSONString(paramMap)); | |||
| @@ -68,10 +68,8 @@ public class BillNotificationSchedule { | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.BILL_OWE.getCode()); | |||
| wxMsgRecord.setReceiver(phone); | |||
| wxMsgRecord.updateTenantInfo(new TenantEntity(){{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}); | |||
| wxMsgRecord.setTenantId(tenantId); | |||
| wxMsgRecord.setParentTenantId(parentTenantId); | |||
| Map<String, String> map = new HashedMap(); | |||
| map.put("price", price.toString()); | |||
| map.put("app", appname); | |||
| @@ -101,10 +99,8 @@ public class BillNotificationSchedule { | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.BILL_WAIT_PAY.getCode()); | |||
| wxMsgRecord.setReceiver(phone); | |||
| wxMsgRecord.updateTenantInfo(new TenantEntity(){{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}); | |||
| wxMsgRecord.setTenantId(tenantId); | |||
| wxMsgRecord.setParentTenantId(parentTenantId); | |||
| Map<String, String> map = new HashedMap(); | |||
| map.put("price", price.toString()); | |||
| map.put("app", appname); | |||
| @@ -57,9 +57,9 @@ public class WxAppVisitSchedule { | |||
| if(StringUtils.isBlank(app.getAppId())||StringUtils.isBlank(app.getSecret())||StringUtils.isBlank(app.getTenantId())) { | |||
| continue; | |||
| } | |||
| TenantEntity TenantEntity = new TenantEntity(){{ | |||
| setTenantId(app.getTenantId()); | |||
| }}; | |||
| TenantEntity TenantEntity = new TenantEntity(); | |||
| TenantEntity.setTenantId(app.getTenantId()); | |||
| WxMall byTenantInfo = wxMallService.getByTenantInfo(TenantEntity); | |||
| if(byTenantInfo != null && StringUtils.isNotBlank(byTenantInfo.getParentTenantId())){ | |||
| app.setParentTenantId(byTenantInfo.getParentTenantId()); | |||
| @@ -89,9 +89,9 @@ public class WxAppVisitSchedule { | |||
| if(StringUtils.isBlank(appinfo.getAppId())||StringUtils.isBlank(appinfo.getSecret())||StringUtils.isBlank(appinfo.getTenantId())) { | |||
| continue; | |||
| } | |||
| TenantEntity TenantEntity = new TenantEntity(){{ | |||
| setTenantId(appinfo.getTenantId()); | |||
| }}; | |||
| TenantEntity TenantEntity = new TenantEntity(); | |||
| TenantEntity.setTenantId(appinfo.getTenantId()); | |||
| WxMall byTenantInfo = wxMallService.getByTenantInfo(TenantEntity); | |||
| if(byTenantInfo != null && StringUtils.isNotBlank(byTenantInfo.getParentTenantId())){ | |||
| appinfo.setParentTenantId(byTenantInfo.getParentTenantId()); | |||
| @@ -43,5 +43,14 @@ public class WxMsgConfig extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="发短信渠道0:wiwidi; 11:aliyun",name="smsChannel") | |||
| private Integer smsChannel; | |||
| // 短信API产品名称(短信产品名固定,无需修改) product = "Dysmsapi" | |||
| private String product; | |||
| //短信API产品域名,接口地址固定,无需修改 domain = "dysmsapi.aliyuncs.com" | |||
| private String domain; | |||
| //API支持的RegionID,如短信API的值为: cn-hangzhou。 | |||
| private String regionId; | |||
| //服务结点: cn-hangzhou | |||
| private String endpointName; | |||
| } | |||
| @@ -66,9 +66,10 @@ public class BaseTenantEntity extends BaseEntity { | |||
| } | |||
| public TenantEntity getTenantInfo() { | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| return tenantEntity; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| tenantEntity.setParentTenantId(parentTenantId); | |||
| return tenantEntity; | |||
| } | |||
| public String getTenantId() { | |||
| @@ -42,12 +42,12 @@ public class TenantVEntity extends BaseEntity { | |||
| } | |||
| public TenantEntity getTenantInfo() { | |||
| return new TenantEntity() {{ | |||
| setTenantId(tenantId); | |||
| if (StringUtils.isNotBlank(parentTenantId)) { | |||
| setParentTenantId(parentTenantId); | |||
| } | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| if (StringUtils.isNotBlank(parentTenantId)) { | |||
| tenantEntity.setParentTenantId(parentTenantId); | |||
| } | |||
| return tenantEntity; | |||
| } | |||
| public String getTenantId() { | |||
| @@ -67,10 +67,10 @@ public class BaseMsg extends BaseEntity { | |||
| } | |||
| public TenantEntity getTenantInfo() { | |||
| return new TenantEntity() {{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| tenantEntity.setParentTenantId(parentTenantId); | |||
| return tenantEntity; | |||
| } | |||
| public String getFinalTenantId() { | |||
| @@ -92,9 +92,9 @@ public class WxMsg extends BaseMsg { | |||
| } | |||
| public TenantEntity getTenantInfo() { | |||
| return new TenantEntity() {{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| tenantEntity.setParentTenantId(parentTenantId); | |||
| return tenantEntity; | |||
| } | |||
| } | |||
| @@ -15,8 +15,6 @@ import java.util.Map; | |||
| public class WxMsgRecord extends BaseMsg { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="消息类型 1短信 2回调短信 3邮件 4微信小程序模板 5微信公众号模板 6系统通知 7websocket",name="msg") | |||
| private String msg; | |||
| @io.swagger.annotations.ApiModelProperty(value="发送时间",name="sendTime") | |||
| @@ -53,13 +51,4 @@ public class WxMsgRecord extends BaseMsg { | |||
| @io.swagger.annotations.ApiModelProperty(value="动态替换内容",name="dynamicContentMap") | |||
| private Map<String,String> dynamicContentMap; | |||
| public void updateTenantInfo(TenantEntity tenantEntity) { | |||
| setTenantId(tenantEntity.getTenantId()); | |||
| } | |||
| public TenantEntity getTenantInfo() { | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| return tenantEntity; | |||
| } | |||
| } | |||
| @@ -77,14 +77,13 @@ public class MallPermissionServiceImpl implements MallPermissionService { | |||
| public List<Long> queryAdminMenuList(MallUserInfo userInfo) { | |||
| if(userInfo.fmSuperAdmin() || | |||
| userInfo.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode())) { | |||
| WxMall q = new WxMall() {{ | |||
| if (StringUtils.isBlank(userInfo.getParentTenantId())) { | |||
| setTenantId(userInfo.getTenantId()); | |||
| } else { | |||
| setTenantId(userInfo.getTenantId()); | |||
| setParentTenantId(userInfo.getParentTenantId()); | |||
| } | |||
| }}; | |||
| WxMall q = new WxMall(); | |||
| if (StringUtils.isBlank(userInfo.getParentTenantId())) { | |||
| q.setTenantId(userInfo.getTenantId()); | |||
| } else { | |||
| q.setTenantId(userInfo.getTenantId()); | |||
| q.setParentTenantId(userInfo.getParentTenantId()); | |||
| } | |||
| String menus = wxMallMapper.queryMenusByTenantInfo(q); | |||
| JSONArray menuIdList = JSON.parseArray(menus); | |||
| return menuIdList.toJavaList(Long.class); | |||
| @@ -122,9 +121,9 @@ public class MallPermissionServiceImpl implements MallPermissionService { | |||
| } else if (userInfo.checkGroupAdmin()) { | |||
| // 集团超管 | |||
| // if (boolNav) { | |||
| WxMall q = new WxMall() {{ | |||
| setTenantId(userInfo.getTenantId()); | |||
| }}; | |||
| WxMall q = new WxMall(); | |||
| q.setTenantId(userInfo.getTenantId()); | |||
| String menus = wxMallMapper.queryMenusByTenantInfo(q); | |||
| JSONArray menuIdList = JSON.parseArray(menus); | |||
| return getAllMenuListByParentId(0L, menuIdList.toJavaList(Long.class), boolNav); | |||
| @@ -134,10 +133,10 @@ public class MallPermissionServiceImpl implements MallPermissionService { | |||
| // } | |||
| } else if (userInfo.checkAdmin()) { | |||
| // 租户超管 | |||
| WxMall q = new WxMall() {{ | |||
| setTenantId(userInfo.getTenantId()); | |||
| setParentTenantId(userInfo.getParentTenantId()); | |||
| }}; | |||
| WxMall q = new WxMall(); | |||
| q.setTenantId(userInfo.getTenantId()); | |||
| q.setParentTenantId(userInfo.getParentTenantId()); | |||
| String menus = wxMallMapper.queryMenusByTenantInfo(q); | |||
| JSONArray menuIdList = JSON.parseArray(menus); | |||
| if (null != menuIdList) { | |||
| @@ -95,11 +95,11 @@ public class MemCouponFromDspServiceImpl implements MemCouponFromDspService { | |||
| user.setOperatorType(EnumUserType.MALLUSER.getCode()); | |||
| user.setOperatorId(user.getId()); | |||
| // 手机是否有未注的券 | |||
| MemCouponFromDsp memQ = new MemCouponFromDsp() {{ | |||
| updateTenantInfo(record); | |||
| setPhone(record.getPhone()); | |||
| setStatus(EnumCouponDspStatus.RECEIVED.getCode()); | |||
| }}; | |||
| MemCouponFromDsp memQ = new MemCouponFromDsp(); | |||
| memQ.updateTenantInfo(record); | |||
| memQ.setPhone(record.getPhone()); | |||
| memQ.setStatus(EnumCouponDspStatus.RECEIVED.getCode()); | |||
| List<MemCouponFromDsp> couponFromDsps = memCouponFromDspMapper.findList(memQ); | |||
| for (MemCouponFromDsp memCouponFromDsp: couponFromDsps) { | |||
| // 注入券码, 无论此券是有价还是免费 | |||
| @@ -128,10 +128,10 @@ public class MemCouponFromDspServiceImpl implements MemCouponFromDspService { | |||
| @Override | |||
| public void couponOrderFromDsp(TenantEntity tenantEntity, String phone) { | |||
| List<MemCouponFromDsp> couponFromDsps = getList( new MemCouponFromDsp() {{ | |||
| updateTenantInfo(tenantEntity); | |||
| setPhone(phone); | |||
| }}); | |||
| MemCouponFromDsp mcfdQ= new MemCouponFromDsp(); | |||
| mcfdQ.updateTenantInfo(tenantEntity); | |||
| mcfdQ.setPhone(phone); | |||
| List<MemCouponFromDsp> couponFromDsps = getList(mcfdQ); | |||
| for(MemCouponFromDsp memCouponFromDsp: couponFromDsps ){ | |||
| couponOrder(memCouponFromDsp); | |||
| } | |||
| @@ -1646,10 +1646,9 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| String manager = (String) mapList.get(0).get("manager"); | |||
| String managerPhone = (String) mapList.get(0).get("managerPhone"); | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| tenantEntity.setParentTenantId(parentTenantId); | |||
| String billListStr = ""; | |||
| BigDecimal sumNeedPay = new BigDecimal(0); | |||
| @@ -1707,10 +1706,9 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| String managerPhone = (String) mapList.get(0).get("managerPhone"); | |||
| Long expiredDay = (Long) mapList.get(0).get("expiredDay"); | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| tenantEntity.setParentTenantId(parentTenantId); | |||
| String billListStr = ""; | |||
| BigDecimal sumNeedPay = new BigDecimal(0); | |||
| @@ -99,9 +99,9 @@ public class WxBrandServiceImpl implements WxBrandService { | |||
| @Override | |||
| public List<Map<String,Object>> queryBrand(TenantEntity tenantEntity) { | |||
| WxBrand wxBrand = new WxBrand() {{ | |||
| updateTenantInfo(tenantEntity); | |||
| }}; | |||
| WxBrand wxBrand = new WxBrand(); | |||
| wxBrand.updateTenantInfo(tenantEntity); | |||
| return wxBrandMapper.queryBrandByTenant(wxBrand); | |||
| } | |||
| @@ -538,7 +538,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| return resList; | |||
| } | |||
| private List<WxTags> assignTypeId18(WxCUserBasicInfo user) { | |||
| private List<WxTags> assignTypeId18(WxCUserBasicInfo user,TenantEntity tenantEntity) { | |||
| List<WxTags> resList = null; | |||
| final int WORK_DAY = 0; | |||
| @@ -558,12 +558,14 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| startC.add(Calendar.DAY_OF_YEAR, -30); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| wxCouponOrder.setCUserId(user.getId()); | |||
| wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||
| wxCouponOrder.setStartTime(startC.getTime()); | |||
| wxCouponOrder.setEndTime(endC.getTime()); | |||
| WxCardSpend wxCardSpend = new WxCardSpend(); | |||
| wxCardSpend.updateTenantInfo(tenantEntity); | |||
| wxCardSpend.setOwnerId(user.getId()); | |||
| wxCardSpend.setStartdate(startC.getTime()); | |||
| wxCardSpend.setEnddate(endC.getTime()); | |||
| @@ -632,7 +634,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| return resList; | |||
| } | |||
| private List<WxTags> assignTypeId22(WxCUserBasicInfo user) { | |||
| private List<WxTags> assignTypeId22(WxCUserBasicInfo user,TenantEntity tenantEntity) { | |||
| List<WxTags> resList = null; | |||
| int days = (int) ((new Date().getTime() - user.getCreateDate().getTime()) / (1000*3600*24)); | |||
| @@ -772,9 +774,9 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| //饮食偏好 | |||
| resList = assignTypeId17(user,tenantEntity); | |||
| //消费时段 | |||
| resList = assignTypeId18(user); | |||
| resList = assignTypeId18(user,tenantEntity); | |||
| //消费频度 | |||
| resList = assignTypeId22(user); | |||
| resList = assignTypeId22(user,tenantEntity); | |||
| } | |||
| } | |||
| break; | |||
| @@ -841,9 +843,9 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| resList = assignTypeId17(user,tenantEntity); | |||
| //消费时段 | |||
| resList = assignTypeId18(user); | |||
| resList = assignTypeId18(user,tenantEntity); | |||
| //消费频度 | |||
| resList = assignTypeId22(user); | |||
| resList = assignTypeId22(user,tenantEntity); | |||
| //活跃 | |||
| resList = assignTypeId21(user,tenantEntity); | |||
| @@ -816,10 +816,11 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| // 4. get user info | |||
| WxCUser user = null; | |||
| List<WxCUser> list = wxCUserMapper.findList(new WxCUser(){{ | |||
| updateTenantInfo(bUser); | |||
| setUserId(couponOrder.getCUserId()); | |||
| }}); | |||
| WxCUser wcuQ = new WxCUser(); | |||
| wcuQ.updateTenantInfo(bUser); | |||
| wcuQ.setUserId(couponOrder.getCUserId()); | |||
| List<WxCUser> list = wxCUserMapper.findList(wcuQ); | |||
| if(list != null && list.size() > 0){ | |||
| user = list.get(0); | |||
| } | |||
| @@ -1447,45 +1448,44 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| // 添加payOrder | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long payOrderId = idWorker.nextId(); | |||
| WxPayOrder payOrder = new WxPayOrder() {{ | |||
| Date curDate = new Date(); | |||
| setId(payOrderId); | |||
| updateTenantInfo(microOrder); | |||
| setCUserId(microOrder.getCUserId()); | |||
| setOrderId(microOrder.getId()); | |||
| setCreateTime(curDate); | |||
| setUpdateTime(curDate); | |||
| setPayTimeStart(curDate); | |||
| setPayTimeEnd(curDate); | |||
| setPayOrderNo(String.valueOf(payOrderId)); | |||
| setIp(ipstr); | |||
| setAuthCode(authCode); | |||
| Integer payAmount = microOrder.getPayment() - wxCoupon.getPrice(); | |||
| setPayAmount(payAmount); | |||
| WxPayOrder payOrder = new WxPayOrder(); | |||
| Date curDate = new Date(); | |||
| payOrder.setId(payOrderId); | |||
| payOrder.updateTenantInfo(microOrder); | |||
| payOrder.setCUserId(microOrder.getCUserId()); | |||
| payOrder.setOrderId(microOrder.getId()); | |||
| payOrder.setCreateTime(curDate); | |||
| payOrder.setUpdateTime(curDate); | |||
| payOrder.setPayTimeStart(curDate); | |||
| payOrder.setPayTimeEnd(curDate); | |||
| payOrder.setPayOrderNo(String.valueOf(payOrderId)); | |||
| payOrder.setIp(ipstr); | |||
| payOrder.setAuthCode(authCode); | |||
| Integer payAmount = microOrder.getPayment() - wxCoupon.getPrice(); | |||
| payOrder.setPayAmount(payAmount); | |||
| // if (microOrder.getPayment() > wxCoupon.getPrice()) { | |||
| // setPayAmount(wxCoupon.getPrice()); | |||
| // payOrder.setPayAmount(wxCoupon.getPrice()); | |||
| // } else { | |||
| // setPayAmount(microOrder.getPayment()); | |||
| // payOrder.setPayAmount(microOrder.getPayment()); | |||
| // } | |||
| setPayVendor(payWay.getCode()); | |||
| setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | |||
| setShare(shareCode); | |||
| if (shareCode.intValue() == EnumPayShare.YES.getCode().intValue()) { | |||
| // 分账金额 | |||
| int iChargeFee = PayUtils.getPayRate(payAmount, payAccount.getRate(), false); | |||
| Integer share_amount = payAmount - iChargeFee; | |||
| setShareAmount(share_amount); | |||
| if(payAccount.getRealRate() != null) { | |||
| int iRealChargeFee = PayUtils.getPayRate(payAmount, payAccount.getRealRate(), true); | |||
| setRateAmount(iRealChargeFee); | |||
| } | |||
| if (share_amount <= 0) { | |||
| setShare(EnumPayShare.NO.getCode()); | |||
| } | |||
| payOrder.setPayVendor(payWay.getCode()); | |||
| payOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | |||
| payOrder.setShare(shareCode); | |||
| if (shareCode.intValue() == EnumPayShare.YES.getCode().intValue()) { | |||
| // 分账金额 | |||
| int iChargeFee = PayUtils.getPayRate(payAmount, payAccount.getRate(), false); | |||
| Integer share_amount = payAmount - iChargeFee; | |||
| payOrder.setShareAmount(share_amount); | |||
| if(payAccount.getRealRate() != null) { | |||
| int iRealChargeFee = PayUtils.getPayRate(payAmount, payAccount.getRealRate(), true); | |||
| payOrder.setRateAmount(iRealChargeFee); | |||
| } | |||
| if (share_amount <= 0) { | |||
| payOrder.setShare(EnumPayShare.NO.getCode()); | |||
| } | |||
| setPayFrom(EnumPayFrom.INSIDE_B.getCode()); | |||
| setPosPayOrderId(couponOrder.getId()); | |||
| }}; | |||
| } | |||
| payOrder.setPayFrom(EnumPayFrom.INSIDE_B.getCode()); | |||
| payOrder.setPosPayOrderId(couponOrder.getId()); | |||
| try { | |||
| payOrderMapper.insert(payOrder); | |||
| @@ -440,10 +440,10 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| private void sendMsgForSendCoupon(TenantEntity tenantEntity, WxCouponSend send, WxCouponOrder couponOrder, WxCUserBasicInfo user) { | |||
| List<WxCUser> list = wxCUserMapper.findList(new WxCUser(){{ | |||
| updateTenantInfo(tenantEntity); | |||
| setUserId(couponOrder.getCUserId()); | |||
| }}); | |||
| WxCUser wcuQ = new WxCUser(); | |||
| wcuQ.updateTenantInfo(tenantEntity); | |||
| wcuQ.setUserId(couponOrder.getCUserId()); | |||
| List<WxCUser> list = wxCUserMapper.findList(wcuQ); | |||
| if(list != null && list.size() > 0){ | |||
| for (WxCUser cuser:list) { | |||
| //发订阅消息 | |||
| @@ -332,9 +332,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| //有价券判断商户是否配置了分账账号 | |||
| if (record.getSalePrice() != null && record.getSalePrice() > 0) { | |||
| boolean share = false; | |||
| WxPayAccount payQ = new WxPayAccount() {{ | |||
| updateTenantInfo(record); | |||
| }}; | |||
| WxPayAccount payQ = new WxPayAccount(); | |||
| payQ.updateTenantInfo(record); | |||
| try { | |||
| WxPayAccount payAccount = payAccountMapper.selectOne(new QueryWrapper<>(payQ)); | |||
| if (payAccount != null) { | |||
| @@ -172,23 +172,22 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { | |||
| String [] floors = record.getFloors().split(","); | |||
| // 楼座 | |||
| WxMallBuilding mallBuilding = new WxMallBuilding() {{ | |||
| setId(idWorker.nextId()); | |||
| updateTenantInfo(record); | |||
| setName(record.getBuilding()); | |||
| setFloorNumber(floors.size()); | |||
| }}; | |||
| WxMallBuilding mallBuilding = new WxMallBuilding(); | |||
| mallBuilding.setId(idWorker.nextId()); | |||
| mallBuilding.updateTenantInfo(record); | |||
| mallBuilding.setName(record.getBuilding()); | |||
| mallBuilding.setFloorNumber(floors.length); | |||
| wxMallBuildingMapper.insert(mallBuilding); | |||
| // 楼层 | |||
| for(String floor: floors) { | |||
| WxMallFloor mallFloor = new WxMallFloor() {{ | |||
| setId(idWorker.nextId()); | |||
| updateTenantInfo(record); | |||
| setBuildingId(mallBuilding.getId()); | |||
| setFloorName(floor); | |||
| setBackgroundImg(Constant.floor_back_img); | |||
| }}; | |||
| WxMallFloor mallFloor = new WxMallFloor(); | |||
| mallFloor.setId(idWorker.nextId()); | |||
| mallFloor.updateTenantInfo(record); | |||
| mallFloor.setBuildingId(mallBuilding.getId()); | |||
| mallFloor.setFloorName(floor); | |||
| mallFloor.setBackgroundImg(Constant.floor_back_img); | |||
| wxMallFloorMapper.insert(mallFloor); | |||
| } | |||
| @@ -199,16 +198,15 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { | |||
| @Override | |||
| public void saveFloorArea(WxMallFloor record) { | |||
| WxMallFloor mallFloor = new WxMallFloor() {{ | |||
| setId(record.getId()); | |||
| updateTenantInfo(record); | |||
| if (record.getTotalArea() != null) { | |||
| setTotalArea(record.getTotalArea()); | |||
| } | |||
| if (record.getOperatingArea() != null) { | |||
| setOperatingArea(record.getOperatingArea()); | |||
| } | |||
| }}; | |||
| WxMallFloor mallFloor = new WxMallFloor(); | |||
| mallFloor.setId(record.getId()); | |||
| mallFloor.updateTenantInfo(record); | |||
| if (record.getTotalArea() != null) { | |||
| mallFloor.setTotalArea(record.getTotalArea()); | |||
| } | |||
| if (record.getOperatingArea() != null) { | |||
| mallFloor.setOperatingArea(record.getOperatingArea()); | |||
| } | |||
| wxMallFloorMapper.updateById(mallFloor); | |||
| String key = Constant.mallBuildingPrev + record.getTenantId(); | |||
| @@ -222,15 +220,14 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { | |||
| @Override | |||
| public void saveFloorImg(WxMallFloor record) { | |||
| WxMallFloor mallFloor = new WxMallFloor() {{ | |||
| setId(record.getId()); | |||
| updateTenantInfo(record); | |||
| if(record.getFloorMaps() == null || record.getFloorMaps().size() == 0){ | |||
| setFloorMap("[]"); | |||
| }else{ | |||
| setFloorMap(JSON.toJSONString(record.getFloorMaps())); | |||
| } | |||
| }}; | |||
| WxMallFloor mallFloor = new WxMallFloor(); | |||
| mallFloor.setId(record.getId()); | |||
| mallFloor.updateTenantInfo(record); | |||
| if(record.getFloorMaps() == null || record.getFloorMaps().size() == 0){ | |||
| mallFloor.setFloorMap("[]"); | |||
| }else{ | |||
| mallFloor.setFloorMap(JSON.toJSONString(record.getFloorMaps())); | |||
| } | |||
| wxMallFloorMapper.updateById(mallFloor); | |||
| } | |||
| @@ -143,9 +143,8 @@ public class WxMallServiceImpl implements WxMallService { | |||
| if (mall == null) { | |||
| return null; | |||
| } | |||
| WxMallBuilding wxMallBuilding = new WxMallBuilding() {{ | |||
| updateTenantInfo(tenantEntity); | |||
| }}; | |||
| WxMallBuilding wxMallBuilding = new WxMallBuilding(); | |||
| wxMallBuilding.updateTenantInfo(tenantEntity); | |||
| List<WxMallBuilding> buildings = wxMallBuildingMapper.findList(wxMallBuilding); | |||
| List<WxMallBuilding> wxMallBuildings = buildings.stream().map(b -> { | |||
| WxMallBuilding tempb = new WxMallBuilding(); | |||
| @@ -238,9 +237,9 @@ public class WxMallServiceImpl implements WxMallService { | |||
| @Override | |||
| public void undateSubmall(String parentTenantId, List<String> tenantIds) { | |||
| wxMallMapper.undateSubmall(parentTenantId, tenantIds); | |||
| this.deleteRedis(new TenantEntity(){{ | |||
| setTenantId(parentTenantId); | |||
| }}); | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(parentTenantId); | |||
| this.deleteRedis(tenantEntity); | |||
| } | |||
| @Override | |||
| @@ -73,9 +73,8 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { | |||
| } | |||
| } | |||
| String result = SMSFactory.addTemplate(secret, bid, wxMsgConfig.getPublickey(), signature, | |||
| content, wxMsgConfig.getModelnotifyurl(),EnumVerifyCode.NO.getCode().toString(), | |||
| wxMsgModel.getName(),1,wxMsgModel.getName(),wxMsgConfig.getSmsChannel()); | |||
| String result = SMSFactory.addTemplate(wxMsgConfig, signature,content, EnumVerifyCode.NO.getCode().toString(), | |||
| wxMsgModel.getName(),1,wxMsgModel.getName()); | |||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | |||
| String ret = jsonObjectResult.get("ret").toString(); | |||
| logger.info("短信模板创建结果:" + result); | |||
| @@ -217,10 +217,10 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| @Override | |||
| public ResultData add(WxMsg wxMsg){ | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(wxMsg.getTenantId()); | |||
| setParentTenantId(wxMsg.getParentTenantId()); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(wxMsg.getTenantId()); | |||
| tenantEntity.setParentTenantId(wxMsg.getParentTenantId()); | |||
| //不是草稿检验疲劳度 | |||
| if (!wxMsg.getStatus().equals(EnumMsgStatus.MSG_STATUS_DRAFT.getCode())) { | |||
| if (wxMsg.getIsright().equals(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode())) { | |||
| @@ -44,55 +44,55 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM | |||
| DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |||
| String nowTimestr = format.format(new Date()); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| String initSql = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `model_code`) values " + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '2', '代办通知', '富茂', '{userName}提交了一个合同待您审批,电脑登陆{page} 查看您的待办。', '" + nowTimestr + "', '1', '0', '226', 'SMS_194910027')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '3', '审批通知', '富茂', '{userName}同意编号{contract}的合同审批,已呈送至{toUserName},登录{page}查看审批进度。', '" + nowTimestr + "', '1', '0', '227', 'SMS_194915023')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '4', '通过审批通知', '富茂', '编号{contract}的合同已通过审批,请登录{page} 跟进后续工作。', '" + nowTimestr + "', '1', '0', '228', 'SMS_194915020')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '5', '驳回通知', '富茂', '编号{contract}的合同审批被驳回,请登录{page} 查看审批明细。', '" + nowTimestr + "', '1', '0', '229', 'SMS_194900030')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '6', '验证码', '富茂', '{s6}(动态验证码),请在1分钟内填写', '" + nowTimestr + "', '1', '1', '115', 'SMS_194910023')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '7', '账单待缴模板', '富茂', '您当期的待缴账单为{price}元,截止日期为{date} ,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, 'SMS_194900024')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '8', '账单欠缴模板', '富茂', '截止今日您的账单共计欠缴{price}元,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, 'SMS_194910026')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '9', '场景投放', '富茂', '亲爱的vip,悄悄地送您一张{title},请到{app}微信小程序中使用吧!', '" + nowTimestr + "', '1', '0', null, 'SMS_194920015')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '商户分账账户新增通知商户', '富茂', '您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '富茂', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '富茂', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '富茂', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '富茂', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '17', '限时活动报名成功', '富茂', '亲爱的{person},您已成功报名{party},盼望您于{time}到场参加活动,谢谢。', '" + nowTimestr + "', '1', '0', null, 'SMS_194900027')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '18', '限时活动参加提醒', '富茂', '亲爱的{person},{party}活动将在{time}准时开始,感谢您能够抽出宝贵时间准时到活动现场参与,谢谢。', '" + nowTimestr + "', '1', '0', null, 'SMS_194920016')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '28', '会员生日券开启', '富茂', '亲到的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,并在生日当天消费领取{creditScale}倍积分,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, 'SMS_194915025')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '29', '会员生日券未开启', '富茂', '亲到的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, 'SMS_194900031')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '30', '系统发卡', '富茂', '亲爱的,您收到一张【{title}】,兑换码:{pw}。请于30天内打开微信小程序:{app}兑换!进店详询。', '" + nowTimestr + "', '1', '0', null, 'SMS_194920021');"; | |||
| String initSql = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `msg_type`, `model_code`) values " + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '2', '代办通知', '富茂', '{userName}提交了一个{bustype}待您审批,电脑登陆管理后台查看您的待办。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900032')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '3', '审批通知', '富茂', '{userName}同意编号{contract}的{bustype}审批,已呈送至{toUserName},登录{page}查看审批进度。', '" + nowTimestr + "', '1', '0', null, '1', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '4', '通过审批通知', '富茂', '编号{contract}的合同已通过审批,请登录{page} 跟进后续工作。', '" + nowTimestr + "', '1', '0', null, '1', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '5', '驳回通知', '富茂', '编号{contract}的合同审批被驳回,请登录{page} 查看审批明细。', '" + nowTimestr + "', '1', '0', null, '1', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '6', '验证码', '富茂', '{s6}(动态验证码),请在5分钟内填写', '" + nowTimestr + "', '1', '5', null, '1', 'SMS_194910023')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '7', '账单待缴模板', '富茂', '您当期的待缴账单为{price}元,截止日期为{date} ,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900024')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '8', '账单欠缴模板', '富茂', '截止今日您的账单共计欠缴{price}元,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194910026')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '9', '场景投放', '富茂', '亲爱的vip,悄悄地送您一张{title},请到{app}微信小程序中使用吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920015')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '商户分账账户新增通知商户', '富茂', '您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '富茂', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '富茂', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '富茂', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, '1', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '富茂', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '17', '限时活动报名成功', '富茂', '亲爱的{person},您已成功报名{party},盼望您于{time}到场参加活动,谢谢。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900027')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '18', '限时活动参加提醒', '富茂', '亲爱的{person},{party}活动将在{time}准时开始,感谢您能够抽出宝贵时间准时到活动现场参与,谢谢。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920016')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '28', '会员生日券开启', '富茂', '亲爱的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,并在生日当天消费领取{creditScale}倍积分,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194915025')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '29', '会员生日券未开启', '富茂', '亲爱的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900031')," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '30', '系统发卡', '富茂', '亲爱的,您收到一张【{title}】,兑换码:{pw}。请于30天内打开微信小程序:{app}兑换!进店详询。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920021');"; | |||
| wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql); | |||
| String initSql1 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| String initSql1 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + | |||
| "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '10', '审批通过通知', '富茂', " + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \\'px\\';</script>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\\\" src=\\\"https://formall.oss-accelerate.aliyuncs.com/cimg/changrong-logo.png\\\"/>\\n </header>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\\\">审批通过通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\\\">编号<span>{contract}</span>的{bustype}已经审批通过,请登录<a href=\\\"{page}\\\">{page}</a>跟进后续工作</div>\\n </div>\\n </div>\\n</body>\\n\\n</html>', " + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');"; | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; | |||
| wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql1); | |||
| String initSql2 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| String initSql2 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + | |||
| "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '待缴账单通知', '富茂', " + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background: #fff;padding-bottom: 40px;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding-top: 56px;padding-left: 55px;\\\">待缴账单通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding:36px 55px 0;\\\">您当前的待缴账单为<span style=\\\"font-weight:400;color:rgba(200,89,98,1);margin:0 10px;\\\">{price}</span>元,截止日期为<span>{date}</span>请登录<span>您的商户端</span>小程序查看账单并缴费</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">租金账单</span>\\n <div style=\\\"margin: 0 5%;width:90%;overflow: hidden;\\\">\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单类型</div>\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单金额(元)</div>\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">缴费时间</div>\\n </div>\\n {billList}\\n </div>\\n </div>\\n <div style=\\\"background: #fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold; font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;margin-left: 55px;padding-top: 56px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系商管负责人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');"; | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; | |||
| wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql2); | |||
| String initSql3 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| String initSql3 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + | |||
| "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '12', '审批通知', '富茂', " + | |||
| "'<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \\'px\\';</script>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\\\">审批通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\\\"><span>{userName}</span>同意编号<span>{contract}</span>的{bustype}审批,已呈送<span>{toUserName},</span>请登录<a href=\\\"{page}\\\">{page}</a>查看审批进度</div>\\n </div>\\n </div>\\n</body>\\n\\n</html>', " + | |||
| "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');"; | |||
| "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; | |||
| wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql3); | |||
| String initSql4 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| String initSql4 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + | |||
| "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '欠缴账单通知', '富茂', " + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background: #fff;padding-bottom: 40px;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">欠缴账单通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px 0;\\\">您当前的欠缴账单为<span style=\\\"font-weight:400;color:rgba(200,89,98,1);margin:0 10px;\\\">{price}</span>元,截止日期为<span>{date}</span>请登录<span>您的商户端</span>小程序查看账单并缴费</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">租金账单</span>\\n <div style=\\\"margin: 0 5%;width:90%;overflow: hidden;font-size:14px;\\\">\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单类型</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单金额(元)</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">缴费时间</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">逾期天数</div>\\n </div>\\n {billList}\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold; font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;margin-left: 55px;padding-top: 56px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系商管负责人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," + | |||
| "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');"; | |||
| "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; | |||
| wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql4); | |||
| String initSql5 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| String initSql5 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + | |||
| " values ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '待办通知', '富茂'," + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">待办通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px 40px;\\\"><span>{name}</span><span>提交了一个{bustype}待您审批,电脑登录</span><a href=\\\"{page}\\\" target=\\\"_blank\\\">{page}</a>查看您的待办</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <div style=\\\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">申请时间:</div>\\n <div style=\\\"float: left;font-size:18px;width:cale(80%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{applyTime}</div>\\n </div>\\n <div style=\\\"overflow: hidden;\\\">\\n <div style=\\\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">申请进度:</div>\\n <div style=\\\"float: left;width:cale(80%-55px);margin-left: 55px;\\\">\\n \\n {taskList}\\n </div>\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;padding: 56px 55px 0;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系申请人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');"; | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; | |||
| wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql5); | |||
| String initSql6 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| String initSql6 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + | |||
| " values ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '驳回通知', '富茂', " + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">审批通过通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding:36px 55px 40px;\\\">编号<span>{contract}</span>的{bustype}审批被驳回,请登录<a href=\\\"{page}\\\">{page}</a>查看审批明细</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">驳回人:</span>\\n <span style=\\\"display: block;float: left; width:calc(100% - 240px);font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{name}</span>\\n </div>\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">驳回原因:</span>\\n <span style=\\\"display: block;float: left;width:calc(100% - 240px); font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{remark}</span>\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;margin-top: 26px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系驳回人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');"; | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; | |||
| wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql6); | |||
| } | |||
| @@ -141,9 +141,8 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM | |||
| } | |||
| } | |||
| String result = SMSFactory.addTemplate(secret, bid, wxMsgConfig.getPublickey(), signature, content, | |||
| wxMsgConfig.getVerifynotifyurl(),EnumVerifyCode.YES.getCode().toString(), | |||
| wxMsgModel.getName(),1,wxMsgModel.getName(),wxMsgConfig.getSmsChannel()); | |||
| String result = SMSFactory.addTemplate(wxMsgConfig, signature, content,EnumVerifyCode.YES.getCode().toString(), | |||
| wxMsgModel.getName(),1,wxMsgModel.getName()); | |||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | |||
| String ret = jsonObjectResult.get("ret").toString(); | |||
| @@ -106,6 +106,7 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic | |||
| //给发起人发送驳回消息 | |||
| Map<String,String> msgReplaceMap = new HashedMap(); | |||
| msgReplaceMap.put("s6",String.valueOf(code)); | |||
| msgReplaceMap.put("code",String.valueOf(code)); | |||
| WxMsgRecord wxMsgRecord = new WxMsgRecord(); | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.VALIDATION_CODE.getCode()); | |||
| @@ -163,10 +163,10 @@ public class WxOrderPressServiceImpl implements WxOrderPressService { | |||
| } | |||
| // 3. get user info | |||
| WxCUser user = null; | |||
| List<WxCUser> list = userMapper.findList(new WxCUser(){{ | |||
| updateTenantInfo(order); | |||
| setUserId(order.getCUserId()); | |||
| }}); | |||
| WxCUser wcuQ = new WxCUser(); | |||
| wcuQ.updateTenantInfo(order); | |||
| wcuQ.setUserId(order.getCUserId()); | |||
| List<WxCUser> list = userMapper.findList(wcuQ); | |||
| if(list != null && list.size() > 0){ | |||
| user = list.get(0); | |||
| } | |||
| @@ -53,10 +53,10 @@ public class WxTemplateMsgServiceImpl implements WxTemplateMsgService { | |||
| wxTemplateMsg.setCreateDate(new Date()); | |||
| wxTemplateMsg.setUpdateDate(new Date()); | |||
| wxTemplateMsgMapper.insert(wxTemplateMsg); | |||
| wxTemplateMsg.setId(null); | |||
| wxTemplateMsg.setType(EnumTemplateType.LIVE_REMIND.getCode()); | |||
| wxTemplateMsg.setCustomParam("{\"index\": [\"thing1\", \"date3\", \"thing4\", \"thing5\"], \"emphasis\": \"\"}"); | |||
| wxTemplateMsgMapper.insert(wxTemplateMsg); | |||
| // wxTemplateMsg.setId(null); | |||
| // wxTemplateMsg.setType(EnumTemplateType.LIVE_REMIND.getCode()); | |||
| // wxTemplateMsg.setCustomParam("{\"index\": [\"thing1\", \"date3\", \"thing4\", \"thing5\"], \"emphasis\": \"\"}"); | |||
| // wxTemplateMsgMapper.insert(wxTemplateMsg); | |||
| wxTemplateMsg.setId(null); | |||
| wxTemplateMsg.setType(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | |||
| wxTemplateMsg.setCustomParam("{\"index\": [\"character_string1\", \"character_string2\", \"time4\", \"thing3\"], \"emphasis\": \"\"}"); | |||
| @@ -106,9 +106,9 @@ public class SendCallBackSmsServiceImpl implements MsgSendService { | |||
| outId = Long.toString(record.getId()); | |||
| }catch(Exception e){} | |||
| String result = SMSFactory.sendSms(secret, bid, publickey, phone, signature, msg, notifyUrl, | |||
| String result = SMSFactory.sendSms(wxMsgConfig, phone, signature, msg, | |||
| EnumVerifyCode.NO.getCode().toString(), modelId, | |||
| null,wxMsgModel.getModelCode(),outId,wxMsgConfig.getSmsChannel()); | |||
| null,wxMsgModel.getModelCode(),outId); | |||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | |||
| String ret = jsonObjectResult.get("ret").toString(); | |||
| @@ -99,10 +99,9 @@ public class SendSmsServiceImpl implements MsgSendService { | |||
| String notifyUrl = wxMsgConfig.getNotifyurl(); | |||
| Integer modelId = wxMsgValidationcodeModel.getModelId(); | |||
| String id = record.getDynamicContentMap().get("id"); | |||
| String result = SMSFactory.sendSms(secret, bid, publickey, phone, signature, msg, notifyUrl, | |||
| EnumVerifyCode.YES.getCode().toString(), modelId, | |||
| JSON.toJSONString(record.getDynamicContentMap()),wxMsgValidationcodeModel.getModelCode(), | |||
| id,wxMsgConfig.getSmsChannel()); | |||
| String result = SMSFactory.sendSms(wxMsgConfig, phone, signature, msg, | |||
| EnumVerifyCode.YES.getCode().toString(), modelId,JSON.toJSONString(record.getDynamicContentMap()), | |||
| wxMsgValidationcodeModel.getModelCode(),id); | |||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | |||
| String ret = jsonObjectResult.get("ret").toString(); | |||
| String batchNo = jsonObjectResult.get("data").toString(); | |||
| @@ -110,7 +109,7 @@ public class SendSmsServiceImpl implements MsgSendService { | |||
| if (ret.equals("1")) { | |||
| long currentTime = System.currentTimeMillis(); | |||
| Date createtime=new Date(currentTime); | |||
| Date createtime = new Date(currentTime); | |||
| wxMsgValidationcode.setCreatetime(createtime); | |||
| Integer minutes = wxMsgValidationcodeModel.getMinutes(); | |||
| if(minutes >0) { | |||
| @@ -7,6 +7,7 @@ package com.iformall.sms; | |||
| public enum EnumSMSChannel { | |||
| ALIYUN(11, "ALIYUN"), | |||
| ALIYUN_ZDY(12, "ALIYUN_ZDY"), | |||
| WIWIDE(0,"WIWIDE"); | |||
| public static EnumSMSChannel getEnum(Integer code) { | |||
| @@ -1,6 +1,8 @@ | |||
| package com.iformall.sms; | |||
| import com.iformall.domain.po.WxMsgConfig; | |||
| import com.iformall.sms.aliyun.AliyunSMS; | |||
| import com.iformall.sms.aliyun.bean.AliyunSMSConfig; | |||
| import com.iformall.sms.wiwide.WiwideUtil; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -11,7 +13,10 @@ import javax.annotation.PostConstruct; | |||
| public class SMSFactory { | |||
| @Autowired | |||
| private AliyunSMS aliyunSMS; | |||
| private AliyunSMSConfig smsConfig; | |||
| @Autowired | |||
| private AliyunSMS aliyunSMS ; | |||
| @Autowired | |||
| private WiwideUtil wiwide; | |||
| @@ -24,25 +29,39 @@ public class SMSFactory { | |||
| smsFactory = this; | |||
| } | |||
| private static SMSExcutor getSendExcutor(Integer channel) { | |||
| if(EnumSMSChannel.ALIYUN.getCode().equals(channel)) { | |||
| private static SMSExcutor getSendExcutor(WxMsgConfig wxMsgConfig) { | |||
| if(EnumSMSChannel.ALIYUN.getCode().equals(wxMsgConfig.getSmsChannel())) { | |||
| smsFactory.aliyunSMS.setSmsConfig(smsFactory.smsConfig); | |||
| return smsFactory.aliyunSMS; | |||
| }else if(EnumSMSChannel.ALIYUN_ZDY.getCode().equals(wxMsgConfig.getSmsChannel())){ | |||
| smsFactory.smsConfig = new AliyunSMSConfig(); | |||
| smsFactory.smsConfig.setAccessKeyId(wxMsgConfig.getPublickey()); | |||
| smsFactory.smsConfig.setAccessKeySecret(wxMsgConfig.getSecret()); | |||
| smsFactory.smsConfig.setProduct(wxMsgConfig.getProduct()); | |||
| smsFactory.smsConfig.setDomain(wxMsgConfig.getDomain()); | |||
| smsFactory.smsConfig.setRegionId(wxMsgConfig.getRegionId()); | |||
| smsFactory.smsConfig.setEndpointName(wxMsgConfig.getEndpointName()); | |||
| smsFactory.aliyunSMS.setSmsConfig(smsFactory.smsConfig); | |||
| return smsFactory.aliyunSMS; | |||
| }else{ | |||
| return smsFactory.wiwide; | |||
| } | |||
| } | |||
| public static String sendSms(String secret, String bid, String publickey,String phone, String signature, | |||
| String msg, String notifyUrl, String verifysms, Integer modelId,String templateParam, | |||
| String templateCode, String outId,Integer channel) { | |||
| return getSendExcutor(channel).sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, | |||
| public static String sendSms(WxMsgConfig wxMsgConfig,String phone, String signature, String msg, | |||
| String verifysms, Integer modelId, String templateParam, | |||
| String templateCode, String outId) { | |||
| return getSendExcutor(wxMsgConfig).sendMsg(wxMsgConfig.getSecret(), wxMsgConfig.getBid(), wxMsgConfig.getPublickey(), | |||
| phone, signature, msg, wxMsgConfig.getNotifyurl(), | |||
| verifysms, modelId,templateParam,templateCode,outId); | |||
| } | |||
| public static String addTemplate(String secret, String bid, String publickey, String signature, String content, | |||
| String notifyUrl, String verifysms,String templateName,Integer templateType, | |||
| String remark,Integer channel) { | |||
| return getSendExcutor(channel).addTemplate(secret, bid, publickey, signature, content, notifyUrl,verifysms, | |||
| templateName,templateType,remark); | |||
| public static String addTemplate(WxMsgConfig wxMsgConfig, String signature, String content, | |||
| String verifysms,String templateName,Integer templateType, | |||
| String remark) { | |||
| return getSendExcutor(wxMsgConfig).addTemplate(wxMsgConfig.getSecret(), wxMsgConfig.getBid(), wxMsgConfig.getPublickey(), | |||
| signature, content, wxMsgConfig.getNotifyurl(), | |||
| verifysms,templateName,templateType,remark); | |||
| } | |||
| } | |||
| @@ -21,9 +21,12 @@ import java.text.SimpleDateFormat; | |||
| @Slf4j | |||
| public class AliyunSMS implements SMSExcutor { | |||
| @Autowired | |||
| private AliyunSMSConfig smsConfig; | |||
| public void setSmsConfig(AliyunSMSConfig smsConfig){ | |||
| this.smsConfig = smsConfig; | |||
| } | |||
| @Override | |||
| public String sendMsg(String secret, String bid, String publickey, String phone, String signature, String msg, String notifyUrl, String verifysms, Integer modelId, String templateParam, String templateCode, String outId) { | |||
| SMSResult SMSResult = new SMSResult(); | |||
| @@ -75,7 +78,7 @@ public class AliyunSMS implements SMSExcutor { | |||
| SendSmsResponse sendSmsResponse = null; | |||
| try { | |||
| sendSmsResponse = acsClient.getAcsResponse(request); | |||
| log.info("发送短信-----" + sendSmsResponse.getCode() + "----" + sendSmsResponse.getMessage()); | |||
| log.info("ali发送短信-----" + sendSmsResponse.getCode() + "----" + sendSmsResponse.getMessage()); | |||
| } catch (ClientException e) { | |||
| log.error("发送短信发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| @@ -23,7 +23,7 @@ public class AliyunSMSConfig { | |||
| //API支持的RegionID,如短信API的值为: cn-hangzhou。 | |||
| private String regionId; | |||
| //#发送日期 支持30天内记录查询,格式: yyyyMMdd | |||
| private String dateFormat; | |||
| private String dateFormat = "yyyyMMdd"; | |||
| //服务结点: cn-hangzhou | |||
| private String endpointName; | |||
| @@ -76,7 +76,8 @@ public class WiwideUtil implements SMSExcutor { | |||
| } | |||
| public static String sendMsg(String secret, String bid, String publickey, | |||
| String phone, String signature, String msg, String notifyUrl, String verifysms, Integer modelId) { | |||
| String phone, String signature, String msg, String notifyUrl, | |||
| String verifysms, Integer modelId) { | |||
| TreeMap<String, Object> message = new TreeMap<>(); | |||
| message.put("bid", bid); | |||
| message.put("phone", phone); | |||
| @@ -95,7 +96,7 @@ public class WiwideUtil implements SMSExcutor { | |||
| sb.append("&secret=").append(secret); | |||
| String sign = HMACSHA256.sha256_HMAC(sb.toString(), secret); | |||
| message.put("sign", sign.toUpperCase()); | |||
| logger.debug(message.toString()); | |||
| logger.info("wiwide发短信---"+message.toString()); | |||
| String str32 = HMACSHA256.STR2; | |||
| String iv = HMACSHA256.IV; | |||
| @@ -232,7 +232,7 @@ | |||
| <select id="listOpenId" parameterType="com.iformall.domain.po.WxCUser" resultType="String"> | |||
| select open_id from wx_c_user where msg_count > 10 | |||
| select open_id from wx_c_user where msg_count >= 10 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| @@ -21,11 +21,17 @@ | |||
| <!-- <result column="appid" jdbcType="VARCHAR" property="appid" />--> | |||
| <result column="sms_channel" jdbcType="SMALLINT" property="smsChannel" /> | |||
| <result column="product" jdbcType="VARCHAR" property="product" /> | |||
| <result column="domain" jdbcType="VARCHAR" property="domain" /> | |||
| <result column="region_id" jdbcType="VARCHAR" property="regionId" /> | |||
| <result column="endpoint_name" jdbcType="VARCHAR" property="endpointName" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`secret`,`publickey`,`bid`,`recharge`,`remains`,`total`,`account`, | |||
| `reminderstatus`,`reminder`,`phone`,`notifyurl`,`modelnotifyurl`,`verifynotifyurl`,`sms_channel` | |||
| `reminderstatus`,`reminder`,`phone`,`notifyurl`,`modelnotifyurl`,`verifynotifyurl`,`sms_channel`, | |||
| `product`,`domain`,`region_id`,`endpoint_name` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -70,11 +70,11 @@ public class WxBrandController extends BaseController { | |||
| if(EnumDelFlag.YES.getCode().equals(wxBrand.getIsDel())){ | |||
| //判断是否解绑商户 | |||
| WxMerchant wxMerchant = new WxMerchant() {{ | |||
| setIsDel(0); | |||
| setBrand(wxBrand.getId()); | |||
| updateTenantInfo(wxBrand); | |||
| }}; | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.setIsDel(0); | |||
| wxMerchant.setBrand(wxBrand.getId()); | |||
| wxMerchant.updateTenantInfo(wxBrand); | |||
| List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant); | |||
| if(CollectionUtils.isNotEmpty(merchantList)){ | |||
| return new ResultData(Result.ERROR, "请先删除已绑定该品牌的商户。"); | |||
| @@ -116,10 +116,9 @@ public class WxBrandController extends BaseController { | |||
| @SystemControllerLog(description = "品牌-名称是否存在") | |||
| public ResultData hasBrand(String name, Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxBrandController::hasBrand"); | |||
| WxBrand wxBrand = new WxBrand() {{ | |||
| setName(name); | |||
| updateTenantInfo(getTenantInfo()); | |||
| }}; | |||
| WxBrand wxBrand = new WxBrand(); | |||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||
| wxBrand.setName(name); | |||
| wxBrand.setId(id); | |||
| return wxBrandService.hasBrand(wxBrand); | |||
| } | |||
| @@ -116,10 +116,10 @@ public class WxShopController extends BaseController { | |||
| @SystemControllerLog(description = "店铺管理-查询商铺号是否存在") | |||
| public ResultData hasShopNumber(String shopNumber, Long id, Integer type) { | |||
| logger.debug("[" + getIpAddr() + "] WxShopController::hasShopNumber"); | |||
| WxShop wxShop = new WxShop() {{ | |||
| setShopNumber(shopNumber); | |||
| setType(type); | |||
| }}; | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.setShopNumber(shopNumber); | |||
| wxShop.setType(type); | |||
| wxShop.setId(id); | |||
| wxShop.updateTenantInfo(getTenantInfo()); | |||
| return wxShopService.hasShopNumber(wxShop); | |||
| @@ -83,10 +83,8 @@ public class WxMsgValidationcodeController extends BaseController { | |||
| public ResultData sendvalidationcode(String tenantId, String parentTenantId, String phone, Integer type, String appid) { | |||
| logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeController::sendvalidationcode"); | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.updateTenantInfo(new TenantEntity(){{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}); | |||
| wxMsgValidationcode.setTenantId(tenantId); | |||
| wxMsgValidationcode.setParentTenantId(parentTenantId); | |||
| wxMsgValidationcode.setPhone(phone); | |||
| wxMsgValidationcode.setType(type); | |||
| wxMsgValidationcode.setAppid(appid); | |||
| @@ -104,10 +102,8 @@ public class WxMsgValidationcodeController extends BaseController { | |||
| public ResultData hasvalidationcode(String tenantId, String parentTenantId, String phone, Integer type, String code, String appid) { | |||
| logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeController::hasvalidationcode"); | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.updateTenantInfo(new TenantEntity(){{ | |||
| setTenantId(tenantId); | |||
| setParentTenantId(parentTenantId); | |||
| }}); | |||
| wxMsgValidationcode.setTenantId(tenantId); | |||
| wxMsgValidationcode.setParentTenantId(parentTenantId); | |||
| wxMsgValidationcode.setPhone(phone); | |||
| wxMsgValidationcode.setType(type); | |||
| wxMsgValidationcode.setCode(code); | |||
| @@ -241,9 +241,9 @@ public class HomeController extends BaseController { | |||
| logger.error("appid未找到"); | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| } | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(appinfo.getTenantId()); | |||
| }}; | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(appinfo.getTenantId()); | |||
| if (StringUtils.isNotBlank(user.getPhone())) { | |||
| // 领导登录 | |||
| user = mallUserInfoService.getByPhone(user.getPhone(), tenantEntity); | |||
| @@ -0,0 +1,77 @@ | |||
| package com.iformall.callback; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.controller.BaseController; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| import com.iformall.douyin.pay.DouYinPayHelper; | |||
| import com.iformall.interceptor.BodyReaderHttpServletRequestWrapper; | |||
| import com.iformall.service.WxAppinfoService; | |||
| import com.iformall.service.WxPayAccountService; | |||
| import com.iformall.service.tt.TtOrderService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| /** | |||
| * https://op.jinritemai.com/docs/guide-docs/10/99 | |||
| * @author alascor | |||
| */ | |||
| @RestController | |||
| @RequestMapping("/shopcallback") | |||
| public class TtShopCallbackController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private TtOrderService ttOrderService; | |||
| @Autowired | |||
| private WxAppinfoService appinfoService; | |||
| @Autowired | |||
| private WxPayAccountService payAccountService; | |||
| @PostMapping(value = "/notice") | |||
| @ResponseBody | |||
| public Map<String,Object> createOrder( HttpServletRequest request){ | |||
| String body = ((BodyReaderHttpServletRequestWrapper) request).getBody(); | |||
| Map retMap = new HashMap(); | |||
| retMap.put("code", 0); | |||
| retMap.put("msg", "success"); | |||
| try { | |||
| JSONArray bodyarrays = JSONArray.parseArray(body); | |||
| if (null != bodyarrays) { | |||
| for (int i = 0 ; i < bodyarrays.size(); i++) { | |||
| JSONObject object = bodyarrays.getJSONObject(i); | |||
| String tag = object.getString("tag"); | |||
| String msgId = object.getString("msg_id"); | |||
| String dataJson = object.getString("data"); | |||
| if ("0".equals(tag) && "0".equals(msgId)) { | |||
| return retMap; | |||
| //doudian_trade_TradePaid https://op.jinritemai.com/docs/message-docs/30/110 | |||
| }else if ("101".equals(tag)) { | |||
| //解析串 | |||
| return retMap; | |||
| } | |||
| } | |||
| } | |||
| return retMap; | |||
| } catch (Exception e){ | |||
| e.printStackTrace(); | |||
| retMap.put("code","1"); | |||
| retMap.put("msg", "failed"); | |||
| return retMap; | |||
| } | |||
| } | |||
| } | |||