| @@ -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") | |||
| @@ -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); | |||
| } | |||
| } | |||
| @@ -43,6 +43,8 @@ public class WxCouponOrder extends TenantEntity { | |||
| private Integer couponOrderStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间数值,供查询优化用", name = "createDateTimes") | |||
| private Long createDateTimes; | |||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateDate") | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice") | |||
| @@ -70,6 +72,9 @@ public class WxCouponOrder extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="商品数量",name="couponNumber") | |||
| private Integer couponNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="补贴",name="subsidy") | |||
| private Integer subsidy; | |||
| @TableField(exist = false) | |||
| private String couponName; | |||
| @@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.UUID; | |||
| @TableName(value = "wx_merchant_b_user") | |||
| @@ -24,6 +25,8 @@ public class WxMerchantBUser extends TenantEntity { | |||
| private String userPwd; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户id", name = "merchantId") | |||
| private Long merchantId; | |||
| @TableField(exist = false) | |||
| private List<Long> merchantIds; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateDate") | |||
| @@ -1,11 +1,13 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @TableName(value = "wx_merchant_shop") | |||
| @Data | |||
| @@ -18,6 +20,8 @@ public class WxMerchantShop extends TenantEntity { | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺ID",name="shopId") | |||
| private Long shopId; | |||
| @TableField(exist = false) | |||
| private List<Long> shopIdList; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| @@ -55,7 +55,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @Excel(name = "会员手机号", width = 20, orderNum = "13") | |||
| @io.swagger.annotations.ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") | |||
| private String cUserPhone; | |||
| @Excel(name = "微信昵称", width = 20, orderNum = "14") | |||
| @io.swagger.annotations.ApiModelProperty(value="微信昵称",name="userNickName") | |||
| private String userNickName; | |||
| @@ -141,7 +141,8 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @Excel(name = "所属商户", width = 50, orderNum = "3") | |||
| @io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName") | |||
| private String merchantName; | |||
| @TableField(exist = false) | |||
| private List<Long> bUserIdList; | |||
| @Excel(name = "发券商户(商户注券)", width = 50, orderNum = "3") | |||
| @io.swagger.annotations.ApiModelProperty(value="发券商户(商户注券)",name="sendMerchantName") | |||
| @@ -170,9 +171,13 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @TableField(exist = false) | |||
| private Date startDate; | |||
| @TableField(exist = false) | |||
| private Long startDateTimes; | |||
| @TableField(exist = false) | |||
| private Date endDate; | |||
| @TableField(exist = false) | |||
| private Long endDateTimes; | |||
| @TableField(exist = false) | |||
| private Long merchantId; | |||
| @@ -192,6 +197,8 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @TableField(exist = false) | |||
| private Long couponId; | |||
| @TableField(exist = false) | |||
| private List<Long> couponIds; | |||
| @Excel(name = "类型", width = 50, orderNum = "16", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "券礼包_12", "积分券_50", "积分停车券_51", "消费卡_100"}) | |||
| @TableField(exist = false) | |||
| @@ -0,0 +1,31 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @JsonIgnoreProperties(value = {"handler"}) | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxMerchantProductVo extends TenantEntity { | |||
| /** | |||
| * | |||
| */ | |||
| private static final long serialVersionUID = -367003237067255221L; | |||
| @io.swagger.annotations.ApiModelProperty(value = "券编码", name = "productId") | |||
| private Long productId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户编码", name = "merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户数", name = "merchantId") | |||
| private Integer mc; | |||
| } | |||
| @@ -22,6 +22,8 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||
| List<WxCUserBasicInfo> findList(WxCUserBasicInfo wxCUserBasicInfo); | |||
| List<WxCUserBasicInfo> findList1(@Param("tenantInfo")TenantEntity tenantInfo, @Param("basicInfo")WxCUserBasicInfo wxCUserBasicInfo); | |||
| List<WxCUserBasicInfo> findListPhoneAndNameByIds(WxCUserBasicInfo wxCUserBasicInfo); | |||
| WxCUserBasicInfo selectById(@Param("id")Long id,@Param("finalTenantId")String finalTenantId); | |||
| void updateScore(WxCUserBasicInfo record); | |||
| @@ -15,6 +15,10 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||
| List<WxCouponStatisVo> findCountData(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("wxCoupon")WxCoupon wxCoupon); | |||
| List<WxCoupon> findList(WxCoupon wxCoupon); | |||
| List<WxCoupon> findTenantSimpleList(WxCoupon wxCoupon); | |||
| List<Long> findIdList(WxCoupon wxCoupon); | |||
| List<WxCoupon> findCouponList(WxCoupon wxCoupon); | |||
| WxCoupon selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxCouponMerchant; | |||
| import com.iformall.domain.vo.WxMerchantProductVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import java.util.List; | |||
| @@ -16,4 +17,6 @@ public interface WxCouponMerchantMapper extends CommonMapper<WxCouponMerchant, L | |||
| List<WxMerchantVo> findMerchantVoList(@Param("productId")Long productId,@Param("tenantId")String tenantId); | |||
| List<WxMerchantVo> findMerchantNameList(@Param("productId")Long productId,@Param("tenantId")String tenantId); | |||
| List<WxMerchantVo> findMerchantBaseList(@Param("productId")Long productId,@Param("tenantId")String tenantId); | |||
| List<WxMerchantProductVo> findMerchantProduct(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList); | |||
| List<Long> findMerchantProductIds(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList); | |||
| } | |||
| @@ -32,6 +32,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| int updateVerifyCouponOrderStatus(WxCouponOrder wxCouponOrder); | |||
| int updateVerifyCouponOrderStatusForMicroPay(WxCouponOrder wxCouponOrder); | |||
| int cancelVerifyCouponOrder(WxCouponOrder wxCouponOrder); | |||
| int updateVerifyCouponOrderSubsidy(WxCouponOrder wxCouponOrder); | |||
| //统一的计数接口 | |||
| int findCount(WxCouponOrder wxCouponOrder); | |||
| @@ -8,6 +8,9 @@ import com.iformall.domain.vo.WxMerchantBuInfoVo; | |||
| public interface WxMerchantBUserMapper extends CommonMapper<WxMerchantBUser, Long> { | |||
| List<WxMerchantBUser> findList(WxMerchantBUser wxMerchantBUser); | |||
| List<Long> findIdList(WxMerchantBUser wxMerchantBUser); | |||
| List<WxMerchantBUser> findMerchantIdListByIds(WxMerchantBUser wxMerchantBUser); | |||
| List<WxMerchantBuInfoVo> findSelMerchantList(WxMerchantBUser wxMerchantBUser); | |||
| @@ -16,6 +16,7 @@ import java.util.Map; | |||
| public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||
| List<WxMerchant> findList(WxMerchant wxMerchant); | |||
| List<Long> findIdList(WxMerchant wxMerchant); | |||
| List<WxMerchant> findIdNameList(WxMerchant wxMerchant); | |||
| @@ -11,6 +11,8 @@ public interface WxMerchantShopMapper extends CommonMapper<WxMerchantShop, Strin | |||
| List<WxMerchantShop> findList(WxMerchantShop wxMerchantShop); | |||
| List<Long> findMerchantIdList(WxMerchantShop wxMerchantShop); | |||
| List<Long> findShopIds(@Param("merchantId") Long merchantId); | |||
| void delShops(@Param("merchantId") Long merchantId,@Param("shopList") List<Long> shopIds); | |||
| @@ -16,6 +16,7 @@ import java.util.Map; | |||
| public interface WxShopMapper extends CommonMapper<WxShop, String> { | |||
| List<WxShop> findList(WxShop wxShop); | |||
| List<Long> findIdList(WxShop wxShop); | |||
| List<Map<String,Object>> findListMap(WxShop record); | |||
| @@ -44,7 +44,8 @@ public interface WxCUserBasicInfoService { | |||
| */ | |||
| PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxCUserBasicInfo> listAsPage(TenantEntity tenantInfo, WxCUserBasicInfo wxCUserBasicInfo, Integer pageIndex, Integer pageSize); | |||
| List<WxCUserBasicInfo> listPhoneAndNameByIds(WxCUserBasicInfo record); | |||
| /** | |||
| * 根据实体查询列表 | |||
| * @param record | |||
| @@ -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)); | |||
| @@ -591,6 +591,12 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||
| return wxCUserBasicInfoMapper.selectCount(new QueryWrapper(record)); | |||
| } | |||
| @Override | |||
| public List<WxCUserBasicInfo> listPhoneAndNameByIds(WxCUserBasicInfo record) { | |||
| return wxCUserBasicInfoMapper.findListPhoneAndNameByIds(record); | |||
| } | |||
| @Override | |||
| public List<WxCUserBasicInfo> findByPhone(TenantEntity tenantEntity, String phone) { | |||
| WxCUserBasicInfo basicQ = new WxCUserBasicInfo(); | |||
| @@ -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; | |||
| } | |||
| @@ -171,6 +171,12 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| SysConfigService sysConfigService; | |||
| @Autowired | |||
| WxMerchantBUserService wxMerchantBUserService; | |||
| @Autowired | |||
| WxShopMapper wxShopMapper; | |||
| @Autowired | |||
| WxMerchantShopMapper wxMerchantShopMapper; | |||
| private final SimpleDateFormat mydateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |||
| @@ -335,9 +341,326 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| @Override | |||
| public ResultData listAdminAsPage(WxCouponOrderBVo wxCouponOrderBVo, Integer pageIndex, Integer pageSize) { | |||
| handleWxCouponOrderBVoQueryParam(wxCouponOrderBVo); | |||
| PageInfo<WxCouponOrderBVo> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findListOfAdmin(wxCouponOrderBVo)); | |||
| if (null != pageInfo && null != pageInfo.getList()){ | |||
| handleQueryResult(pageInfo.getList(), wxCouponOrderBVo); | |||
| } | |||
| return new ResultData(pageInfo); | |||
| } | |||
| private void handleQueryResult(List<WxCouponOrderBVo> list,TenantEntity tenantEntity) { | |||
| if (null != list ) { | |||
| WxMerchant merchantQ = new WxMerchant(); | |||
| merchantQ.updateTenantInfo(tenantEntity); | |||
| List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ); | |||
| Map<Long,String> merchantNameMap = new HashMap<Long,String>(); | |||
| if (null != merchantList) { | |||
| for (int i = 0 ; i < merchantList.size() ; i ++) { | |||
| WxMerchant m = merchantList.get(i); | |||
| merchantNameMap.put(m.getId(), m.getName()); | |||
| } | |||
| } | |||
| WxCoupon couponQ = new WxCoupon(); | |||
| couponQ.updateTenantInfo(tenantEntity); | |||
| List<WxCoupon> couponList = wxCouponMapper.findTenantSimpleList(couponQ); | |||
| Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>(); | |||
| if (null != couponList) { | |||
| for (int i = 0 ; i < couponList.size() ; i ++) { | |||
| WxCoupon c = couponList.get(i); | |||
| couponMap.put(c.getId(), c); | |||
| } | |||
| } | |||
| List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), null); | |||
| Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>(); | |||
| if (null != merchantProductVos) { | |||
| for (int i = 0 ; i < merchantProductVos.size(); i ++) { | |||
| WxMerchantProductVo mp = merchantProductVos.get(i); | |||
| if (mp.getMc() > 1) { | |||
| merchantProductIdMap.put(mp.getProductId(), -999L); | |||
| }else { | |||
| merchantProductIdMap.put(mp.getProductId(), mp.getMerchantId()); | |||
| } | |||
| } | |||
| } | |||
| //循环list,获取 cUserId | |||
| List<Long> cUserIdList = new ArrayList<Long>(); | |||
| List<Long> bUserIdList = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < list.size() ; i ++ ) { | |||
| WxCouponOrderBVo bo = list.get(i); | |||
| Long cusrid = bo.getcUserId(); | |||
| if (null != cusrid && (!cUserIdList.contains(cusrid))) { | |||
| cUserIdList.add(cusrid); | |||
| } | |||
| Long busrid = bo.getBUserId(); | |||
| if (null != busrid && (!bUserIdList.contains(busrid))) { | |||
| bUserIdList.add(busrid); | |||
| } | |||
| } | |||
| Map<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>(); | |||
| if (cUserIdList.size() > 0) { | |||
| WxCUserBasicInfo cUserBasicInfoQ = new WxCUserBasicInfo(); | |||
| cUserBasicInfoQ.setIds(cUserIdList); | |||
| cUserBasicInfoQ.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| List<WxCUserBasicInfo> cuserList = wxCUserBasicInfoService.listPhoneAndNameByIds(cUserBasicInfoQ); | |||
| if (null != cuserList) { | |||
| for (int i = 0 ; i < cuserList.size() ; i++) { | |||
| WxCUserBasicInfo cbi = cuserList.get(i); | |||
| cUserMap.put(cbi.getId(), cbi); | |||
| } | |||
| } | |||
| } | |||
| Map<Long,Long> buserMerchantIdMap = new HashMap<Long,Long>(); | |||
| if (bUserIdList.size() > 0 ) { | |||
| WxMerchantBUser merchantBUserQ = new WxMerchantBUser(); | |||
| merchantBUserQ.setIds(bUserIdList); | |||
| merchantBUserQ.updateTenantInfo(tenantEntity); | |||
| List<WxMerchantBUser> busrlist = wxMerchantBUserMapper.findMerchantIdListByIds(merchantBUserQ); | |||
| if (null != busrlist ) { | |||
| for (int i = 0 ; i < busrlist.size() ; i ++) { | |||
| WxMerchantBUser buser = busrlist.get(i); | |||
| buserMerchantIdMap.put(buser.getId(), buser.getMerchantId()); | |||
| } | |||
| } | |||
| } | |||
| for (int i = 0 ; i < list.size() ; i ++) { | |||
| WxCouponOrderBVo co = list.get(i); | |||
| if (co.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode())) { | |||
| co.setUpdateDate(null); | |||
| } | |||
| if (null != co.getSendMerchantId()) { | |||
| co.setSendMerchantName(merchantNameMap.get(co.getSendMerchantId())); | |||
| } | |||
| WxCoupon coupon = couponMap.get(co.getCouponId()); | |||
| if (null != coupon) { | |||
| co.setTitle(coupon.getTitle()); | |||
| co.setSalePrice(coupon.getSalePrice()); | |||
| co.setUsePrice(coupon.getUsePrice()); | |||
| co.setPrice(coupon.getPrice()); | |||
| co.setAutoRefund(coupon.getAutoRefund()); | |||
| co.setBusiness(coupon.getBusiness()); | |||
| co.setSubsidyType(coupon.getSubsidyType()); | |||
| co.setSourceType(coupon.getSourceType()); | |||
| } | |||
| // WxMerchantSubsidy merchantSubsidyQ = new WxMerchantSubsidy(); | |||
| // merchantSubsidyQ.setCouponOrderId(co.getId()); | |||
| // merchantSubsidyQ.setCouponType(co.getCouponType()); | |||
| // merchantSubsidyQ.setType(EnumMerchantSubsidyType.MANUAL.getCode()); | |||
| // merchantSubsidyQ.updateTenantInfo(co); | |||
| // List<WxMerchantSubsidy> msList = wxMerchantSubsidyMapper.selectList(new QueryWrapper<WxMerchantSubsidy>(merchantSubsidyQ)); | |||
| // if (msList.size() > 0) { | |||
| // co.setSubsidyNum(msList.get(0).getSubsidy()); | |||
| // } | |||
| co.setSubsidyNum(co.getSubsidy()); | |||
| Long merchanId = merchantProductIdMap.get(co.getCouponId()); | |||
| if (null != merchanId) { | |||
| if (merchanId == -999L) { | |||
| co.setMerchantName("多商户通用"); | |||
| co.setMerchantId(0L); | |||
| }else { | |||
| co.setMerchantName(merchantNameMap.get(merchanId)); | |||
| co.setMerchantId(merchanId); | |||
| } | |||
| } | |||
| //WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.getById(co.getCUserId(), co.getFinalTenantId()); | |||
| WxCUserBasicInfo basicInfo = cUserMap.get(co.getCUserId()); | |||
| if (null != basicInfo) { | |||
| co.setcuserPhone(basicInfo.getPhone()); | |||
| co.setUserNickName(basicInfo.getNickName()); | |||
| } | |||
| //WxMerchantBUser buser = wxMerchantBUserService.getById(co.getBUserId()); | |||
| Long buserMechantId = buserMerchantIdMap.get(co.getBUserId()); | |||
| if (null != buserMechantId) { | |||
| co.setVerifyMerchantName(merchantNameMap.get(buserMechantId)); | |||
| } | |||
| //co.setChannelType();) | |||
| } | |||
| } | |||
| } | |||
| private List<Long> getMerchantIdsQueryParam(WxCouponOrderBVo wxCouponOrder) { | |||
| List<Long> retMerchantIdList = new ArrayList<Long>(); | |||
| boolean isConditiondQquery = false; | |||
| //根据名称查询商户 | |||
| String merchantName = StringUtils.trimToNull(wxCouponOrder.getMerchantName()); | |||
| if (null != merchantName) { | |||
| WxMerchant merchantQ1 = new WxMerchant(); | |||
| merchantQ1.updateTenantInfo(wxCouponOrder); | |||
| merchantQ1.setName(merchantName); | |||
| List<Long> merchantIdList = wxMerchantMapper.findIdList(merchantQ1); | |||
| if (null == merchantIdList || merchantIdList.size() <= 0) { | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"商户名称查询不到商户。"); | |||
| retMerchantIdList.add(-999L); | |||
| return retMerchantIdList; | |||
| } | |||
| retMerchantIdList.addAll(merchantIdList); | |||
| isConditiondQquery = true; | |||
| } | |||
| //楼层楼座查询商户 | |||
| if (null != wxCouponOrder.getBuilding() || null != wxCouponOrder.getFloor()) { | |||
| WxShop shopQ = new WxShop(); | |||
| shopQ.updateTenantInfo(wxCouponOrder); | |||
| if (null != wxCouponOrder.getBuilding()) { | |||
| shopQ.setBuilding(Long.parseLong(String.valueOf(wxCouponOrder.getBuilding()))); | |||
| } | |||
| if (null != wxCouponOrder.getFloor()) { | |||
| shopQ.setFloor(Long.parseLong(String.valueOf(wxCouponOrder.getFloor()))); | |||
| } | |||
| List<Long> shopIds = wxShopMapper.findIdList(shopQ); | |||
| if (null == shopIds || shopIds.size() <= 0 ){ | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"楼座楼层提交查询不到店铺信息."); | |||
| retMerchantIdList.add(-999L); | |||
| return retMerchantIdList; | |||
| } | |||
| WxMerchantShop wxMerchantShopQ = new WxMerchantShop(); | |||
| wxMerchantShopQ.updateTenantInfo(wxCouponOrder); | |||
| wxMerchantShopQ.setShopIdList(shopIds); | |||
| wxMerchantShopQ.setIsDel(0); | |||
| List<Long> buildMerchantIdList = wxMerchantShopMapper.findMerchantIdList(wxMerchantShopQ); | |||
| if (null == buildMerchantIdList || buildMerchantIdList.size() <= 0 ){ | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"楼座楼层对应店铺无商户绑定记录."); | |||
| retMerchantIdList.add(-999L); | |||
| return retMerchantIdList; | |||
| } | |||
| retMerchantIdList.retainAll(buildMerchantIdList); | |||
| isConditiondQquery = true; | |||
| } | |||
| if (isConditiondQquery) { | |||
| if (retMerchantIdList.size() <= 0 ) { | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"根据条件交集未查询到商户记录."); | |||
| retMerchantIdList.add(-999L); | |||
| return retMerchantIdList; | |||
| }else { | |||
| return retMerchantIdList; | |||
| } | |||
| }else { | |||
| return null; | |||
| } | |||
| } | |||
| private void handleWxCouponOrderBVoQueryParam(WxCouponOrderBVo wxCouponOrder) { | |||
| if(null == wxCouponOrder.getStartDate()) { | |||
| wxCouponOrder.setStartDate(DateUtils.getFirstDayForCurrMonth()); | |||
| } | |||
| wxCouponOrder.setStartDateTimes(wxCouponOrder.getStartDate().getTime()); | |||
| wxCouponOrder.setStartDate(null); | |||
| if(null == wxCouponOrder.getEndDate()) { | |||
| wxCouponOrder.setEndDate(DateUtils.getLastDayForMonth(new Date())); | |||
| } | |||
| wxCouponOrder.setEndDateTimes(wxCouponOrder.getEndDate().getTime()); | |||
| wxCouponOrder.setEndDate(null); | |||
| String cuserPhone = StringUtils.trimToNull(wxCouponOrder.getcuserPhone()); | |||
| if (null != cuserPhone) { | |||
| WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(wxCouponOrder, cuserPhone); | |||
| if (null != basicInfo) { | |||
| wxCouponOrder.setCUserId(basicInfo.getId()); | |||
| }else { | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"手机号查询不到会员信息。"); | |||
| wxCouponOrder.setCUserId(-999L); | |||
| return; | |||
| } | |||
| } | |||
| List<Long> merchantIdListQueryParam = getMerchantIdsQueryParam(wxCouponOrder); | |||
| List<Long> merchantProductIds = null; | |||
| if (null != merchantIdListQueryParam) { | |||
| //查询商户券 | |||
| merchantProductIds = wxCouponMerchantMapper.findMerchantProductIds(wxCouponOrder.getTenantId(), merchantIdListQueryParam); | |||
| if (null == merchantProductIds || merchantProductIds.size() <= 0) { | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"商户下查询不到券信息。"); | |||
| List<Long> tempCouponIds = new ArrayList<Long>(); | |||
| tempCouponIds.add(-999L); | |||
| wxCouponOrder.setCouponIds(tempCouponIds); | |||
| return; | |||
| } | |||
| } | |||
| List<Long> couponIds = null; | |||
| String title = StringUtils.trimToNull(wxCouponOrder.getTitle()); | |||
| if (null != title || null != wxCouponOrder.getType() || null != wxCouponOrder.getBusiness() || null != wxCouponOrder.getSourceType()) { | |||
| WxCoupon wxCouponQuery = new WxCoupon(); | |||
| wxCouponQuery.updateTenantInfo(wxCouponOrder); | |||
| wxCouponQuery.setTitle(title); | |||
| wxCouponQuery.setType(wxCouponOrder.getType()); | |||
| wxCouponQuery.setBusiness(wxCouponOrder.getBusiness()); | |||
| wxCouponQuery.setSourceType(wxCouponOrder.getSourceType()); | |||
| couponIds = wxCouponMapper.findIdList(wxCouponQuery); | |||
| if (null == couponIds || couponIds.size() <= 0) { | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"根据券条件搜索不到券信息。"); | |||
| List<Long> tempCouponIds = new ArrayList<Long>(); | |||
| tempCouponIds.add(-999L); | |||
| wxCouponOrder.setCouponIds(tempCouponIds); | |||
| return; | |||
| } | |||
| } | |||
| //merchantProducts 和 couponIds 取交集 | |||
| if (null != merchantProductIds) { | |||
| if (null != couponIds) { | |||
| //取交集 | |||
| merchantProductIds.retainAll(couponIds); | |||
| } | |||
| wxCouponOrder.setCouponIds(merchantProductIds); | |||
| }else { | |||
| if (null != couponIds) { | |||
| wxCouponOrder.setCouponIds(couponIds); | |||
| } | |||
| } | |||
| //核销商户 | |||
| String verifyMerchantName = StringUtils.trimToNull(wxCouponOrder.getVerifyMerchantName()); | |||
| if (null != verifyMerchantName) { | |||
| WxMerchant merchantQ2 = new WxMerchant(); | |||
| merchantQ2.updateTenantInfo(wxCouponOrder); | |||
| merchantQ2.setName(verifyMerchantName); | |||
| List<Long> merchantIds = wxMerchantMapper.findIdList(merchantQ2); | |||
| if (null == merchantIds || merchantIds.size() <= 0 ){ | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"核销商户名称查询不到商户记录."); | |||
| List<Long> tempBUserIds = new ArrayList<Long>(); | |||
| tempBUserIds.add(-999L); | |||
| wxCouponOrder.setBUserIdList(tempBUserIds); | |||
| return; | |||
| } | |||
| WxMerchantBUser merchantBUserQ = new WxMerchantBUser(); | |||
| merchantBUserQ.setMerchantIds(merchantIds); | |||
| List<Long> bUserIdList = wxMerchantBUserMapper.findIdList(merchantBUserQ); | |||
| if (null == bUserIdList || bUserIdList.size() <= 0 ){ | |||
| //throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"核销商户下查询不到员工信息."); | |||
| List<Long> tempBUserIds = new ArrayList<Long>(); | |||
| tempBUserIds.add(-999L); | |||
| wxCouponOrder.setBUserIdList(tempBUserIds); | |||
| return; | |||
| } | |||
| wxCouponOrder.setBUserIdList(bUserIdList); | |||
| } | |||
| } | |||
| @Override | |||
| public ResultData detailAdminVo(Long couponOrderId,TenantEntity tenantinfo) { | |||
| @@ -354,40 +677,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| if(EnumCouponType.COUPON_DISTRIBUTION.getCode().equals(wxCouponOrder.getCouponType())){ | |||
| filename = "商品订单"; | |||
| } | |||
| WxMerchant merchantQ = new WxMerchant(); | |||
| merchantQ.updateTenantInfo(wxCouponOrder); | |||
| List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ); | |||
| Map<Long,String> merchantNameMap = new HashMap<Long,String>(); | |||
| if (null != merchantList) { | |||
| merchantList.parallelStream().forEach(m -> { | |||
| merchantNameMap.put(m.getId(), m.getName()); | |||
| }); | |||
| } | |||
| handleWxCouponOrderBVoQueryParam(wxCouponOrder); | |||
| List<WxCouponOrderBVo> list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder); | |||
| list.parallelStream().forEach(c -> { | |||
| if (c.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode())) { | |||
| c.setUpdateDate(null); | |||
| } | |||
| if (null != c.getSendMerchantId()) { | |||
| c.setSendMerchantName(merchantNameMap.get(c.getSendMerchantId())); | |||
| } | |||
| // if (!c.getMerchantId().equals(0L)) { | |||
| // List<WxMerchantVo> merchantVoList = c.getMerchantVoList(); | |||
| // if (!CollectionUtils.isEmpty(merchantVoList)) { | |||
| // StringBuilder shopNumber = new StringBuilder(); | |||
| // StringBuilder building = new StringBuilder(); | |||
| // WxMerchantVo wxMerchantVo = merchantVoList.get(0); | |||
| // List<WxShopVo> shopVoList = wxMerchantVo.getShopVoList(); | |||
| // for (WxShopVo wxShopVo : shopVoList) { | |||
| // shopNumber.append(wxShopVo.getShopNumber()).append(";"); | |||
| // building.append(wxShopVo.getBuildingName()).append(wxShopVo.getFloorName()).append(";"); | |||
| // } | |||
| // c.setShopNumber(shopNumber.toString()); | |||
| // c.setBuildingStr(building.toString()); | |||
| // } | |||
| // } | |||
| }); | |||
| handleQueryResult(list,wxCouponOrder); | |||
| excelService.exportCsv(list, null, filename, WxCouponOrderBVo.class, filename + ".csv", response, false); | |||
| } | |||
| @@ -1027,6 +1319,14 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| logger.error("数据库插入错误:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL); | |||
| } | |||
| try { | |||
| couponOrder.setSubsidy(subsidyNum); | |||
| wxCouponOrderMapper.updateVerifyCouponOrderSubsidy(couponOrder); | |||
| } catch (Exception e) { | |||
| logger.error("数据库插入错误:" + e.getMessage(),e); | |||
| throw new MallinkException(ErrorCode.DB_FAIL); | |||
| } | |||
| } | |||
| } | |||
| @@ -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); | |||
| @@ -1087,6 +1087,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.CARD_USING.getCode()); | |||
| } | |||
| couponOrder.setCreateDate(curr); | |||
| couponOrder.setCreateDateTimes(curr.getTime()); | |||
| couponOrder.setUpdateDate(curr); | |||
| couponOrder.setCouponPrice(order.getPayment()); | |||
| wxCouponOrderMapper.insert(couponOrder); | |||
| @@ -1193,6 +1194,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.CARD_USING.getCode()); | |||
| } | |||
| couponOrder.setCreateDate(curr); | |||
| couponOrder.setCreateDateTimes(curr.getTime()); | |||
| couponOrder.setUpdateDate(curr); | |||
| couponOrder.setCouponPrice(order.getPayment()); | |||
| couponOrder.setComposeOrderType(order.getComposeOrderType()); | |||
| @@ -244,6 +244,19 @@ | |||
| </sql> | |||
| <select id="findListPhoneAndNameByIds" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultMap="BaseResultMap"> | |||
| select id, phone, nick_name | |||
| from wx_c_user_basic_info wcubi | |||
| where wcubi.`final_tenant_id` = #{finalTenantId} | |||
| <if test=" null != ids "> | |||
| and wcubi.id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| </select> | |||
| <select id="findList1" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| @@ -313,6 +313,17 @@ | |||
| select <include refid="allColumns"/> ,c.html from wx_coupon c where id = #{id} and tenant_id = #{tenantId} | |||
| </select> | |||
| <select id="findTenantSimpleList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | |||
| select id,title,sale_price,use_price,price,auto_refund,business,subsidy_type,source_type | |||
| from wx_coupon c where c.`tenant_id` = #{tenantId} | |||
| </select> | |||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | |||
| select id | |||
| from wx_coupon c | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <delete id="deleteById" parameterType="java.util.HashMap"> | |||
| update wx_coupon set is_del = 1 where id = #{id} and tenant_id = #{tenantId} | |||
| </delete> | |||
| @@ -134,5 +134,43 @@ | |||
| and cm.product_id = #{productId} and cm.tenant_id = #{tenantId} | |||
| </select> | |||
| <resultMap id="MerchantProductVoResultMap" type="com.iformall.domain.vo.WxMerchantProductVo"> | |||
| <result column="product_id" jdbcType="BIGINT" property="productId"/> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> | |||
| <result column="mc" jdbcType="INTEGER" property="mc"/> | |||
| </resultMap> | |||
| <select id = "findMerchantProduct" parameterType="java.util.Map" resultMap="MerchantProductVoResultMap"> | |||
| SELECT wcm.product_id,wcm.merchant_id,COUNT(1) AS mc | |||
| FROM wx_coupon_merchant wcm | |||
| WHERE wcm.STATUS = 0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and wcm.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != merchantIdList"> | |||
| and wcm.merchant_id in | |||
| <foreach collection="merchantIdList" index="index" item="merchantIdItem" open="(" separator="," close=")"> | |||
| #{merchantIdItem} | |||
| </foreach> | |||
| </if> | |||
| GROUP BY product_id | |||
| </select> | |||
| <select id = "findMerchantProductIds" parameterType="java.util.Map" resultType="Long"> | |||
| SELECT distinct wcm.product_id | |||
| FROM wx_coupon_merchant wcm | |||
| WHERE wcm.STATUS = 0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and wcm.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != merchantIdList"> | |||
| and wcm.merchant_id in | |||
| <foreach collection="merchantIdList" index="index" item="merchantIdItem" open="(" separator="," close=")"> | |||
| #{merchantIdItem} | |||
| </foreach> | |||
| </if> | |||
| </select> | |||
| </mapper> | |||
| @@ -15,6 +15,7 @@ | |||
| <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" /> | |||
| <result column="coupon_order_status" jdbcType="INTEGER" property="couponOrderStatus" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="create_date_times" jdbcType="BIGINT" property="createDateTimes" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="coupon_price" jdbcType="INTEGER" property="couponPrice" /> | |||
| <result column="auto_refund" jdbcType="INTEGER" property="autoRefund" /> | |||
| @@ -27,7 +28,7 @@ | |||
| <result column="compose_order_id" jdbcType="BIGINT" property="composeOrderId" /> | |||
| <result column="parent_coupon_order_id" jdbcType="BIGINT" property="parentCouponOrderId" /> | |||
| <result column="coupon_number" jdbcType="BIGINT" property="couponNumber" /> | |||
| <result column="subsidy" jdbcType="INTEGER" property="subsidy" /> | |||
| <result column="freight_price" jdbcType="INTEGER" property="freightPrice"/> | |||
| <result column="shipping_type" jdbcType="INTEGER" property="shippingType"/> | |||
| <result column="shipping_address" jdbcType="VARCHAR" property="shippingAddress"/> | |||
| @@ -38,7 +39,7 @@ | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_type`,`c_user_id`,`owner_id`,`b_user_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price`, `auto_refund`, | |||
| `verify_type`,`verify_remark`,`pay_vendor`,`send_merchant_id`,`send_merchant_user_id`,`compose_order_type`,`compose_order_id`,`parent_coupon_order_id`,`coupon_number`, | |||
| `freight_price`,`shipping_type`,`shipping_address`,`shipping_status`,`delivery_info` | |||
| `freight_price`,`shipping_type`,`shipping_address`,`shipping_status`,`delivery_info`,`subsidy` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -241,6 +242,12 @@ | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </update> | |||
| <update id="updateVerifyCouponOrderSubsidy" parameterType="com.iformall.domain.po.WxCouponOrder"> | |||
| update wx_coupon_order | |||
| set `subsidy` = #{subsidy} | |||
| where id=#{id} | |||
| </update> | |||
| <select id="couponDataMap" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap"> | |||
| SELECT DATE_FORMAT(create_date,'%m/%d') as createTime, | |||
| @@ -430,7 +437,7 @@ | |||
| </select> | |||
| <select id="findCount" parameterType="com.iformall.domain.po.WxCouponOrder" resultType="java.lang.Integer"> | |||
| select COUNT(*) FROM wx_coupon_order co | |||
| select COUNT(1) FROM wx_coupon_order co | |||
| <if test=" null != businessId "> | |||
| inner join wx_coupon c | |||
| on c.id = co.coupon_id | |||
| @@ -841,13 +848,12 @@ | |||
| <result column="pay_vendor" jdbcType="INTEGER" property="payVendor" /> | |||
| <result column="verify_type" jdbcType="INTEGER" property="verifyType" /> | |||
| <result column="verify_remark" jdbcType="VARCHAR" property="verifyRemark" /> | |||
| <result column="freight_price" jdbcType="INTEGER" property="freightPrice"/> | |||
| <result column="shipping_type" jdbcType="INTEGER" property="shippingType"/> | |||
| <result column="shipping_address" jdbcType="VARCHAR" property="shippingAddress"/> | |||
| <result column="shipping_status" jdbcType="INTEGER" property="shippingStatus"/> | |||
| <result column="delivery_info" jdbcType="VARCHAR" property="deliveryInfo"/> | |||
| <result column="subsidy" jdbcType="INTEGER" property="subsidy"/> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| @@ -872,34 +878,6 @@ | |||
| <result column="send_merchant_id" jdbcType="INTEGER" property="sendMerchantId" /> | |||
| </resultMap> | |||
| <sql id="allAdminCouponOrderListColumns"> | |||
| <!-- | |||
| co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | |||
| c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,ms.subsidy subsidy_num, | |||
| (case when com.mc=1 then | |||
| (select m.name from wx_merchant m, wx_coupon_merchant cm | |||
| where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name, | |||
| (case when com.mc = 1 then (select m.id from wx_merchant m, | |||
| wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id = co.coupon_id | |||
| and cm.status = 0) else 0 end) as merchant_id, | |||
| cu.phone,bu.verify_merchant_name,cal.channel_type | |||
| (case when couc.mc = 1 then m1.name else '[多商户通用]' end) as merchant_name, | |||
| (case when couc.mc = 1 then m1.id else 0 end) as merchant_id, | |||
| cu.phone,m2.name as verify_merchant_name,cal.channel_type | |||
| --> | |||
| co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.order_id, | |||
| co.create_date,co.update_date,co.coupon_price, co.verify_type, co.verify_remark,co.pay_vendor, | |||
| co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`, | |||
| c.title,c.sale_price,c.use_price,c.price, | |||
| co.send_merchant_id,c.unit,c.auto_refund,c.business,c.subsidy_type,c.source_type,ms.subsidy subsidy_num, | |||
| (CASE WHEN couc.mc = 1 THEN m1.name ELSE '[多商户通用]' END) AS merchant_name, | |||
| (CASE WHEN couc.mc = 1 THEN m1.id ELSE 0 END) AS merchant_id, | |||
| cu.phone,cu.nick_name,m2.name AS verify_merchant_name,cal.channel_type | |||
| </sql> | |||
| <sql id="allAdminCouponOrderDetailColumns"> | |||
| co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id, | |||
| co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark, co.pay_vendor, | |||
| @@ -911,39 +889,10 @@ | |||
| </sql> | |||
| <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="AdminBVoResultMap"> | |||
| select <include refid="allAdminCouponOrderListColumns" /> | |||
| FROM ( | |||
| SELECT wcm.product_id,wcm.merchant_id,COUNT(1) AS mc | |||
| FROM wx_coupon_merchant wcm | |||
| WHERE STATUS = 0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and wcm.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and wcm.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| GROUP BY product_id) couc | |||
| RIGHT JOIN ( | |||
| SELECT co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.c_user_id,co.b_user_id,co.order_id,co.coupon_type, | |||
| co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.auto_refund,co.verify_type,co.verify_remark,co.pay_vendor | |||
| ,co.send_merchant_id,co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info` | |||
| FROM wx_coupon_order co WHERE 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and co.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and co.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| ) co | |||
| ON co.coupon_id = couc.product_id | |||
| LEFT JOIN wx_c_user_basic_info cu ON cu.id=co.c_user_id | |||
| LEFT JOIN wx_coupon c ON c.id = co.coupon_id | |||
| LEFT JOIN wx_merchant m1 ON m1.id = couc.merchant_id | |||
| LEFT JOIN wx_merchant_subsidy ms ON co.id = ms.coupon_order_id AND ms.type = 1 | |||
| LEFT JOIN wx_merchant_b_user mbu ON mbu.id = co.b_user_id LEFT JOIN wx_merchant m2 ON m2.id = mbu.merchant_id | |||
| LEFT JOIN wx_coupon_action_log cal ON cal.coupon_order_id = co.id AND cal.coupon_id = co.coupon_id | |||
| where 1=1 | |||
| select co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.expired_time,co.coupon_order_status,co.order_id, | |||
| co.create_date,co.update_date,co.coupon_price, co.verify_type, co.verify_remark,co.pay_vendor, | |||
| co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,co.send_merchant_id,co.subsidy | |||
| FROM wx_coupon_order co where co.`tenant_id` = #{tenantId} | |||
| <choose> | |||
| <when test=" null != couponType"> | |||
| and co.coupon_type = #{couponType} | |||
| @@ -956,16 +905,9 @@ | |||
| and co.coupon_type < 100 | |||
| </otherwise> | |||
| </choose> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and co.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and co.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != cUserPhone and '' != cUserPhone"> | |||
| and cu.`phone` = #{cUserPhone} | |||
| </if> | |||
| <if test=" null != couponOrderStatus "> | |||
| and co.coupon_order_status = #{couponOrderStatus} | |||
| </if> | |||
| @@ -978,27 +920,22 @@ | |||
| and co.`shipping_status` = #{shippingStatus} | |||
| </if> | |||
| <if test=" null != merchantName and merchantName!=''"> | |||
| and (case when couc.mc=1 | |||
| then | |||
| m1.name | |||
| <!--(select m.name from wx_merchant m, wx_coupon_merchant cm | |||
| where m.id = cm.merchant_id | |||
| and cm.product_id=co.coupon_id | |||
| and cm.status = 0)--> | |||
| else'[多商户通用]' end) | |||
| like concat('%', #{merchantName},'%') | |||
| </if> | |||
| <if test="startDate != null"> | |||
| AND co.create_date > #{startDate,jdbcType=TIMESTAMP} | |||
| </if> | |||
| <if test="startDateTimes != null"> | |||
| AND co.create_date_times > #{startDateTimes} | |||
| </if> | |||
| <if test="endDate != null"> | |||
| AND co.create_date < #{endDate,jdbcType=TIMESTAMP} | |||
| </if> | |||
| <if test="endDateTimes != null"> | |||
| AND co.create_date_times < #{endDateTimes} | |||
| </if> | |||
| <if test="verifyStartDate != null"> | |||
| AND co.update_date > #{verifyStartDate,jdbcType=TIMESTAMP} | |||
| </if> | |||
| @@ -1016,39 +953,24 @@ | |||
| <if test=" null != couponId "> | |||
| and c.id = #{couponId} | |||
| </if> | |||
| <if test=" null != title "> | |||
| and c.title like concat('%', #{title},'%') | |||
| </if> | |||
| <if test=" null != type "> | |||
| and c.`type` = #{type} | |||
| </if> | |||
| <if test=" null != business "> | |||
| and c.business = #{business} | |||
| </if> | |||
| <if test=" null != sourceType "> | |||
| and c.`source_type` = #{sourceType} | |||
| <if test=" null != cUserId and '' != cUserId"> | |||
| and co.c_user_id = #{cUserId} | |||
| </if> | |||
| <if test=" null != verifyMerchantName and ''!= verifyMerchantName "> | |||
| and bu.verify_merchant_name = #{verifyMerchantName} | |||
| <if test=" null != couponIds"> | |||
| and co.coupon_id in | |||
| <foreach collection="couponIds" index="index" item="couponIdItem" open="(" separator="," close=")"> | |||
| #{couponIdItem} | |||
| </foreach> | |||
| </if> | |||
| <if test="null!=building"> | |||
| and co.coupon_id in( | |||
| select cm.product_id from wx_merchant_shop ms left join wx_merchant m on ms.merchant_id=m.id | |||
| left join wx_shop s on ms.shop_id=s.id | |||
| left join wx_coupon_merchant cm on ms.merchant_id=cm.merchant_id | |||
| where ms.is_del=0 and s.building=#{building} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and ms.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and ms.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test="null!=floor"> | |||
| and s.floor=#{floor} | |||
| </if> | |||
| ) | |||
| <if test=" null != bUserIdList"> | |||
| and co.b_user_id in | |||
| <foreach collection="bUserIdList" index="index" item="bUserIdItem" open="(" separator="," close=")"> | |||
| #{bUserIdItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| <if test=" null == sortColumns">order by co.create_date desc,co.id desc</if> | |||
| @@ -78,6 +78,14 @@ | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != merchantIds "> | |||
| and merchant_id in | |||
| <foreach collection="merchantIds" index="index" item="merchantIdItem" open="(" separator="," close=")"> | |||
| #{merchantIdItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| @@ -88,6 +96,24 @@ | |||
| from wx_merchant_b_user | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findMerchantIdListByIds" parameterType="com.iformall.domain.po.WxMerchantBUser" resultMap="BaseResultMap"> | |||
| select id, merchant_id | |||
| from wx_merchant_b_user | |||
| where `tenant_id` = #{tenantId} | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| </select> | |||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxMerchantBUser" resultType="Long"> | |||
| select id | |||
| from wx_merchant_b_user | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findSelMerchantList" parameterType="com.iformall.domain.po.WxMerchantBUser" resultType="com.iformall.domain.vo.WxMerchantBuInfoVo"> | |||
| select | |||
| @@ -207,6 +207,12 @@ | |||
| from wx_merchant m | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxMerchant" resultType="Long"> | |||
| select id | |||
| from wx_merchant m | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findFollowList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap"> | |||
| select | |||
| @@ -60,7 +60,15 @@ | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| </if> | |||
| <if test=" null != shopIdList "> | |||
| and shop_id in | |||
| <foreach collection="shopIdList" index="index" item="shopIdItem" open="(" separator="," close=")"> | |||
| #{shopIdItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| @@ -71,6 +79,13 @@ | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="findMerchantIdList" parameterType="com.iformall.domain.po.WxMerchantShop" resultType="Long"> | |||
| select distinct merchant_id | |||
| from wx_merchant_shop | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="findShopIds" parameterType="Long" resultType="Long"> | |||
| select shop_id from wx_merchant_shop where `merchant_id` = #{merchantId} and is_del = 0 | |||
| </select> | |||
| @@ -146,6 +146,12 @@ | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxShop" resultType="Long"> | |||
| select id | |||
| from wx_shop | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectBatchByIds" resultMap="BaseResultMap"> | |||
| select | |||
| s.`id`,s.`tenant_id`,s.`parent_tenant_id`,s.`shop_number`,s.`build_area`,s.`operation_area`,s.building,b.building_name building_name,s.floor,f.floor_name floor_name,s.`status`,s.`x`,s.`y`,s.`sid`,s.`addr`, | |||