| @@ -66,17 +66,17 @@ public class DataTowerController extends BaseController { | |||
| return new ResultData(data); | |||
| } | |||
| @ApiOperation("查询车流") | |||
| @GetMapping("/queryCar") | |||
| @SystemControllerLog(description = "数据塔台-查询车流") | |||
| public ResultData queryCar() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryCar"); | |||
| Map<String, Object> data = dataTowerService.queryCar(getTenantInfo()); | |||
| return new ResultData(data); | |||
| } | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("查询车流") | |||
| // @GetMapping("/queryCar") | |||
| // @SystemControllerLog(description = "数据塔台-查询车流") | |||
| // public ResultData queryCar() { | |||
| // logger.debug("[" + getIpAddr() + "] DataTowerController::queryCar"); | |||
| // | |||
| // Map<String, Object> data = dataTowerService.queryCar(getTenantInfo()); | |||
| // | |||
| // return new ResultData(data); | |||
| // } | |||
| @ApiOperation("查询客流") | |||
| @GetMapping("/queryCustomer") | |||
| @@ -44,22 +44,23 @@ public class WxCouponOrderController extends BaseController { | |||
| @Autowired | |||
| private WxAppinfoService wxAppinfoService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "券包-列表") | |||
| public ResultData list(@ModelAttribute WxCouponOrderBVo wxCouponOrder, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponOrderController::list"); | |||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo(); | |||
| wxCouponOrder.updateTenantInfo(getTenantInfo()); | |||
| if (wxCouponOrder.getMerchantName() != null && | |||
| wxCouponOrder.getMerchantName().isEmpty()) { | |||
| wxCouponOrder.setMerchantName(null); | |||
| } | |||
| return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize); | |||
| } | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("分页列表接口") | |||
| // @GetMapping("list") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| // @SystemControllerLog(description = "券包-列表") | |||
| // public ResultData list(@ModelAttribute WxCouponOrderBVo wxCouponOrder, Integer pageNum, Integer pageSize) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCouponOrderController::list"); | |||
| // if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo(); | |||
| // wxCouponOrder.updateTenantInfo(getTenantInfo()); | |||
| // if (wxCouponOrder.getMerchantName() != null && | |||
| // wxCouponOrder.getMerchantName().isEmpty()) { | |||
| // wxCouponOrder.setMerchantName(null); | |||
| // } | |||
| // return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize); | |||
| // } | |||
| @ApiOperation(value = "卡券详情接口") | |||
| @GetMapping("detail") | |||
| @@ -125,17 +126,18 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.REFUND_ORDER_ERROR.getCode(), "AppInfo获取失败"); | |||
| } | |||
| @GetMapping("exportData") | |||
| @SystemControllerLog(description = "券订单数据-导出数据") | |||
| public void exportData(@ModelAttribute WxCouponOrderBVo wxCouponOrder, HttpServletRequest request, HttpServletResponse response) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponOrderController::exportData"); | |||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo(); | |||
| wxCouponOrder.updateTenantInfo(getTenantInfo()); | |||
| if (wxCouponOrder.getMerchantName() != null && | |||
| wxCouponOrder.getMerchantName().isEmpty()) { | |||
| wxCouponOrder.setMerchantName(null); | |||
| } | |||
| wxCouponOrderService.exportData(wxCouponOrder, request, response); | |||
| } | |||
| //TODO 待优化数据 | |||
| // @GetMapping("exportData") | |||
| // @SystemControllerLog(description = "券订单数据-导出数据") | |||
| // public void exportData(@ModelAttribute WxCouponOrderBVo wxCouponOrder, HttpServletRequest request, HttpServletResponse response) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCouponOrderController::exportData"); | |||
| // if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo(); | |||
| // wxCouponOrder.updateTenantInfo(getTenantInfo()); | |||
| // if (wxCouponOrder.getMerchantName() != null && | |||
| // wxCouponOrder.getMerchantName().isEmpty()) { | |||
| // wxCouponOrder.setMerchantName(null); | |||
| // } | |||
| // wxCouponOrderService.exportData(wxCouponOrder, request, response); | |||
| // } | |||
| } | |||
| @@ -264,103 +264,104 @@ public class WxCUserDataController extends BaseController { | |||
| return new ResultData(mapVo); | |||
| } | |||
| @ApiOperation("查询用户消费金额") | |||
| @GetMapping("findUserAmountData") | |||
| @SystemControllerLog(description = "会员首页-报表数据-查询用户消费金额") | |||
| public ResultData findUserAmountData(Integer plat) { | |||
| logger.debug("[" + getIpAddr() + "] WxCUserDataController::findUserAmountData"); | |||
| if(plat == null){ | |||
| plat = EnumAppPlat.WX.getCode(); | |||
| } | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| Calendar c = Calendar.getInstance(); | |||
| Date today = c.getTime(); | |||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||
| c.set(Calendar.MINUTE, 0); | |||
| c.set(Calendar.SECOND, 0); | |||
| Date endTime = c.getTime();//明天0点 | |||
| c.add(Calendar.DAY_OF_YEAR, -30);//三十天前 | |||
| Date startTime = c.getTime(); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| wxCouponOrder.setStartTime(startTime); | |||
| wxCouponOrder.setEndTime(endTime); | |||
| int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额 | |||
| c.clear(); | |||
| c.setTime(endTime); | |||
| Date eTime = c.getTime(); | |||
| c.add(Calendar.DAY_OF_YEAR, -30); | |||
| Date sTime = c.getTime(); | |||
| List<CUserDateAmountVo> datas = wxCouponOrderService.queryPriceTotalGroup(tenantEntity, sTime, eTime); | |||
| Map<String, Integer> dataMap = new HashMap<>(); | |||
| for (CUserDateAmountVo v : datas) { | |||
| dataMap.put(v.getXTime(), v.getPrice()); | |||
| } | |||
| Integer todayCount = 0;//今日金额数 | |||
| Integer yesterdayCount = 0;//昨日金额数 | |||
| Integer dayOfWeekCount = 0;//上周x | |||
| List<UserStructureVo> weekVos = new ArrayList<>();//周消费金额 | |||
| List<UserStructureVo> monthVos = new ArrayList<>();//周消费金额 | |||
| for (int i = 29, sortNum = 0; i >= 0; i--) { | |||
| c.clear(); | |||
| c.setTime(today); | |||
| c.add(Calendar.DAY_OF_YEAR, -i); | |||
| String dateStr = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime()); | |||
| UserStructureVo vo = new UserStructureVo(); | |||
| vo.setName(new SimpleDateFormat("MM/dd").format(c.getTime())); | |||
| vo.setSortNum(sortNum++); | |||
| if (dataMap.get(dateStr) != null) { | |||
| int price = dataMap.get(dateStr); | |||
| vo.setPrice(price); | |||
| } else { | |||
| vo.setPrice(0); | |||
| } | |||
| if (i <= 7) { | |||
| UserStructureVo vow = new UserStructureVo(); | |||
| vow.setName(vo.getName()); | |||
| vow.setSortNum(vo.getSortNum()); | |||
| vow.setPrice(vo.getPrice()); | |||
| if (i == 0) { | |||
| todayCount = vow.getPrice(); | |||
| } | |||
| if (i == 1) { | |||
| yesterdayCount = vow.getPrice(); | |||
| } | |||
| if (i == 7) { | |||
| dayOfWeekCount = vow.getPrice(); | |||
| } else { | |||
| weekVos.add(vow); | |||
| } | |||
| } | |||
| monthVos.add(vo); | |||
| } | |||
| NumberFormat nf = NumberFormat.getPercentInstance(); | |||
| nf.setMinimumFractionDigits(2); | |||
| String dayPercentage = "--"; | |||
| if (yesterdayCount > 0) { | |||
| Integer count = todayCount - yesterdayCount; | |||
| dayPercentage = nf.format(count.doubleValue() / new Double(yesterdayCount).doubleValue()); | |||
| } | |||
| String weekPercentage = "--"; | |||
| if (dayOfWeekCount > 0) { | |||
| Integer count = todayCount - dayOfWeekCount; | |||
| weekPercentage = nf.format(count.doubleValue() / new Double(dayOfWeekCount).doubleValue()); | |||
| } | |||
| Map<String, Object> map = new HashMap<>(); | |||
| DecimalFormat df = new DecimalFormat("0.00"); | |||
| map.put("todayCount", df.format((float) todayCount / 100));//今日消费金额 | |||
| String thisMonthCountStr = df.format((float) thisMonthCount / 100); | |||
| map.put("thisMonthCount", thisMonthCountStr);//近一个月消费金额数 | |||
| map.put("dayPercentage", dayPercentage);//日环比 | |||
| map.put("weekPercentage", weekPercentage); //周同比 | |||
| map.put("weekVos", weekVos);//一周金额列表 | |||
| map.put("monthVos", monthVos);//一月金额列表 | |||
| return new ResultData(map); | |||
| } | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("查询用户消费金额") | |||
| // @GetMapping("findUserAmountData") | |||
| // @SystemControllerLog(description = "会员首页-报表数据-查询用户消费金额") | |||
| // public ResultData findUserAmountData(Integer plat) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCUserDataController::findUserAmountData"); | |||
| // if(plat == null){ | |||
| // plat = EnumAppPlat.WX.getCode(); | |||
| // } | |||
| // TenantEntity tenantEntity = getTenantInfo(); | |||
| // Calendar c = Calendar.getInstance(); | |||
| // Date today = c.getTime(); | |||
| // c.add(Calendar.DAY_OF_YEAR, 1); | |||
| // c.set(Calendar.HOUR_OF_DAY, 0); | |||
| // c.set(Calendar.MINUTE, 0); | |||
| // c.set(Calendar.SECOND, 0); | |||
| // Date endTime = c.getTime();//明天0点 | |||
| // c.add(Calendar.DAY_OF_YEAR, -30);//三十天前 | |||
| // Date startTime = c.getTime(); | |||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| // WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| // wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| // wxCouponOrder.setStartTime(startTime); | |||
| // wxCouponOrder.setEndTime(endTime); | |||
| // int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额 | |||
| // c.clear(); | |||
| // c.setTime(endTime); | |||
| // Date eTime = c.getTime(); | |||
| // c.add(Calendar.DAY_OF_YEAR, -30); | |||
| // Date sTime = c.getTime(); | |||
| // List<CUserDateAmountVo> datas = wxCouponOrderService.queryPriceTotalGroup(tenantEntity, sTime, eTime); | |||
| // Map<String, Integer> dataMap = new HashMap<>(); | |||
| // for (CUserDateAmountVo v : datas) { | |||
| // dataMap.put(v.getXTime(), v.getPrice()); | |||
| // } | |||
| // Integer todayCount = 0;//今日金额数 | |||
| // Integer yesterdayCount = 0;//昨日金额数 | |||
| // Integer dayOfWeekCount = 0;//上周x | |||
| // List<UserStructureVo> weekVos = new ArrayList<>();//周消费金额 | |||
| // List<UserStructureVo> monthVos = new ArrayList<>();//周消费金额 | |||
| // for (int i = 29, sortNum = 0; i >= 0; i--) { | |||
| // c.clear(); | |||
| // c.setTime(today); | |||
| // c.add(Calendar.DAY_OF_YEAR, -i); | |||
| // String dateStr = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime()); | |||
| // UserStructureVo vo = new UserStructureVo(); | |||
| // vo.setName(new SimpleDateFormat("MM/dd").format(c.getTime())); | |||
| // vo.setSortNum(sortNum++); | |||
| // if (dataMap.get(dateStr) != null) { | |||
| // int price = dataMap.get(dateStr); | |||
| // vo.setPrice(price); | |||
| // } else { | |||
| // vo.setPrice(0); | |||
| // } | |||
| // if (i <= 7) { | |||
| // UserStructureVo vow = new UserStructureVo(); | |||
| // vow.setName(vo.getName()); | |||
| // vow.setSortNum(vo.getSortNum()); | |||
| // vow.setPrice(vo.getPrice()); | |||
| // | |||
| // if (i == 0) { | |||
| // todayCount = vow.getPrice(); | |||
| // } | |||
| // if (i == 1) { | |||
| // yesterdayCount = vow.getPrice(); | |||
| // } | |||
| // if (i == 7) { | |||
| // dayOfWeekCount = vow.getPrice(); | |||
| // } else { | |||
| // weekVos.add(vow); | |||
| // } | |||
| // } | |||
| // monthVos.add(vo); | |||
| // } | |||
| // | |||
| // NumberFormat nf = NumberFormat.getPercentInstance(); | |||
| // nf.setMinimumFractionDigits(2); | |||
| // String dayPercentage = "--"; | |||
| // if (yesterdayCount > 0) { | |||
| // Integer count = todayCount - yesterdayCount; | |||
| // dayPercentage = nf.format(count.doubleValue() / new Double(yesterdayCount).doubleValue()); | |||
| // } | |||
| // String weekPercentage = "--"; | |||
| // if (dayOfWeekCount > 0) { | |||
| // Integer count = todayCount - dayOfWeekCount; | |||
| // weekPercentage = nf.format(count.doubleValue() / new Double(dayOfWeekCount).doubleValue()); | |||
| // } | |||
| // Map<String, Object> map = new HashMap<>(); | |||
| // DecimalFormat df = new DecimalFormat("0.00"); | |||
| // map.put("todayCount", df.format((float) todayCount / 100));//今日消费金额 | |||
| // String thisMonthCountStr = df.format((float) thisMonthCount / 100); | |||
| // map.put("thisMonthCount", thisMonthCountStr);//近一个月消费金额数 | |||
| // map.put("dayPercentage", dayPercentage);//日环比 | |||
| // map.put("weekPercentage", weekPercentage); //周同比 | |||
| // map.put("weekVos", weekVos);//一周金额列表 | |||
| // map.put("monthVos", monthVos);//一月金额列表 | |||
| // return new ResultData(map); | |||
| // } | |||
| } | |||
| @@ -0,0 +1,190 @@ | |||
| spring: | |||
| profiles: | |||
| #include: aliyunRocketMQ | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://101.200.130.134:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| password: fm2020test | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| maxActive: 20 | |||
| initialSize: 1 | |||
| maxWait: 60000 | |||
| minIdle: 1 | |||
| timeBetweenEvictionRunsMillis: 28000 | |||
| minEvictableIdleTimeMillis: 28000 | |||
| validationQuery: select 'x' | |||
| testWhileIdle: true | |||
| testOnBorrow: false | |||
| testOnReturn: false | |||
| poolPreparedStatements: true | |||
| maxOpenPreparedStatements: 20 | |||
| #jackson: | |||
| #date-format: yyyy-MM-dd HH:mm:ss | |||
| # REDIS | |||
| redis: | |||
| host: 101.200.130.134 | |||
| port: 6379 | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 50 | |||
| max-idle: 30 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkbapi | |||
| filedomain: https://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: service@iformall.com | |||
| password: jGvApygXN7wc5SzN # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| auth: true | |||
| starttls: | |||
| enable: true | |||
| socketFactory: | |||
| port: 465 | |||
| class: javax.net.ssl.SSLSocketFactory | |||
| # ROCKETMQ | |||
| rocketmq: | |||
| nameServer: 127.0.0.1:9876 | |||
| producer: | |||
| retry-times-when-send-async-failed: 0 | |||
| send-msg-timeout: 300000 | |||
| compress-msg-body-over-howmuch: 4096 | |||
| max-message-size: 4194304 | |||
| retry-another-broker-when-not-store-ok: false | |||
| retry-times-when-send-failed: 2 | |||
| # RABBITMQ | |||
| rabbitmq: | |||
| host: 101.200.130.134 | |||
| port: 5672 | |||
| username: fumao | |||
| password: f9l98 | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| jasypt: | |||
| encryptor: | |||
| password: oRqdnDbK5pj3eMmB | |||
| #wechat: | |||
| # open: | |||
| # componentAppId: "wxdfc8fb4e62d6b52b" | |||
| # componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 101.201.103.81 | |||
| # port: 6379 | |||
| # password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| open: | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| redis: | |||
| host: 101.200.130.134 | |||
| port: 6379 | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| alipay: | |||
| open: | |||
| appId: 2021002137663024 | |||
| appPrivateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCUfymV5J73QQMG52PVIGUbowkloYCO4B7TQoKbrTZf2YeYsg/To/o4PiXPMNwEUfEUU8NYQ6WwNhCd2fa1ei8WFXJUf3bfgswtBk1aOmHLeY9yoXFxIKMTQ9RcobnmBzKQZlaAPMTSr7t1QtKZKPuc2gEHGRFYKO/ZuL8gIpnsVidVtmi52yd7hzao/pI3ThLA0lreg4L3rYP5ESQZRytxIPgUQ4KI11pZxFgbe+uy28AGDYIQscSIb+SWOHPYKLvOEqqepIZ8M18w/U0lZzpzepzi/V/llekvXJ6UEf1lzl7x/4UIA3WPN1B40+NzbD/OxEGTuM0UctOG6ZTd4Te9AgMBAAECggEAPYksnHbvARspu/SrRCh2fatkIPn6Ijrxyy3mnch7neCw9i/jqxpqmF/4nxFqO0gRlRDZBHyT7p+Y5zDpsW5+kLI2fJmNkzXKkmXoLBnBaOZo8WHBdtXFfjg/iltig9Y7t+cQtXd5QK2eCwuz5dA75FXa0ywqKdRdAGY0nYZ5LpwrHVU8RXheUDCJyhKNj2+W6lIaSKDxLZU3laO1oBrv1agcy7Crd5E2ndb8O3Enga+z7wSz2h7A1BasC/Yl/Ro0Y21wLCH3s/R6qA0Paq12+WEF+xdodM7SrP43CCTVFGbC1TfEOdanJfixop8QuYsIp7pHrL925+vP4eY9RfckgQKBgQDQqLdpDzzU7Ot/L9Vc/r8d4iwXXbX8+HwVFV4oBuausgFyv8eJJpfrI+IlEoB1ubJcPpJBFqfmeYTW6/v6ioFljJAlWfFvesUVt/HszBMIOsU0Bzt7ex6WlwKOagb0q0ZPA4T0OY0K0lg0loaaaR8ZTr4ivDymaGBtTBYhslpc7QKBgQC2MBznGEc5r2dhyENvdPOR20PnXQcevGnPdqSus8m0VmDcHE72RVcckcZtwczsb3NaLSqmjAcWTn51/VFmlvhB3F34FcFTPZGq6sj7fWK8HuFq7l7mu5OzYuVr73zy9ggsUuaw10IqvvwIVxszNAF0hiRnSGH3z27CoRmz3s+8EQKBgQCK3o7atBJ3X4rIJiypbL4DhIB1uJ+jUjk6yvLUTut+fufp1+tTw0S+cS5UIAEw2Lr1G4u5F/v8rwmTBJG6SC4gSLGyui6uVBYRA1BWmedcxchzfRDAeMt9y9kesUAZ3Fe5xIzbAeZ1ulKMBVZmM+pHrJlsgr0Wv0bV1xqvqITtbQKBgBIsIGXopQoa9dvqBtfyOW1eCprkS5aEQqWf9vM6Ga90QjsSU8n6xqKh48IE57TZtQ7UnIF6TCasc66/MsRh4KdpHLJnMR5lcMc0nhF/wz5ychehaTPol+X3wlyOyc7OPah2KG6ROhdbb3ZBggQMduyxiKYIsUTvmuOtAAxR+DSRAoGADtuDzGQDOJYWiO2uuP6FpA5IJaiwlSfu3xncJVfhO8SVr6VBJFg88igbIB3w6nk/sv7j9VTXqXre9HMvp1flxaaLsdxM4HcTSALS9q6t/ajaveqte6S5kAtWx0WW8C6PtgWXHbxcD7LXARSsKLoEl2JXXyUVS/m2l/RzHBQ8GJI= | |||
| appPublicKeyCertPath: /opt/iformall/service/alipay/appCertPublicKey_2021002137663024.crt | |||
| alipayCertPath: /opt/iformall/service/alipay/alipayCertPublicKey_RSA2.crt | |||
| alipayRootCertPath: /opt/iformall/service/alipay/alipayRootCert.crt | |||
| callback: https://callbacktest.malls.iformall.com/api/alipay/notify/callback | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| regionId: cn-beijing | |||
| fm: | |||
| exception: true | |||
| exception_emails: xuxiaohu@iformall.com | |||
| deploy: 1 | |||
| open: true | |||
| upload_dir: /home/test/server/uploads | |||
| videoType: aliyun | |||
| pos: | |||
| dev_id: fmpos | |||
| url: https://pos.youlane.cn/api | |||
| req_key: ZiGFLC4@3c5sTLZT | |||
| res_key: ugPAM7wd&%p6I0W8 | |||
| logging: | |||
| level: | |||
| com.iformall.mapper: debug | |||
| path: ./logs/b | |||
| @@ -0,0 +1,150 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(nUefcxWYlMS/1cDxikIKwA==) | |||
| password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| maxActive: 20 | |||
| initialSize: 1 | |||
| maxWait: 60000 | |||
| minIdle: 1 | |||
| timeBetweenEvictionRunsMillis: 28000 | |||
| minEvictableIdleTimeMillis: 28000 | |||
| validationQuery: select 'x' | |||
| testWhileIdle: true | |||
| testOnBorrow: false | |||
| testOnReturn: false | |||
| poolPreparedStatements: true | |||
| maxOpenPreparedStatements: 20 | |||
| # REDIS | |||
| redis: | |||
| host: r-2zeaglwf13qqmnllj5.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: mallone:iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 20 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: https://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: sysadministor@iformall.com # 登陆密码sysAd1231 | |||
| password: SWqPekCEmhUYuYCd # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| auth: true | |||
| starttls: | |||
| enable: true | |||
| socketFactory: | |||
| port: 465 | |||
| class: javax.net.ssl.SSLSocketFactory | |||
| # RABBITMQ | |||
| rabbitmq: | |||
| host: localhost | |||
| port: 5672 | |||
| username: ENC(lRmLd6EzgeY1RT5ktcHv9g==) | |||
| password: ENC(gBI8mCjr3OC0v57jcnSb660Ux7mW03K2oePgvohhg7w=) | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| access: ENC(a6SN1sZ1enNL49ypiOXkg/pPPAnZD8H4buQFTTKN08s=) | |||
| secret: ENC(5P5ff4bTMJUbXVR4ZsM03UHzOKZ4+Zg5Iutcdkyp/Quny/oXg+A4KpfwEyGarlLu3vQMJahGP5M=) | |||
| wechat: | |||
| open: | |||
| componentAppId: ENC(b3JG0MUZgQfz5Zj+DC2ZM1zDeLOiGTmmeokfe2O8kaM=) | |||
| componentSecret: ENC(QVyc4BPGdnSjXGs2ivgpDBE1v8wPWHLLRMYI7Vv8uYwC0SiZHQz0QpyyQV/b48Pb) | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: r-2zeaglwf13qqmnllj5.redis.rds.aliyuncs.com | |||
| port: 6379 | |||
| password: mallone:iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| alipay: | |||
| open: | |||
| appId: 2021002140616334 | |||
| appPrivateKey: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCEJmHIlS0luIH7zJRRVlypCcgiSkqpSlnmgyCEM7nu8IerV8Yf7dMBitBklTpJB+4URV1bW+q6Ijzo8RsCyjm1Kx+EFiKf1PiJXlT0h1+bF3fYdDr6r5GK0/TtB8O80p774NcRD3HgbzUS8AEe/GcBvhiXbDRgJh7yAngW9vxl9u1o5UcaxOXVLWDrjlQGF6qyXUlycCNIdPXj3LduP3PBK5daVZwJm33Pr7kmSI0agZvV267HaTpSKaiXI7Zwo+nFMqx9g9kpzmYRfOgHx3DWpQUFI646IB8nEpLpQp3/0eDocuqiHXYgEpLpPoFKoVE228v74YSFh3Y4fFGX+qtjAgMBAAECggEAIJK9Y42xtSyHjaNdo7bf3CK3HAyn3pafFjyYFT4SxJyxNEDMay5Z5nVq7IAD/+BehMycOFqtvveVf+1+NO/XzZo1iH9URYVfRazkz+lWXYopVkdACm6gN1ILeymAy9g2q+s918ywyxteP668+ABK+5j5wsk/F7wNwKVvKGn0yMT7DP0FAL1e0KWndZCZlF79VnFpBLscDJq28GqRzqYop4CWqHHTA6DBvIqkfQV4U3IzqnzOsxNLEMBwhnbK08XfYZ3DxCPH0jQdA2Jj/aABrntq2EpWjzW5H9iZqrVo33rmsNHUSQvla/333RkbpwGyNhI6kcPBRq4cVSAa3y7dMQKBgQDVfyDUPWKXVwIJUgO1my8WIUu2p6nhuT7Mfnpk4X7ewdFaRVjb/r0KvhLgoz2/KOwkqtWTlEvNaCDDycpLXk+V5ZH833kYsDEmxY7ikOUjCcrfYJgT7P77//cZ4Kx8a5X45SiKAZT2GQv7BTtIfNhrfTUj6AQx/3MP3sa2QAWeNQKBgQCedWoF7t+qyck2hctqtTFC7fRkEk7RNJVph1ZOeTqOIAKhmhkwaOE3joxQ/VqHDy212YdW4hI0BWUzbEdMy0Idz2G3y9ERVD84hZehf5GGRdiSrY9EEQgHlcI6Qb8/AnDdpy1DlKUMwTYjVNzkDL3AzeWn61JS1XQaOzZBsJy2NwKBgFa+pJQXrOtYytcGn8M2Hlebh6vbS8cPAVkNOqWqiWXw0iMfcg9Q3XZz7C+hpAD7m5b6YnToGDSJTma+opck5qk88agRFJ7XV+Es+/VKcg9edzNzh9bwwFmbksbM5shW3kSWt3X7Vo73dkqzwXaeY0CpSuIf7zRxWkrkdVCvipjRAoGAMcJlPN+6VQNwsDJromKryXy31gT5wzBkCvN44sOm46KhsOWXK2CD+NJGtdgZaXgWvphEq7/qP3PCR9ekvDTH2lyZLwJN8Mcn4zPwXcKVjDi6vbTK3HEMuHUKvQiQadT2ZGRvDl3LRqoVuhqYEvT9UWJWz9hRzblB8ErPyukPDRkCgYB7bMv2iflpaGE1J3gkTlVJB+2QSfnAXaUDMLWsZN4gYjwEBVCEJ+mhWL1/GeEIBjSs5/qZIeRsYzlxGEcnsJzRfog6ITBF14AeZ+xNkHq83ja87OGVKMypiccGwRehijDhJi6tgMJ0u0w6PiqcJvh0SX4jBhDDPjuWzK2XD+lx8A== | |||
| appPublicKeyCertPath: /opt/iformall/service/alipay/appCertPublicKey_2021002140616334.crt | |||
| alipayCertPath: /opt/iformall/service/alipay/alipayCertPublicKey_RSA2.crt | |||
| alipayRootCertPath: /opt/iformall/service/alipay/alipayRootCert.crt | |||
| callback: https://callback.malls.iformall.com/api/alipay/notify/callback | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| regionId: cn-beijing | |||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||
| corePoolSize: 6 | |||
| maxPoolSize: 20 | |||
| queueCapacity: 1000 | |||
| namePrefix: aliyun-video-upload | |||
| fm: | |||
| exception: true | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| videoType: aliyun | |||
| pos: | |||
| dev_id: fmpos | |||
| url: https://pos.malls.iformall.com/api | |||
| req_key: ZiGFLC4@3c5sTLZT | |||
| res_key: ugPAM7wd&%p6I0W8 | |||
| logging: | |||
| level: | |||
| com.iformall.mapper: debug | |||
| path: ./logs/b | |||
| @@ -0,0 +1,106 @@ | |||
| spring: | |||
| profiles: | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallinkTest?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(Uc0AjgkytxHHCwZrmDASWg==) | |||
| password: ENC(nV4Mi3bEbBx0Fj7uUyYH55eTaqsFMjKvmNzagicH4pc=) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| maxActive: 20 | |||
| initialSize: 1 | |||
| maxWait: 60000 | |||
| minIdle: 1 | |||
| timeBetweenEvictionRunsMillis: 28000 | |||
| minEvictableIdleTimeMillis: 28000 | |||
| validationQuery: select 'x' | |||
| testWhileIdle: true | |||
| testOnBorrow: false | |||
| testOnReturn: false | |||
| poolPreparedStatements: true | |||
| maxOpenPreparedStatements: 20 | |||
| # REDIS | |||
| redis: | |||
| host: 127.0.0.1 | |||
| port: 6379 | |||
| password: ENC(QFwqv3NshvvGhFPiP8rwhvbnxk+rFSqhJi8Pw6TogSg=) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 50 | |||
| max-idle: 30 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(TtJQE2C4cWo8CpVGMMl5hiy5eykepd96J5XjsW3Kj5fgP+6+5ctDNQ==) | |||
| password: ENC(Zh6A6kRtA2ABtH6nzdvsqQSO1/8p3mparJr8neI2BLU=) # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| auth: true | |||
| starttls: | |||
| enable: true | |||
| socketFactory: | |||
| port: 465 | |||
| class: javax.net.ssl.SSLSocketFactory | |||
| # RABBITMQ | |||
| rabbitmq: | |||
| host: 127.0.0.1 | |||
| port: 5672 | |||
| username: ENC(aSRr6mnSryEqzHHz1hJf1g==) | |||
| password: ENC(GnjF/mdqKdvmDYC0tIIso7+20/jBALPw39tiWCYJ4iw=) | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| access: ENC(NCLcmjwKpAWdn/abD17OKIY7yKepVLWzEpqRYUlURCw=) | |||
| secret: ENC(TRcZqql0Rq5PExlMeH/4WiZ/i02b8FXKmLTBChJmbluTa1uoLS9LrHyNEMrqe1DK+QgOAdvqGBo=) | |||
| wechat: | |||
| open: | |||
| componentAppId: ENC(hnH31XdNzArfMfikKgBFpqQuJUl6rVOPFFcAVyb595o=) | |||
| componentSecret: ENC(t/GUVX5L+U7LCwSvZ5WmxAnmTMrc/Uy1nljsrokuzzsBL2j6BEVnrS/n7DCdGc/G) | |||
| componentToken: ENC(gUF1m0YgCCI2IY54fX6sGLZVlCswA8tG) | |||
| componentAesKey: ENC(TYHcrIkICtfrCfGq4HW6s1b/pHf7OD2uyPN11SzJNB0acqJ/4JVX1nuljo/cAtgMG4O05TImLQc=) | |||
| redis: | |||
| host: 127.0.0.1 | |||
| port: 6379 | |||
| password: ENC(QFwqv3NshvvGhFPiP8rwhvbnxk+rFSqhJi8Pw6TogSg=) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| fm: | |||
| exception: true | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 2 | |||
| open: true | |||
| upload_dir: /home/ec2-user/server/uploads/ | |||
| pos: | |||
| dev_id: fmpos | |||
| url: https://postest.malls.iformall.com/api | |||
| req_key: ZiGFLC4@3c5sTLZT | |||
| res_key: ugPAM7wd&%p6I0W8 | |||
| logging: | |||
| level: | |||
| com.iformall: debug | |||
| path: ./logs/b | |||
| @@ -0,0 +1,54 @@ | |||
| server: | |||
| port: 8000 | |||
| servlet: | |||
| context-path: /B | |||
| spring: | |||
| application: | |||
| name: mallink | |||
| profiles: | |||
| active: dev | |||
| jackson: | |||
| date-format: yyyy-MM-dd HH:mm:ss | |||
| time-zone: GMT+8 | |||
| default-property-inclusion: non_null | |||
| # rocketmq: | |||
| # nameServer: 127.0.0.1:9876 | |||
| # producer: | |||
| # retry-times-when-send-async-failed: 0 | |||
| # send-msg-timeout: 300000 | |||
| # compress-msg-body-over-howmuch: 4096 | |||
| # max-message-size: 4194304 | |||
| # retry-another-broker-when-not-store-ok: false | |||
| # retry-times-when-send-failed: 2 | |||
| # MybatisPlus | |||
| mybatis-plus: | |||
| mapper-locations: classpath:mapper/*Mapper.xml | |||
| global-config: | |||
| db-config: | |||
| id-type: id_worker | |||
| field-strategy: not_null | |||
| db-type: mysql | |||
| configuration: | |||
| jdbc-type-for-null: 'null' | |||
| cache-enabled: false | |||
| call-setters-on-nulls: true | |||
| type-aliases-package: com.iformall.domain.po | |||
| type-enums-package: com.iformall.enums | |||
| # PageHelper | |||
| pagehelper: | |||
| helperDialect: mysql | |||
| reasonable: false | |||
| supportMethodsArguments: true | |||
| params: count=countSql | |||
| offset-as-page-num: true | |||
| page-size-zero: true | |||
| row-bounds-with-count: true | |||
| mapper: | |||
| mappers: | |||
| - com.iformall.common.CommonMapper | |||
| version: 1.0 | |||
| @@ -0,0 +1,100 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <configuration scan="true" scanPeriod="10 seconds"> | |||
| <!-- 外部指定路径 --> | |||
| <springProperty scop="context" name="logPath" source="logging.path" /> | |||
| <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |||
| <encoder> | |||
| <Pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] --%mdc{client}%msg%n</Pattern> | |||
| </encoder> | |||
| </appender> | |||
| <appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |||
| <file>${logPath}/trace.log</file> | |||
| <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |||
| <FileNamePattern>${logPath}/daily/trace.%d{yyyy-MM-dd}.log</FileNamePattern> | |||
| <maxHistory>30</maxHistory> <!-- 保留180天 --> | |||
| </rollingPolicy> | |||
| <layout> | |||
| <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n</pattern> | |||
| </layout> | |||
| </appender> | |||
| <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |||
| <file>${logPath}/info.log</file> | |||
| <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |||
| <FileNamePattern>${logPath}/daily/info.%d{yyyy-MM-dd}.log</FileNamePattern> | |||
| <maxHistory>30</maxHistory> <!-- 保留180天 --> | |||
| </rollingPolicy> | |||
| <layout> | |||
| <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n</pattern> | |||
| </layout> | |||
| <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |||
| <level>INFO</level> | |||
| <onMatch>ACCEPT</onMatch> | |||
| <onMismatch>DENY</onMismatch> | |||
| </filter> | |||
| </appender> | |||
| <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |||
| <file>${logPath}/debug.log</file> | |||
| <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |||
| <FileNamePattern>${logPath}/daily/debug.%d{yyyy-MM-dd}.log</FileNamePattern> | |||
| <maxHistory>30</maxHistory> <!-- 保留180天 --> | |||
| </rollingPolicy> | |||
| <layout> | |||
| <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n</pattern> | |||
| </layout> | |||
| <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |||
| <level>DEBUG</level> | |||
| <onMatch>ACCEPT</onMatch> | |||
| <onMismatch>DENY</onMismatch> | |||
| </filter> | |||
| </appender> | |||
| <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |||
| <file>${logPath}/warn.log</file> | |||
| <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |||
| <FileNamePattern>${logPath}/daily/warn.%d{yyyy-MM-dd}.log</FileNamePattern> | |||
| <maxHistory>30</maxHistory> <!-- 保留180天 --> | |||
| </rollingPolicy> | |||
| <layout> | |||
| <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n</pattern> | |||
| </layout> | |||
| <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |||
| <level>WARN</level> | |||
| <onMatch>ACCEPT</onMatch> | |||
| <onMismatch>DENY</onMismatch> | |||
| </filter> | |||
| </appender> | |||
| <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |||
| <file>${logPath}/error.log</file> | |||
| <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |||
| <FileNamePattern>${logPath}/daily/error.%d{yyyy-MM-dd}.log</FileNamePattern> | |||
| <maxHistory>30</maxHistory> <!-- 保留180天 --> | |||
| </rollingPolicy> | |||
| <layout> | |||
| <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n</pattern> | |||
| </layout> | |||
| <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |||
| <level>ERROR</level> | |||
| <onMatch>ACCEPT</onMatch> | |||
| <onMismatch>DENY</onMismatch> | |||
| </filter> | |||
| </appender> | |||
| <root level="TRACE"> | |||
| <appender-ref ref="TRACE_FILE" /> | |||
| <appender-ref ref="INFO_FILE" /> | |||
| <!-- <appender-ref ref="DEBUG_FILE" /> --> | |||
| <!-- <appender-ref ref="WARN_FILE" /> --> | |||
| <appender-ref ref="ERROR_FILE" /> | |||
| </root> | |||
| <root level="INFO"> | |||
| <appender-ref ref="STDOUT" /> | |||
| </root> | |||
| </configuration> | |||
| @@ -38,54 +38,56 @@ public class WxBillController extends BaseController { | |||
| @Autowired | |||
| WxBillSettleService wxBillSettleService; | |||
| @ApiOperation("所有欠缴和待缴的数据") | |||
| @PostMapping("listBillOweAndWaitPay") | |||
| public ResultData listBillOweAndWaitPay(@RequestBody WxBillAll wxBillAll) { | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("所有欠缴和待缴的数据") | |||
| // @PostMapping("listBillOweAndWaitPay") | |||
| // public ResultData listBillOweAndWaitPay(@RequestBody WxBillAll wxBillAll) { | |||
| // | |||
| // if(StringUtils.isEmpty(wxBillAll.getTenantId())){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId不能为空"); | |||
| // } | |||
| // if(wxBillAll.getMerchantId()==null){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"merchantId不能为空"); | |||
| // } | |||
| // WxMerchant wxMerchant = wxMerchantService.getById(wxBillAll.getMerchantId()); | |||
| // if(wxMerchant==null){ | |||
| // return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| // } | |||
| // if(wxMerchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())){ | |||
| // return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID); | |||
| // } | |||
| // List<Map<String,Object>> result=wxBillAllService.listBillOweAndWaitPay(wxBillAll); | |||
| // return new ResultData(result); | |||
| // } | |||
| if(StringUtils.isEmpty(wxBillAll.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId不能为空"); | |||
| } | |||
| if(wxBillAll.getMerchantId()==null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"merchantId不能为空"); | |||
| } | |||
| WxMerchant wxMerchant = wxMerchantService.getById(wxBillAll.getMerchantId()); | |||
| if(wxMerchant==null){ | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| if(wxMerchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())){ | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID); | |||
| } | |||
| List<Map<String,Object>> result=wxBillAllService.listBillOweAndWaitPay(wxBillAll); | |||
| return new ResultData(result); | |||
| } | |||
| @ApiOperation("账单") | |||
| @PostMapping("listBill") | |||
| public ResultData listBill(@RequestBody WxBillAll wxBillAll) { | |||
| if(StringUtils.isEmpty(wxBillAll.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId不能为空"); | |||
| } | |||
| if(wxBillAll.getMerchantId()==null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"merchantId不能为空"); | |||
| } | |||
| WxMerchant wxMerchant = wxMerchantService.getById(wxBillAll.getMerchantId()); | |||
| if(wxMerchant==null){ | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| if(wxMerchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())){ | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID); | |||
| } | |||
| if(!StringUtils.isEmpty(wxBillAll.getStarttime()) && StringUtils.isEmpty(wxBillAll.getEndtime())){ | |||
| logger.info("开始时间和结束时间要同时存在或不存在"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"starttime和endtime要同时存在或不存在"); | |||
| } | |||
| if(StringUtils.isEmpty(wxBillAll.getStarttime()) && !StringUtils.isEmpty(wxBillAll.getEndtime())){ | |||
| logger.info("开始时间和结束时间要同时存在或不存在"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"starttime和endtime要同时存在或不存在"); | |||
| } | |||
| return wxBillAllService.listBill(wxBillAll); | |||
| } | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("账单") | |||
| // @PostMapping("listBill") | |||
| // public ResultData listBill(@RequestBody WxBillAll wxBillAll) { | |||
| // | |||
| // if(StringUtils.isEmpty(wxBillAll.getTenantId())){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId不能为空"); | |||
| // } | |||
| // if(wxBillAll.getMerchantId()==null){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"merchantId不能为空"); | |||
| // } | |||
| // WxMerchant wxMerchant = wxMerchantService.getById(wxBillAll.getMerchantId()); | |||
| // if(wxMerchant==null){ | |||
| // return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| // } | |||
| // if(wxMerchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())){ | |||
| // return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID); | |||
| // } | |||
| // if(!StringUtils.isEmpty(wxBillAll.getStarttime()) && StringUtils.isEmpty(wxBillAll.getEndtime())){ | |||
| // logger.info("开始时间和结束时间要同时存在或不存在"); | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"starttime和endtime要同时存在或不存在"); | |||
| // } | |||
| // if(StringUtils.isEmpty(wxBillAll.getStarttime()) && !StringUtils.isEmpty(wxBillAll.getEndtime())){ | |||
| // logger.info("开始时间和结束时间要同时存在或不存在"); | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"starttime和endtime要同时存在或不存在"); | |||
| // } | |||
| // return wxBillAllService.listBill(wxBillAll); | |||
| // } | |||
| @GetMapping("/findSettleById") | |||
| @@ -56,57 +56,58 @@ public class WxCouponController extends BaseController { | |||
| @Autowired | |||
| RedisLock redisLock; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize, Integer dataType) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | |||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| if(null == wxCoupon.getSourceType()){ | |||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Bapi.getCode()); | |||
| } | |||
| wxCoupon.setMerchantId(getLoginBUser().getMerchantId()); | |||
| if(StringUtils.isNotBlank(wxCoupon.getSortColumn())){ | |||
| String coryColumn = "c."+wxCoupon.getSortColumns(); | |||
| wxCoupon.setSortColumns(coryColumn); | |||
| wxCoupon.setSortColumn(null); | |||
| } | |||
| return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表 | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("listWithTypePress") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData listWithTypePress(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | |||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| Integer[] typeArray = { | |||
| EnumCouponType.COUPON_MANJIAN.getCode(), | |||
| EnumCouponType.COUPON_DAIJIN.getCode(), | |||
| EnumCouponType.COUPON_TUANGOU.getCode(), | |||
| EnumCouponType.COUPON_LIPIN.getCode(), | |||
| EnumCouponType.COUPON_TINGCHE.getCode(), | |||
| EnumCouponType.COUPON_MULTIMCH.getCode(), | |||
| EnumCouponType.COUPON_PRESS.getCode(), | |||
| EnumCouponType.COUPON_PREORDER.getCode()}; | |||
| wxCoupon.setTypes(Arrays.asList(typeArray)); | |||
| wxCoupon.setMerchantId(getLoginBUser().getMerchantId()); | |||
| if(StringUtils.isNotBlank(wxCoupon.getSortColumn())){ | |||
| String coryColumn = "c."+wxCoupon.getSortColumns(); | |||
| wxCoupon.setSortColumns(coryColumn); | |||
| wxCoupon.setSortColumn(null); | |||
| } | |||
| return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表 | |||
| } | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("分页列表接口") | |||
| // @GetMapping("list") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| // public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize, Integer dataType) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | |||
| // if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||
| // wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| // if(null == wxCoupon.getSourceType()){ | |||
| // wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Bapi.getCode()); | |||
| // } | |||
| // wxCoupon.setMerchantId(getLoginBUser().getMerchantId()); | |||
| // | |||
| // if(StringUtils.isNotBlank(wxCoupon.getSortColumn())){ | |||
| // String coryColumn = "c."+wxCoupon.getSortColumns(); | |||
| // wxCoupon.setSortColumns(coryColumn); | |||
| // wxCoupon.setSortColumn(null); | |||
| // } | |||
| // | |||
| // return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表 | |||
| // } | |||
| // | |||
| // @ApiOperation("分页列表接口") | |||
| // @GetMapping("listWithTypePress") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| // public ResultData listWithTypePress(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | |||
| // if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||
| // wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| // Integer[] typeArray = { | |||
| // EnumCouponType.COUPON_MANJIAN.getCode(), | |||
| // EnumCouponType.COUPON_DAIJIN.getCode(), | |||
| // EnumCouponType.COUPON_TUANGOU.getCode(), | |||
| // EnumCouponType.COUPON_LIPIN.getCode(), | |||
| // EnumCouponType.COUPON_TINGCHE.getCode(), | |||
| // EnumCouponType.COUPON_MULTIMCH.getCode(), | |||
| // EnumCouponType.COUPON_PRESS.getCode(), | |||
| // EnumCouponType.COUPON_PREORDER.getCode()}; | |||
| // | |||
| // wxCoupon.setTypes(Arrays.asList(typeArray)); | |||
| // wxCoupon.setMerchantId(getLoginBUser().getMerchantId()); | |||
| // if(StringUtils.isNotBlank(wxCoupon.getSortColumn())){ | |||
| // String coryColumn = "c."+wxCoupon.getSortColumns(); | |||
| // wxCoupon.setSortColumns(coryColumn); | |||
| // wxCoupon.setSortColumn(null); | |||
| // } | |||
| // return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表 | |||
| // } | |||
| private Map<String,Object> generateFlowParams(EnumFlowKey flowType,EnumCouponAppType approvalType, WxCoupon wxCoupon,String remark,String phone) { | |||
| Map<String,Object> map = new HashMap<String,Object>(); | |||
| @@ -109,44 +109,45 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("交易流水分页列表接口") | |||
| @GetMapping("listUnverified") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData listUnverified(String date, Integer pageNum, Integer pageSize) { | |||
| return wxCouponOrderService.listOnDateAsPage(getLoginBUser().getId(), date, pageNum, pageSize, false); | |||
| } | |||
| @ApiOperation("核销流水分页列表接口") | |||
| @GetMapping("listVerified") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData listVerified(String date, Integer pageNum, Integer pageSize) { | |||
| return wxCouponOrderService.listOnDateAsPage(getLoginBUser().getId(), date, pageNum, pageSize, true); | |||
| } | |||
| @RedisCache | |||
| @ApiOperation("某日期交易总流水") | |||
| @GetMapping("getUnverifiedAmountOnDate") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query")}) | |||
| public ResultData getUnverifiedAmountOnDate(String date) { | |||
| return wxCouponOrderService.listOnDateAsPage(getLoginBUser().getId(), date, null, null, false); | |||
| } | |||
| @RedisCache | |||
| @ApiOperation("某日期核销总流水") | |||
| @GetMapping("getVerifiedAmountOnDate") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query")}) | |||
| public ResultData getVerifiedAmountOnDate(String date) { | |||
| return wxCouponOrderService.listOnDateAsPage(getLoginBUser().getId(), date, null, null, true); | |||
| } | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("交易流水分页列表接口") | |||
| // @GetMapping("listUnverified") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query"), | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| // public ResultData listUnverified(String date, Integer pageNum, Integer pageSize) { | |||
| // return wxCouponOrderService.listOnDateAsPage(getLoginBUser().getId(), date, pageNum, pageSize, false); | |||
| // } | |||
| // | |||
| // @ApiOperation("核销流水分页列表接口") | |||
| // @GetMapping("listVerified") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query"), | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| // public ResultData listVerified(String date, Integer pageNum, Integer pageSize) { | |||
| // return wxCouponOrderService.listOnDateAsPage(getLoginBUser().getId(), date, pageNum, pageSize, true); | |||
| // } | |||
| // | |||
| // | |||
| // @RedisCache | |||
| // @ApiOperation("某日期交易总流水") | |||
| // @GetMapping("getUnverifiedAmountOnDate") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query")}) | |||
| // public ResultData getUnverifiedAmountOnDate(String date) { | |||
| // return wxCouponOrderService.listOnDateAsPage(getLoginBUser().getId(), date, null, null, false); | |||
| // } | |||
| // @RedisCache | |||
| // @ApiOperation("某日期核销总流水") | |||
| // @GetMapping("getVerifiedAmountOnDate") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query")}) | |||
| // public ResultData getVerifiedAmountOnDate(String date) { | |||
| // return wxCouponOrderService.listOnDateAsPage(getLoginBUser().getId(), date, null, null, true); | |||
| // } | |||
| @ApiOperation(value = "卡券详情接口") | |||
| @@ -44,34 +44,35 @@ public class WxCouponSendController extends BaseController { | |||
| @Resource | |||
| private WxCUserMapper wxCUserMapper; | |||
| @ApiOperation("查询商户注券列表") | |||
| @GetMapping("/list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData list(WxCouponSend wxCouponSend, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponSendController::list"); | |||
| if (Objects.isNull(wxCouponSend.getSendType())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| wxCouponSend.updateTenantInfo(getTenantInfo()); | |||
| wxCouponSend.setMerchantId(getLoginBUser().getMerchantId()); | |||
| if (Objects.nonNull(wxCouponSend.getExpired()) && Objects.equals(wxCouponSend.getExpired(), 0)) { | |||
| wxCouponSend.setMerchantRemain(0); | |||
| } | |||
| wxCouponSend.setStatus(wxCouponSend.getStatus()); | |||
| //库存大于0 | |||
| if (Objects.isNull(wxCouponSend.getSortColumn())) { | |||
| wxCouponSend.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| } | |||
| final PageInfo<WxCouponSendVo> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | |||
| for (WxCouponSendVo cs : page.getList()) { | |||
| cs.setSendCount(wxCouponActionLogService.getCountByChannelId(wxCouponSend, cs.getSendType(), cs.getId())); | |||
| } | |||
| return new ResultData(page); | |||
| } | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("查询商户注券列表") | |||
| // @GetMapping("/list") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| // }) | |||
| // public ResultData list(WxCouponSend wxCouponSend, Integer pageNum, Integer pageSize) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCouponSendController::list"); | |||
| // if (Objects.isNull(wxCouponSend.getSendType())) { | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| // } | |||
| // wxCouponSend.updateTenantInfo(getTenantInfo()); | |||
| // wxCouponSend.setMerchantId(getLoginBUser().getMerchantId()); | |||
| // if (Objects.nonNull(wxCouponSend.getExpired()) && Objects.equals(wxCouponSend.getExpired(), 0)) { | |||
| // wxCouponSend.setMerchantRemain(0); | |||
| // } | |||
| // wxCouponSend.setStatus(wxCouponSend.getStatus()); | |||
| // //库存大于0 | |||
| // if (Objects.isNull(wxCouponSend.getSortColumn())) { | |||
| // wxCouponSend.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| // } | |||
| // final PageInfo<WxCouponSendVo> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | |||
| // | |||
| // for (WxCouponSendVo cs : page.getList()) { | |||
| // cs.setSendCount(wxCouponActionLogService.getCountByChannelId(wxCouponSend, cs.getSendType(), cs.getId())); | |||
| // } | |||
| // return new ResultData(page); | |||
| // } | |||
| @ApiOperation("商户注券") | |||
| @PostMapping("/handSel") | |||
| @@ -144,25 +144,26 @@ public class WxCreditHistoryController extends BaseController { | |||
| } | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxCreditHistory wxCreditHistory, Integer pageNum, Integer pageSize) { | |||
| log.debug("[" + getIpAddr() + "] WxCreditHistoryController::list"); | |||
| if (null == wxCreditHistory) wxCreditHistory = new WxCreditHistory(); | |||
| wxCreditHistory.setTenantId(getTenantInfo().getFinalTenantId()); | |||
| wxCreditHistory.setFinalTenantId(getTenantInfo().getFinalTenantId()); | |||
| WxMerchantBUser bUser = getLoginBUser(); | |||
| WxMerchant merchant = wxMerchantService.getById(wxCreditHistory.getMerchantId()); | |||
| if (merchant != null && merchant.getIsAdmin() != null && merchant.getIsAdmin() == 1) { | |||
| wxCreditHistory.setOperatorId(bUser.getId()); | |||
| wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | |||
| wxCreditHistory.setMerchantId(null); | |||
| } | |||
| final PageInfo<WxCreditHistoryVo> page = wxCreditHistoryService.listAsPageMore(wxCreditHistory, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| //TODO 待优化数据 | |||
| // @ApiOperation("分页列表接口") | |||
| // @GetMapping("list") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| // @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| // public ResultData list(@ModelAttribute WxCreditHistory wxCreditHistory, Integer pageNum, Integer pageSize) { | |||
| // log.debug("[" + getIpAddr() + "] WxCreditHistoryController::list"); | |||
| // if (null == wxCreditHistory) wxCreditHistory = new WxCreditHistory(); | |||
| // wxCreditHistory.setTenantId(getTenantInfo().getFinalTenantId()); | |||
| // wxCreditHistory.setFinalTenantId(getTenantInfo().getFinalTenantId()); | |||
| // WxMerchantBUser bUser = getLoginBUser(); | |||
| // WxMerchant merchant = wxMerchantService.getById(wxCreditHistory.getMerchantId()); | |||
| // if (merchant != null && merchant.getIsAdmin() != null && merchant.getIsAdmin() == 1) { | |||
| // wxCreditHistory.setOperatorId(bUser.getId()); | |||
| // wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | |||
| // wxCreditHistory.setMerchantId(null); | |||
| // } | |||
| // final PageInfo<WxCreditHistoryVo> page = wxCreditHistoryService.listAsPageMore(wxCreditHistory, pageNum, pageSize); | |||
| // return new ResultData(page); | |||
| // } | |||
| } | |||
| @@ -12,6 +12,8 @@ import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.service.WxCampaignService; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| import com.iformall.utils.RedisCacheUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -19,6 +21,8 @@ import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| @@ -39,6 +43,10 @@ public class WxCampaignController extends BaseController { | |||
| private WxCampaignService wxCampaignService; | |||
| @Autowired | |||
| private WxCouponChannelService wxCouponChannelService; | |||
| @Autowired | |||
| @Qualifier("objectCommonRedisTemplate") | |||
| RedisTemplate<String, Object> redisTemplate; | |||
| @RedisCache | |||
| @ApiOperation("分页列表接口") | |||
| @@ -56,6 +64,7 @@ public class WxCampaignController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @RedisCache | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @@ -68,30 +77,37 @@ public class WxCampaignController extends BaseController { | |||
| wxCouponChannel.setSubTargetId(wxCampaign.getId()); | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| wxCouponChannel.setShowBeginTime(new Date()); | |||
| List<WxCouponChannelVo> couponList = wxCouponChannelService.listVo(wxCouponChannel); | |||
| //TODO待优化数据 | |||
| List<WxCouponChannelVo> couponList = RedisCacheUtils.getCacheListObject(redisTemplate, "wxCampaignCoupons:"+wxCouponChannel.getTenantId(), WxCouponChannelVo.class); | |||
| if (null == couponList) { | |||
| couponList = wxCouponChannelService.listVo(wxCouponChannel); | |||
| if (null != couponList) { | |||
| RedisCacheUtils.cache(redisTemplate, "wxCampaignCoupons:"+wxCouponChannel.getTenantId(), couponList, 3600); | |||
| } | |||
| } | |||
| wxCampaign.setCoupons(couponList); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxCampaign); | |||
| } | |||
| @ApiOperation("调整顺序") | |||
| @GetMapping("/move") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "sourceId", value = "", dataType = "Long", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "targetId", value = "", dataType = "Long", paramType = "query", required = true)}) | |||
| public ResultData move(Long sourceId, Long targetId,EnumPayWay payWay) { | |||
| WxCampaign source = wxCampaignService.getById(sourceId); | |||
| WxCampaign target = wxCampaignService.getById(targetId); | |||
| if (source == null || target == null) { | |||
| return new ResultData(Result.ERROR, "调整顺序失败", null); | |||
| } | |||
| int temp = source.getSortNum(); | |||
| source.setSortNum(target.getSortNum()); | |||
| target.setSortNum(temp); | |||
| wxCampaignService.saveOrUpdate(source, EnumProjectPlat.FM); | |||
| wxCampaignService.saveOrUpdate(target, EnumProjectPlat.FM); | |||
| return new ResultData(Result.SUCCESS, "调整顺序成功", null); | |||
| } | |||
| // @ApiOperation("调整顺序") | |||
| // @GetMapping("/move") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "sourceId", value = "", dataType = "Long", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "targetId", value = "", dataType = "Long", paramType = "query", required = true)}) | |||
| // public ResultData move(Long sourceId, Long targetId,EnumPayWay payWay) { | |||
| // WxCampaign source = wxCampaignService.getById(sourceId); | |||
| // WxCampaign target = wxCampaignService.getById(targetId); | |||
| // if (source == null || target == null) { | |||
| // return new ResultData(Result.ERROR, "调整顺序失败", null); | |||
| // } | |||
| // int temp = source.getSortNum(); | |||
| // source.setSortNum(target.getSortNum()); | |||
| // target.setSortNum(temp); | |||
| // wxCampaignService.saveOrUpdate(source, EnumProjectPlat.FM); | |||
| // wxCampaignService.saveOrUpdate(target, EnumProjectPlat.FM); | |||
| // return new ResultData(Result.SUCCESS, "调整顺序成功", null); | |||
| // } | |||
| @ApiOperation("输出富文本内容") | |||
| @GetMapping("/printHtmlById") | |||
| @@ -10,6 +10,8 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| @@ -25,6 +27,7 @@ import com.iformall.enums.EnumCouponChannelType; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.utils.RedisCacheUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -42,6 +45,10 @@ public class WxCouponChannelController extends BaseController { | |||
| @Autowired | |||
| private WxMerchantService wxMerchantService; | |||
| @Autowired | |||
| @Qualifier("objectCommonRedisTemplate") | |||
| RedisTemplate<String, Object> redisTemplate; | |||
| @RedisCache | |||
| @ApiOperation("分页列表接口") | |||
| @@ -123,8 +130,21 @@ public class WxCouponChannelController extends BaseController { | |||
| Map<String,Object> map = new HashedMap(); | |||
| wxCouponChannel.setShowBeginTime(new Date()); | |||
| PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listByMerchant(wxCouponChannel,pageNum,pageSize); | |||
| filterTimed(wxCouponChannel, page); | |||
| //TODO待优化数据,先用缓存处理 | |||
| String key = wxCouponChannel.getTenantId(); | |||
| if (null != merchantId) { | |||
| key = String.valueOf(merchantId); | |||
| }else if (null != merchantIds){ | |||
| key = merchantIds.toString(); | |||
| } | |||
| PageInfo<WxCouponChannelVo> page = RedisCacheUtils.getCacheObject(redisTemplate, "merchantCouponList:"+key, PageInfo.class); | |||
| if (null == page ) { | |||
| page = wxCouponChannelService.listByMerchant(wxCouponChannel,pageNum,pageSize); | |||
| filterTimed(wxCouponChannel, page); | |||
| RedisCacheUtils.cache(redisTemplate, "merchantCouponList:"+key, page, 3600); | |||
| } | |||
| if(wxCouponChannel.getMerchantId() != null){ | |||
| WxMerchant wm = wxMerchantService.getById(wxCouponChannel.getMerchantId()); | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.annotation.RedisCache; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| @@ -31,6 +32,7 @@ public class WxGameController extends BaseController { | |||
| @Autowired | |||
| private WxCouponOrderService wxCouponOrderService; | |||
| @RedisCache | |||
| @ApiOperation("蒙层/游戏入口获取游戏信息") | |||
| @GetMapping("getOne") | |||
| public ResultData getOne(@ModelAttribute WxGame wxGame) { | |||
| @@ -46,6 +48,7 @@ public class WxGameController extends BaseController { | |||
| return new ResultData(record); | |||
| } | |||
| @RedisCache | |||
| @ApiOperation("获取游戏信息") | |||
| @GetMapping("getOneGame") | |||
| public ResultData getOneGame(@ModelAttribute WxGame wxGame) { | |||
| @@ -5,10 +5,14 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxTopic; | |||
| import com.iformall.enums.EnumWxTopicType; | |||
| import com.iformall.service.WxTopicService; | |||
| import com.iformall.utils.RedisCacheUtils; | |||
| import io.swagger.annotations.Api; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.web.bind.annotation.*; | |||
| @@ -21,6 +25,10 @@ public class WxTopicController extends BaseController { | |||
| @Autowired | |||
| private WxTopicService wxTopicService; | |||
| @Autowired | |||
| @Qualifier("objectCommonRedisTemplate") | |||
| RedisTemplate<String, Object> redisTemplate; | |||
| @RedisCache | |||
| @GetMapping("show") | |||
| @@ -50,7 +58,14 @@ public class WxTopicController extends BaseController { | |||
| public ResultData findById(WxTopic wxTopic) { | |||
| logger.debug("[" + getIpAddr() + "] WxTopicController::findById"); | |||
| wxTopic.updateTenantInfo(getTenantInfo()); | |||
| WxTopic queryTopic = wxTopicService.findCById(wxTopic); | |||
| //TODO 待优化数据 | |||
| WxTopic queryTopic =RedisCacheUtils.getCacheObject(redisTemplate, "topic:"+wxTopic.getId(), WxTopic.class); | |||
| if (null == queryTopic) { | |||
| queryTopic = wxTopicService.findCById(wxTopic); | |||
| if (null != queryTopic) { | |||
| RedisCacheUtils.cache(redisTemplate, "topic:"+wxTopic.getId(), queryTopic, 3600); | |||
| } | |||
| } | |||
| return new ResultData(queryTopic); | |||
| } | |||
| } | |||
| @@ -394,7 +394,9 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| dataMap.put("shop", shopRunning(tenantEntity)); | |||
| dataMap.put("rent", rentRunning(tenantEntity)); | |||
| dataMap.put("report", reportRunning(tenantEntity)); | |||
| dataMap.put("car", carRunning(tenantEntity)); | |||
| //TODO 待优化数据 | |||
| //dataMap.put("car", carRunning(tenantEntity)); | |||
| dataMap.put("car", null); | |||
| dataMap.put("coupon", couponRunning(tenantEntity)); | |||
| dataMap.put("visitor", visitorRunning(tenantEntity)); | |||
| @@ -409,7 +411,9 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| dataMap.put("shop", shopRunning(tenantEntity)); | |||
| dataMap.put("rent", rentRunning(tenantEntity)); | |||
| dataMap.put("report", reportRunning(tenantEntity)); | |||
| dataMap.put("car", carRunning(tenantEntity)); | |||
| //TODO 待优化数据 | |||
| //dataMap.put("car", carRunning(tenantEntity)); | |||
| dataMap.put("car", null); | |||
| dataMap.put("coupon", couponRunning(tenantEntity)); | |||
| dataMap.put("visitor", visitorRunning(tenantEntity)); | |||
| dataMap.put("contract", contractRunning(tenantEntity)); | |||
| @@ -895,7 +895,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| params.put("startdate", startdate + " 00:00:00"); | |||
| params.put("enddate", systemTime + " 23:59:59"); | |||
| List<Map<String, Object>> historylist = wxCarCmdLogMapper.queryHistory(params); | |||
| //TODO 待优化数据 | |||
| //List<Map<String, Object>> historylist = wxCarCmdLogMapper.queryHistory(params); | |||
| List<Map<String, Object>> historylist = null; | |||
| if (true) { | |||
| return new ResultData(); | |||
| } | |||
| Map<Object, Object> collect = historylist.stream().collect(Collectors.toMap(m -> { | |||
| return m.get("create_date"); | |||
| @@ -1430,7 +1435,9 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| wxCouponOrder.setStartTime(startTime); | |||
| wxCouponOrder.setEndTime(endTime); | |||
| // wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额 | |||
| //TODO 待优化数据 | |||
| //int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额 | |||
| int thisMonthCount = 0; | |||
| c.clear(); | |||
| c.add(Calendar.DAY_OF_YEAR, -1); | |||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||
| @@ -1553,7 +1560,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| c.add(Calendar.DAY_OF_YEAR, -7); | |||
| Date sTime = c.getTime(); | |||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||
| List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntitys, tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime); | |||
| //TOOD 待优化 | |||
| //List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntitys, tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime); | |||
| List<CUserDateAmountVo> datas = null; | |||
| if (true) { | |||
| return new ResultData(); | |||
| } | |||
| Map<String, Integer> dataMap = new HashMap<>(); | |||
| for (CUserDateAmountVo v : datas) { | |||
| dataMap.put(v.getXTime(), v.getPrice()); | |||
| @@ -1595,7 +1607,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| Date eTime = c.getTime();//明天0点 | |||
| c.add(Calendar.DAY_OF_YEAR, -30);//三十天前 | |||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||
| List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntitys,tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime); | |||
| //TODO 待优化数据 | |||
| //List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntitys,tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime); | |||
| List<CUserDateAmountVo> datas = null; | |||
| if (true ) { | |||
| return new ResultData(); | |||
| } | |||
| List<UserStructureVo> monthVos = new ArrayList<>();//周消费金额 | |||
| Map<String, Integer> dataMap = new HashMap<>(); | |||
| for (CUserDateAmountVo v : datas) { | |||
| @@ -1734,7 +1751,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| c.add(Calendar.DAY_OF_YEAR, -30);//三十天前 | |||
| Date sTime = c.getTime(); | |||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||
| List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntitys, tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime); | |||
| //TODO 待优化数据 | |||
| //List<CUserDateAmountVo> datas = wxCouponOrderMapper.queryPriceTotalGroup(tenantEntitys, tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), sTime, eTime); | |||
| List<CUserDateAmountVo> datas = null; | |||
| if(true) { | |||
| return new ResultData(); | |||
| } | |||
| Map<String, Integer> dataMap = new HashMap<>(); | |||
| for (CUserDateAmountVo v : datas) { | |||
| dataMap.put(v.getXTime(), v.getPrice()); | |||
| @@ -19,6 +19,9 @@ import com.iformall.mapper.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.JsonUtil; | |||
| import com.iformall.utils.RedisCacheUtils; | |||
| import com.iformall.utils.RedisUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| @@ -60,6 +63,10 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| @Autowired | |||
| @Qualifier("couponChannelRedisTemplate") | |||
| RedisTemplate<String, PageInfo<WxCouponChannelVo>> cdRedisTemplate; | |||
| @Autowired | |||
| @Qualifier("objectCommonRedisTemplate") | |||
| RedisTemplate<String, Object> redisTemplate; | |||
| /** | |||
| * B端业务端 | |||
| @@ -159,7 +166,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| record.updateTenantInfo(tenantEntity); | |||
| record.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| record.setType(Integer.parseInt(type)); | |||
| List<WxCouponChannelVo> list = wxCouponChannelMapper.findVoList(record); | |||
| List<WxCouponChannel> list = wxCouponChannelMapper.findList(record); | |||
| if (null != list && list.size() > 0 ) { | |||
| return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"该版本【拼团】、【砍价】、【限时抢购】、【预售】线上只能投放一个,已经存在已上线的活动,不能再投放。"); | |||
| } | |||
| @@ -175,7 +182,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| record.updateTenantInfo(tenantEntity); | |||
| record.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| record.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode()); | |||
| List<WxCouponChannelVo> list = wxCouponChannelMapper.findVoList(record); | |||
| List<WxCouponChannel> list = wxCouponChannelMapper.findList(record); | |||
| if (null != list && list.size() > 0 ) { | |||
| return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"该版本【拼团】、【砍价】、【限时抢购】、【预售】线上只能投放一个,已经存在已上线的活动,不能再投放。"); | |||
| } | |||
| @@ -219,8 +226,12 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| couponId = record.getCouponId(); | |||
| record.setCouponId(null); | |||
| } | |||
| // TODO 缓存优化 | |||
| List<WxCouponChannelVo> voList = wxCouponChannelMapper.findVoList(record); | |||
| //TODO 待优化数据,暂时放缓存 | |||
| List<WxCouponChannelVo> voList = RedisCacheUtils.getCacheListObject(redisTemplate, "changeCoupon:"+record.getTenantId(), WxCouponChannelVo.class); | |||
| if (null == voList) { | |||
| voList = wxCouponChannelMapper.findVoList(record); | |||
| RedisCacheUtils.cache(redisTemplate,"changeCoupon:"+record.getTenantId(), voList, 600); | |||
| } | |||
| if (voList.isEmpty()) { | |||
| return new ResultData(Result.SUCCESS, "查询成功", null); | |||
| } | |||
| @@ -393,7 +404,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| }else{ | |||
| pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponChannelMapper.findVoList(record)); | |||
| //插入缓存 | |||
| operations.set(key, pageInfo, 60, TimeUnit.SECONDS); | |||
| operations.set(key, pageInfo, 600, TimeUnit.SECONDS); | |||
| } | |||
| return pageInfo; | |||
| } | |||
| @@ -25,6 +25,8 @@ import com.iformall.mapper.WxGameMapper; | |||
| import com.iformall.service.*; | |||
| import com.iformall.service.order.entity.WxComposeOrder; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.RedisCacheUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -78,6 +80,10 @@ public class WxGameServiceImpl implements WxGameService { | |||
| @Autowired | |||
| @Qualifier("couponDetailRedisTemplate") | |||
| RedisTemplate<String, WxCouponCVo> cdRedisTemplate; | |||
| @Autowired | |||
| @Qualifier("objectCommonRedisTemplate") | |||
| RedisTemplate<String, Object> redisTemplate; | |||
| @Override | |||
| public PageInfo<WxGame> listAsPage(WxGame record, Integer pageIndex, Integer pageSize) { | |||
| @@ -224,7 +230,14 @@ public class WxGameServiceImpl implements WxGameService { | |||
| couponChannelQ.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); | |||
| couponChannelQ.setSubTargetId(record.getId()); | |||
| couponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| List<WxCouponChannelVo> wxCouponChannelVos = wxCouponChannelService.listVo(couponChannelQ); | |||
| //TODO 待优化数据 | |||
| List<WxCouponChannelVo> wxCouponChannelVos = RedisCacheUtils.getCacheListObject(redisTemplate, "gameCoupons:"+record.getId(), WxCouponChannelVo.class); | |||
| if (null == wxCouponChannelVos) { | |||
| wxCouponChannelVos = wxCouponChannelService.listVo(couponChannelQ); | |||
| if (null != wxCouponChannelVos) { | |||
| RedisCacheUtils.cache(redisTemplate, "gameCoupons:"+record.getId(), wxCouponChannelVos, 3600); | |||
| } | |||
| } | |||
| Map<Long, WxCouponChannelVo> wxCouponChannelsMap = new HashMap<Long, WxCouponChannelVo>(); | |||
| for(WxCouponChannelVo wxCouponChannelVo: wxCouponChannelVos) { | |||
| wxCouponChannelsMap.put(wxCouponChannelVo.getCouponId(), wxCouponChannelVo); | |||