1
0

90 Commits cc071c7eb0 ... 7c0ce2a8cb

Autor SHA1 Nachricht Datum
  zhh 7c0ce2a8cb 修改管理端收银管理页面和修复bug vor 3 Jahren
  zhh af5b700bd0 Merge remote-tracking branch 'upsteam/master' vor 3 Jahren
  lhm 50195bb59b Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm 47cfe35ff1 fix:收银端bug,截止时间导入问题 vor 3 Jahren
  zhh d6c4b64f1a Merge remote-tracking branch 'upsteam/master' vor 3 Jahren
  lhm 8eb22db363 Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm 5a351fe277 多个积分变动记录详情 vor 3 Jahren
  lhm b49b7e608c 支付单推送优化 vor 3 Jahren
  lhm aab5df7691 去除截止时间、是否提前结束 vor 3 Jahren
  lhm 5d9e6af199 提示重新计算优惠价 vor 3 Jahren
  lhm 2f4f837e47 fix:同步会员消费订单bug、无效token vor 3 Jahren
  lhm 997e49e764 收银端操作库存优化,页面刷新光标定位在扫条码输入框 vor 3 Jahren
  lhm 3eb7897178 优化:积分不足直接返回,不抛异常 vor 3 Jahren
  lhm 3063cf93be 收银页面样式优化 vor 3 Jahren
  lhm a2314ede41 收银界面显示会员信息 vor 3 Jahren
  lhm 57c93f1a78 fix:消费订单bug vor 3 Jahren
  lhm 5d6f4df810 提交订单参数修改 vor 3 Jahren
  lhm dab9bb9c26 积分赠送规则优化 vor 3 Jahren
  lhm c46252b2fd 提交订单自动带出手机号优化 vor 3 Jahren
  lhm 3f992f2d75 新增扫描珠免会员二维码,提交订单自动带出手机号,会员积分为0时不抛异常直接返回 vor 3 Jahren
  lhm c9d89739e2 库存不足提示优化 vor 3 Jahren
  lhm 56e616a443 会员码和付款码输入框自动获取焦点 vor 3 Jahren
  lhm fa2934a546 环境配置文档更新 vor 3 Jahren
  lhm 5fe6f9ed86 收银端计算价格小数限制 vor 3 Jahren
  lhm 7128505f80 库存不足提示优化 vor 3 Jahren
  lhm 1f6ffa9ffa 赠送积分bug修复 vor 3 Jahren
  lhm e4e7d07c4a fastdfs配置更新 vor 3 Jahren
  lhm 11e4afa171 fix:活动时间bug vor 3 Jahren
  lhm 77245168e1 fix:积分抵扣bug vor 3 Jahren
  lhm a0cf4353ba 自动选中付款码输入框 vor 3 Jahren
  lhm 43a333c2c3 Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm 9242c9673f 推送支付单商户订单号改为订单号 vor 3 Jahren
  lhm 79681a0caa fix:明细税款改为单个商品的税款 vor 3 Jahren
  lhm 40d0f4896c fix:积分计算bug vor 3 Jahren
  lhm d64c09d6df fastdfs配置更新 vor 3 Jahren
  lhm a8bfc982e0 Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm b915b07130 fix:深拷贝bug vor 3 Jahren
  lhm 32fc1f6071 订单积分回退 vor 3 Jahren
  lhm cb75f97948 创建订单新加字段finally_cart_amount(订单优惠后金额) vor 3 Jahren
  lhm dfdd5e8b06 订单编号修改 vor 3 Jahren
  lhm 52e4bc0c23 接口日志bug fix vor 3 Jahren
  lhm 495761a19c 测试用例提交 vor 3 Jahren
  lhm b70bdf174d 重发其他系统判断 vor 3 Jahren
  lhm 229cb7b836 fix bug vor 3 Jahren
  lhm af3b7c2e2d fix:订单积分变动bug vor 3 Jahren
  lhm 5b8b8b800f 海控支付配置更新 vor 3 Jahren
  lhm 8c5b3eae38 积分抵扣前端修改 vor 3 Jahren
  lhm f90689661d 响应为空 vor 3 Jahren
  lhm 9b00d690ba 会员信息bug vor 3 Jahren
  lhm 2d5679285f 积分同步bug修改 vor 3 Jahren
  lhm 10b2721a45 收银端websocket地址更新 vor 3 Jahren
  lhm 225b1513a7 fix bug vor 3 Jahren
  lhm 652f198066 海控正式环境,更新支付相关信息 vor 3 Jahren
  lhm bc3509374a fix bug:商品信息查询,推送订单新增字段buy_price(成交价,必填) vor 3 Jahren
  lhm af39c92aba 替换XML工具类 vor 3 Jahren
  lhm 2d272e60c4 fix bug:推送订单json字段,查询库存货主编码 vor 3 Jahren
  lhm 4d05e34407 Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm fe0d52145d fix bug:重推订单创建接口未更新小票码状态 vor 3 Jahren
  lhm 863ded8ff1 fix bug:重推订单创建接口未更新小票码状态 vor 3 Jahren
  lhm 3fe2794184 Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm 53efca76c4 fix bug vor 3 Jahren
  zhh 181ecf6ce0 Merge remote-tracking branch 'upsteam/master' vor 3 Jahren
  lhm 16125696c4 Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm 804473fe96 配置修改 vor 3 Jahren
  lhm 2a4bf510a6 Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm 89b2dddffc fix bug vor 3 Jahren
  lhm d16aa194a2 应免税mall要求:是否含税改为字符串类型 vor 3 Jahren
  lhm 1eabdb18d0 新增海关口岸代码系统配置 vor 3 Jahren
  lhm ef0d839496 fix bug vor 3 Jahren
  lhm 99fd5b5d45 配置文件修改 vor 3 Jahren
  lhm 566d1fddfd fix bug:收银端扫描条码报错 vor 3 Jahren
  lhm 34fe7996ce fix bug vor 3 Jahren
  lhm 8fb9726a24 fix bug vor 3 Jahren
  lhm aacfbe3691 fix:积分抵扣页面不显示按钮bug vor 3 Jahren
  lhm add6b17da9 Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm c57cf9bcbf fix:积分抵扣页面bug vor 3 Jahren
  lhm 255b0f8df0 去除验证码 vor 3 Jahren
  lhm b1b509dd8c 配置废弃 vor 3 Jahren
  lhm e8bd71e20e Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm 38b35a341d 海控会员系统生产相关配置修改 vor 3 Jahren
  lhm 40ea336a2a Merge branch 'master' of lhm/kmall-haikong into master vor 3 Jahren
  lhm d7a8f5655a 海控支付相关配置修改 vor 3 Jahren
  zhh cfef101a2f Merge remote-tracking branch 'upsteam/master' vor 3 Jahren
  lhm 99cd196c3f Merge branch 'master' of zhh/kmall-haikong into master vor 3 Jahren
  lhm dc3355d211 Merge branch 'master' of http://git.ds-bay.com/project/kmall-haikong vor 3 Jahren
  lhm c3a6cc0d74 Merge branch 'feature/test' vor 3 Jahren
  lhm 1d8d05ed0b 海控环境切换(直接改配置文件即可,不需要改代码) vor 3 Jahren
  lhm 0d0030f908 配置修改 vor 3 Jahren
  lhm ffc638536b Merge branch 'master' of http://git.ds-bay.com/project/kmall-haikong vor 3 Jahren
  lhm 978dd2c179 fix:其它表脚本bug vor 3 Jahren
83 geänderte Dateien mit 1544 neuen und 984 gelöschten Zeilen
  1. 6 0
      kmall-admin/src/main/java/com/kmall/admin/aop/InterfaceExternalAspect.java
  2. 122 0
      kmall-admin/src/main/java/com/kmall/admin/config/datasource/DataSourceConfig.java
  3. 158 0
      kmall-admin/src/main/java/com/kmall/admin/config/datasource/DataSourceProperties.java
  4. 12 70
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  5. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/PickUpCodeDao.java
  6. 4 3
      kmall-admin/src/main/java/com/kmall/admin/dao/haikong/HaiKongSendOrderInfoDetailRecordDao.java
  7. 3 3
      kmall-admin/src/main/java/com/kmall/admin/dao/haikong/HaiKongSendOrderInfoRecordDao.java
  8. 1 4
      kmall-admin/src/main/java/com/kmall/admin/dao/mk/MkActivitiesScoreDao.java
  9. 0 18
      kmall-admin/src/main/java/com/kmall/admin/dto/ScoreReductionDTO.java
  10. 0 9
      kmall-admin/src/main/java/com/kmall/admin/dto/TemporaryPromotionalItemsDto.java
  11. 3 3
      kmall-admin/src/main/java/com/kmall/admin/entity/haikong/HaiKongMemberOrderSyncResendEntity.java
  12. 12 0
      kmall-admin/src/main/java/com/kmall/admin/entity/haikong/HaiKongSendOrderInfoDetailRecordEntity.java
  13. 0 17
      kmall-admin/src/main/java/com/kmall/admin/entity/mk/MkActivitiesScoreEntity.java
  14. 3 3
      kmall-admin/src/main/java/com/kmall/admin/fromcomm/controller/SysLoginController.java
  15. 53 7
      kmall-admin/src/main/java/com/kmall/admin/haikong/config/HaiKongConfig.java
  16. 13 0
      kmall-admin/src/main/java/com/kmall/admin/haikong/constant/Constants.java
  17. 67 0
      kmall-admin/src/main/java/com/kmall/admin/haikong/constant/ErrorCodeConstants.java
  18. 2 2
      kmall-admin/src/main/java/com/kmall/admin/haikong/constant/HaiKongMemberSystemUrlEnum.java
  19. 0 15
      kmall-admin/src/main/java/com/kmall/admin/haikong/dto/MemberOrderInfoSyncDTO.java
  20. 15 0
      kmall-admin/src/main/java/com/kmall/admin/haikong/dto/OrderInfoDTO.java
  21. 15 3
      kmall-admin/src/main/java/com/kmall/admin/haikong/dto/OrderInfoItemDTO.java
  22. 10 6
      kmall-admin/src/main/java/com/kmall/admin/haikong/task/MemberOrderSyncResendTask.java
  23. 11 6
      kmall-admin/src/main/java/com/kmall/admin/haikong/task/MemberScoreChangeResendTask.java
  24. 3 4
      kmall-admin/src/main/java/com/kmall/admin/haikong/task/MemberSysAccessTokenRefreshTask.java
  25. 32 12
      kmall-admin/src/main/java/com/kmall/admin/haikong/task/SendOrderInfoTask.java
  26. 51 0
      kmall-admin/src/main/java/com/kmall/admin/haikong/utils/DeepCopyUtils.java
  27. 47 1
      kmall-admin/src/main/java/com/kmall/admin/haikong/utils/Response.java
  28. 28 0
      kmall-admin/src/main/java/com/kmall/admin/haikong/vo/CalculateOrderDiscountPriceResponseVO.java
  29. 3 1
      kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java
  30. 2 0
      kmall-admin/src/main/java/com/kmall/admin/service/PickUpCodeService.java
  31. 89 313
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  32. 0 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/MkActivitiesPromotionServiceImpl.java
  33. 260 168
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  34. 5 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/PickUpCodeServiceImpl.java
  35. 4 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/haikong/HaikongSendOrderInfoRecordServiceImpl.java
  36. 5 20
      kmall-admin/src/main/java/com/kmall/admin/service/impl/mk/MkActivitiesScoreServiceImpl.java
  37. 1 9
      kmall-admin/src/main/java/com/kmall/admin/service/mk/MkActivitiesScoreService.java
  38. 0 1
      kmall-admin/src/main/resources/XmlTemplate/ScoreReductionDTOList.xml
  39. 0 1
      kmall-admin/src/main/resources/XmlTemplate/TemporaryPromotionalItemsDtoList.xml
  40. 24 11
      kmall-admin/src/main/resources/conf/cuspay/cuspay-wx.properties
  41. 46 8
      kmall-admin/src/main/resources/conf/fastdfs.properties
  42. 1 0
      kmall-admin/src/main/resources/logback.xml
  43. 2 1
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  44. 7 0
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  45. 8 0
      kmall-admin/src/main/resources/mybatis/mapper/PickUpCodeDao.xml
  46. 23 5
      kmall-admin/src/main/resources/mybatis/mapper/SaleRecordDao.xml
  47. 9 0
      kmall-admin/src/main/resources/mybatis/mapper/haikong/HaikongSendOrderInfoDetailRecordDao.xml
  48. 0 4
      kmall-admin/src/main/resources/mybatis/mapper/haikong/HaikongSendOrderInfoRecordDao.xml
  49. 7 27
      kmall-admin/src/main/resources/mybatis/mapper/mk/MkActivitiesScoreDao.xml
  50. 1 0
      kmall-admin/src/main/resources/mybatis/mapper/vip/Mall2PointsRulesDao.xml
  51. 22 13
      kmall-admin/src/main/webapp/WEB-INF/page/cashier/salerecord.html
  52. 2 2
      kmall-admin/src/main/webapp/WEB-INF/page/mk/mkactivitiespromotion.html
  53. 6 8
      kmall-admin/src/main/webapp/WEB-INF/page/mk/mkactivitiesscore.html
  54. 4 4
      kmall-admin/src/main/webapp/WEB-INF/page/mk/mkactivityform.html
  55. 4 1
      kmall-admin/src/main/webapp/WEB-INF/page/receipt/receiptCheck.html
  56. 16 12
      kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html
  57. 14 3
      kmall-admin/src/main/webapp/js/cashier/salerecord.js
  58. 1 1
      kmall-admin/src/main/webapp/js/mk/mkactivitiespromotion.js
  59. 4 1
      kmall-admin/src/main/webapp/js/mk/mkactivitiesscore.js
  60. 3 3
      kmall-admin/src/main/webapp/js/mk/mkactivityform.js
  61. 6 3
      kmall-admin/src/main/webapp/js/receipt/receiptCheck.js
  62. 113 55
      kmall-admin/src/main/webapp/js/sale/sale.js
  63. 10 2
      kmall-admin/src/main/webapp/js/shop/interfacesendlog.js
  64. 2 2
      kmall-admin/src/main/webapp/login.html
  65. BIN
      kmall-admin/src/main/webapp/statics/file/activities_promotion.xlsx
  66. BIN
      kmall-admin/src/main/webapp/statics/file/activities_score.xlsx
  67. 2 2
      kmall-admin/src/main/webapp/userLogin.html
  68. 38 3
      kmall-admin/src/test/java/com/kmall/admin/Test.java
  69. 14 13
      kmall-framework/src/test/resources/applicationContext-test.xml
  70. 1 0
      kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusDevProperties.java
  71. 1 0
      kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusProdProperties.java
  72. 1 0
      kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusProperties.java
  73. 1 0
      kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusPropertiesBuilder.java
  74. 1 0
      kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusPropertiesConfiguration.java
  75. 1 1
      kmall-manager/src/main/resources/conf/cus.properties
  76. 16 16
      kmall-manager/src/main/resources/conf/db.properties
  77. 1 1
      kmall-manager/src/main/resources/conf/express-kdn.properties
  78. 33 22
      kmall-manager/src/main/resources/conf/haikong.properties
  79. 9 5
      kmall-manager/src/main/resources/conf/redis.properties
  80. 10 10
      kmall-manager/src/main/resources/conf/wx-mp.properties
  81. 12 12
      kmall-manager/src/main/resources/spring/spring-jdbc.xml
  82. 5 4
      sql/init/other_table.sql
  83. 21 28
      切换环境需要修改的.md

+ 6 - 0
kmall-admin/src/main/java/com/kmall/admin/aop/InterfaceExternalAspect.java

@@ -48,6 +48,9 @@ public class InterfaceExternalAspect {
              interfaceSendLogEntity = getMethdMsg(methd);
             Object[] args = proceedingJoinPoint.getArgs();
             for (Object o : args) {
+                if (o instanceof String) {
+                    o = ((String) o).replaceAll("\r|\n", "");
+                }
                 requestLog.append(String.format("参数:%s\r\n", JSON.toJSON(o)));
             }
             interfaceSendLogEntity.setRequestDate(new Date());
@@ -57,6 +60,9 @@ public class InterfaceExternalAspect {
             exMsg = e.getMessage();
             throw e;
         } finally {
+            if (result instanceof String) {
+                result = ((String) result).replaceAll("\r|\n", "");
+            }
             saveVmcSend(interfaceSendLogEntity,requestLog.toString(),JSON.toJSONString(result),exMsg);
         }
         return result;

+ 122 - 0
kmall-admin/src/main/java/com/kmall/admin/config/datasource/DataSourceConfig.java

@@ -0,0 +1,122 @@
+package com.kmall.admin.config.datasource;
+
+import com.alibaba.druid.filter.Filter;
+import com.alibaba.druid.filter.stat.StatFilter;
+import com.alibaba.druid.pool.DruidDataSource;
+import com.alibaba.druid.wall.WallConfig;
+import com.alibaba.druid.wall.WallFilter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.env.Environment;
+import org.springframework.util.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author lhm
+ * @createDate 2021-12-15
+ */
+@Configuration
+@PropertySource(value = {"classpath:conf/db.properties"})
+public class DataSourceConfig {
+
+    @Autowired
+    private Environment environment;
+
+    @Bean
+    public DataSourceProperties dataSourceProperties() {
+        DataSourceProperties dataSourceProperties = new DataSourceProperties();
+        String env = environment.getProperty("jdbc.env");
+        String url = environment.getProperty(String.format("jdbc.%s.url", env));
+        String username = environment.getProperty(String.format("jdbc.%s.username", env));
+        String password = environment.getProperty(String.format("jdbc.%s.password", env));
+        String initialSize = environment.getProperty("jdbc.initialSize");
+        String maxActive = environment.getProperty("jdbc.maxActive");
+        String minPoolSize = environment.getProperty("jdbc.minPoolSize");
+        String maxIdleTime = environment.getProperty("jdbc.maxIdleTime");
+        String idleConnectionTestPeriod = environment.getProperty("jdbc.idleConnectionTestPeriod");
+        String driver = environment.getProperty("jdbc.driver");
+        String idleTimeout = environment.getProperty("jdbc.idleTimeout");
+        String maxLifetime = environment.getProperty("jdbc.maxLifetime");
+        String connectionTimeout = environment.getProperty("jdbc.connectionTimeout");
+        String maximumPoolSize = environment.getProperty("jdbc.maximumPoolSize");
+        String validationTimeout = environment.getProperty("jdbc.validationTimeout");
+
+        dataSourceProperties.setEnv(env);
+        dataSourceProperties.setUrl(url);
+        dataSourceProperties.setUsername(username);
+        dataSourceProperties.setPassword(password);
+        // 通用配置
+        dataSourceProperties.setInitialSize(StringUtils.isEmpty(initialSize) ? 5 : Integer.parseInt(initialSize));
+        dataSourceProperties.setMaxActive(StringUtils.isEmpty(maxActive) ? 30 : Integer.parseInt(maxActive));
+        dataSourceProperties.setMinPoolSize(StringUtils.isEmpty(minPoolSize) ? 2 : Integer.parseInt(minPoolSize));
+        dataSourceProperties.setMaxIdleTime(StringUtils.isEmpty(maxIdleTime) ? 30000 : Integer.parseInt(maxIdleTime));
+        dataSourceProperties.setIdleConnectionTestPeriod(StringUtils.isEmpty(idleConnectionTestPeriod) ? 100 : Integer.parseInt(idleConnectionTestPeriod));
+        dataSourceProperties.setDriver(driver);
+        dataSourceProperties.setIdleTimeout(StringUtils.isEmpty(idleTimeout) ? 400000L : Long.parseLong(idleTimeout));
+        dataSourceProperties.setMaxLifetime(StringUtils.isEmpty(maxLifetime) ? 500000L : Long.parseLong(maxLifetime));
+        dataSourceProperties.setConnectionTimeout(StringUtils.isEmpty(connectionTimeout) ? 5000L : Long.parseLong(connectionTimeout));
+        dataSourceProperties.setMaximumPoolSize(StringUtils.isEmpty(maximumPoolSize) ? 5 : Integer.parseInt(maximumPoolSize));
+        dataSourceProperties.setValidationTimeout(StringUtils.isEmpty(validationTimeout) ? 30L : Long.parseLong(validationTimeout));
+
+        return dataSourceProperties;
+    }
+
+    @Bean(initMethod = "init", destroyMethod = "close")
+    public DruidDataSource dataSource(DataSourceProperties dataSourceProperties,
+                                      StatFilter statFilter,
+                                      WallFilter wallFilter) {
+        DruidDataSource druidDataSource = new DruidDataSource();
+        druidDataSource.setUrl(dataSourceProperties.getUrl());
+        druidDataSource.setUsername(dataSourceProperties.getUsername());
+        druidDataSource.setPassword(dataSourceProperties.getPassword());
+        druidDataSource.setInitialSize(dataSourceProperties.getInitialSize());
+        druidDataSource.setMaxActive(dataSourceProperties.getMaxActive());
+        List<Filter> filters = new ArrayList<>();
+        filters.add(statFilter);
+        filters.add(wallFilter);
+        druidDataSource.setProxyFilters(filters);
+        druidDataSource.setConnectionInitSqls(Collections.singleton("set names utf8mb4;"));
+        // 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        druidDataSource.setTimeBetweenEvictionRunsMillis(60000);
+        // 配置一个连接在池中最小生存的时间,单位是毫秒
+        druidDataSource.setMinEvictableIdleTimeMillis(300000);
+        // 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效
+        druidDataSource.setTestWhileIdle(true);
+        // 指定每个连接上PSCache的大小
+        druidDataSource.setMaxPoolPreparedStatementPerConnectionSize(20);
+        return druidDataSource;
+    }
+
+    @Bean
+    public StatFilter statFilter() {
+        StatFilter statFilter = new StatFilter();
+        statFilter.setSlowSqlMillis(1000);
+        statFilter.setLogSlowSql(true);
+        statFilter.setMergeSql(true);
+        return statFilter;
+    }
+
+    @Bean
+    public WallFilter wallFilter(WallConfig wallConfig) {
+        WallFilter wallFilter = new WallFilter();
+        wallFilter.setDbType("mysql");
+        wallFilter.setConfig(wallConfig);
+        return wallFilter;
+    }
+
+    /**
+     * 过滤永真条件 防止注入
+     */
+    @Bean
+    public WallConfig wallConfig() {
+        WallConfig wallConfig = new WallConfig();
+        wallConfig.setMultiStatementAllow(true);
+        return wallConfig;
+    }
+
+}

+ 158 - 0
kmall-admin/src/main/java/com/kmall/admin/config/datasource/DataSourceProperties.java

@@ -0,0 +1,158 @@
+package com.kmall.admin.config.datasource;
+
+/**
+ * @author lhm
+ * @createDate 2021-12-15
+ */
+public class DataSourceProperties {
+
+    private String env;
+
+    private String url;
+
+    private String username;
+
+    private String password;
+
+    private Integer initialSize;
+
+    private Integer maxActive;
+
+    private Integer minPoolSize;
+
+    private Integer maxIdleTime;
+
+    private Integer idleConnectionTestPeriod;
+
+    private String driver;
+
+    private Long idleTimeout;
+
+    private Long maxLifetime;
+
+    private Long connectionTimeout;
+
+    private Integer maximumPoolSize;
+
+    private Long validationTimeout;
+
+    public String getEnv() {
+        return env;
+    }
+
+    public void setEnv(String env) {
+        this.env = env;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public Integer getInitialSize() {
+        return initialSize;
+    }
+
+    public void setInitialSize(Integer initialSize) {
+        this.initialSize = initialSize;
+    }
+
+    public Integer getMaxActive() {
+        return maxActive;
+    }
+
+    public void setMaxActive(Integer maxActive) {
+        this.maxActive = maxActive;
+    }
+
+    public Integer getMinPoolSize() {
+        return minPoolSize;
+    }
+
+    public void setMinPoolSize(Integer minPoolSize) {
+        this.minPoolSize = minPoolSize;
+    }
+
+    public Integer getMaxIdleTime() {
+        return maxIdleTime;
+    }
+
+    public void setMaxIdleTime(Integer maxIdleTime) {
+        this.maxIdleTime = maxIdleTime;
+    }
+
+    public Integer getIdleConnectionTestPeriod() {
+        return idleConnectionTestPeriod;
+    }
+
+    public void setIdleConnectionTestPeriod(Integer idleConnectionTestPeriod) {
+        this.idleConnectionTestPeriod = idleConnectionTestPeriod;
+    }
+
+    public String getDriver() {
+        return driver;
+    }
+
+    public void setDriver(String driver) {
+        this.driver = driver;
+    }
+
+    public Long getIdleTimeout() {
+        return idleTimeout;
+    }
+
+    public void setIdleTimeout(Long idleTimeout) {
+        this.idleTimeout = idleTimeout;
+    }
+
+    public Long getMaxLifetime() {
+        return maxLifetime;
+    }
+
+    public void setMaxLifetime(Long maxLifetime) {
+        this.maxLifetime = maxLifetime;
+    }
+
+    public Long getConnectionTimeout() {
+        return connectionTimeout;
+    }
+
+    public void setConnectionTimeout(Long connectionTimeout) {
+        this.connectionTimeout = connectionTimeout;
+    }
+
+    public Integer getMaximumPoolSize() {
+        return maximumPoolSize;
+    }
+
+    public void setMaximumPoolSize(Integer maximumPoolSize) {
+        this.maximumPoolSize = maximumPoolSize;
+    }
+
+    public Long getValidationTimeout() {
+        return validationTimeout;
+    }
+
+    public void setValidationTimeout(Long validationTimeout) {
+        this.validationTimeout = validationTimeout;
+    }
+}

+ 12 - 70
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -1,6 +1,7 @@
 package com.kmall.admin.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.kmall.admin.dto.GoodsDetailsDto;
 import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.dto.GoodsPanoramaDto;
 import com.kmall.admin.entity.GoodsEntity;
@@ -569,9 +570,9 @@ public class GoodsController {
         return R.ok().put("goods", goods);
     }
 
-    @RequestMapping("/details/{prodBarcode}/{storeId}/{sku}")
+    @RequestMapping("/details/{prodBarcode}/{storeId}/{sku}/{sellVolume}")
 //    @RequiresPermissions("goods:details") http://127.0.0.1:8080/goods/details/11111
-    public R details(@PathVariable("prodBarcode")String prodBarcode,@PathVariable("storeId")String storeId,@PathVariable("sku")String sku) {
+    public R details(@PathVariable("prodBarcode")String prodBarcode,@PathVariable("storeId")String storeId,@PathVariable("sku")String sku, @PathVariable("sellVolume") Integer sellVolume) {
         SysUserEntity user = ShiroUtils.getUserEntity();
         if(user == null) {
             return R.error("用户登录超时,请重新登录");
@@ -581,7 +582,7 @@ public class GoodsController {
         }
         Map<String,Object> map = null;
         try {
-            map = goodsService.calculateGoodsDetail(prodBarcode,storeId,sku);
+            map = goodsService.calculateGoodsDetail(prodBarcode,storeId,sku, sellVolume);
         } catch (ServiceException e) {
             log.error("查询订单详情出现异常!", e);
             return R.error(e.getMessage());
@@ -595,9 +596,9 @@ public class GoodsController {
         return R.ok().put("goodsDetails", map.get("goods")).put("map",map);
     }
 
-    @RequestMapping("/detailsOld/{prodBarcode}/{storeId}")
+    @RequestMapping("/detailsOld/{prodBarcode}/{storeId}/{sellVolume}")
 //    @RequiresPermissions("goods:details") http://127.0.0.1:8080/goods/details/11111
-    public R details(@PathVariable("prodBarcode")String prodBarcode,@PathVariable("storeId")String storeId) {
+    public R details(@PathVariable("prodBarcode")String prodBarcode,@PathVariable("storeId")String storeId, @PathVariable("sellVolume") Integer sellVolume) {
         SysUserEntity user = ShiroUtils.getUserEntity();
         if(user == null) {
             return R.error("用户登录超时,请重新登录");
@@ -607,7 +608,7 @@ public class GoodsController {
         }
         Map<String,Object> map = null;
         try {
-            map = goodsService.calculateGoodsDetail(prodBarcode,storeId,null);
+            map = goodsService.calculateGoodsDetail(prodBarcode,storeId,null, sellVolume);
         } catch (ServiceException e) {
             log.error("查询订单详情出现异常!", e);
             return R.error(e.getMessage());
@@ -621,83 +622,24 @@ public class GoodsController {
         return R.ok().put("goodsDetails", map.get("goods")).put("map",map);
     }
 
-    // storeId + sku + prodBarcode
-    @RequestMapping(value = "/number/minus/{storeId}/{sku}/{prodBarcode}", method = RequestMethod.GET)
-    public R minus(@PathVariable("storeId") String storeId, @PathVariable("sku") String sku, @PathVariable("prodBarcode") String prodBarcode) {
-        String key = Constants.WAREHOUSE_STOCK_MAP_KEY + "_" + storeId;
-        String itemKey = storeId + sku + prodBarcode;
-
-        try {
-            String cartNumber = JedisUtil.hget(key, itemKey);
-            int number = Integer.parseInt(cartNumber);
-            JedisUtil.hset(key, itemKey, String.valueOf(++number));
-        } catch (Exception e) {
-            log.error("storeId:【{}】,sku:【{}】,prodBarcode:【{}】,扣减购物篮商品数量失败!", storeId, sku, prodBarcode);
-            return R.error("扣减购物篮商品数量失败!请删除购物篮商品后重试!");
-        }
-
-        return R.ok();
-    }
-
     @RequestMapping(value = "/number/add/{storeId}/{sku}/{prodBarcode}/{sellVolume}", method = RequestMethod.GET)
     public R add(@PathVariable("storeId") String storeId,
                  @PathVariable("sku") String sku,
                  @PathVariable("prodBarcode") String prodBarcode,
                  @PathVariable("sellVolume") Integer sellVolume) {
-        String key = Constants.WAREHOUSE_STOCK_MAP_KEY + "_" + storeId;
-        String itemKey = storeId + sku + prodBarcode;
-
-        try {
-            GoodsEntity goodsEntity = goodsService.queryGoodsStockByBarcodeAndStoreIdAndSku(prodBarcode, Integer.parseInt(storeId), sku);
-            Integer exitRegionNumber = goodsEntity.getExitRegionNumber();
-            Integer stockNum = goodsEntity.getStockNum();
-            String number = JedisUtil.hget(key, itemKey);
-            int cartNumber = Integer.parseInt(number);
-            if (stockNum + cartNumber - exitRegionNumber >= sellVolume) {
-                JedisUtil.hset(key, itemKey, String.valueOf(--cartNumber));
-            } else {
-                log.error("增加商品数量失败!保税仓库存不足!storeId:【{}】,sku:【{}】,prodBarcode:【{}】,stockNum:【{}】,exitRegionNumber:【{}】,wareStockNumber:【{}】"
-                , storeId, sku, prodBarcode, stockNum, exitRegionNumber, cartNumber);
-                return R.error("增加商品数量失败!保税仓库存不足!");
-            }
-        } catch (Exception e) {
-            log.error("storeId:【{}】,sku:【{}】,prodBarcode:【{}】,增加购物篮商品数量失败!", storeId, sku, prodBarcode);
-            return R.error("增加购物篮商品数量失败!请删除购物篮商品后重试!");
-        }
-
-        return R.ok();
-    }
-
-    @RequestMapping(value = "/number/del/{storeId}/{sku}/{prodBarcode}", method = RequestMethod.GET)
-    public R del(@PathVariable("storeId") String storeId, @PathVariable("sku") String sku, @PathVariable("prodBarcode") String prodBarcode) {
-        String key = Constants.WAREHOUSE_STOCK_MAP_KEY + "_" + storeId;
-        String itemKey = storeId + sku + prodBarcode;
 
         try {
-            JedisUtil.hdel(key, itemKey);
+            GoodsDetailsDto goodsDetailsDto = goodsService.queryGoodsDetailsByProdBarcode(prodBarcode, storeId, sku);
+            goodsDetailsDto.setSellVolume(sellVolume);
+            goodsService.validateWarehouseStock(goodsDetailsDto, prodBarcode, sku, storeId);
         } catch (Exception e) {
-            log.error("storeId:【{}】,sku:【{}】,prodBarcode:【{}】,删除购物篮商品失败!", storeId, sku, prodBarcode);
-            return R.error("删除购物篮商品失败!请刷新收银端页面!");
+            log.error("storeId:【{}】,sku:【{}】,prodBarcode:【{}】,增加购物篮商品数量失败!", storeId, sku, prodBarcode, e);
+            return R.error("校验库存===>" + e.getMessage());
         }
 
         return R.ok();
     }
 
-    @RequestMapping(value = "/number/clear/{storeId}", method = RequestMethod.GET)
-    public R clear(@PathVariable("storeId") String storeId) {
-        String key = Constants.WAREHOUSE_STOCK_MAP_KEY + "_" + storeId;
-
-        try {
-            JedisUtil.del(key);
-        } catch (Exception e) {
-            log.error("storeId:【{}】,清空购物篮商品失败!", storeId);
-            return R.error("清空购物篮商品失败!请刷新收银端页面!");
-        }
-
-        return R.ok();
-    }
-
-
     /**
      * 多sku可选
      * @param prodBarcode

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/PickUpCodeDao.java

@@ -38,4 +38,6 @@ public interface PickUpCodeDao extends BaseDao<PickUpCodeEntity> {
     void updatePickUpCodeStatusByOrderSn(@Param("orderSn") String orderSn, @Param("pickUpCodeStatus") String pickUpCodeStatus);
 
     void updatePickUpCode(Map<String, String> pickUpCodeMap);
+
+    void updateBatchPickUpCodeStatus(@Param("orderSnList") List<String> orderSnList, @Param("pickUpCodeStatus") String pickUpCodeStatus);
 }

+ 4 - 3
kmall-admin/src/main/java/com/kmall/admin/dao/haikong/HaiKongSendOrderInfoDetailRecordDao.java

@@ -2,6 +2,7 @@ package com.kmall.admin.dao.haikong;
 
 
 import com.kmall.admin.entity.haikong.HaiKongSendOrderInfoDetailRecordEntity;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -15,9 +16,9 @@ import java.util.Map;
  */
 public interface HaiKongSendOrderInfoDetailRecordDao {
 
-    HaiKongSendOrderInfoDetailRecordEntity queryObject(Integer id);
+    HaiKongSendOrderInfoDetailRecordEntity queryObject(@Param("id") Integer id);
 
-    List<HaiKongSendOrderInfoDetailRecordEntity> queryListByOrderId(String orderId);
+    List<HaiKongSendOrderInfoDetailRecordEntity> queryListByOrderId(@Param("orderId") String orderId);
 
     List<HaiKongSendOrderInfoDetailRecordEntity> queryList(Map<String, Object> params);
 
@@ -27,7 +28,7 @@ public interface HaiKongSendOrderInfoDetailRecordDao {
 
     int update(HaiKongSendOrderInfoDetailRecordEntity entity);
 
-    int delete(Integer id);
+    int delete(@Param("id") Integer id);
 
     int deleteBatch(List<Integer> idList);
 

+ 3 - 3
kmall-admin/src/main/java/com/kmall/admin/dao/haikong/HaiKongSendOrderInfoRecordDao.java

@@ -16,9 +16,9 @@ import java.util.Map;
  */
 public interface HaiKongSendOrderInfoRecordDao {
 
-    HaiKongSendOrderInfoRecordEntity queryObjectByOuterOrderNo(String outerOrderNo);
+    HaiKongSendOrderInfoRecordEntity queryObjectByOuterOrderNo(@Param("outerOrderNo") String outerOrderNo);
 
-    HaiKongSendOrderInfoRecordEntity queryObject(Integer id);
+    HaiKongSendOrderInfoRecordEntity queryObject(@Param("id") Integer id);
 
     List<HaiKongSendOrderInfoRecordEntity> queryListByResendStatus();
 
@@ -30,7 +30,7 @@ public interface HaiKongSendOrderInfoRecordDao {
 
     int update(HaiKongSendOrderInfoRecordEntity entity);
 
-    int delete(Integer id);
+    int delete(@Param("id") Integer id);
 
     int deleteBatch(List<Integer> idList);
 

+ 1 - 4
kmall-admin/src/main/java/com/kmall/admin/dao/mk/MkActivitiesScoreDao.java

@@ -19,10 +19,7 @@ public interface MkActivitiesScoreDao extends BaseDao<MkActivitiesScoreEntity> {
 
     MkActivitiesScoreEntity queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(@Param("prodBarcode") String prodBarcode,
                                                                             @Param("sku") String sku,
-                                                                            @Param("storeId") Integer storeId,
-                                                                            @Param("nowTime") Date nowTime);
-
-    List<MkActivitiesScoreEntity> queryDetailByTime(@Param("date") Date date);
+                                                                            @Param("storeId") Integer storeId);
 
     /**
      * 查询积分抵扣活动信息

+ 0 - 18
kmall-admin/src/main/java/com/kmall/admin/dto/ScoreReductionDTO.java

@@ -16,8 +16,6 @@ public class ScoreReductionDTO implements Serializable {
     private String prodBarcode;
     private String sku;
     private Integer storeId;
-    private Date deadline;
-    private String deadlineStr;
     private String reject;
 
     public String getProdBarcode() {
@@ -44,22 +42,6 @@ public class ScoreReductionDTO implements Serializable {
         this.storeId = storeId;
     }
 
-    public Date getDeadline() {
-        return deadline;
-    }
-
-    public void setDeadline(Date deadline) {
-        this.deadline = deadline;
-    }
-
-    public String getDeadlineStr() {
-        return deadlineStr;
-    }
-
-    public void setDeadlineStr(String deadlineStr) {
-        this.deadlineStr = deadlineStr;
-    }
-
     public String getReject() {
         return reject;
     }

+ 0 - 9
kmall-admin/src/main/java/com/kmall/admin/dto/TemporaryPromotionalItemsDto.java

@@ -23,7 +23,6 @@ public class TemporaryPromotionalItemsDto implements Serializable {
      * 是否参与积分抵扣,0:参与 1:不参与
      */
     private String rejectScore;
-    private String deadline; // 截止日期
 
 
     public String getStoreId() {
@@ -82,14 +81,6 @@ public class TemporaryPromotionalItemsDto implements Serializable {
         this.activitiesPrice = activitiesPrice;
     }
 
-    public String getDeadline() {
-        return deadline;
-    }
-
-    public void setDeadline(String deadline) {
-        this.deadline = deadline;
-    }
-
     public String getRejectScore() {
         return rejectScore;
     }

+ 3 - 3
kmall-admin/src/main/java/com/kmall/admin/entity/haikong/HaiKongMemberOrderSyncResendEntity.java

@@ -44,7 +44,7 @@ public class HaiKongMemberOrderSyncResendEntity {
     /**
      * 会员系统订单id,请求成功后返回
      */
-    private Long memberSysOrderId;
+    private String memberSysOrderId;
 
     /**
      * 重发状态,0:等待重发 1:重发成功 2:重发失败 3:无需重发
@@ -138,11 +138,11 @@ public class HaiKongMemberOrderSyncResendEntity {
         this.createTime = createTime;
     }
 
-    public Long getMemberSysOrderId() {
+    public String getMemberSysOrderId() {
         return memberSysOrderId;
     }
 
-    public void setMemberSysOrderId(Long memberSysOrderId) {
+    public void setMemberSysOrderId(String memberSysOrderId) {
         this.memberSysOrderId = memberSysOrderId;
     }
 

+ 12 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/haikong/HaiKongSendOrderInfoDetailRecordEntity.java

@@ -48,6 +48,10 @@ public class HaiKongSendOrderInfoDetailRecordEntity implements Serializable {
      */
     private BigDecimal price;
     /**
+     * 成交价
+     */
+    private BigDecimal buyPrice;
+    /**
      * 商品编码
      */
     private String itemcode;
@@ -233,4 +237,12 @@ public class HaiKongSendOrderInfoDetailRecordEntity implements Serializable {
     public void setTaxPrice(BigDecimal taxPrice) {
         this.taxPrice = taxPrice;
     }
+
+    public BigDecimal getBuyPrice() {
+        return buyPrice;
+    }
+
+    public void setBuyPrice(BigDecimal buyPrice) {
+        this.buyPrice = buyPrice;
+    }
 }

+ 0 - 17
kmall-admin/src/main/java/com/kmall/admin/entity/mk/MkActivitiesScoreEntity.java

@@ -36,10 +36,6 @@ public class MkActivitiesScoreEntity implements Serializable {
      */
     private Long mkaId;
     /**
-     * 截止日期
-     */
-    private Date deadline;
-    /**
      * 是否参与,0:参与 1:不参与
      */
     private String reject;
@@ -125,19 +121,6 @@ public class MkActivitiesScoreEntity implements Serializable {
     public Long getMkaId() {
         return mkaId;
     }
-    /**
-     * 设置:截止日期
-     */
-    public void setDeadline(Date deadline) {
-        this.deadline = deadline;
-    }
-
-    /**
-     * 获取:截止日期
-     */
-    public Date getDeadline() {
-        return deadline;
-    }
 
     public String getReject() {
         return reject;

+ 3 - 3
kmall-admin/src/main/java/com/kmall/admin/fromcomm/controller/SysLoginController.java

@@ -84,9 +84,9 @@ public class SysLoginController {
         LOGGER.info("获取验证码:"+kaptcha);
         System.out.println(kaptcha);
         JedisUtil.del(Constants.KAPTCHA_SESSION_KEY);
-        if (!captcha.equalsIgnoreCase(kaptcha)) {
-            return R.error("验证码不正确");
-        }
+//        if (!captcha.equalsIgnoreCase(kaptcha)) {
+//            return R.error("验证码不正确");
+//        }
 
         try {
             Subject subject = ShiroUtils.getSubject();

+ 53 - 7
kmall-admin/src/main/java/com/kmall/admin/haikong/config/HaiKongConfig.java

@@ -5,6 +5,7 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.PropertySource;
 import org.springframework.core.env.Environment;
+import org.springframework.util.StringUtils;
 
 /**
  * 海控配置类
@@ -22,14 +23,59 @@ public class HaiKongConfig {
     public HaiKongProperties haiKongProperties() {
         HaiKongProperties haiKongProperties = new HaiKongProperties();
 
-        haiKongProperties.setMemberUrl(environment.getProperty("haikong.member.url"));
-        haiKongProperties.setMemberAppId(environment.getProperty("haikong.member.appId"));
-        haiKongProperties.setMemberAppSecret(environment.getProperty("haikong.member.appSecret"));
+        String env = environment.getProperty("haikong.env");
         haiKongProperties.setRetry(Integer.parseInt(environment.getProperty("haikong.retry")));
-        haiKongProperties.setVmcconnectUrl(environment.getProperty("haikong.vmcconnect.url"));
-        haiKongProperties.setVmcconnectAppId(environment.getProperty("haikong.vmcconnect.appId"));
-        haiKongProperties.setVmcconnectSecretKey(environment.getProperty("haikong.vmcconnect.secretKey"));
-        haiKongProperties.setRequestRetry(Integer.parseInt(environment.getProperty("haikong.vmcconnect.requestRetry")));
+
+        haiKongProperties.setMemberUrl(environment.getProperty(String.format("haikong.%s.member.url", env)));
+        haiKongProperties.setMemberAppId(environment.getProperty(String.format("haikong.%s.member.appId", env)));
+        haiKongProperties.setMemberAppSecret(environment.getProperty(String.format("haikong.%s.member.appSecret", env)));
+
+        haiKongProperties.setVmcconnectUrl(environment.getProperty(String.format("haikong.%s.vmcconnect.url", env)));
+        haiKongProperties.setVmcconnectAppId(environment.getProperty(String.format("haikong.%s.vmcconnect.appId", env)));
+        haiKongProperties.setVmcconnectSecretKey(environment.getProperty(String.format("haikong.%s.vmcconnect.secretKey", env)));
+        haiKongProperties.setRequestRetry(Integer.parseInt(environment.getProperty(String.format("haikong.%s.vmcconnect.requestRetry", env))));
+
+        String wareAppId = environment.getProperty(String.format("haikong.%s.ware.appId", env));
+        String wareAppSecret = environment.getProperty(String.format("haikong.%s.ware.appSecret", env));
+        String wareCode = environment.getProperty(String.format("haikong.%s.ware.code", env));
+        String companyCode = environment.getProperty(String.format("haikong.%s.ware.companyCode", env));
+        String wareCustomerId = environment.getProperty(String.format("haikong.%s.ware.customerId", env));
+        String wareShopCode = environment.getProperty(String.format("haikong.%s.ware.shopCode", env));
+        String wareSignMethod = environment.getProperty(String.format("haikong.%s.ware.signMethod", env));
+        String wareUrl = environment.getProperty(String.format("haikong.%s.ware.url", env));
+
+        if (!StringUtils.isEmpty(wareAppId)) {
+            haiKongProperties.setWareAppId(wareAppId);
+        }
+
+        if (!StringUtils.isEmpty(wareAppSecret)) {
+            haiKongProperties.setWareAppSecret(wareAppSecret);
+        }
+
+        if (!StringUtils.isEmpty(wareCode)) {
+            haiKongProperties.setWareCode(wareCode);
+        }
+
+        if (!StringUtils.isEmpty(companyCode)) {
+            haiKongProperties.setWareCompanyCode(companyCode);
+        }
+
+        if (!StringUtils.isEmpty(wareCustomerId)) {
+            haiKongProperties.setWareCustomerId(wareCustomerId);
+        }
+
+        if (!StringUtils.isEmpty(wareShopCode)) {
+            haiKongProperties.setWareShopCode(wareShopCode);
+        }
+
+        if (!StringUtils.isEmpty(wareSignMethod)) {
+            haiKongProperties.setWareSignMethod(wareSignMethod);
+        }
+
+        if (!StringUtils.isEmpty(wareUrl)) {
+            haiKongProperties.setWareUrl(wareUrl);
+        }
+
         return haiKongProperties;
     }
 

+ 13 - 0
kmall-admin/src/main/java/com/kmall/admin/haikong/constant/Constants.java

@@ -25,8 +25,21 @@ public class Constants {
 
     public static final String HAIKONG_MEMBER_MAX_SCORE_RATIO = "HAIKONG_MEMBER_MAX_SCORE_RATIO";
 
+    public static final String CUSTOMS_PORT_CODE = "CUSTOMS_PORT_CODE";
+
     /* --------------------------------------------------系统常量----------------------------------------------- */
 
+    /* --------------------------------------------------环境常量----------------------------------------------- */
+
+    public static final String DEV = "dev";
+
+    public static final String TEST = "test";
+
+    public static final String PRE = "pre";
+
+    public static final String PROD = "prod";
+
+    /* --------------------------------------------------环境常量----------------------------------------------- */
 
     /* --------------------------------------------------支付宝常量----------------------------------------------- */
 

+ 67 - 0
kmall-admin/src/main/java/com/kmall/admin/haikong/constant/ErrorCodeConstants.java

@@ -0,0 +1,67 @@
+package com.kmall.admin.haikong.constant;
+
+/**
+ * 海控对接,错误码枚举
+ * @author lhm
+ * @createDate 2021-12-21
+ */
+public class ErrorCodeConstants {
+
+    /**
+     * 会员系统异常返回码
+     */
+    public enum MemberSysErrorCodeEnum {
+        CODE_0(0, "成功"),
+        CODE_401(401, "无效token,稍后再试!"),
+        CODE_500(500, "系统繁忙"),
+        CODE_1001(1001, "参数不合法"),
+        CODE_150007(150007, "退款积分超出上线"),
+        CODE_150008(150008, "积分不够扣除"),
+        CODE_150009(150009, "积分余额不足以回退"),
+        CODE_150010(150010, "仅支持全额回退")
+        ;
+
+        private final Integer code;
+
+        private final String desc;
+
+        MemberSysErrorCodeEnum(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 免税mall异常返回码
+     */
+    public enum VmcShopSysErrorCodeEnum {
+        CODE_0(0, "成功"),
+        CODE_10500(10500, "参数不合法"),
+        ;
+
+        private final Integer code;
+
+        private final String desc;
+
+        VmcShopSysErrorCodeEnum(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+}

+ 2 - 2
kmall-admin/src/main/java/com/kmall/admin/haikong/constant/HaiKongMemberSystemUrlEnum.java

@@ -40,11 +40,11 @@ public enum HaiKongMemberSystemUrlEnum {
     /**
      * 查询会员优惠券,不用对接
      */
-    QUERY_MEMBER_COUPON("GET", "/gateway/wk.coupon.user.list/v1","查询会员优惠券接口"),
+    QUERY_MEMBER_COUPON("GET", "/gw/gateway/wk.coupon.user.list/v1","查询会员优惠券接口"),
     /**
      * 会员消费订单同步接口
      */
-    MEMBER_ORDER_SYNC("POST", "/gateway/wk.user.order.add/v1","会员消费订单同步接口"),
+    MEMBER_ORDER_SYNC("POST", "/gw/gateway/wk.user.order.add/v1","会员消费订单同步接口"),
 
     ;
 

+ 0 - 15
kmall-admin/src/main/java/com/kmall/admin/haikong/dto/MemberOrderInfoSyncDTO.java

@@ -28,12 +28,6 @@ public class MemberOrderInfoSyncDTO implements Serializable {
     private String openId;
 
     /**
-     * 会员手机号
-     */
-    @JsonProperty("phone")
-    private String phone;
-
-    /**
      * 消费时间
      */
     @JsonProperty("consume_date")
@@ -85,14 +79,6 @@ public class MemberOrderInfoSyncDTO implements Serializable {
         this.openId = openId;
     }
 
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-
     public Date getConsumeDate() {
         return consumeDate;
     }
@@ -146,7 +132,6 @@ public class MemberOrderInfoSyncDTO implements Serializable {
         return "MemberOrderInfoSyncDTO{" +
                 "storeId=" + storeId +
                 ", openId='" + openId + '\'' +
-                ", phone='" + phone + '\'' +
                 ", consumeDate=" + consumeDate +
                 ", orderAmount=" + orderAmount +
                 ", orderNo='" + orderNo + '\'' +

+ 15 - 0
kmall-admin/src/main/java/com/kmall/admin/haikong/dto/OrderInfoDTO.java

@@ -63,6 +63,12 @@ public class OrderInfoDTO implements Serializable {
 
     private String platform;
 
+    /**
+     * 商品优惠后总金额
+     */
+    @JsonProperty("finally_cart_amount")
+    private BigDecimal finallyCartAmount;
+
     public String getOuterOrderNo() {
         return outerOrderNo;
     }
@@ -191,6 +197,14 @@ public class OrderInfoDTO implements Serializable {
         this.platform = platform;
     }
 
+    public BigDecimal getFinallyCartAmount() {
+        return finallyCartAmount;
+    }
+
+    public void setFinallyCartAmount(BigDecimal finallyCartAmount) {
+        this.finallyCartAmount = finallyCartAmount;
+    }
+
     @Override
     public String toString() {
         return "OrderInfoDTO{" +
@@ -209,6 +223,7 @@ public class OrderInfoDTO implements Serializable {
                 ", weight='" + weight + '\'' +
                 ", quantity='" + quantity + '\'' +
                 ", orderTotal=" + orderTotal +
+                ", finallyCartAmount=" + finallyCartAmount +
                 ", platform='" + platform + '\'' +
                 '}';
     }

+ 15 - 3
kmall-admin/src/main/java/com/kmall/admin/haikong/dto/OrderInfoItemDTO.java

@@ -30,6 +30,9 @@ public class OrderInfoItemDTO implements Serializable {
 
     private BigDecimal price;
 
+    @JsonProperty("buy_price")
+    private BigDecimal buyPrice;
+
     private String itemcode;
 
     private BigDecimal amount;
@@ -37,7 +40,7 @@ public class OrderInfoItemDTO implements Serializable {
     private Integer nums;
 
     @JsonProperty("is_tax")
-    private Boolean tax;
+    private String tax;
 
     @JsonProperty("tax_price")
     private BigDecimal taxPrice;
@@ -122,11 +125,11 @@ public class OrderInfoItemDTO implements Serializable {
         this.nums = nums;
     }
 
-    public Boolean getTax() {
+    public String getTax() {
         return tax;
     }
 
-    public void setTax(Boolean tax) {
+    public void setTax(String tax) {
         this.tax = tax;
     }
 
@@ -138,6 +141,14 @@ public class OrderInfoItemDTO implements Serializable {
         this.taxPrice = taxPrice;
     }
 
+    public BigDecimal getBuyPrice() {
+        return buyPrice;
+    }
+
+    public void setBuyPrice(BigDecimal buyPrice) {
+        this.buyPrice = buyPrice;
+    }
+
     @Override
     public String toString() {
         return "OrderInfoItemDTO{" +
@@ -148,6 +159,7 @@ public class OrderInfoItemDTO implements Serializable {
                 ", name='" + name + '\'' +
                 ", cost=" + cost +
                 ", price=" + price +
+                ", buyPrice=" + buyPrice +
                 ", itemcode='" + itemcode + '\'' +
                 ", amount=" + amount +
                 ", nums=" + nums +

+ 10 - 6
kmall-admin/src/main/java/com/kmall/admin/haikong/task/MemberOrderSyncResendTask.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.kmall.admin.entity.haikong.HaiKongMemberOrderSyncResendEntity;
 import com.kmall.admin.entity.haikong.HaiKongMemberScoreChangeRecordEntity;
 import com.kmall.admin.haikong.client.HaiKongMemberTemplate;
+import com.kmall.admin.haikong.constant.ErrorCodeConstants;
 import com.kmall.admin.haikong.constant.HaiKongMemberOrderResendStatusEnum;
 import com.kmall.admin.haikong.dto.MemberOrderInfoSyncDTO;
 import com.kmall.admin.haikong.dto.MemberScoreChangeDTO;
@@ -40,8 +41,7 @@ public class MemberOrderSyncResendTask {
     @Autowired
     private HaiKongMemberOrderSyncResendService haiKongMemberOrderSyncResendService;
 
-    //    @Scheduled(cron = "0 55 0/2 * * ?")
-//    @Scheduled(cron = "0/20 0/2 * * * ?")
+    @Scheduled(cron = "0 0/2 * * * ?")
     public void resend() {
         // 查询等待发送和发送失败的记录
         List<HaiKongMemberOrderSyncResendEntity> haiKongMemberOrderSyncResendEntities = haiKongMemberOrderSyncResendService.queryListByResendStatus();
@@ -57,20 +57,24 @@ public class MemberOrderSyncResendTask {
             haiKongMemberOrderSyncResendEntity.setLastResendTime(new Date());
             log.info("【重发】请求会员消费订单同步接口!请求体:{}", body);
             try {
-                String responseJson = haiKongMemberTemplate.changeMemberScore(body);
-                Response<Long> response = JacksonUtil.fromListJson(responseJson, new TypeReference<Response<Long>>() {});
+                String responseJson = haiKongMemberTemplate.memberOrderSync(body);
+                Response<String> response = JacksonUtil.fromListJson(responseJson, new TypeReference<Response<String>>() {});
                 if (Objects.nonNull(response) && response.getSuccess()) {
                     haiKongMemberOrderSyncResendEntity.setMemberSysOrderId(response.getData());
                     haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_SUCCESS.getStatus());
                     successList.add(haiKongMemberOrderSyncResendEntity);
                     log.info("【重发】请求会员消费订单同步接口成功!响应数据:{}", responseJson);
-                } else {
+                }/* else if (Objects.nonNull(response) && ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_500.getCode().equals(response.getCode())) {
                     haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_FAILED.getStatus());
                     failedList.add(haiKongMemberOrderSyncResendEntity);
                     log.error("【重发】请求会员消费订单同步接口失败!响应:{}", responseJson);
+                }*/ else {
+                    haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
+                    failedList.add(haiKongMemberOrderSyncResendEntity);
+                    log.error("【重发】请求会员消费订单同步接口失败!响应:{}", responseJson);
                 }
             } catch (Exception e) {
-                haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_FAILED.getStatus());
+                haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
                 failedList.add(haiKongMemberOrderSyncResendEntity);
                 log.error("【重发】请求会员消费订单同步接口失败!异常:", e);
             }

+ 11 - 6
kmall-admin/src/main/java/com/kmall/admin/haikong/task/MemberScoreChangeResendTask.java

@@ -3,6 +3,7 @@ package com.kmall.admin.haikong.task;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.kmall.admin.entity.haikong.HaiKongMemberScoreChangeRecordEntity;
 import com.kmall.admin.haikong.client.HaiKongMemberTemplate;
+import com.kmall.admin.haikong.constant.ErrorCodeConstants;
 import com.kmall.admin.haikong.constant.HaiKongMemberOrderResendStatusEnum;
 import com.kmall.admin.haikong.constant.HaiKongMemberScoreChangeEventEnum;
 import com.kmall.admin.haikong.dto.MemberScoreChangeDTO;
@@ -39,8 +40,7 @@ public class MemberScoreChangeResendTask {
     @Autowired
     private HaiKongMemberScoreChangeRecordService haiKongMemberScoreChangeRecordService;
 
-    //    @Scheduled(cron = "0 55 0/2 * * ?")
-    //@Scheduled(cron = "0/20 0/2 * * * ?")
+    @Scheduled(cron = "0 0/2 * * * ?")
     public void resend() {
         // 查询等待发送和发送失败的记录
         List<HaiKongMemberScoreChangeRecordEntity> haiKongMemberScoreChangeRecordEntities = haiKongMemberScoreChangeRecordService.queryListByResendStatus();
@@ -57,20 +57,25 @@ public class MemberScoreChangeResendTask {
             log.info("【重发】请求会员系统积分变动接口!请求体:{}", body);
             try {
                 String responseJson = haiKongMemberTemplate.changeMemberScore(body);
-                Response<String> response = JacksonUtil.fromListJson(responseJson, new TypeReference<Response<String>>() {});
-                if (Objects.nonNull(response) && response.getSuccess()) {
+                Response<String> response = JacksonUtil.fromListJson(responseJson, new TypeReference<Response<String>>() {
+                });
+                if (Objects.nonNull(response) && ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_0.getCode().equals(response.getCode())) {
                     MemberScoreChangeResponseDTO responseData = JacksonUtil.fromStringJson(response.getData(), MemberScoreChangeResponseDTO.class);
                     haiKongMemberScoreChangeRecordEntity.setStatementId(responseData.getStatementId());
                     haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_SUCCESS.getStatus());
                     successList.add(haiKongMemberScoreChangeRecordEntity);
                     log.info("【重发】请求会员系统积分变动接口成功!响应数据:{}", responseJson);
-                } else {
+                } else if (Objects.nonNull(response) && ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_500.getCode().equals(response.getCode())) {
                     haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_FAILED.getStatus());
+                    successList.add(haiKongMemberScoreChangeRecordEntity);
+                    log.info("【重发】请求会员系统积分变动接口失败!响应:{}", responseJson);
+                } else {
+                    haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
                     failedList.add(haiKongMemberScoreChangeRecordEntity);
                     log.error("【重发】请求会员系统积分变动接口失败!响应:{}", responseJson);
                 }
             } catch (Exception e) {
-                haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_FAILED.getStatus());
+                haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
                 failedList.add(haiKongMemberScoreChangeRecordEntity);
                 log.error("【重发】请求会员系统积分变动接口失败!异常:", e);
             }

+ 3 - 4
kmall-admin/src/main/java/com/kmall/admin/haikong/task/MemberSysAccessTokenRefreshTask.java

@@ -32,8 +32,7 @@ public class MemberSysAccessTokenRefreshTask {
     private HaiKongMemberTemplate haiKongMemberTemplate;
 
 
-//    @Scheduled(cron = "0 55 0/2 * * ?")
-    @Scheduled(cron = "0 0/2 * * * ?")
+    @Scheduled(cron = "0/30 * * * * ?")
     public void refresh() {
         String refreshToken = JedisUtil.get(Constants.MEMBER_SYS_REFRESH_TOKEN_REDIS_KEY);
         String accessToken = JedisUtil.get(Constants.MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY);
@@ -51,7 +50,7 @@ public class MemberSysAccessTokenRefreshTask {
             } catch (Exception e) {
                 log.error(e.getMessage() + "====>", e);
             }
-        } else {
+        } else if (StringUtils.isEmpty(accessToken) && !StringUtils.isEmpty(refreshToken)) {
             try {
                 String refreshAccessTokenJson = haiKongMemberTemplate.refreshAccessToken(refreshToken);
                 handleResponse(refreshAccessTokenJson, a);
@@ -74,7 +73,7 @@ public class MemberSysAccessTokenRefreshTask {
         if (Objects.nonNull(response) && response.getSuccess()) {
             AccessTokenDTO accessTokenDTO = response.getData();
             JedisUtil.del(Constants.MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY);
-            JedisUtil.set(Constants.MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY, JacksonUtil.toJson(accessTokenDTO), (60 * 60 * 2) - (60 * 2));
+            JedisUtil.set(Constants.MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY, JacksonUtil.toJson(accessTokenDTO), (60 * 60 * 2) - (60 * 10));
             if (a) {
                 JedisUtil.del(Constants.MEMBER_SYS_REFRESH_TOKEN_REDIS_KEY);
                 JedisUtil.set(Constants.MEMBER_SYS_REFRESH_TOKEN_REDIS_KEY, Optional.ofNullable(accessTokenDTO.getRefreshToken()).orElse(""), (60 * 60 * 24 * 7));

+ 32 - 12
kmall-admin/src/main/java/com/kmall/admin/haikong/task/SendOrderInfoTask.java

@@ -5,16 +5,20 @@ import com.kmall.admin.entity.haikong.HaiKongMemberOrderSyncResendEntity;
 import com.kmall.admin.entity.haikong.HaiKongSendOrderInfoDetailRecordEntity;
 import com.kmall.admin.entity.haikong.HaiKongSendOrderInfoRecordEntity;
 import com.kmall.admin.haikong.client.VmcShopTemplate;
+import com.kmall.admin.haikong.constant.ErrorCodeConstants;
 import com.kmall.admin.haikong.constant.HaiKongMemberOrderResendStatusEnum;
 import com.kmall.admin.haikong.dto.*;
 import com.kmall.admin.haikong.utils.Response;
+import com.kmall.admin.service.PickUpCodeService;
 import com.kmall.admin.service.haikong.HaiKongSendOrderInfoDetailRecordService;
 import com.kmall.admin.service.haikong.HaiKongSendOrderInfoRecordService;
 import com.kmall.admin.utils.jackson.JacksonUtil;
+import com.kmall.common.constant.Dict;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 
@@ -41,9 +45,12 @@ public class SendOrderInfoTask {
     private HaiKongSendOrderInfoDetailRecordService haiKongSendOrderInfoDetailRecordService;
 
     @Autowired
+    private PickUpCodeService pickUpCodeService;
+
+    @Autowired
     private VmcShopTemplate vmcShopTemplate;
 
-    //    @Scheduled(cron = "0/20 0/2 * * * ?")
+    @Scheduled(cron = "0 0/1 * * * ?")
     public void resend() {
         // 查询等待发送和发送失败的记录
         List<HaiKongSendOrderInfoRecordEntity> haiKongSendOrderInfoRecordEntities = haiKongSendOrderInfoRecordService.queryListByResendStatus();
@@ -57,9 +64,12 @@ public class SendOrderInfoTask {
             SeaportInfoDTO seaportInfoDTO = new SeaportInfoDTO();
             PayInfoDTO payInfoDTO = new PayInfoDTO();
             OrderInfoDTO orderInfoDTO = new OrderInfoDTO();
-
             BeanUtils.copyProperties(haiKongSendOrderInfoRecordEntity, orderInfoDTO);
+            orderInfoDTO.setFinallyCartAmount(haiKongSendOrderInfoRecordEntity.getOrderTotal());
             BeanUtils.copyProperties(haiKongSendOrderInfoRecordEntity, payInfoDTO);
+            String response1 = payInfoDTO.getResponse();
+            response1 = response1.replaceAll("\r|\n", "");
+            payInfoDTO.setResponse(response1);
             seaportInfoDTO.setSeaportCode(haiKongSendOrderInfoRecordEntity.getSeaportCode());
             seaportInfoDTO.setPlatform(haiKongSendOrderInfoRecordEntity.getPlatform());
             seaportInfoDTO.setIdentityCard(haiKongSendOrderInfoRecordEntity.getIdentityCard());
@@ -71,7 +81,7 @@ public class SendOrderInfoTask {
             List<OrderInfoItemDTO> dtoList = detailRecordEntities.stream().map(detailRecord -> {
                 OrderInfoItemDTO orderInfoItemDTO = new OrderInfoItemDTO();
                 BeanUtils.copyProperties(detailRecord, orderInfoItemDTO);
-                orderInfoItemDTO.setTax(Boolean.getBoolean(detailRecord.getIsTax()));
+                orderInfoItemDTO.setTax(detailRecord.getIsTax());
                 return orderInfoItemDTO;
             }).collect(Collectors.toList());
 
@@ -80,29 +90,39 @@ public class SendOrderInfoTask {
             sendOrderToVmcShopDTO.setOrderInfoItems(dtoList);
             sendOrderToVmcShopDTO.setOrderInfo(orderInfoDTO);
 
-            String body = JacksonUtil.toJson(sendOrderToVmcShopDTO);
-            log.info("【重发】请求会员消费订单同步接口!请求体:{}", body);
             try {
+                String body = JacksonUtil.getObjectMapper().writeValueAsString(sendOrderToVmcShopDTO);
+                log.info("【重发】请求免税mall创建订单接口!请求体:{}", body);
                 String responseJson = vmcShopTemplate.sendOrder(body);
-                Response<Long> response = JacksonUtil.fromListJson(responseJson, new TypeReference<Response<Long>>() {});
-                if (Objects.nonNull(response) && response.getSuccess()) {
+                Response<String> response = JacksonUtil.fromListJson(responseJson, new TypeReference<Response<String>>() {});
+                if (Objects.nonNull(response) && ErrorCodeConstants.VmcShopSysErrorCodeEnum.CODE_0.getCode().equals(response.getCode())) {
                     haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_SUCCESS.getStatus());
                     successList.add(haiKongSendOrderInfoRecordEntity);
-                    log.info("【重发】请求会员消费订单同步接口成功!响应数据:{}", responseJson);
-                } else {
+                    log.info("【重发】请求免税mall创建订单接口成功!响应数据:{}", responseJson);
+                } else if (Objects.nonNull(response) && ErrorCodeConstants.VmcShopSysErrorCodeEnum.CODE_10500.getCode().equals(response.getCode())) {
+                    haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
+                    failedList.add(haiKongSendOrderInfoRecordEntity);
+                    log.error("【重发】请求免税mall创建订单接口失败!响应:{}", responseJson);
+                } else if (Objects.isNull(response)) {
                     haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_FAILED.getStatus());
                     failedList.add(haiKongSendOrderInfoRecordEntity);
-                    log.error("【重发】请求会员消费订单同步接口失败!响应:{}", responseJson);
+                    log.error("【重发】请求免税mall创建订单接口失败!响应:{}", responseJson);
+                } else {
+                    haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
+                    failedList.add(haiKongSendOrderInfoRecordEntity);
+                    log.error("【重发】请求免税mall创建订单接口失败!响应:{}", responseJson);
                 }
             } catch (Exception e) {
-                haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_FAILED.getStatus());
+                haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
                 failedList.add(haiKongSendOrderInfoRecordEntity);
-                log.error("【重发】请求会员消费订单同步接口失败!异常:", e);
+                log.error("【重发】请求免税mall创建订单接口失败!异常:", e);
             }
         });
 
         if (!CollectionUtils.isEmpty(successList)) {
             haiKongSendOrderInfoRecordService.updateResendStatusBatch(successList);
+            List<String> orderSnList = successList.stream().map(HaiKongSendOrderInfoRecordEntity::getOuterOrderNo).collect(Collectors.toList());
+            pickUpCodeService.updateBatchPickUpCodeStatus(orderSnList, Dict.PickUpCodeStatusEnum.item_0.getStatus());
         }
 
         if (!CollectionUtils.isEmpty(failedList)) {

+ 51 - 0
kmall-admin/src/main/java/com/kmall/admin/haikong/utils/DeepCopyUtils.java

@@ -0,0 +1,51 @@
+package com.kmall.admin.haikong.utils;
+
+import java.io.*;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
+/**
+ * 深拷贝工具类
+ * @author lhm
+ * @createDate 2021-12-21
+ */
+public class DeepCopyUtils {
+
+    public static <T> Collection<T> depCopyHashSet(Collection<T> srcList) {
+        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
+        try {
+            ObjectOutputStream out = new ObjectOutputStream(byteOut);
+            out.writeObject(srcList);
+
+            ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray());
+            ObjectInputStream inStream = new ObjectInputStream(byteIn);
+            HashSet<T> destList = (HashSet<T>) inStream.readObject();
+            return destList;
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static <T> Collection<T> depCopyList(Collection<T> srcList) {
+        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
+        try {
+            ObjectOutputStream out = new ObjectOutputStream(byteOut);
+            out.writeObject(srcList);
+
+            ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray());
+            ObjectInputStream inStream = new ObjectInputStream(byteIn);
+            List<T> destList = (List<T>) inStream.readObject();
+            return destList;
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+}

+ 47 - 1
kmall-admin/src/main/java/com/kmall/admin/haikong/utils/Response.java

@@ -25,6 +25,14 @@ public class Response<T> {
 
     private Integer totalCount;
 
+    private Integer code;
+
+    private String result;
+
+    private String message;
+
+    private String ext;
+
     public Boolean getSuccess() {
         return success;
     }
@@ -81,6 +89,38 @@ public class Response<T> {
         this.totalCount = totalCount;
     }
 
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public String getExt() {
+        return ext;
+    }
+
+    public void setExt(String ext) {
+        this.ext = ext;
+    }
+
     @Override
     public String toString() {
         return "Response{" +
@@ -91,6 +131,10 @@ public class Response<T> {
                 ", pageSize=" + pageSize +
                 ", pageNo=" + pageNo +
                 ", totalCount=" + totalCount +
+                ", code=" + code +
+                ", result='" + result + '\'' +
+                ", message='" + message + '\'' +
+                ", ext='" + ext + '\'' +
                 '}';
     }
 
@@ -101,7 +145,9 @@ public class Response<T> {
         /**
          * 无效的refresh_token
          */
-        INVALID_REFRESH(1005, "无效的refresh_token");
+        INVALID_REFRESH(1005, "无效的refresh_token"),
+        PRODUCT_NON_EXISTS(10500, "商品不存在"),
+        ;
 
         /**
          * 错误码

+ 28 - 0
kmall-admin/src/main/java/com/kmall/admin/haikong/vo/CalculateOrderDiscountPriceResponseVO.java

@@ -19,6 +19,16 @@ public class CalculateOrderDiscountPriceResponseVO {
     private String memberPhone;
 
     /**
+     * 会员当前可用积分
+     */
+    private Integer memberCurrentAvailableScore;
+
+    /**
+     * 会员等级名称
+     */
+    private String levelName;
+
+    /**
      * 抵扣积分
      */
     private Integer deductionScore;
@@ -121,11 +131,29 @@ public class CalculateOrderDiscountPriceResponseVO {
         this.openId = openId;
     }
 
+    public Integer getMemberCurrentAvailableScore() {
+        return memberCurrentAvailableScore;
+    }
+
+    public void setMemberCurrentAvailableScore(Integer memberCurrentAvailableScore) {
+        this.memberCurrentAvailableScore = memberCurrentAvailableScore;
+    }
+
+    public String getLevelName() {
+        return levelName;
+    }
+
+    public void setLevelName(String levelName) {
+        this.levelName = levelName;
+    }
+
     @Override
     public String toString() {
         return "CalculateOrderDiscountPriceResponseVO{" +
                 "orderTotalPrice=" + orderTotalPrice +
                 ", memberCode='" + memberCode + '\'' +
+                ", memberCurrentAvailableScore='" + memberCurrentAvailableScore + '\'' +
+                ", levelName='" + levelName + '\'' +
                 ", memberPhone='" + memberPhone + '\'' +
                 ", deductionScore=" + deductionScore +
                 ", scoreDeductionPrice=" + scoreDeductionPrice +

+ 3 - 1
kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java

@@ -170,7 +170,7 @@ public interface GoodsService {
      * @param storeId
      * @return
      */
-    Map<String,Object> calculateGoodsDetail(String prodBarcode, String storeId,String sku);
+    Map<String,Object> calculateGoodsDetail(String prodBarcode, String storeId,String sku, Integer sellVolume);
 
     /**
      * 根据条形码查询商品
@@ -250,4 +250,6 @@ public interface GoodsService {
      * @return              更新数
      */
     int updateStockNumberByProductCodeAndSku(GoodsEntity goodsEntity);
+
+    void validateWarehouseStock(GoodsDetailsDto goods, String prodBarcode, String sku, String storeId);
 }

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/service/PickUpCodeService.java

@@ -80,4 +80,6 @@ public interface PickUpCodeService {
     void updatePickUpCodeStatusByOrderSn(String orderSn, String pickUpCodeStatus);
 
     void updatePickUpCode(Map<String,String> pickUpCodeMap);
+
+    void updateBatchPickUpCodeStatus(List<String> orderSnList, String pickUpCodeStatus);
 }

+ 89 - 313
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -14,10 +14,12 @@ import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
 import com.kmall.admin.entity.mk.MkActivitiesEntity;
 import com.kmall.admin.entity.shop.ShopErrorPriceRecordEntity;
 import com.kmall.admin.haikong.client.HaiKongWarehouseTemplate;
+import com.kmall.admin.haikong.config.HaiKongProperties;
 import com.kmall.admin.haikong.constant.Constants;
 import com.kmall.admin.haikong.dto.Criteria;
 import com.kmall.admin.haikong.dto.WareQueryStockParamDTO;
 import com.kmall.admin.haikong.dto.WareQueryStockResponseDTO;
+import com.kmall.admin.haikong.utils.XmlUtils;
 import com.kmall.admin.haikong.vo.QueryGoodsVO;
 import com.kmall.admin.service.*;
 import com.kmall.admin.service.kmall2eccs.KtoEccsService;
@@ -34,13 +36,16 @@ import com.kmall.common.constant.Dict;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.common.utils.*;
 import com.kmall.manager.manager.express.sf.ServiceException;
+import com.kmall.manager.manager.express.sf.XmlUtil;
 import com.kmall.manager.manager.redis.JedisCacheManager;
 import com.kmall.manager.manager.redis.JedisUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -136,6 +141,11 @@ public class GoodsServiceImpl implements GoodsService {
     @Autowired
     private HaiKongWarehouseTemplate haiKongWarehouseTemplate;
 
+    @Autowired
+    private HaiKongProperties haiKongProperties;
+    @Autowired
+    private Environment environment;
+
     @Override
     public GoodsEntity queryObject(Integer id) {
         Map<String, Object> map = new HashMap<String, Object>();
@@ -1545,7 +1555,7 @@ public class GoodsServiceImpl implements GoodsService {
      */
     @Override
     @Transactional
-    public synchronized Map<String,Object> calculateGoodsDetail(String prodBarcode, String storeId, String sku) {
+    public synchronized Map<String,Object> calculateGoodsDetail(String prodBarcode, String storeId, String sku, Integer sellVolume) {
         /**
          * 1.首先根据商品条码跟门店id查询是否有库存,没库存直接返回
          */
@@ -1553,48 +1563,85 @@ public class GoodsServiceImpl implements GoodsService {
         if(goods == null) {
             return null;
         }
+        goods.setSellVolume(sellVolume);
 
         /*
         * 2. 查询海仓仓库系统,判断库存是否足够
         * */
-        sku = org.springframework.util.StringUtils.isEmpty(sku) ? goods.getSku() : sku;
+        /*sku = org.springframework.util.StringUtils.isEmpty(sku) ? goods.getSku() : sku;
         String wareStockNumberKey = storeId + sku + prodBarcode;
         String warehouseStockMapKey = Constants.WAREHOUSE_STOCK_MAP_KEY + "_" + storeId;
-        String redisCacheWareQuantity = JedisUtil.hget(warehouseStockMapKey, wareStockNumberKey);
+        String redisCacheWareQuantity = JedisUtil.hget(warehouseStockMapKey, wareStockNumberKey);*/
+
+        validateWarehouseStock(goods, prodBarcode, sku, storeId);
+
+        goods.setDiscountedPrice(new BigDecimal(0));
+        BigDecimal retailPrice = goods.getRetailPrice();
+
+        goods.setActualPaymentAmount(retailPrice.setScale(2,RoundingMode.HALF_UP));
+
+        Map<String,Object> skuActivitiesMap = new HashMap<>();
+
+        // 计算税费
+        GoodsEntity goodsEntity = goodsDao.queryByBarcodeAndSku(prodBarcode, goods.getGoodsSn());
+        BigDecimal tax = CalculateTax.calculateFinalTax(goodsEntity, goods.getActualPaymentAmount(),this).setScale(3,RoundingMode.HALF_UP);
+        goods.setGoodstaxes(tax.toString());
+        goods.setSellVolume(1);
+
+        skuActivitiesMap.put("goods",goods);
+        return skuActivitiesMap;
+    }
+
+    @Override
+    public void validateWarehouseStock(GoodsDetailsDto goods, String prodBarcode, String sku, String storeId) {
+        // 保税仓库存
         Integer wareQuantity = 0;
+
+        String env = environment.getProperty("haikong.env");
+        // 保税仓库存
         Integer exitRegionNumber = goods.getExitRegionNumber();
         String stockNum = goods.getStockNum();
         Integer sellVolume = Objects.isNull(goods.getSellVolume()) ? 1 : goods.getSellVolume();
-        if (org.springframework.util.StringUtils.isEmpty(redisCacheWareQuantity)) {
-
-            /* -----------------↓--------------生产请打开注释-------------------↓------------ */
-//            WareQueryStockParamDTO wareQueryStockParamDTO = new WareQueryStockParamDTO();
-//            List<Criteria> criteriaList = new ArrayList<>();
-//            Criteria criteria = new Criteria();
-//            criteria.setItemId(goods.getWarehouseSysGoodId());
-//            criteria.setItemCode(goods.getSku());
-//            criteria.setOwnerCode(goods.getConsignorSn());
-//            criteria.setInventoryType(Constants.InventoryType.ZP.getType());
-//            criteria.setWarehouseCode(goods.getWarehouseSn());
-//            criteriaList.add(criteria);
-//            wareQueryStockParamDTO.setCriteriaList(criteriaList);
-//            String queryWarehouseStockResponse = null;
-//            try {
-//                queryWarehouseStockResponse = haiKongWarehouseTemplate.queryWarehouseStock(wareQueryStockParamDTO);
-//            } catch (Exception e) {
-//                log.error("sku:【{}】,调用海控仓库系统查询库存出现异常!", sku, e);
-//                throw new ServiceException(String.format("sku:【%s】,调用海控仓库系统查询库存出现异常!", sku));
-//            }
-//            log.info("调用海控仓库系统,请求参数,门店:{}、商品条码:{}、商品编码:{},响应数据:{}", storeId, prodBarcode, sku, queryWarehouseStockResponse);
-//            if (org.springframework.util.StringUtils.isEmpty(queryWarehouseStockResponse)) {
-//                log.error("调用库存系统接口出现错误!返回结果为空!");
-//                throw new ServiceException("调用库存系统接口出现错误!");
-//            }
-//            WareQueryStockResponseDTO wareQueryStockResponseDTO = JacksonUtil.fromStringJson(queryWarehouseStockResponse, WareQueryStockResponseDTO.class);
-            /* -----------------↑--------------生产请打开注释------------------↑------------- */
-
-            /* -----------------↓--------------测试数据,生产请注释-------------------↓------------ */
-            WareQueryStockResponseDTO wareQueryStockResponseDTO = new WareQueryStockResponseDTO();
+        WareQueryStockResponseDTO wareQueryStockResponseDTO = null;
+        String queryWarehouseStockResponse = null;
+        // 环境配置
+        if (!org.springframework.util.StringUtils.isEmpty(env) && Constants.PROD.equals(env)) {
+            WareQueryStockParamDTO wareQueryStockParamDTO = new WareQueryStockParamDTO();
+            List<Criteria> criteriaList = new ArrayList<>();
+            Criteria criteria = new Criteria();
+            criteria.setItemId(goods.getWarehouseSysGoodId());
+            criteria.setItemCode(goods.getSku());
+            criteria.setOwnerCode(haiKongProperties.getWareCompanyCode());
+            criteria.setInventoryType(Constants.InventoryType.ZP.getType());
+            criteria.setWarehouseCode(goods.getWarehouseSn());
+            criteriaList.add(criteria);
+            wareQueryStockParamDTO.setCriteriaList(criteriaList);
+            try {
+                queryWarehouseStockResponse = haiKongWarehouseTemplate.queryWarehouseStock(wareQueryStockParamDTO);
+            } catch (Exception e) {
+                log.error("sku:【{}】,调用海控仓库系统查询库存出现异常!", sku, e);
+                throw new ServiceException(String.format("sku:【%s】,调用海控仓库系统查询库存出现异常!", sku));
+            }
+            log.info("调用海控仓库系统,请求参数,门店:{}、商品条码:{}、商品编码:{},响应数据:{}", storeId, prodBarcode, sku, queryWarehouseStockResponse);
+            if (org.springframework.util.StringUtils.isEmpty(queryWarehouseStockResponse)) {
+                log.error("调用库存系统接口出现错误!返回结果为空!");
+                throw new ServiceException("调用库存系统接口出现错误!");
+            }
+            try {
+                wareQueryStockResponseDTO = (WareQueryStockResponseDTO) XmlUtils.toObject(queryWarehouseStockResponse, WareQueryStockResponseDTO.class);
+            } catch (Exception e) {
+                log.error("解析一步达库存系统响应数据出现错误!出现异常:", e);
+            }
+            if (Objects.isNull(wareQueryStockResponseDTO)) {
+                log.error("解析一步达库存系统响应数据出现错误!请求响应结果:{}", queryWarehouseStockResponse);
+                throw new ServiceException("解析一步达库存系统响应数据出现错误!");
+            }
+            if ("failure".equals(wareQueryStockResponseDTO.getFlag())) {
+                log.error("请求一步达库存系统返回错误响应!响应数据:{}", queryWarehouseStockResponse);
+                throw new ServiceException(String.format("请求一步达库存系统查询库存错误!响应数据:%s", wareQueryStockResponseDTO.getMessage()));
+            }
+        } else {
+            wareQueryStockResponseDTO = new WareQueryStockResponseDTO();
             wareQueryStockResponseDTO.setCode("0");
             wareQueryStockResponseDTO.setFlag("success");
             wareQueryStockResponseDTO.setMessage("");
@@ -1605,46 +1652,23 @@ public class GoodsServiceImpl implements GoodsService {
             List<WareQueryStockResponseDTO.WareQueryStockResponseItemDTO> wareQueryStockResponseItemDTOS = new ArrayList<>();
             wareQueryStockResponseItemDTOS.add(wareQueryStockResponseItemDTO);
             wareQueryStockResponseDTO.setItems(wareQueryStockResponseItemDTOS);
-            /* -----------------↑--------------测试数据,生产请注释------------------↑------------- */
-
-
-            if (Objects.isNull(wareQueryStockResponseDTO)) {
-//            log.error("解析一步达库存系统响应数据出现错误!请求响应结果:{}", queryWarehouseStockResponse);
-                throw new ServiceException("解析一步达库存系统响应数据出现错误!");
-            }
+        }
 
-            // 校验库存
-            WareQueryStockResponseDTO.WareQueryStockResponseItemDTO itemDTO = wareQueryStockResponseDTO.getItems().get(0);
-            // 仓库可用库存
-            wareQuantity = itemDTO.getQuantity();
-            JedisUtil.hset(warehouseStockMapKey, wareStockNumberKey, String.valueOf(wareQuantity));
-        } else {
-            wareQuantity = Integer.parseInt(redisCacheWareQuantity);
+        // 校验库存
+        List<WareQueryStockResponseDTO.WareQueryStockResponseItemDTO> items = wareQueryStockResponseDTO.getItems();
+        if (CollectionUtils.isEmpty(items)) {
+            log.error("查询商品时:【{}】,仓库不存在该商品!", prodBarcode);
+            throw new ServiceException(String.format("查询商品时:【%s】,仓库不存在该商品!", prodBarcode));
         }
+        WareQueryStockResponseDTO.WareQueryStockResponseItemDTO itemDTO = items.get(0);
+        // 仓库可用库存
+        wareQuantity = itemDTO.getQuantity();
         // 保税仓库存 + 展销店库存 - 出区数 >= 购买数
         if (!((wareQuantity + Integer.parseInt(stockNum) - exitRegionNumber) > sellVolume)) {
             // 库存不足
             log.error("商品条码:【{}】,sku:【{}】,门店库存:【{}】,保税仓库存:【{}】,出区数:【{}】,该商品仓库库存不足!", prodBarcode, sku, stockNum, wareQuantity, exitRegionNumber);
             throw new ServiceException(String.format("商品条码:【%s】,sku:【%s】,门店库存:【%s】,保税仓库存:【%s】,出区数:【%s】,该商品仓库库存不足!", prodBarcode, sku, stockNum, wareQuantity, exitRegionNumber));
-        } else {
-            JedisUtil.hset(warehouseStockMapKey, wareStockNumberKey, String.valueOf(wareQuantity - sellVolume));
         }
-
-        goods.setDiscountedPrice(new BigDecimal(0));
-        BigDecimal retailPrice = goods.getRetailPrice();
-
-        goods.setActualPaymentAmount(retailPrice.setScale(2,RoundingMode.HALF_UP));
-
-        Map<String,Object> skuActivitiesMap = new HashMap<>();
-
-        // 计算税费
-        GoodsEntity goodsEntity = goodsDao.queryByBarcodeAndSku(prodBarcode, goods.getGoodsSn());
-        BigDecimal tax = CalculateTax.calculateFinalTax(goodsEntity, goods.getActualPaymentAmount(),this).setScale(3,RoundingMode.HALF_UP);
-        goods.setGoodstaxes(tax.toString());
-        goods.setSellVolume(1);
-
-        skuActivitiesMap.put("goods",goods);
-        return skuActivitiesMap;
     }
 
     @Override
@@ -1668,260 +1692,12 @@ public class GoodsServiceImpl implements GoodsService {
         /**
          * 1.首先根据商品条码跟门店id查询是否有库存,没库存直接返回
          */
-
         goods.setDiscountedPrice(new BigDecimal(0));
         BigDecimal retailPrice = goods.getRetailPrice();
 
-
         goods.setActualPaymentAmount(retailPrice.setScale(2,RoundingMode.HALF_UP));
 
         Map<String,Object> skuActivitiesMap = new HashMap<>();
-
-        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
-        /**
-         * 2.查询当前时间,该门店是否有活动,如果有活动,查询开启了哪些营销方式
-         * 参数: 当前时间  门店id
-         */
-        List<MkActivitiesEntity> mkActivitiesEntityList = mkActivitiesService.queryByNow(storeId,format.format(new Date()));
-
-        if(mkActivitiesEntityList == null || mkActivitiesEntityList.size() == 0){
-            // 计算税费
-            GoodsEntity goodsEntity = goodsDao.queryByBarcodeAndSku(prodBarcode, goods.getGoodsSn());
-            BigDecimal tax = CalculateTax.calculateFinalTax(goodsEntity,goods.getActualPaymentAmount(),this).setScale(3,RoundingMode.HALF_UP);
-            goods.setGoodstaxes(tax.toString());
-            skuActivitiesMap.put("goods",goods);
-            return skuActivitiesMap;
-        }
-
-
-
-        // 遍历活动集合,查询有哪些活动是开启的
-        boolean daily = false,coupon = false,combinationPrice = false
-                ,discount = false,fullGift = false,fullReduction = false
-                ,getOneFree = false,promotion = false,halfPrice = false;
-
-        List<String> topicList = new ArrayList<>(); // 记录有哪些营销活动的topic
-        Map<String,String> mkaIdMap = new HashMap<>(); // 记录topic跟mkaId的关系
-        // 将所有的营销活动新增到list中
-        for(MkActivitiesEntity mkActivitiesEntity : mkActivitiesEntityList){
-            topicList.add(mkActivitiesEntity.getMkaTopic());
-            String mkaId = mkaIdMap.putIfAbsent(mkActivitiesEntity.getMkaTopic(), mkActivitiesEntity.getMkaId()+"");
-            if(StringUtils.isNotEmpty(mkaId)){
-//                mkaId = "'"+mkaId + "','" + mkActivitiesEntity.getMkaId()+"'";
-                mkaId += String.format(",%s",mkActivitiesEntity.getMkaId());
-                mkaIdMap.put(mkActivitiesEntity.getMkaTopic(),mkaId);
-            }
-        }
-        // 判断有哪些营销活动
-        if(topicList.contains("zhjsp")) // 组合价
-            combinationPrice = true;
-        if(topicList.contains("dz")) // 打折
-            discount = true;
-        if(topicList.contains("mz")) //满赠
-            fullGift = true;
-        if(topicList.contains("mj"))  // 满减
-            fullReduction = true;
-        if(topicList.contains("mysy")) // 买一送一
-            getOneFree = true;
-        if(topicList.contains("rchd")) // 日常活动
-            daily = true;
-        if(topicList.contains("yhq")) // 优惠券
-            coupon = true;
-        if(topicList.contains("lscx")) // 临时促销
-            promotion = true;
-        if(topicList.contains("drjbj"))
-            halfPrice = true;
-
-
-        // 获取未优惠前的商品价格
-        retailPrice = goods.getRetailPrice();
-
-
-        // 根据条码查询商品品牌名称 mall_brand  mall_product_store_rela  mall_goods
-        String brandName = goods.getBrand();
-
-        /**
-         * 优先级:临时促销 》买一送一=满赠 》 组合价=日常活动 》 打折=满减 》 优惠券
-         */
-
-        /**
-         * 组合价的做法就是将参与组合的条码带到收银端
-         * 现根据营销活动id跟条形码,查询有哪些参与该条码组合的商品
-         *
-         *
-         * TODO
-         */
-        if(combinationPrice){
-            String mkaId = mkaIdMap.get("zhjsp");
-            Map<String,Object> param = new HashMap<>();
-            param.put("mkaId",mkaId);
-            param.put("prodBarcode",prodBarcode);
-            List<MkActivitiesCombinationPriceEntity> combinationPriceList = combinationPriceService.queryList(param);
-            if(combinationPriceList != null && combinationPriceList.size() > 0) {
-                Map<String, List<MkActivitiesCombinationPriceEntity>> collect =
-                        combinationPriceList.stream().collect(Collectors.groupingBy(MkActivitiesCombinationPriceEntity::getCombinationType));
-
-                skuActivitiesMap.put("zhjsp",collect);
-            }
-        }
-
-
-
-        format = new SimpleDateFormat("yyyy-MM-dd");
-        String nowTime = format.format(new Date());
-        /**
-         * 满减可能是跟着条码,也可能跟着品牌
-         * 根据商品品牌跟商品条码去查询是否有优惠金额
-         *
-         * 满足金额   购买商品条码   赠品条码
-         *
-         */
-        Map<String,Object> fullReductionMap = new HashMap<>();
-        if(fullReduction){
-            String mkaId = mkaIdMap.get("mj");
-            MkActivitiesFullReductionEntity fullReductionEntity = fullReductionService.queryByCodeOrBrand(mkaId,prodBarcode,brandName,nowTime);
-            if(fullReductionEntity != null) {
-                if(!StringUtils.isNullOrEmpty(fullReductionEntity.getProductBrand())){
-                    // 跟着品牌走
-                    fullReductionMap.put(brandName,fullReductionEntity);
-                }else{
-                    // 跟着条码走
-                    fullReductionMap.put(fullReductionEntity.getBarcode(), fullReductionEntity);
-                }
-                skuActivitiesMap.put("mj",fullReductionMap);
-            }
-        }
-
-        /**
-         * 满赠可能是跟着条码,也可能跟着品牌
-         * 根据商品品牌跟商品条码去查询是否有满赠
-         * 1.先扫买的商品,然后查询出赠送的商品条码
-         * 2.先扫赠的商品,然后查询出符合条件的商品条码或者品牌
-         * 满足的金额   购买的商品条码或者品牌   赠送的商品条码
-         * TODO
-         */
-        Map<String,Object> fullGiftMap = new HashMap<>();
-        if(fullGift){
-            String mkaId = mkaIdMap.get("mz");
-            MkActivitiesFullGiftEntity giftEntity = fullGiftService.queryByCodeOrBrand(mkaId,prodBarcode,brandName,nowTime);
-            if(giftEntity != null) {
-                if(giftEntity.getProductBrand() != null){
-                    // 跟着品牌走
-                    fullGiftMap.put(brandName,giftEntity);
-                }else{
-                    // 跟着条码走
-                    fullGiftMap.put(giftEntity.getBarcode(), giftEntity);
-                }
-                skuActivitiesMap.put("mz",fullGiftMap);
-            }
-        }
-
-        /**
-         * 买一送一可能是跟着条码,也可能跟着品牌
-         * 根据商品品牌跟商品条码去查询是否有送的商品
-         * 有两个场景
-         * 1.先扫买的商品,然后查询出赠送的商品条码
-         * 2.先扫赠的商品,然后查询出符合条件的商品条码或者品牌
-         * 所以就需要一个map
-         * key为购买的商品条码或者商品品牌  value为赠送的商品条码
-         * 但是品牌是根据条码查询的,所以最终map里面的结构是
-         * key 商品条码 value 赠品条码
-         */
-        if(getOneFree){
-            String mkaId = mkaIdMap.get("mysy");
-            MkActivitiesGetOneFreeGoodsEntity getOneFreeGoodsEntity = getOneFreeGoodsService.queryByCodeOrBrand(mkaId,prodBarcode,brandName);
-            if(getOneFreeGoodsEntity != null){
-                if("无".equals(getOneFreeGoodsEntity.getProductBrand())){
-                    getOneFreeGoodsEntity.setBrand(false);
-                    skuActivitiesMap.put("mysy",getOneFreeGoodsEntity);
-                }else{
-                    getOneFreeGoodsEntity.setBrand(true);
-                    skuActivitiesMap.put("mysy",getOneFreeGoodsEntity);
-                }
-
-            }
-        }
-
-
-        // 第二份半价
-        if(halfPrice){
-            String mkaId = mkaIdMap.get("drjbj");
-            MkActivitiesHalfPriceEntity activitiesHalfPriceEntity = halfPriceService.queryByCodeOrBrand(mkaId,prodBarcode);
-            if(activitiesHalfPriceEntity != null){
-                skuActivitiesMap.put("drjbj",activitiesHalfPriceEntity);
-
-            }
-
-        }
-
-
-        // --------------------------------------------------------------------------------------
-
-        /**
-         * 优惠券跟着条形码走,一般是设置一个标识,然后最后输入优惠券码后,减扣对应的标识,所以返回一个map数组
-         */
-
-        if(coupon){
-            String mkaId = mkaIdMap.get("yhq");
-            MkActivitiesCouponEntity couponEntity =  couponService.queryByBarCode(mkaId,prodBarcode,nowTime);
-            if(couponEntity != null){ // 优惠券码,优惠金额
-                Map<String,Object> returnMap = new HashMap<>();
-                returnMap.put(couponEntity.getCouponSn() , couponEntity.getCouponPrice());
-                skuActivitiesMap.put("yhq",returnMap);
-            }
-        }
-
-
-        /**
-         * 打折的价格是与条形码对应的,所以需要根据条形码和营销方式id去查询活动价格
-         */
-
-        if(discount){
-            String mkaId = mkaIdMap.get("dz");
-            MkActivitiesDiscountEntity discountEntity =  discountService.queryByBarCode(mkaId,prodBarcode);
-            // TODO 可能会直接替代产品价格
-            if (discountEntity != null) {
-                goods.setActualPaymentAmount(discountEntity.getActivityPrice());
-                goods.setRetailPrice(discountEntity.getActivityPrice());
-
-                goods.setActivity("打折");
-            }
-        }
-
-
-        /**
-         * 日常活动跟着条形码走,优先级比临时促销低,但是高于正常价格
-         */
-        if(daily){
-            String mkaId = mkaIdMap.get("rchd");
-            MkDailyActivitiesEntity dailyActivitiesEntity = dailyActivitiesService.queryByBarCode(mkaId,prodBarcode);
-            if(dailyActivitiesEntity != null){
-                goods.setActualPaymentAmount(dailyActivitiesEntity.getActivityPrice());
-                goods.setRetailPrice(dailyActivitiesEntity.getActivityPrice());
-
-                goods.setActivity("日常活动");
-
-            }
-        }
-
-
-        /**
-         * 临时促销跟着条形码走,优先级应该最高,所以排到了最下面
-         */
-        if(promotion){
-            String mkaId = mkaIdMap.get("lscx");
-            MkActivitiesPromotionEntity promotionEntity = promotionService.queryByBarCode(mkaId,prodBarcode);
-            // 如果该商品存在临时促销,直接替换活动价格
-            if(promotionEntity != null){
-                goods.setActualPaymentAmount(promotionEntity.getActivityPrice());
-                goods.setRetailPrice(promotionEntity.getActivityPrice());
-
-                goods.setActivity("临时促销");
-
-            }
-        }
-
         // 计算税费
         GoodsEntity goodsEntity = goodsDao.queryByBarcodeAndSku(prodBarcode, goods.getGoodsSn());
         BigDecimal tax = CalculateTax.calculateFinalTax(goodsEntity,goods.getActualPaymentAmount(),this).setScale(3,RoundingMode.HALF_UP);

+ 0 - 2
kmall-admin/src/main/java/com/kmall/admin/service/impl/MkActivitiesPromotionServiceImpl.java

@@ -89,7 +89,6 @@ public class MkActivitiesPromotionServiceImpl implements MkActivitiesPromotionSe
                 builder.put("goodsEnglishName", "产品英文名称");
                 builder.put("rejectScore", "是否参与积分抵扣");
                 builder.put("activitiesPrice", "活动价格");
-                builder.put("deadline", "截止日期");
 
                 R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
                 if (Integer.valueOf(r.get("code").toString()) != 0) {
@@ -109,7 +108,6 @@ public class MkActivitiesPromotionServiceImpl implements MkActivitiesPromotionSe
                 mkActivitiesPromotionEntity.setSku(temporaryPromotionalItemsDto.getSku()); // 商品编号
                 mkActivitiesPromotionEntity.setBarcode(temporaryPromotionalItemsDto.getBarCode()); // 商品条码
                 mkActivitiesPromotionEntity.setRejectScore(temporaryPromotionalItemsDto.getRejectScore());
-                mkActivitiesPromotionEntity.setDeadline(temporaryPromotionalItemsDto.getDeadline());// 商品截止日期
                 mkActivitiesPromotionEntity.setMkaId(Long.parseLong(mkaId));
 
 

+ 260 - 168
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -1,6 +1,10 @@
 package com.kmall.admin.service.impl;
 
+import cn.hutool.core.lang.Snowflake;
 import cn.hutool.core.lang.UUID;
+import cn.hutool.core.lang.generator.SnowflakeGenerator;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.XmlUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
@@ -11,6 +15,8 @@ import com.google.gson.Gson;
 import com.google.gson.internal.LinkedTreeMap;
 import com.kmall.admin.cuspay.biz.ali.AliCusDeclareBiz;
 import com.kmall.admin.cuspay.biz.wx.WxCusDeclareBiz;
+import com.kmall.admin.cuspay.manager.snow.SnowflakeIdWorker;
+import com.kmall.admin.cuspay.manager.snow.SnowflakeUtil;
 import com.kmall.admin.dao.*;
 import com.kmall.admin.dao.alarm.Mall2LowPriceWarningDao;
 import com.kmall.admin.dao.mk.Mk2GoodsTopicPriceDao;
@@ -35,7 +41,9 @@ import com.kmall.admin.fromcomm.dao.SysConfigDao;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.haikong.constant.*;
 import com.kmall.admin.haikong.dto.*;
+import com.kmall.admin.haikong.utils.DeepCopyUtils;
 import com.kmall.admin.haikong.utils.ListUtils;
+import com.kmall.admin.haikong.utils.XmlUtils;
 import com.kmall.admin.haikong.vo.*;
 import com.kmall.admin.haikong.client.HaiKongMemberTemplate;
 import com.kmall.admin.haikong.client.HaiKongWarehouseTemplate;
@@ -91,6 +99,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -307,6 +316,9 @@ public class OrderServiceImpl implements OrderService {
     private AliCusDeclareBiz aliCusDeclareBiz;
 
     @Autowired
+    private Environment environment;
+
+    @Autowired
     private HaiKongSendOrderInfoRecordService haiKongSendOrderInfoRecordService;
 
     @Autowired
@@ -638,6 +650,9 @@ public class OrderServiceImpl implements OrderService {
         mailInfo.setShopTel(storeEntity.getTelephoneNumber());
         AddressEntity addressEntity = addressDao.queryStoreAddress(storeEntity.getId(),Dict.addressStatus.item_1.getItem());
         // 发货人
+        if (Objects.isNull(addressEntity)) {
+            throw new ServiceException("请先配置发货地址!");
+        }
         mailInfo.setSenderTel(addressEntity.getTelNumber());
         mailInfo.setSenderName(addressEntity.getSenderName());
         mailInfo.setSenderProvince(addressEntity.getProvinceName());
@@ -2171,10 +2186,20 @@ public class OrderServiceImpl implements OrderService {
                 queryGoodsVo.setSellVolume((Integer) map.get("sellVolume"));
                 queryGoodsVo.setRetailPrice(new BigDecimal(String.valueOf(map.get("retailPrice"))));
                 queryGoodsVo.setGoodsTaxes(new BigDecimal(String.valueOf(map.get("goodstaxes"))));
-                queryGoodsVo.setDisCountedPrice(new BigDecimal(String.valueOf(map.get("discountedPrice"))));
+                Object discountedPriceObj = map.get("discountedPrice");
+                BigDecimal discountedPrice = BigDecimal.ZERO;
+                if (Objects.nonNull(discountedPriceObj)) {
+                    discountedPrice = new BigDecimal(String.valueOf(discountedPriceObj));
+                }
+                queryGoodsVo.setDisCountedPrice(discountedPrice);
                 queryGoodsVo.setTotalPrice(new BigDecimal(String.valueOf(map.get("actualPaymentAmount"))));
                 queryGoodsVo.setActivity((String) map.get("activity"));
-                queryGoodsVo.setDeductionScore((Integer) map.get("deductionScore"));
+                Object deductionScoreObj = map.get("deductionScore");
+                Integer deductionScore = 0;
+                if (Objects.nonNull(deductionScoreObj)) {
+                    deductionScore = (Integer) deductionScoreObj;
+                }
+                queryGoodsVo.setDeductionScore(deductionScore);
                 Object deductionPriceObj = map.get("deductionPrice");
                 BigDecimal deductionPrice = BigDecimal.ZERO;
                 if (Objects.nonNull(deductionPriceObj)) {
@@ -2194,63 +2219,69 @@ public class OrderServiceImpl implements OrderService {
         Map resultObj = Maps.newHashMap();
         // 海控需求,下单流程修改,收银端接收会员码,付款码,用户信息,订单数据
         // 1. 校验库存:保税仓库存 + 展销店库存 - 出区数 >= 购买数
-        /* -----------------↓--------------生产请打开注释-------------------↓------------ */
-        /*WareQueryStockParamDTO wareQueryStockParamDTO = new WareQueryStockParamDTO();
-        List<Criteria> criteriaList = new ArrayList<>();
-        goodsList.forEach(goods -> {
-            Criteria criteria = new Criteria();
-            String sku = (String) goods.get("goodsSn");
-            criteria.setItemCode(sku);
-            GoodsEntity goodsEntity = goodsEntityMap.get(sku);
-            criteria.setItemId(goodsEntity.getWarehousSysGoodId());
-            criteria.setWarehouseCode(goodsEntity.getWarehouseSn());
-            criteria.setOwnerCode(goodsEntity.getConsignorSn());
-            criteria.setInventoryType(Constants.InventoryType.ZP.getType());
-            criteriaList.add(criteria);
-        });
-        wareQueryStockParamDTO.setCriteriaList(criteriaList);
-        String queryWarehouseStockResponse = null;
-        try {
-            queryWarehouseStockResponse = haiKongWarehouseTemplate.queryWarehouseStock(wareQueryStockParamDTO);
-        } catch (Exception e) {
-            LOGGER.error("下单调用海控仓库系统查询库存出现异常!", e);
-            throw new ServiceException(String.format("下单调用海控仓库系统查询库存出现异常!"));
-        }
-        if (org.springframework.util.StringUtils.isEmpty(queryWarehouseStockResponse)) {
-            LOGGER.error("调用库存系统接口出现错误!返回结果为空!");
-            throw new ServiceException("调用库存系统接口出现错误!");
-        }
-        WareQueryStockResponseDTO wareQueryStockResponseDTO = JacksonUtil.fromStringJson(queryWarehouseStockResponse, WareQueryStockResponseDTO.class);
-        if (Objects.isNull(wareQueryStockResponseDTO)) {
-            throw new ServiceException("解析一步达库存系统响应数据出现错误!");
-        }
-        List<WareQueryStockResponseDTO.WareQueryStockResponseItemDTO> items = wareQueryStockResponseDTO.getItems();
-        // 解析xml,组装成map key=>sku value=>库存
-        Map<String, Integer> stockMap = new HashMap<>(16);
-        items.forEach(item -> {
-            String itemCode = item.getItemCode();
-            Integer quantity = item.getQuantity();
-            if (stockMap.containsKey(itemCode)) {
-                // 避免出现sku相同情况
-                stockMap.put(itemCode, stockMap.get(itemCode) + quantity);
-            } else {
-                stockMap.put(itemCode, quantity);
+        Map<String, Integer> stockMap = null;
+
+        String env = environment.getProperty("haikong.env");
+        if (Constants.PROD.equals(env)) {
+            WareQueryStockParamDTO wareQueryStockParamDTO = new WareQueryStockParamDTO();
+            List<Criteria> criteriaList = new ArrayList<>();
+            goodsList.forEach(goods -> {
+                Criteria criteria = new Criteria();
+                String sku = (String) goods.get("goodsSn");
+                criteria.setItemCode(sku);
+                GoodsEntity goodsEntity = goodsEntityMap.get(sku);
+                criteria.setItemId(goodsEntity.getWarehousSysGoodId());
+                criteria.setWarehouseCode(goodsEntity.getWarehouseSn());
+                criteria.setOwnerCode(haiKongProperties.getWareCompanyCode());
+                criteria.setInventoryType(Constants.InventoryType.ZP.getType());
+                criteriaList.add(criteria);
+            });
+            wareQueryStockParamDTO.setCriteriaList(criteriaList);
+            String queryWarehouseStockResponse = null;
+            try {
+                queryWarehouseStockResponse = haiKongWarehouseTemplate.queryWarehouseStock(wareQueryStockParamDTO);
+            } catch (Exception e) {
+                LOGGER.error("下单调用海控仓库系统查询库存出现异常!", e);
+                throw new ServiceException(String.format("下单调用海控仓库系统查询库存出现异常!"));
             }
-        });*/
-        /* -----------------↑--------------生产请打开注释------------------↑------------- */
-
-        /* -----------------↓--------------测试数据,生产请注释-------------------↓------------ */
-        Map<String, Integer> stockMap = new HashMap<>(16);
-        goodsList.forEach(goods -> {
-            String sku = (String) goods.get("goodsSn");
-            if (stockMap.containsKey(sku)) {
-                // 避免出现sku相同情况
-                stockMap.put(sku, stockMap.get(sku) + 3);
-            } else {
-                stockMap.put(sku, 3);
+            if (org.springframework.util.StringUtils.isEmpty(queryWarehouseStockResponse)) {
+                LOGGER.error("调用库存系统接口出现错误!返回结果为空!");
+                throw new ServiceException("调用库存系统接口出现错误!");
             }
-        });
-        /* -----------------↑--------------测试数据,生产请注释------------------↑------------- */
+            WareQueryStockResponseDTO wareQueryStockResponseDTO = null;
+            try {
+                wareQueryStockResponseDTO = (WareQueryStockResponseDTO) XmlUtils.toObject(queryWarehouseStockResponse, WareQueryStockResponseDTO.class);
+            } catch (Exception e) {
+                LOGGER.error("解析一步达库存系统响应数据出现错误!", e);
+            }
+            if (Objects.isNull(wareQueryStockResponseDTO)) {
+                throw new ServiceException("解析一步达库存系统响应数据出现错误!");
+            }
+            List<WareQueryStockResponseDTO.WareQueryStockResponseItemDTO> items = wareQueryStockResponseDTO.getItems();
+            // 解析xml,组装成map key=>sku value=>库存
+            stockMap = new HashMap<>(16);
+            for (WareQueryStockResponseDTO.WareQueryStockResponseItemDTO item : items) {
+                String itemCode = item.getItemCode();
+                Integer quantity = item.getQuantity();
+                if (stockMap.containsKey(itemCode)) {
+                    // 避免出现sku相同情况
+                    stockMap.put(itemCode, stockMap.get(itemCode) + quantity);
+                } else {
+                    stockMap.put(itemCode, quantity);
+                }
+            }
+        } else {
+            stockMap = new HashMap<>(16);
+            for (LinkedHashMap goods : goodsList) {
+                String sku = (String) goods.get("goodsSn");
+                if (stockMap.containsKey(sku)) {
+                    // 避免出现sku相同情况
+                    stockMap.put(sku, stockMap.get(sku) + 3);
+                } else {
+                    stockMap.put(sku, 3);
+                }
+            }
+        }
 
         try {
             if (user == null) {
@@ -2278,11 +2309,11 @@ public class OrderServiceImpl implements OrderService {
             ListUtils listUtils = BeanUtils.instantiate(ListUtils.class);
             listUtils.copyList(goodsEntityList, queryGoodsVOList);
 
-            // 商品总重量
-            BigDecimal weight = new BigDecimal(0);
             //生成商户订单号
             SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
-            String orderSn = "ZWCW" + format.format(new Date()) + CommonUtil.generateOrderNumber();
+//            String orderSn = "ZMHK" + format.format(new Date()) + CommonUtil.generateOrderNumber();
+            Snowflake snowflake = IdUtil.createSnowflake(14, 14);
+            String orderSn = "8" + snowflake.nextIdStr().substring(6);
             // 检查库存和更新库存
             for (QueryGoodsVO goodsDto : queryGoodsVOList) {
                 // 要购买的数量
@@ -2402,7 +2433,7 @@ public class OrderServiceImpl implements OrderService {
 
             String openId = (String) param.get("openId");
             String memberCode = (String) param.get("memberCode");
-            UserEntity userEntity = userDao.queryByMobile((String) userInfo.get("customPhone"));
+            UserEntity userEntity = userDao.queryByOpenId((String) userInfo.get("customPhone"));
             if (userEntity == null) {
                 // 保存用户信息
                 userEntity = new UserEntity();
@@ -2414,7 +2445,7 @@ public class OrderServiceImpl implements OrderService {
                 userEntity.setRegisterTime(new Date());
                 userEntity.setLastLoginTime(new Date());
                 userEntity.setIdNo((String) userInfo.get("customIDCard"));
-                userEntity.setOpenId(openId);
+                userEntity.setOpenId(userEntity.getMobile());
                 userEntity.setMemberCode(memberCode);
                 userDao.save(userEntity);
 
@@ -2429,12 +2460,8 @@ public class OrderServiceImpl implements OrderService {
                 userEntity.setUsername((String) userInfo.get("customName"));
                 userEntity.setIdNo((String) userInfo.get("customIDCard"));
                 userEntity.setMobile((String) userInfo.get("customPhone"));
-                if (!org.springframework.util.StringUtils.isEmpty(openId)) {
-                    userEntity.setOpenId(openId);
-                }
-                if (!org.springframework.util.StringUtils.isEmpty(memberCode)) {
-                    userEntity.setMemberCode(memberCode);
-                }
+                userEntity.setOpenId(userEntity.getMobile());
+                userEntity.setMemberCode(memberCode);
                 userDao.update(userEntity);
             }
 
@@ -2501,35 +2528,36 @@ public class OrderServiceImpl implements OrderService {
 
             processRecordEntity.setPaymentStartTime(new Date());
             // 判断是微信的支付码还是支付宝的支付码
-            if (parCode.startsWith("28")) {
-                // 支付宝支付
-                try {
-                    AliPay(user, parCode, order, processRecordEntity, orderWXPayRecordCurrent, store);
-                } catch (Exception e) {
-                    LOGGER.error("支付宝支付出现异常!订单号:【{}】", order.getOrder_sn(), e);
-                    throw e;
+
+            if (!org.springframework.util.StringUtils.isEmpty(env) && Constants.PROD.equals(env)) {
+                if (parCode.startsWith("28")) {
+                    // 支付宝支付
+                    throw new ServiceException("目前暂不支持支付宝付款!请使用微信进行支付!");
+                    /*try {
+                        AliPay(user, parCode, order, processRecordEntity, orderWXPayRecordCurrent, store);
+                    } catch (Exception e) {
+                        LOGGER.error("支付宝支付出现异常!订单号:【{}】", order.getOrder_sn(), e);
+                        throw e;
+                    }*/
+                } else {
+                    // 微信支付
+                    try {
+                        wxPay(user, parCode, resultObj, order, processRecordEntity, orderWXPayRecordCurrent, store);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        throw e;
+                    }
                 }
             } else {
-                // 微信支付
-                try {
-                    wxPay(user, parCode, resultObj, order, processRecordEntity, orderWXPayRecordCurrent, store);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    throw e;
-                }
+                OrderEntity orderEntity = queryObject(order.getId());
+                orderEntity.setOrderStatus(Integer.parseInt(Dict.orderStatus.item_201.getItem()));
+                orderEntity.setPayStatus(Integer.parseInt(Dict.payStatus.item_2.getItem()));
+                orderEntity.setPayTime(new Date());
+                orderDao.update(orderEntity);
             }
 
             processRecordEntity.setPaymentStartTime(new Date());
 
-
-            // TODO 到时候要注释掉,测试用而已
-            OrderEntity orderEntity = queryObject(order.getId());
-            orderEntity.setOrderStatus(Integer.parseInt(Dict.orderStatus.item_201.getItem()));
-            orderEntity.setPayStatus(Integer.parseInt(Dict.payStatus.item_2.getItem()));
-            orderEntity.setPayTime(new Date());
-            orderDao.update(orderEntity);
-
-
             resultObj.put("shopName", store.getStoreName()); // 根据门店编号查询
             resultObj.put("userName", user.getUsername());
 
@@ -2591,7 +2619,7 @@ public class OrderServiceImpl implements OrderService {
                             orderGiftScoreRulesVo.setGenerateType(Constants.MemberScoreRulesEnum.TWO.getCode());
                             if (ratio.compareTo(BigDecimal.ZERO) > 0) {
                                 // 算出所积的分
-                                int giftScore = money.multiply(ratio).add(new BigDecimal(memberScore.get())).intValue();
+                                int giftScore = money.multiply(ratio).setScale(0, BigDecimal.ROUND_FLOOR).add(new BigDecimal(memberScore.get())).intValue();
                                 memberScore.set(giftScore);
                                 orderGiftScoreRulesVo.setGiftScore(giftScore);
                                 orderGiftScoreRulesVo.setGenerateRatio(ratio);
@@ -2607,8 +2635,9 @@ public class OrderServiceImpl implements OrderService {
 
                     }
                     if (pointsType.equals(Constants.MemberScoreRulesEnum.ONE.getCode())) {
-                        Collection<GoodsEntity> goodsEntityCollection = goodsDataMap.values();
-                        goodsEntityCollection.forEach(goodsEntity -> {
+                        Collection<GoodsEntity> values = goodsDataMap.values();
+                        Collection<GoodsEntity> entityCollection = DeepCopyUtils.depCopyHashSet(new HashSet<>(values));
+                        entityCollection.forEach(goodsEntity -> {
                             // 商品类别
                             Integer categoryId = goodsEntity.getCategoryId();
                             String sku = goodsEntity.getSku();
@@ -2620,7 +2649,7 @@ public class OrderServiceImpl implements OrderService {
                                     BigDecimal money = goodsMap.get(sku);
                                     if (ratio.compareTo(BigDecimal.ZERO) > 0) {
                                         // 算出所积的分
-                                        int giftScore = money.multiply(ratio).add(new BigDecimal(memberScore.get())).intValue();
+                                        int giftScore = money.multiply(ratio).setScale(0, BigDecimal.ROUND_FLOOR).add(new BigDecimal(memberScore.get())).intValue();
                                         memberScore.set(giftScore);
                                         orderGiftScoreRulesVo.setGiftScore(giftScore);
                                         orderGiftScoreRulesVo.setGenerateRatio(ratio);
@@ -2649,7 +2678,7 @@ public class OrderServiceImpl implements OrderService {
                                 BigDecimal money = goodsMap.get(sku);
                                 if (ratio.compareTo(BigDecimal.ZERO) != 0) {
                                     // 算出所积的分
-                                    int giftScore = money.multiply(ratio).add(new BigDecimal(memberScore.get())).intValue();
+                                    int giftScore = money.multiply(ratio).setScale(0, BigDecimal.ROUND_FLOOR).add(new BigDecimal(memberScore.get())).intValue();
                                     memberScore.set(giftScore);
                                     orderGiftScoreRulesVo.setGiftScore(giftScore);
                                     orderGiftScoreRulesVo.setGenerateRatio(ratio);
@@ -2749,10 +2778,13 @@ public class OrderServiceImpl implements OrderService {
 
             JedisUtil.del(Constants.WAREHOUSE_STOCK_MAP_KEY + "_" + storeId);
 
-            // TODO 推单测试用
-//            order.setPayApp("wxpay");
-//            order.setRequest("1111111111111111111");
-//            order.setResponse("2222222222222222222");
+
+            if (org.springframework.util.StringUtils.isEmpty(env) && Constants.TEST.equals(env)) {
+                order.setPayApp("wxpay");
+                order.setRequest("1111111111111111111");
+                order.setResponse("2222222222222222222");
+            }
+
             // 推单
             sendOrderInfoToVmcShop(order, orderGoodsVoList);
 
@@ -2791,29 +2823,35 @@ public class OrderServiceImpl implements OrderService {
         HaiKongSendOrderInfoRecordEntity haiKongSendOrderInfoRecordEntity = wrapSendOrderInfoRecord(sendOrderToVmcShopDTO);
         List<HaiKongSendOrderInfoDetailRecordEntity> detailRecordEntities = wrapSendOrderInfoDetailRecord(orderInfoItemDTOList);
 
-        // 不要用自带的工具类,处理XML字符串时有bug
-        cn.hutool.json.JSON json = JSONUtil.parse(sendOrderToVmcShopDTO);
-        String body = JSONUtil.toJsonPrettyStr(json);
 
         String orderSn = order.getOrder_sn();
         try {
-
+            String body = JacksonUtil.getObjectMapper().writeValueAsString(sendOrderToVmcShopDTO);
+            LOGGER.info("请求免税mall创建订单接口!请求体:{}", body);
             String response = vmcShopTemplate.sendOrder(body);
 
-            com.kmall.admin.haikong.utils.R<String> r = JacksonUtil.fromListJson(response, new TypeReference<com.kmall.admin.haikong.utils.R<String>>() {});
+            Response<String> r = JacksonUtil.fromListJson(response, new TypeReference<Response<String>>() {});
 
-            if (Objects.nonNull(r) && r.getCode() == 0) {
+            if (Objects.nonNull(r) && ErrorCodeConstants.VmcShopSysErrorCodeEnum.CODE_0.getCode().equals(r.getCode())) {
                 pickUpCodeService.updatePickUpCodeStatusByOrderSn(orderSn, Dict.PickUpCodeStatusEnum.item_0.getStatus());
-                haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
+                haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_SUCCESS.getStatus());
                 LOGGER.info("推送订单到免税mall成功!响应结果:{}", response);
-            } else {
+            } else if (Objects.nonNull(r) && ErrorCodeConstants.VmcShopSysErrorCodeEnum.CODE_10500.getCode().equals(r.getCode())) {
+                pickUpCodeService.updatePickUpCodeStatusByOrderSn(orderSn, Dict.PickUpCodeStatusEnum.item_6.getStatus());
+                haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
+                LOGGER.error("推送订单到免税mall失败!响应结果:{}", response);
+            } else if (Objects.isNull(r)) {
                 pickUpCodeService.updatePickUpCodeStatusByOrderSn(orderSn, Dict.PickUpCodeStatusEnum.item_6.getStatus());
                 haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.WAIT_RESEND.getStatus());
                 LOGGER.error("推送订单到免税mall失败!响应结果:{}", response);
+            } else {
+                pickUpCodeService.updatePickUpCodeStatusByOrderSn(orderSn, Dict.PickUpCodeStatusEnum.item_6.getStatus());
+                haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
+                LOGGER.error("推送订单到免税mall失败!响应结果:{}", response);
             }
         } catch (Exception e) {
             pickUpCodeService.updatePickUpCodeStatusByOrderSn(orderSn, Dict.PickUpCodeStatusEnum.item_6.getStatus());
-            haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.WAIT_RESEND.getStatus());
+            haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
             LOGGER.error("推送订单到免税mall失败!出现异常!", e);
         }
 
@@ -2856,7 +2894,11 @@ public class OrderServiceImpl implements OrderService {
      */
     private SeaportInfoDTO wrapSeaportInfo(OrderVo order) {
         SeaportInfoDTO seaportInfoDTO = new SeaportInfoDTO();
-        seaportInfoDTO.setSeaportCode("4600");
+        String value = sysConfigDao.queryByKey(Constants.CUSTOMS_PORT_CODE);
+        if (org.springframework.util.StringUtils.isEmpty(value)) {
+            throw new ServiceException("未配置海关口岸代码!配置方式:【系统管理】->【系统参数】");
+        }
+        seaportInfoDTO.setSeaportCode(value);
         seaportInfoDTO.setPlatform("1");
         seaportInfoDTO.setIdentityCard(order.getIdCard());
         seaportInfoDTO.setIdentityName(order.getPay_name());
@@ -2874,7 +2916,9 @@ public class OrderServiceImpl implements OrderService {
         payInfoDTO.setMoney(order.getActual_price());
         payInfoDTO.setPayMode("offline");
         payInfoDTO.setRequest(order.getRequest());
-        payInfoDTO.setResponse(order.getResponse());
+        String response = order.getResponse();
+        response = response.replaceAll("\r|\n", "");
+        payInfoDTO.setResponse(response);
         payInfoDTO.setOutTradeNo(order.getAliTradeNo());
         return payInfoDTO;
     }
@@ -2895,8 +2939,9 @@ public class OrderServiceImpl implements OrderService {
         orderInfoItemDTO.setPrice(orderGoodsVo.getRetail_price());
         orderInfoItemDTO.setItemcode(orderGoodsVo.getSku());
         orderInfoItemDTO.setAmount(orderGoodsVo.getActualPaymentAmount());
+        orderInfoItemDTO.setBuyPrice(orderGoodsVo.getActualPaymentAmount());
         orderInfoItemDTO.setNums(orderGoodsVo.getNumber());
-        orderInfoItemDTO.setTax(true);
+        orderInfoItemDTO.setTax("true");
         orderInfoItemDTO.setTaxPrice(orderGoodsVo.getTaxPrice());
         return orderInfoItemDTO;
     }
@@ -2922,6 +2967,7 @@ public class OrderServiceImpl implements OrderService {
         orderInfoDTO.setConsigneeMobile(order.getMobile());
         orderInfoDTO.setQuantity(order.getNumber());
         orderInfoDTO.setOrderTotal(order.getActual_price());
+        orderInfoDTO.setFinallyCartAmount(order.getActual_price());
         orderInfoDTO.setPlatform("store");
 
         return orderInfoDTO;
@@ -3170,21 +3216,28 @@ public class OrderServiceImpl implements OrderService {
 
         if (atomicBoolean.get()) {
             // 推送支付单
-            sendWxPayInfo(order, store);
+            sendWxPayInfo(order, store, wechatMicropayApiResult);
         }
 
     }
 
-    private void sendWxPayInfo(OrderVo order, StoreEntity store) {
+    private void sendWxPayInfo(OrderVo order, StoreEntity store, WechatMicropayApiResult wechatMicropayApiResult) {
         // 组装支付单信息
+        String payTransactionId = "";
+        if (Objects.nonNull(wechatMicropayApiResult)) {
+            payTransactionId = wechatMicropayApiResult.getTransaction_id();
+        } else {
+            payTransactionId = order.getPayTransactionId();
+        }
+
         Map<String, Object> orderSendCusParams = new HashMap<>();
         orderSendCusParams.put("merchSn", order.getMerchSn());
         orderSendCusParams.put("orderSn", order.getOrder_sn());
         orderSendCusParams.put("merchName", order.getMerchName());
         orderSendCusParams.put("thirdPartyMerchCode", store.getThirdPartyMerchCode());
         orderSendCusParams.put("thirdPartyMerchName", store.getThirdPartyMerchName());
-        orderSendCusParams.put("outTradeNo", order.getMerchOrderSn());
-        orderSendCusParams.put("transactionId", order.getPayTransactionId());
+        orderSendCusParams.put("outTradeNo", order.getOrder_sn());
+        orderSendCusParams.put("transactionId", payTransactionId);
         orderSendCusParams.put("subOrderId", "");   // ccnet原逻辑没有对该字段赋值
         orderSendCusParams.put("subOrderNo", order.getOrder_sn());
         orderSendCusParams.put("feeType", order.getFeeType());
@@ -3209,8 +3262,8 @@ public class OrderServiceImpl implements OrderService {
     private void syncMemberConsumeRecord(String memberPhone, OrderVo order, Integer deductionScore) {
         HaiKongMemberOrderSyncResendEntity haiKongMemberOrderSyncResendEntity = new HaiKongMemberOrderSyncResendEntity();
         MemberOrderInfoSyncDTO memberOrderInfoSyncDTO = new MemberOrderInfoSyncDTO();
-        memberOrderInfoSyncDTO.setPhone(memberPhone);
         memberOrderInfoSyncDTO.setOrderNo(order.getOrder_sn());
+        memberOrderInfoSyncDTO.setOpenId(memberPhone);
         memberOrderInfoSyncDTO.setConsumeDate(new Date());
         memberOrderInfoSyncDTO.setOrderAmount(order.getActual_price());
         memberOrderInfoSyncDTO.setOrderScore(deductionScore);
@@ -3218,25 +3271,28 @@ public class OrderServiceImpl implements OrderService {
         Date date = new Date();
         haiKongMemberOrderSyncResendEntity.setCreateTime(date);
         haiKongMemberOrderSyncResendEntity.setLastResendTime(date);
+        haiKongMemberOrderSyncResendEntity.setPhone(memberPhone);
         try {
             String body = JacksonUtil.toJson(memberOrderInfoSyncDTO);
             LOGGER.info("请求会员系统同步消费订单接口!请求体:{}", body);
             // 发送请求
             String memberOrderSyncResponseJson = haiKongMemberTemplate.memberOrderSync(body);
             LOGGER.info("请求会员系统同步消费订单接口!响应:{}", memberOrderSyncResponseJson);
-            Response<Long> response = JacksonUtil.fromListJson(memberOrderSyncResponseJson, new TypeReference<Response<Long>>() {});
+            Response<String> response = JacksonUtil.fromListJson(memberOrderSyncResponseJson, new TypeReference<Response<String>>() {});
             if (Objects.nonNull(response) && response.getSuccess()) {
                 haiKongMemberOrderSyncResendEntity.setMemberSysOrderId(response.getData());
-                haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
-            } else {
+                haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_SUCCESS.getStatus());
+            } /*else if (Objects.nonNull(response) && ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_500.getCode().equals(response.getCode())) {
                 haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.WAIT_RESEND.getStatus());
+            }*/ else {
+                haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
             }
             haiKongMemberOrderSyncResendService.save(haiKongMemberOrderSyncResendEntity);
             LOGGER.info("请求会员系统同步消费订单接口成功!");
         } catch (Exception e) {
             LOGGER.error("请求会员系统同步消费订单接口出现异常!准备新增发送失败记录,等待重发!异常信息:", e);
             // 没有请求成功,写表,重发
-            haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.WAIT_RESEND.getStatus());
+            haiKongMemberOrderSyncResendEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
             haiKongMemberOrderSyncResendService.save(haiKongMemberOrderSyncResendEntity);
         }
     }
@@ -3277,23 +3333,25 @@ public class OrderServiceImpl implements OrderService {
             String changeMemberScoreResponseJson = haiKongMemberTemplate.changeMemberScore(body);
             LOGGER.info("请求会员系统积分变动接口!响应数据:{}", changeMemberScoreResponseJson);
             Response<MemberScoreChangeResponseDTO> response = JacksonUtil.fromListJson(changeMemberScoreResponseJson, new TypeReference<Response<MemberScoreChangeResponseDTO>>() {});
-            if (Objects.nonNull(response) && response.getSuccess()) {
+            if (Objects.nonNull(response) && ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_0.getCode().equals(response.getCode())) {
                 MemberScoreChangeResponseDTO responseData = response.getData();
                 haiKongMemberScoreChangeRecordEntity.setStatementId(responseData.getStatementId());
-                haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
-            } else {
+                haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.RESEND_SUCCESS.getStatus());
+            } else if (Objects.nonNull(response) && ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_500.getCode().equals(response.getCode())) {
                 haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.WAIT_RESEND.getStatus());
+            } else {
+                haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
             }
             haiKongMemberScoreChangeRecordService.save(haiKongMemberScoreChangeRecordEntity);
             LOGGER.info("请求会员系统积分变动接口成功!");
         } catch (Exception e) {
             LOGGER.error("请求会员系统积分变动接口出现异常!准备新增发送失败记录,等待重发!异常信息:", e);
             // 失败重发
-            haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.WAIT_RESEND.getStatus());
+            haiKongMemberScoreChangeRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
             haiKongMemberScoreChangeRecordService.save(haiKongMemberScoreChangeRecordEntity);
         }
         LOGGER.info("保存会员系统积分变动详情记录中......");
-        List<HaiKongMemberScoreChangeDetailRecordEntity> recordEntityList = goodsList.stream().map(goodsEntity -> {
+        List<HaiKongMemberScoreChangeDetailRecordEntity> recordEntityList = goodsList.stream().distinct().map(goodsEntity -> {
             HaiKongMemberScoreChangeDetailRecordEntity entity = new HaiKongMemberScoreChangeDetailRecordEntity();
             String sku = goodsEntity.getSku();
             OrderGiftScoreRulesVo orderGiftScoreRulesVo = giftGoodsScoreDetailMap.get(sku);
@@ -4231,7 +4289,7 @@ public class OrderServiceImpl implements OrderService {
             if (Objects.nonNull(activity)) {
                 good.setActivity(null);
             }
-            BigDecimal actualPaymentAmount = good.getActualPaymentAmount();
+            BigDecimal actualPaymentAmount = good.getActualPaymentAmount().multiply(BigDecimal.valueOf(good.getSellVolume()));
             good.setActualPaymentAmount(good.getRetailPrice());
 
             QueryGoodsVO queryGoodsVo = new QueryGoodsVO();
@@ -4240,7 +4298,7 @@ public class OrderServiceImpl implements OrderService {
             queryGoodsVo.setStoreId(Long.parseLong(storeId));
             queryGoodsVo.setDisCountedPrice(BigDecimal.ZERO);
             queryGoodsVo.setTotalPrice(actualPaymentAmount);
-            orderTotalPrice = orderTotalPrice.add(good.getRetailPrice());
+            orderTotalPrice = orderTotalPrice.add(good.getRetailPrice().multiply(BigDecimal.valueOf(good.getSellVolume())));
             goodsVos.add(queryGoodsVo);
         }
         calculateOrderDiscountPriceResponseVO.setOrderTotalPrice(orderTotalPrice);
@@ -4254,7 +4312,7 @@ public class OrderServiceImpl implements OrderService {
          * 2.查询当前时间,该门店是否有活动,如果有活动,查询开启了哪些营销方式
          * 参数: 当前时间  门店id
          */
-        List<MkActivitiesEntity> mkActivitiesEntityList = mkActivitiesService.queryByNow(storeId, DateUtils.format(new Date(), "yyyy-MM-dd"));
+        List<MkActivitiesEntity> mkActivitiesEntityList = mkActivitiesService.queryByNow(storeId, DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
         // 活动优先级判定,特价>打折>满减/满赠>优惠券>积分抵扣;
 //        List<Constants.ActivityTopicEnum> activityTopicEnums = Arrays.asList(Constants.ActivityTopicEnum.values());
 //        for (MkActivitiesEntity mkActivitiesEntity : mkActivitiesEntityList) {
@@ -4557,13 +4615,15 @@ public class OrderServiceImpl implements OrderService {
             queryGoodsVo.setSku(good.getGoodsSn());
             queryGoodsVo.setStoreId(Long.parseLong(storeId));
             queryGoodsVo.setDisCountedPrice(BigDecimal.ZERO);
-            queryGoodsVo.setTotalPrice(good.getActualPaymentAmount());
-            orderTotalPrice = orderTotalPrice.add(good.getActualPaymentAmount());
+            queryGoodsVo.setTotalPrice(good.getActualPaymentAmount().multiply(BigDecimal.valueOf(good.getSellVolume())));
+            orderTotalPrice = orderTotalPrice.add(good.getActualPaymentAmount().multiply(BigDecimal.valueOf(good.getSellVolume())));
             goodsVos.add(queryGoodsVo);
         }
         calculateOrderDiscountPriceResponseVO.setOrderTotalPrice(orderTotalPrice);
         calculateOrderDiscountPriceResponseVO.setGoodsDetailsDtos(goodsDetailsDtos);
-
+        calculateOrderDiscountPriceResponseVO.setLevelName("无");
+        calculateOrderDiscountPriceResponseVO.setMemberCurrentAvailableScore(0);
+        calculateOrderDiscountPriceResponseVO.setDeductionScore(0);
 
         // 计算完活动优惠后,计算积分抵扣。(活动与积分抵扣不互斥)
         if (!org.springframework.util.StringUtils.isEmpty(memberCode)) {
@@ -4571,11 +4631,19 @@ public class OrderServiceImpl implements OrderService {
             Response<Object> response;
             try {
                 // 查询会员信息
-                memberInfoByCodeResponseJson = haiKongMemberTemplate.getMemberInfoByPhone("{\"phone\":" + memberCode + "}");
+                if (memberCode.trim().length() == 11) {
+                    memberInfoByCodeResponseJson = haiKongMemberTemplate.getMemberInfoByPhone("{\"phone\":\"" + memberCode + "\"}");
+                } else {
+                    memberInfoByCodeResponseJson = haiKongMemberTemplate.getMemberInfoByCode("{\"code\":\"" + memberCode + "\"}");
+                }
                 response = JacksonUtil.fromListJson(memberInfoByCodeResponseJson, new TypeReference<Response<Object>>() {
                 });
-                if (Objects.isNull(response) || Objects.nonNull(response.getErrorCode())) {
+                if (Objects.isNull(response)) {
                     LOGGER.error("请求会员系统出现异常!error:{}", memberInfoByCodeResponseJson);
+                    if (ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_401.getCode().equals(response.getCode())) {
+                        JedisUtil.del(Constants.MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY);
+                        throw new ServiceException(String.format("请求会员系统出现异常!会员码:%s,error:%s", memberCode, ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_401.getDesc()));
+                    }
                     throw new ServiceException(String.format("请求会员系统出现异常!会员码:%s,error:%s", memberCode, memberInfoByCodeResponseJson));
                 }
             } catch (Exception e) {
@@ -4587,28 +4655,37 @@ public class OrderServiceImpl implements OrderService {
                 MemberInfoDTO memberInfoDTO = JacksonUtil.fromStringJson(JacksonUtil.toJson(response.getData()), MemberInfoDTO.class);
                 assert memberInfoDTO != null : String.format("会员码:【%s】会员信息错误!%s", memberCode, JacksonUtil.toJson(response));
                 // 查询会员表
+                calculateOrderDiscountPriceResponseVO.setOpenId(memberInfoDTO.getOpenId());
+                calculateOrderDiscountPriceResponseVO.setMemberPhone(memberInfoDTO.getPhone());
+                calculateOrderDiscountPriceResponseVO.setMemberCurrentAvailableScore(memberInfoDTO.getScore());
+                calculateOrderDiscountPriceResponseVO.setLevelName(memberInfoDTO.getLevelName());
                 UserEntity userEntity = userService.queryByOpenId(memberInfoDTO.getOpenId());
+                String openId = memberInfoDTO.getOpenId();
                 if (Objects.isNull(userEntity)) {
                     userEntity = new UserEntity();
-                    userEntity.setOpenId(memberInfoDTO.getOpenId());
+                    userEntity.setOpenId(openId);
                     userEntity.setMemberCode(memberCode);
+                    userEntity.setMobile(openId);
                     userService.save(userEntity);
+                } else {
+                    userEntity.setOpenId(openId);
+                    userEntity.setMobile(openId);
+                    userEntity.setMemberCode(memberCode);
+                    userService.update(userEntity);
                 }
                 Integer score = memberInfoDTO.getScore();
                 if (Objects.nonNull(score) && score > 0) {
                     // 有积分
-                    afterDiscountPrice = calculatePreferentialPrice(orderTotalPrice, score, memberCode, calculateOrderDiscountPriceResponseVO, goodsDetailsDtos, promotionSkuList, mkActivitiesEntityList);
-                    LOGGER.info("会员【{}】,当前积分:{},积分抵扣后的订单金额:{},积分抵扣前的订单金额:{}", memberCode, score, afterDiscountPrice, orderTotalPrice);
+                    afterDiscountPrice = calculatePreferentialPrice(orderTotalPrice, score, memberCode, openId, calculateOrderDiscountPriceResponseVO, goodsDetailsDtos, promotionSkuList, mkActivitiesEntityList);
+                    LOGGER.info("会员【{}】,当前积分:{},积分抵扣后的订单金额:{},积分抵扣前的订单金额:{}", openId, score, afterDiscountPrice, orderTotalPrice);
                     calculateOrderDiscountPriceResponseVO.setOrderTotalPrice(afterDiscountPrice);
                     calculateOrderDiscountPriceResponseVO.setGoodsDetailsDtos(goodsDetailsDtos);
                     calculateOrderDiscountPriceResponseVO.setBeforeScore(score);
-                    calculateOrderDiscountPriceResponseVO.setOpenId(memberInfoDTO.getOpenId());
-                    calculateOrderDiscountPriceResponseVO.setMemberPhone(memberInfoDTO.getPhone());
                     // 订单完成后再添加积分消费记录,以及同步积分信息
                     return calculateOrderDiscountPriceResponseVO;
                 } else {
-                    LOGGER.error("会员【{}】积分为0,积分抵扣失败!", memberCode);
-                    throw new ServiceException(String.format("会员【%s】积分为0,积分抵扣失败!", memberCode));
+                    LOGGER.error("会员【{}】积分为0,积分抵扣失败!", openId);
+                    return calculateOrderDiscountPriceResponseVO;
                 }
             } else {
                 LOGGER.error("查询会员信息失败!响应结果:{}", memberInfoByCodeResponseJson);
@@ -4629,15 +4706,18 @@ public class OrderServiceImpl implements OrderService {
      * @param orderTotalPrice   订单商品总价
      * @param score             积分
      * @param memberCode        会员码
+     * @param openId            会员open_id:手机号
      * @param goodsDetailsDtos  订单商品详情
      * @param calculateOrderDiscountPriceResponseVO 响应数据
      * @param promotionSkuList  参与了限时特价活动并且与积分抵扣互斥的sku集合
+     * @param mkActivitiesEntityList 根据优先级排序后的活动集合
      *
      * @return                  积分抵扣后的订单总金额
      */
     private BigDecimal calculatePreferentialPrice(BigDecimal orderTotalPrice,
                                                   Integer score,
                                                   String memberCode,
+                                                  String openId,
                                                   CalculateOrderDiscountPriceResponseVO calculateOrderDiscountPriceResponseVO,
                                                   List<GoodsDetailsDto> goodsDetailsDtos,
                                                   List<String> promotionSkuList,
@@ -4668,11 +4748,13 @@ public class OrderServiceImpl implements OrderService {
                 .filter(m -> Constants.RejectStatus.ALLOW.getCode().equals(m.getReject()))
                 .map(MkActivitiesScoreEntity::getSku)
                 .collect(Collectors.toList());
+        LOGGER.info("参与积分抵扣的sku集合:{}", scoreDeductionAllowSkuList);
         // 不参与积分抵扣的sku集合,如果该list不为空,则默认其余的sku参与积分抵扣
         List<String> scoreDeductionRejectSkuList = mkActivitiesScoreEntities.stream()
                 .filter(m -> Constants.RejectStatus.REJECT.getCode().equals(m.getReject()))
                 .map(MkActivitiesScoreEntity::getSku)
                 .collect(Collectors.toList());
+        LOGGER.info("不参与积分抵扣的sku集合:{}", scoreDeductionRejectSkuList);
 
         if (!CollectionUtils.isEmpty(scoreDeductionAllowSkuList) && !CollectionUtils.isEmpty(scoreDeductionRejectSkuList)) {
             LOGGER.error("积分抵扣表中既有参与又有不参与!与需求不符!");
@@ -4688,14 +4770,10 @@ public class OrderServiceImpl implements OrderService {
         for (GoodsDetailsDto goodsDetailsDto : goodsDetailsDtos) {
             String sku = goodsDetailsDto.getGoodsSn();
             if (!promotionSkuList.contains(sku)) {
-                if (CollectionUtils.isEmpty(scoreDeductionAllowSkuList) && !CollectionUtils.isEmpty(scoreDeductionRejectSkuList)) {
-                    if (!scoreDeductionRejectSkuList.contains(sku)) {
-                        BigDecimal skuActualPaymentAmount = goodsDetailsDto.getActualPaymentAmount();
-                        skuTotalPrice = skuTotalPrice.add(skuActualPaymentAmount);
-                    }
-                } else if (!CollectionUtils.isEmpty(scoreDeductionAllowSkuList) && CollectionUtils.isEmpty(scoreDeductionRejectSkuList)) {
+                if (!CollectionUtils.isEmpty(scoreDeductionAllowSkuList) && CollectionUtils.isEmpty(scoreDeductionRejectSkuList)) {
                     if (scoreDeductionAllowSkuList.contains(sku)) {
-                        BigDecimal skuActualPaymentAmount = goodsDetailsDto.getActualPaymentAmount();
+                        BigDecimal skuActualPaymentAmount = goodsDetailsDto.getActualPaymentAmount()
+                                .multiply(BigDecimal.valueOf(goodsDetailsDto.getSellVolume()));
                         skuTotalPrice = skuTotalPrice.add(skuActualPaymentAmount);
                     }
                 }
@@ -4711,30 +4789,38 @@ public class OrderServiceImpl implements OrderService {
             }
             Integer scoreLimit = Integer.parseInt(scoreLimitStr);
             if (score < scoreLimit) {
-                LOGGER.error("用户【{}】的积分数量为:{},最低需要{}积分才能抵扣!", memberCode, score, scoreLimit);
+                LOGGER.error("会员码【{}】用户【{}】的积分数量为:{},最低需要{}积分才能抵扣!", memberCode, openId, score, scoreLimit);
                 calculateOrderDiscountPriceResponseVO.setAfterScore(score);
-                throw new ServiceException(String.format("用户【%s】的积分数量为:%s,最低需要%s积分才能抵扣!", memberCode, score, scoreLimit));
+                return orderTotalPrice;
+//                throw new ServiceException(String.format("用户【%s】的积分数量为:%s,最低需要%s积分才能抵扣!", openId, score, scoreLimit));
             } else {
                 // 积分取整
                 int scoreInteger = score % scoreLimit == 0 ? score : score - (score % scoreLimit);
                 // 过滤掉参与过限时特价并且与积分抵扣互斥的sku,以及未参加积分抵扣活动的sku
                 goodsDetailsDtos = goodsDetailsDtos.stream().filter(goodsDetailsDto -> {
                     String sku = goodsDetailsDto.getSku();
+
+                    // 满赠商品不参与积分分摊计算
+                    if (Constants.ActivityTopicEnum.MZ.getTopicName().equals(goodsDetailsDto.getActivity())) {
+                        return false;
+                    }
+                    // 如果临时促销中定义了该sku不参与,那么根据优先级不管该商品在积分抵扣中如何设置,都认定为不参与
                     if (!promotionSkuList.contains(sku)) {
                         // 如果导入的商品都为不参与,则其余的商品都默认参与积分抵扣活动
-                        if (CollectionUtils.isEmpty(scoreDeductionAllowSkuList) && !CollectionUtils.isEmpty(scoreDeductionRejectSkuList)) {
-                            if (!scoreDeductionRejectSkuList.contains(sku)) {
-                                return true;
-                            }
+                        if (CollectionUtils.isEmpty(scoreDeductionAllowSkuList) &&
+                                !CollectionUtils.isEmpty(scoreDeductionRejectSkuList) &&
+                                !scoreDeductionRejectSkuList.contains(sku)) {
+                            return true;
+                        }
                         // 如果导入的商品都为参与,则默认其余商品不参与
-                        } else if (!CollectionUtils.isEmpty(scoreDeductionAllowSkuList) && CollectionUtils.isEmpty(scoreDeductionRejectSkuList)) {
-                            if (scoreDeductionAllowSkuList.contains(sku)) {
-                                return true;
-                            }
+                        if (!CollectionUtils.isEmpty(scoreDeductionAllowSkuList) &&
+                                CollectionUtils.isEmpty(scoreDeductionRejectSkuList) &&
+                                scoreDeductionAllowSkuList.contains(sku)) {
+                            return true;
                         }
                     }
-                    // 满赠商品不参与积分分摊计算
-                    return !Constants.ActivityTopicEnum.MZ.getTopicName().equals(goodsDetailsDto.getActivity());
+                    // 临时促销中有这个sku,说明不参与积分抵扣
+                    return false;
                 }).collect(Collectors.toList());
                 // 系统设置的最大抵扣比例(最多能抵扣订单金额的比例),在系统管理的系统参数中设置,KEY为 HAIKONG_MEMBER_MAX_SCORE_RATIO
                 String scoreRatioStr = sysConfigDao.queryByKey(Constants.HAIKONG_MEMBER_MAX_SCORE_RATIO);
@@ -4761,10 +4847,10 @@ public class OrderServiceImpl implements OrderService {
                     String sku = goodsDetailsDto.getGoodsSn();
                     String prodBarcode = goodsDetailsDto.getProdBarcode();
                     // 此字段 = 零售价 - 其他活动优惠金额
-                    BigDecimal actualPaymentAmount = goodsDetailsDto.getActualPaymentAmount();
+                    BigDecimal actualPaymentAmount = goodsDetailsDto.getActualPaymentAmount()
+                            .multiply(BigDecimal.valueOf(goodsDetailsDto.getSellVolume()));
                     // 当前商品最大支持抵扣的金额
-                    BigDecimal currentSkuMaxDeductionPrice = actualPaymentAmount.multiply(BigDecimal.valueOf(goodsDetailsDto.getSellVolume()))
-                                                                                .multiply(scoreRatio).setScale(0, BigDecimal.ROUND_FLOOR);
+                    BigDecimal currentSkuMaxDeductionPrice = actualPaymentAmount.multiply(scoreRatio).setScale(0, BigDecimal.ROUND_FLOOR);
                     // 其他活动优惠金额
                     BigDecimal otherDiscountedPrice = Objects.isNull(goodsDetailsDto.getDiscountedPrice()) ? BigDecimal.ZERO : goodsDetailsDto.getDiscountedPrice();
 
@@ -4828,10 +4914,10 @@ public class OrderServiceImpl implements OrderService {
                 calculateOrderDiscountPriceResponseVO.setOrderTotalPrice(orderTotalPrice);
                 // 积分抵扣的总金额
                 calculateOrderDiscountPriceResponseVO.setScoreDeductionPrice(goodsDetailScoreDeductionPrice);
-                LOGGER.info("会员【{}】,当前积分:{},抵扣订单金额后剩余积分:{}", memberCode, score, afterScore);
+                LOGGER.info("会员【{}】会员码【{}】,当前积分:{},抵扣订单金额后剩余积分:{}", openId, memberCode, score, afterScore);
             }
         } else {
-            LOGGER.info("会员【{}】的积分小于积分抵扣最低值,不参加积分抵扣!", memberCode);
+            LOGGER.info("会员【{}】会员码【{}】的积分小于积分抵扣最低值,不参加积分抵扣!", openId, memberCode);
         }
         return orderTotalPrice;
     }
@@ -5172,7 +5258,7 @@ public class OrderServiceImpl implements OrderService {
         /*GoodsEntity goodsEntity = goodsService.queryObject(goodsDto.getId().intValue());
         BigDecimal goodsTax = CalculateTax.calculateFinalTax(goodsEntity, goodsDto.getStoreRetailPrice(), goodsService).setScale(3, RoundingMode.HALF_UP);
         goodsTax = goodsTax.multiply(number).setScale(2, RoundingMode.HALF_UP);*/
-        orderGoodsVo.setTaxPrice(goodsDto.getGoodsTaxes());
+        orderGoodsVo.setTaxPrice(goodsDto.getGoodsTaxes().divide(BigDecimal.valueOf(goodsDto.getSellVolume()), 3, BigDecimal.ROUND_HALF_UP));
 
         return orderGoodsVo;
     }
@@ -5268,8 +5354,15 @@ public class OrderServiceImpl implements OrderService {
                     LOGGER.info("=======> [integralTask-----重推退款积分]" + responseMsg);
 
                     //解析数据
-                    if ("true".equals(res.get("success").toString())) {
+                    if (!CollectionUtils.isEmpty(res) && ErrorCodeConstants.MemberSysErrorCodeEnum.CODE_0.getCode().equals(res.get("code"))) {
+                        HaiKongResendMsgEntity haiKongResendMsgEntity = new HaiKongResendMsgEntity();
+                        haiKongResendMsgEntity.setResponseMsg(responseMsg);
+                        haiKongResendMsgEntity.setResendNum(haiKongResendMsg.getResendNum()+1);
+                        haiKongResendMsgEntity.setResendTime(date);
+                        haiKongResendMsgEntity.setId(haiKongResendMsg.getId());
+                        haiKongResendMsgEntity.setIsValid(2);
                         LOGGER.info("=======> [integralTask-----重推退款积分]" + responseMsg);
+                        haiKongResendMsgDao.updateResendMsg(haiKongResendMsgEntity);
                     } else {
                         LOGGER.error("=======> [integralTask-----重推退款积分]" + responseMsg);
                         HaiKongResendMsgEntity haiKongResendMsgEntity = new HaiKongResendMsgEntity();
@@ -5279,7 +5372,6 @@ public class OrderServiceImpl implements OrderService {
                         haiKongResendMsgEntity.setId(haiKongResendMsg.getId());
                         haiKongResendMsgDao.updateResendMsg(haiKongResendMsgEntity);
                     }
-
                 }
             }
 

+ 5 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/PickUpCodeServiceImpl.java

@@ -110,4 +110,9 @@ public class PickUpCodeServiceImpl implements PickUpCodeService {
     public void updatePickUpCode(Map<String, String> pickUpCodeMap) {
         pickUpCodeDao.updatePickUpCode(pickUpCodeMap);
     }
+
+    @Override
+    public void updateBatchPickUpCodeStatus(List<String> orderSnList, String pickUpCodeStatus) {
+        pickUpCodeDao.updateBatchPickUpCodeStatus(orderSnList, pickUpCodeStatus);
+    }
 }

+ 4 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/haikong/HaikongSendOrderInfoRecordServiceImpl.java

@@ -2,12 +2,16 @@ package com.kmall.admin.service.impl.haikong;
 
 import com.kmall.admin.dao.haikong.HaiKongSendOrderInfoRecordDao;
 import com.kmall.admin.entity.haikong.HaiKongSendOrderInfoRecordEntity;
+import com.kmall.admin.service.PickUpCodeService;
 import com.kmall.admin.service.haikong.HaiKongSendOrderInfoRecordService;
+import com.kmall.common.constant.Dict;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 
 /**

+ 5 - 20
kmall-admin/src/main/java/com/kmall/admin/service/impl/mk/MkActivitiesScoreServiceImpl.java

@@ -112,16 +112,13 @@ public class MkActivitiesScoreServiceImpl implements MkActivitiesScoreService {
                 builder.put("sku", "商品SKU");
                 builder.put("prodBarcode", "商品条码");
                 builder.put("reject", "是否参与");
-                builder.put("deadlineStr", "截止日期");
 
                 R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
                 if (Integer.valueOf(r.get("code").toString()) != 0) {
                     throw new RRException(r.get("msg").toString());
                 }
 
-                Date nowTime = new Date();
-
-                MkActivitiesScoreEntity mkActivitiesScoreEntity = queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(scoreReductionDTO.getProdBarcode(), scoreReductionDTO.getSku(), scoreReductionDTO.getStoreId(), nowTime);
+                MkActivitiesScoreEntity mkActivitiesScoreEntity = queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(scoreReductionDTO.getProdBarcode(), scoreReductionDTO.getSku(), scoreReductionDTO.getStoreId());
 
                 if (Objects.nonNull(mkActivitiesScoreEntity)) {
                     throw new RRException("该商品已经参与本次活动,商品{"+mkActivitiesScoreEntity.getProdBarcode()+"},sku,{"+mkActivitiesScoreEntity.getSku()+"}", 500);
@@ -130,8 +127,8 @@ public class MkActivitiesScoreServiceImpl implements MkActivitiesScoreService {
                 MkActivitiesScoreEntity scoreEntity = new MkActivitiesScoreEntity();
                 BeanUtils.copyProperties(scoreReductionDTO, scoreEntity);
                 Date updateTime = new Date();
-                DateTime dateTime = DateUtil.parseDate(scoreReductionDTO.getDeadlineStr());
-                scoreEntity.setDeadline(dateTime);
+//                DateTime dateTime = DateUtil.parseDate(scoreReductionDTO.getDeadlineStr());
+//                scoreEntity.setDeadline(dateTime);
                 scoreEntity.setMkaId(Long.parseLong(mkaId));
                 scoreEntity.setCreaterSn("0");
                 scoreEntity.setCreateTime(updateTime);
@@ -153,12 +150,11 @@ public class MkActivitiesScoreServiceImpl implements MkActivitiesScoreService {
      * @param prodBarcode 条码
      * @param sku         sku
      * @param storeId     门店id
-     * @param nowTime     当前时间
      * @return 实体
      */
     @Override
-    public MkActivitiesScoreEntity queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(String prodBarcode, String sku, Integer storeId, Date nowTime) {
-        return mkActivitiesScoreDao.queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(prodBarcode, sku, storeId, nowTime);
+    public MkActivitiesScoreEntity queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(String prodBarcode, String sku, Integer storeId) {
+        return mkActivitiesScoreDao.queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(prodBarcode, sku, storeId);
     }
 
     /**
@@ -173,17 +169,6 @@ public class MkActivitiesScoreServiceImpl implements MkActivitiesScoreService {
     }
 
     /**
-     * 查询当前时间的参与积分抵扣的sku
-     *
-     * @param date 当前时间
-     * @return sku
-     */
-    @Override
-    public List<MkActivitiesScoreEntity> queryDetailByTime(Date date) {
-        return mkActivitiesScoreDao.queryDetailByTime(date);
-    }
-
-    /**
      * 查询积分抵扣活动信息
      *
      * @param mkaIdList 活动id集合

+ 1 - 9
kmall-admin/src/main/java/com/kmall/admin/service/mk/MkActivitiesScoreService.java

@@ -86,10 +86,9 @@ public interface MkActivitiesScoreService {
      * @param prodBarcode   条码
      * @param sku           sku
      * @param storeId       storeId
-     * @param nowTime       当前时间
      * @return              实体
      */
-    MkActivitiesScoreEntity queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(String prodBarcode, String sku, Integer storeId, Date nowTime);
+    MkActivitiesScoreEntity queryEntityByProdBarcodeAndSkuAndStoreIdAndTime(String prodBarcode, String sku, Integer storeId);
 
     /**
      * 批量新增
@@ -98,13 +97,6 @@ public interface MkActivitiesScoreService {
     void saveBatch(List<MkActivitiesScoreEntity> mkActivitiesScoreEntities);
 
     /**
-     * 查询当前时间的参与积分抵扣的sku
-     * @param date  当前时间
-     * @return      sku
-     */
-    List<MkActivitiesScoreEntity> queryDetailByTime(Date date);
-
-    /**
      * 查询积分抵扣活动信息
      * @param mkaIdList 活动id集合
      * @return          活动

+ 0 - 1
kmall-admin/src/main/resources/XmlTemplate/ScoreReductionDTOList.xml

@@ -9,7 +9,6 @@
                 <mapping row="1" col="1">ScoreReductionDTO.prodBarcode</mapping>
                 <mapping row="1" col="2">ScoreReductionDTO.sku</mapping>
                 <mapping row="1" col="3">ScoreReductionDTO.reject</mapping>
-                <mapping row="1" col="4">ScoreReductionDTO.deadlineStr</mapping>
             </section>
             <loopbreakcondition>
                 <rowcheck offset="0">

+ 0 - 1
kmall-admin/src/main/resources/XmlTemplate/TemporaryPromotionalItemsDtoList.xml

@@ -12,7 +12,6 @@
                 <mapping row="1" col="3">TemporaryPromotionalItemsDto.goodsName</mapping>
                 <mapping row="1" col="5">TemporaryPromotionalItemsDto.activitiesPrice</mapping>
                 <mapping row="1" col="6">TemporaryPromotionalItemsDto.rejectScore</mapping>
-                <mapping row="1" col="7">TemporaryPromotionalItemsDto.deadline</mapping>
             </section>
             <loopbreakcondition>
                 <rowcheck offset="0">

+ 24 - 11
kmall-admin/src/main/resources/conf/cuspay/cuspay-wx.properties

@@ -5,28 +5,41 @@
 wx.payment.declare.url=https://api.mch.weixin.qq.com/cgi-bin/mch/customs/customdeclareorder
 wx.payment.query.url=https://api.mch.weixin.qq.com/cgi-bin/mch/customs/customdeclarequery
 
-# \u5546\u6237\u4FE1\u606F
+# \u6D77\u63A7\u5546\u6237\u4FE1\u606F   \u751F\u4EA7\u914D\u7F6E
 # \u5E73\u53F0\u7F16\u53F7
-merchant.plat-sn=146001
+merchant.plat-sn=44048600Y8
 # \u5E73\u53F0\u4E2D\u6587\u540D
-merchant.plat-name=\u4E2D\u7F51\u5546\u57CE
+merchant.plat-name=\u73E0\u6D77\u6D77\u63A7\u79D1\u6280\u6709\u9650\u516C\u53F8
 # \u5546\u6237\u6D77\u5173\u5907\u6848\u7F16\u53F7
-merchant.customs-code=4403160Z3Y
+merchant.customs-code=44048600Y8
 # \u5546\u6237\u6D77\u5173\u5907\u6848\u540D\u79F0
-merchant.customs-name=\u4E2D\u7F51\u79D1\u6280\uFF08\u6DF1\u5733\uFF09\u6709\u9650\u516C\u53F8
+merchant.customs-name=\u73E0\u6D77\u6D77\u63A7\u79D1\u6280\u6709\u9650\u516C\u53F8
+# appid
+#cus.play.wx.app-id=wxd3e627dd62d6ff32
+cus.play.wx.app-id=wxe186e23f5a8f0dbf
+# \u5FAE\u4FE1\u652F\u4ED8\u5546\u6237\u53F7
+cus.play.wx.mch-id=1574349031
+# \u6D77\u5173\uFF0C\u5E7F\u5DDE\uFF08\u603B\u7F72\uFF09
+cus.play.wx.customs=GUANGZHOU_ZS
 
 
 # \u5B9A\u65F6\u5668\u62A5\u5173\u4E00\u6B21\u533A\u7684\u6570\u636E
 db.wx.declare.limit=20
 db.wx.declare.count=2
 
-# ccnet\u9ED8\u8BA4\u914D\u7F6E\u6587\u4EF6\u7684\u503C
+
+
+# \u4E2D\u7F51\u751F\u4EA7\uFF08\u6D4B\u8BD5\u7528\uFF09\uFF0C\u5982\u679C\u8981\u6D4B\u8BD5\u4ED8\u6B3E\uFF0C\u6253\u5F00\u4E0B\u9762\u7684\u6CE8\u91CA
 # \u4E2D\u7F51\u5FAE\u4FE1\u516C\u4F17ID
-cus.play.wx.app-id=wxb6b30b1b14ee502a
-# \u5FAE\u4FE1\u652F\u4ED8\u5546\u6237\u53F7
-cus.play.wx.mch-id=1501125641
-# \u6D77\u5173
-cus.play.wx.customs=SHENZHEN
+#cus.play.wx.app-id=wxb6b30b1b14ee502a
+## \u5FAE\u4FE1\u652F\u4ED8\u5546\u6237\u53F7
+#cus.play.wx.mch-id=1501125641
+## \u6D77\u5173\uFF0C\u6DF1\u5733
+#cus.play.wx.customs=SHENZHEN
+#merchant.plat-sn=146001
+#merchant.customs-code=4403160Z3Y
+#merchant.plat-name=\u4E2D\u7F51\u5546\u57CE
+#merchant.customs-name=\u4E2D\u7F51\u79D1\u6280\uFF08\u6DF1\u5733\uFF09\u6709\u9650\u516C\u53F8
 
 # ccnet dev\u914D\u7F6E\u6587\u4EF6\u7684\u503C
 #cus.play.wx.app-id=wx24013b34e349db3c

+ 46 - 8
kmall-admin/src/main/resources/conf/fastdfs.properties

@@ -33,6 +33,44 @@
 #file.author=kmall-pt
 
 #
+##############\u6D4B\u8BD5\u73AF\u5883################
+##\u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4
+#connect_timeout=30
+##
+###\u7F51\u7EDC\u8D85\u65F6\u65F6\u95F4
+#network_timeout=60
+#
+##\u6587\u4EF6\u8DEF\u5F84
+#base_path=/data/files/
+#
+##tracker server\u662FFastDFS\u6587\u4EF6\u7CFB\u7EDF\u7684\u534F\u8C03\u8005,\u5176\u4E3B\u8981\u4F5C\u7528\u662F\u8D1F\u8F7D\u5747\u8861\u548C\u8C03\u5EA6\u3002
+##Tracker server\u5728\u5185\u5B58\u4E2D\u8BB0\u5F55\u5206\u7EC4\u548CStorage server\u7684\u72B6\u6001\u7B49\u4FE1\u606F\uFF0C\u4E0D\u8BB0\u5F55\u6587\u4EF6\u7D22\u5F15\u4FE1\u606F
+#tracker_server=120.76.26.84:22122
+#
+#log_level=info
+#
+#use_connection_pool = false
+#
+#connection_pool_max_idle_time = 3600
+#
+#load_fdfs_parameters_from_tracker=false
+#
+#use_storage_id = false
+#
+#storage_ids_filename = storage_ids.conf
+#
+##HTTP \u670D\u52A1\u5668\u5730\u5740
+#http.tracket_nginx_addr=120.76.26.84
+#
+##HTTP \u670D\u52A1\u5668\u7AEF\u53E3\u53F7
+#http.tracker_server_port=80
+#
+##\u6587\u4EF6\u4F5C\u8005
+#file.author=kmall-pt
+
+
+
+
 ##############\u751F\u4EA7\u73AF\u5883################
 ##\u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4
 connect_timeout=30
@@ -41,29 +79,29 @@ connect_timeout=30
 network_timeout=60
 
 #\u6587\u4EF6\u8DEF\u5F84
-base_path=/data/files/
+base_path=/home/logs/fastdfs
 
 #tracker server\u662FFastDFS\u6587\u4EF6\u7CFB\u7EDF\u7684\u534F\u8C03\u8005,\u5176\u4E3B\u8981\u4F5C\u7528\u662F\u8D1F\u8F7D\u5747\u8861\u548C\u8C03\u5EA6\u3002
 #Tracker server\u5728\u5185\u5B58\u4E2D\u8BB0\u5F55\u5206\u7EC4\u548CStorage server\u7684\u72B6\u6001\u7B49\u4FE1\u606F\uFF0C\u4E0D\u8BB0\u5F55\u6587\u4EF6\u7D22\u5F15\u4FE1\u606F
-tracker_server=120.76.26.84:22122
+tracker_server=172.18.246.243:22122
 
 log_level=info
 
-use_connection_pool = false
+use_connection_pool=false
 
-connection_pool_max_idle_time = 3600
+connection_pool_max_idle_time=3600
 
 load_fdfs_parameters_from_tracker=false
 
-use_storage_id = false
+use_storage_id=false
 
-storage_ids_filename = storage_ids.conf
+storage_ids_filename=storage_ids.conf
 
 #HTTP \u670D\u52A1\u5668\u5730\u5740
-http.tracket_nginx_addr=120.76.26.84
+http.tracket_nginx_addr=120.76.119.218
 
 #HTTP \u670D\u52A1\u5668\u7AEF\u53E3\u53F7
 http.tracker_server_port=80
 
 #\u6587\u4EF6\u4F5C\u8005
-file.author=kmall-pt
+file.author=kmall-haikong

+ 1 - 0
kmall-admin/src/main/resources/logback.xml

@@ -6,6 +6,7 @@ debug:当此属性设置为true时,将打印出logback内部日志信息,
 -->
 <configuration scan="false" scanPeriod="60 seconds" debug="false">
 
+<!--    <property name="LOG_HOME" value="/data/project/logs/kmall-haikong/kmall-admin/"/>-->
     <property name="LOG_HOME" value="/data/project/logs/kmall-haikong/kmall-admin/"/>
     <!-- 定义日志的根目录 -->
     <property name="TRACE_DIR" value="trace" />

+ 2 - 1
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -1184,7 +1184,8 @@
         SELECT
             a.id,a.sku,a.goods_number,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price storeMarketPrice, r.retail_price as retailPrice,r.retail_price storeRetailPrice ,r.stock_num,s.store_name,r.product_id as productId,s.id 'storeId',a.goods_rate as goodsRate,
             a.hs_code as hsCode , a.legal_unit1_qty as legalUnit1Qty , a.legal_unit2_qty as legalUnit2Qty,a.ciq_prod_model as ciqProdModel,a.to_be_restored, r.stock_num, r.exit_region_number as exitRegionNumber,
-            a.category_id as categoryId, a.brand_id as brandId,a.net_weight as netWeight
+            a.category_id as categoryId, a.brand_id as brandId,a.net_weight as netWeight,
+            a.warehouse_sn as warehouseSn, a.warehous_sys_good_id as warehousSysGoodId, a.inventory_type as inventoryType
         FROM
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id

+ 7 - 0
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -471,6 +471,9 @@
         <if test="ids != null and ids.trim() != ''">
             AND o.id in (${ids})
         </if>
+        <if test="pickUpCodeSn != null and pickUpCodeSn.trim() != ''">
+            AND c.pick_up_code_sn LIKE concat('%',#{pickUpCodeSn},'%')
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -487,6 +490,7 @@
     <select id="queryOffilineOrderTotal" resultType="int">
         select count(DISTINCT o.id) FROM
         mall_order o
+        LEFT JOIN mall_pick_up_code c on c.order_sn = o.order_sn
         LEFT JOIN mall_store s on o.store_id = s.id
         LEFT JOIN mall_order_goods g ON o.id = g.order_id
         WHERE 1=1
@@ -541,6 +545,9 @@
         <if test="ids != null and ids.trim() != ''">
             AND o.id in (${ids})
         </if>
+        <if test="pickUpCodeSn != null and pickUpCodeSn.trim() != ''">
+            AND c.pick_up_code_sn LIKE concat('%',#{pickUpCodeSn},'%')
+        </if>
     </select>
 
     <insert id="save" parameterType="com.kmall.api.entity.OrderVo" useGeneratedKeys="true" keyProperty="id">

+ 8 - 0
kmall-admin/src/main/resources/mybatis/mapper/PickUpCodeDao.xml

@@ -217,4 +217,12 @@
 		where order_sn = #{orderSn}
 	</update>
 
+    <update id="updateBatchPickUpCodeStatus">
+		update mall_pick_up_code set pick_up_code_status = #{pickUpCodeStatus}
+		where order_sn in
+		<foreach collection="orderSnList" item="item" open="(" separator="," close=")">
+			#{item}
+		</foreach>
+	</update>
+
 </mapper>

+ 23 - 5
kmall-admin/src/main/resources/mybatis/mapper/SaleRecordDao.xml

@@ -57,8 +57,17 @@
 
 
 		WHERE 1=1
-		<if test="name != null and name.trim() != ''">
-			AND name LIKE concat('%',#{name},'%')
+		<if test="orderSn != null and orderSn.trim() != ''">
+			AND record.`order_sn` LIKE concat('%',#{orderSn},'%')
+		</if>
+		<if test="cashierSn != null and cashierSn.trim() != ''">
+			AND record.`cashier_sn` LIKE concat('%',#{cashierSn},'%')
+		</if>
+		<if test="sallerId != null and sallerId.trim() != ''">
+			AND record.`saller_id` LIKE concat('%',#{sallerId},'%')
+		</if>
+		<if test="sallerName != null and sallerName.trim() != ''">
+			AND su.`username` LIKE concat('%',#{sallerName},'%')
 		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
@@ -79,9 +88,18 @@
 		left join mall_store store on su.store_id = store.id
 		left join mall_store_topic topic on topic.id = record.discount_id
 		WHERE 1=1
-        <if test="name != null and name.trim() != ''">
-            AND name LIKE concat('%',#{name},'%')
-        </if>
+		<if test="orderSn != null and orderSn.trim() != ''">
+			AND record.`order_sn` LIKE concat('%',#{orderSn},'%')
+		</if>
+		<if test="cashierSn != null and cashierSn.trim() != ''">
+			AND record.`cashier_sn` LIKE concat('%',#{cashierSn},'%')
+		</if>
+		<if test="sallerId != null and sallerId.trim() != ''">
+			AND record.`saller_id` LIKE concat('%',#{sallerId},'%')
+		</if>
+		<if test="sallerName != null and sallerName.trim() != ''">
+			AND su.`username` LIKE concat('%',#{sallerName},'%')
+		</if>
 	</select>
 
 	<insert id="save" parameterType="com.kmall.admin.entity.SaleRecordEntity" useGeneratedKeys="true" keyProperty="msrId">

+ 9 - 0
kmall-admin/src/main/resources/mybatis/mapper/haikong/HaikongSendOrderInfoDetailRecordDao.xml

@@ -12,6 +12,7 @@
         <result property="name" column="name"/>
         <result property="cost" column="cost"/>
         <result property="price" column="price"/>
+        <result property="buyPrice" column="buy_price"/>
         <result property="itemcode" column="itemcode"/>
         <result property="amount" column="amount"/>
         <result property="nums" column="nums"/>
@@ -29,6 +30,7 @@
 			`name`,
 			`cost`,
 			`price`,
+			`buy_price`,
 			`itemcode`,
 			`amount`,
 			`nums`,
@@ -48,6 +50,7 @@
     		`name`,
     		`cost`,
     		`price`,
+    		`buy_price`,
     		`itemcode`,
     		`amount`,
     		`nums`,
@@ -84,6 +87,7 @@
 		`name`,
 		`cost`,
 		`price`,
+		`buy_price`,
 		`itemcode`,
 		`amount`,
 		`nums`,
@@ -116,6 +120,7 @@
 			`name`,
 			`cost`,
 			`price`,
+			`buy_price`,
 			`itemcode`,
 			`amount`,
 			`nums`,
@@ -129,6 +134,7 @@
 			#{name},
 			#{cost},
 			#{price},
+			#{buyPrice},
 			#{itemcode},
 			#{amount},
 			#{nums},
@@ -146,6 +152,7 @@
 			`name`,
 			`cost`,
 			`price`,
+			`buy_price`,
 			`itemcode`,
 			`amount`,
 			`nums`,
@@ -162,6 +169,7 @@
 					#{item.name},
 					#{item.cost},
 					#{item.price},
+					#{item.buyPrice},
 					#{item.itemcode},
 					#{item.amount},
 					#{item.nums},
@@ -181,6 +189,7 @@
 			<if test="name != null">`name` = #{name}, </if>
 			<if test="cost != null">`cost` = #{cost}, </if>
 			<if test="price != null">`price` = #{price}, </if>
+			<if test="buyPrice != null">`buy_price` = #{buyPrice}, </if>
 			<if test="itemcode != null">`itemcode` = #{itemcode}, </if>
 			<if test="amount != null">`amount` = #{amount}, </if>
 			<if test="nums != null">`nums` = #{nums}, </if>

+ 0 - 4
kmall-admin/src/main/resources/mybatis/mapper/haikong/HaikongSendOrderInfoRecordDao.xml

@@ -367,10 +367,6 @@
 			<foreach collection="list" item="item" open="case " close=" end,">
 				when id = #{item.id} then #{item.resendStatus}
 			</foreach>
-			member_sys_order_id =
-			<foreach collection="list" item="item" open="case " close=" end,">
-				when id = #{item.id} then #{item.memberSysOrderId}
-			</foreach>
 		</trim>
 		where id in
 		<foreach collection="list" item="item" open="(" separator="," close=")">

+ 7 - 27
kmall-admin/src/main/resources/mybatis/mapper/mk/MkActivitiesScoreDao.xml

@@ -9,7 +9,6 @@
         <result property="sku" column="sku"/>
         <result property="storeId" column="store_id"/>
         <result property="mkaId" column="mka_id"/>
-        <result property="deadline" column="deadline"/>
         <result property="reject" column="reject"/>
         <result property="createTime" column="create_time"/>
         <result property="createrSn" column="creater_sn"/>
@@ -24,7 +23,6 @@
 			`sku`,
 			`store_id`,
 			`mka_id`,
-			`deadline`,
 			`reject`,
 			`create_time`,
 			`creater_sn`,
@@ -41,7 +39,6 @@
     		`sku`,
     		`store_id`,
     		`mka_id`,
-    		`deadline`,
     		`reject`,
     		`create_time`,
     		`creater_sn`,
@@ -52,6 +49,9 @@
 		<if test="name != null and name.trim() != ''">
 			AND name LIKE concat('%',#{name},'%')
 		</if>
+		<if test="mkaId != null and mkaId.trim() != ''">
+			AND mka_id = #{mkaId}
+		</if>
 		<if test="prodBarcode != null and prodBarcode.trim() != ''">
 			AND `prod_barcode` LIKE concat('%',#{prodBarcode},'%')
 		</if>
@@ -74,6 +74,9 @@
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
         </if>
+		<if test="mkaId != null and mkaId.trim() != ''">
+			AND mka_id = #{mkaId}
+		</if>
 		<if test="prodBarcode != null and prodBarcode.trim() != ''">
 			AND `prod_barcode` LIKE concat('%',#{prodBarcode},'%')
 		</if>
@@ -87,31 +90,13 @@
     		`sku`,
     		`store_id`,
     		`mka_id`,
-    		`deadline`,
-    		`reject`,
-    		`create_time`,
-    		`creater_sn`,
-    		`moder_sn`,
-    		`update_time`
-		from mk_activities_score
-		where prod_barcode = #{prodBarcode} and sku = #{sku} and store_id = #{storeId} and (deadline &gt; #{nowTime})
-	</select>
-
-    <select id="queryDetailByTime" resultType="com.kmall.admin.entity.mk.MkActivitiesScoreEntity">
-		select
-    		`id`,
-    		`prod_barcode`,
-    		`sku`,
-    		`store_id`,
-    		`mka_id`,
-    		`deadline`,
     		`reject`,
     		`create_time`,
     		`creater_sn`,
     		`moder_sn`,
     		`update_time`
 		from mk_activities_score
-		where deadline &gt; #{date}
+		where prod_barcode = #{prodBarcode} and sku = #{sku} and store_id = #{storeId}
 	</select>
 
     <select id="queryActivityInfoByMkaIdList" resultType="com.kmall.admin.entity.mk.MkActivitiesScoreEntity">
@@ -130,7 +115,6 @@
 			`sku`,
 			`store_id`,
 			`mka_id`,
-			`deadline`,
 			`reject`,
 			`create_time`,
 			`creater_sn`,
@@ -141,7 +125,6 @@
 			#{sku},
 			#{storeId},
 			#{mkaId},
-			#{deadline},
 			#{reject},
 			#{createTime},
 			#{createrSn},
@@ -155,7 +138,6 @@
 			`sku`,
 			`store_id`,
 			`mka_id`,
-			`deadline`,
 			`reject`,
 			`create_time`,
 			`creater_sn`,
@@ -168,7 +150,6 @@
 				#{item.sku},
 				#{item.storeId},
 				#{item.mkaId},
-				#{item.deadline},
 				#{item.reject},
 				#{item.createTime},
 				#{item.createrSn},
@@ -185,7 +166,6 @@
 			<if test="sku != null">`sku` = #{sku}, </if>
 			<if test="storeId != null">`store_id` = #{storeId}, </if>
 			<if test="mkaId != null">`mka_id` = #{mkaId}, </if>
-			<if test="deadline != null">`deadline` = #{deadline}, </if>
 			<if test="reject != null">`reject` = #{reject}, </if>
 			<if test="createTime != null">`create_time` = #{createTime}, </if>
 			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>

+ 1 - 0
kmall-admin/src/main/resources/mybatis/mapper/vip/Mall2PointsRulesDao.xml

@@ -156,6 +156,7 @@
     	from mall2_points_rules mpr
     	left join mall2_points_rules_detil mprs on mpr.mpr_id = mprs.father_id
     	where mprs.id is not null and mpr.is_valid = 0 and mpr.points_begin_time &lt;= #{nowTime} and mpr.points_end_time &gt;= #{nowTime}
+    	order by mpr.points_type desc
 	</select>
 
 	<insert id="saveMall2PointsRulesDetil" parameterType="com.kmall.admin.dto.Mall2RulesDto">

+ 22 - 13
kmall-admin/src/main/webapp/WEB-INF/page/cashier/salerecord.html

@@ -8,24 +8,33 @@
 <div id="rrapp" v-cloak>
 	<div v-show="showList">
         <Row :gutter="16">
-            <!--<div class="search-group">
+            <div class="search-group">
                 <i-col span="4">
-                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
+                    <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单编号"/>
+                </i-col>
+                <i-col span="4">
+                    <i-input v-model="q.cashierSn" @on-enter="query" placeholder="收银机编号"/>
+                </i-col>
+                <i-col span="4">
+                    <i-input v-model="q.sallerId" @on-enter="query" placeholder="店员id"/>
+                </i-col>
+                <i-col span="4">
+                    <i-input v-model="q.sallerName" @on-enter="query" placeholder="店员名称"/>
                 </i-col>
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>
             </div>
-            <div class="buttons-group">
-                #if($shiro.hasPermission("salerecord:save"))
-                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
-                #end
-                #if($shiro.hasPermission("salerecord:update"))
-                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
-                #end
-                #if($shiro.hasPermission("salerecord:delete"))
-                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-                #end
-            </div>-->
+<!--            <div class="buttons-group">-->
+<!--                #if($shiro.hasPermission("salerecord:save"))-->
+<!--                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>-->
+<!--                #end-->
+<!--                #if($shiro.hasPermission("salerecord:update"))-->
+<!--                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>-->
+<!--                #end-->
+<!--                #if($shiro.hasPermission("salerecord:delete"))-->
+<!--                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>-->
+<!--                #end-->
+<!--            </div>-->
         </Row>
 	    <table id="jqGrid"></table>
 	    <div id="jqGridPager"></div>

+ 2 - 2
kmall-admin/src/main/webapp/WEB-INF/page/mk/mkactivitiespromotion.html

@@ -61,9 +61,9 @@
             <Form-item label="商品系列" prop="productSeries">
                 <i-input v-model="mkActivitiesPromotion.productSeries" placeholder="商品系列"/>
             </Form-item>
-            <Form-item label="截止日期" prop="deadline">
+            <!--<Form-item label="截止日期" prop="deadline">
                 <i-input v-model="mkActivitiesPromotion.deadline" placeholder="截止日期 yyy-mm-dd"/>
-            </Form-item>
+            </Form-item>-->
             <Form-item>
                 <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                 <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>

+ 6 - 8
kmall-admin/src/main/webapp/WEB-INF/page/mk/mkactivitiesscore.html

@@ -29,15 +29,9 @@
                 <a href="../statics/file/activities_score.xlsx">积分抵扣模板下载</a>
             </div>
             <div class="buttons-group">
-<!--                #if($shiro.hasPermission("mkactivitiesscore:save"))-->
                 <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
-<!--                #end-->
-<!--                #if($shiro.hasPermission("mkactivitiesscore:update"))-->
                 <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
-<!--                #end-->
-<!--                #if($shiro.hasPermission("mkactivitiesscore:delete"))-->
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-<!--                #end-->
                 <i-button type="warning" @click="reloadMkactivities" v-show="!isMkactivitiesShow">返回营销方式页</i-button>
             </div>
         </Row>
@@ -57,9 +51,13 @@
             <Form-item label="门店id" prop="storeId">
                 <i-input v-model="mkActivitiesScore.storeId" placeholder="门店id"/>
             </Form-item>
-            <Form-item label="抵扣比例" prop="scoreLimit">
-                <i-input v-model="mkActivitiesScore.scoreLimit" placeholder="抵扣比例"/>
+            <Form-item label="是否参与积分抵扣" prop="reject">
+                <p>只能有一种情况,如果积分抵扣商品中都为0,则默认这些商品为参与,其余商品不参与,如果积分抵扣商品都为1,其余商品都参与</p>
+                <i-input v-model="mkActivitiesScore.reject" placeholder="0:参与,1:不参与"/>
             </Form-item>
+            <!--<Form-item label="抵扣比例" prop="scoreLimit">
+                <i-input v-model="mkActivitiesScore.scoreLimit" placeholder="抵扣比例"/>
+            </Form-item>-->
             <Form-item label="营销活动编号" prop="mkaId">
                 <i-input v-model="mkActivitiesScore.mkaId" placeholder="营销活动编号"/>
             </Form-item>

+ 4 - 4
kmall-admin/src/main/webapp/WEB-INF/page/mk/mkactivityform.html

@@ -115,7 +115,7 @@
             <Form-item label="结束时间" prop="mkdEndTime">
                 <Date-picker type="datetime" format="yyyy-MM-dd HH:mm:ss" v-model="mkActivities.mkdEndTime" @on-change="getMkdEndTime" placeholder="结束时间" style="width: 240px"></Date-picker>
             </Form-item>
-            <Form-item label="是否提前结束" prop="mkaEndEarly">
+            <!--<Form-item label="是否提前结束" prop="mkaEndEarly">
                 <Radio-group v-model="mkActivities.mkaEndEarly" @on-change="changeMkaEndEarly">
                     <Radio label="1">
                         <span>是</span>
@@ -124,10 +124,10 @@
                         <span>否</span>
                     </Radio>
                 </Radio-group>
-            </Form-item>
-            <Form-item label="提前结束时间" prop="mkdEndEarlyTime" v-show="isMkdEndEarlyTimeShow">
+            </Form-item>-->
+            <!--<Form-item label="提前结束时间" prop="mkdEndEarlyTime" v-show="isMkdEndEarlyTimeShow">
                 <Date-picker type="datetime" format="yyyy-MM-dd HH:mm:ss" v-model="mkActivities.mkdEndEarlyTime" @on-change="getMkdEndEarlyTime" placeholder="提前结束时间" style="width: 240px"></Date-picker>
-            </Form-item>
+            </Form-item>-->
             <Form-item>
                 <i-button type="primary" @click="handleMkactivitiesSubmit('formMkactivitiesValidate')">提交</i-button>
                 <i-button type="warning" @click="reloadMkactivities" style="margin-left: 8px"/>返回</i-button>

+ 4 - 1
kmall-admin/src/main/webapp/WEB-INF/page/receipt/receiptCheck.html

@@ -10,7 +10,10 @@
         <Row :gutter="16">
             <div class="search-group">
                 <i-col span="4">
-                    <i-input v-model="q.orderSn" @on-enter="query" placeholder="小票号"/>
+                    <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单号"/>
+                </i-col>
+                <i-col span="4">
+                    <i-input v-model="q.pickUpCodeSn" @on-enter="query" placeholder="小票号"/>
                 </i-col>
 
                 <i-button @click="query">查询</i-button>

+ 16 - 12
kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html

@@ -115,12 +115,12 @@
                         <Row :gutter="16">
                             <ul class="nav navbar-top-links navbar-right" style="font-size: 1.3em;">
 
-                                <li>
+                                <!--<li>
                                     <i-input v-model="orderSn1" @on-enter="queryInveResponse" placeholder="输入要查询回执的订单号" id="queryInveResponse" />
                                 </li>
                                 <li>
                                     <i-input v-model="orderSn" @on-enter="queryOrderStatus" placeholder="输入要查询订单状态的订单号" id="queryOrderStatus" />
-                                </li>
+                                </li>-->
                                 <li >
                                     <span style="margin-right: 40px">&nbsp; 门店:<b>{{storeName}}</b></span>
                                 </li>
@@ -138,7 +138,7 @@
         <div id="content" class="row-fluid">
             <div class="col-md-3">
                 <div>
-                    <i-input class="search" placeholder="输入或扫码商品条形码" id="saomiao" v-model.trim='prodBarcode' @on-enter="searchQuery(prodBarcode)"/>
+                    <i-input class="search" placeholder="输入或扫码商品条形码" ref="saomiao" id="saomiao" v-model.trim='prodBarcode' @on-enter="searchQuery(prodBarcode)"/>
                 </div>
                 <div v-show="prodBarcode" class="search_menu">
                     <ul>
@@ -205,13 +205,19 @@
                         </table>
                     </li>
                     <li>
-                        <ul>
+                        <ul style="display: inline-block">
                             <li><h3 style="border: white;padding: 8px;">总件数:{{totalCount}}</h3></li>
                             <li><h3 style="border: white;padding: 8px;">总价:{{totalPrice}}</h3></li>
 <!--                            <li><h3 style="border: white;padding: 8px">优惠价:{{discountedPrice}}</h3></li>-->
                             <li><h3 style="border: white;padding: 8px">实际支付价:{{actualPrice}}</h3></li>
                             <li v-if="showReduceMoney != 0"><h3 style="border: white;padding: 8px">满减:{{showReduceMoney}}</h3></li>
                         </ul>
+                        <div style="width: 30px; display: inline-block"></div>
+                        <ul style="display: inline-block">
+                            <li><h3 style="border: white;padding: 8px;">会员当前积分:{{memberCurrentAvailableScore}}</h3></li>
+                            <li><h3 style="border: white;padding: 8px;">抵扣积分:{{deductionScore}}</h3></li>
+                            <li><h3 style="border: white;padding: 8px;">会员等级:{{levelName}}</h3></li>
+                        </ul>
                     </li>
                     <li  style="height: 100px;">
                         <i-button type="error" @click="clearGoodsList" class="goods-button"><i class="fa fa-pencil-square-o"></i>&nbsp;清空</i-button>
@@ -298,7 +304,7 @@
                             </div>
                         </div>
 
-                        <div class="modal fade" id="calculateOrderPriceDialog"  role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+                        <div class="modal fade" id="calculateOrderPriceDialog"  role="dialog" aria-hidden="true">
                             <div class="modal-dialog">
                                 <div class="modal-content">
                                     <div class="modal-header">
@@ -306,12 +312,10 @@
                                         <h4 class="modal-title" id="calculateOrderPriceModalLabel">录入会员码</h4>
                                     </div>
                                     <div class="modal-body">
-                                        <form>
-                                            <div class="form-group">
-                                                <label for="customPhone" class="control-label">会员码:</label>
-                                                <input autocomplete="off" type="text" class="form-control" ref="couponBarCode" id="couponBarCode" @blur="customPhoneBlur" />
-                                            </div>
-                                        </form>
+                                        <div>
+                                            <label for="customPhone" class="control-label">会员码:</label>
+                                            <input autocomplete="off" type="text" ref="couponBarCode" size="60%" id="couponBarCode" @on-enter="calculateOrderPriceSubmit" />
+                                        </div>
                                     </div>
                                     <div class="modal-footer">
                                         <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
@@ -332,7 +336,7 @@
                                     <div class="modal-body">
                                         <form>
                                             <div class="form-group">
-                                                <i-input id="payCode"  @on-enter="submitOrder" ref="payCode" placeholder="请输入付款码"/>
+                                                <i-input id="payCode" class="payCodeInput" @on-enter="submitOrder" ref="payCode" size="60%" placeholder="请输入付款码"/>
                                             </div>
 
                                         </form>

+ 14 - 3
kmall-admin/src/main/webapp/js/cashier/salerecord.js

@@ -61,7 +61,10 @@ let vm = new Vue({
 			]
 		},
 		q: {
-		    name: ''
+			orderSn: '',
+			cashierSn: '',
+			sallerId: '',
+			sallerName: ''
 		}
 	},
 	methods: {
@@ -132,7 +135,10 @@ let vm = new Vue({
 		},
         reloadSearch: function() {
             vm.q = {
-                name: ''
+				orderSn: '',
+				cashierSn: '',
+				sallerId: '',
+				sallerName: ''
             }
             vm.reload();
 		},
@@ -143,7 +149,12 @@ let vm = new Vue({
 				page = $("#jqGrid").jqGrid('getGridParam', 'page');
 			}
 			$("#jqGrid").jqGrid('setGridParam', {
-                postData: {'name': vm.q.name},
+                postData: {
+                	'orderSn': vm.q.orderSn,
+					'cashierSn': vm.q.cashierSn,
+					'sallerId': vm.q.sallerId,
+					'sallerName': vm.q.sallerName
+				},
                 page: page
             }).trigger("reloadGrid");
             vm.handleReset('formValidate');

+ 1 - 1
kmall-admin/src/main/webapp/js/mk/mkactivitiespromotion.js

@@ -39,7 +39,7 @@ $(function () {
 				}
 			},
 			{label: '商品系列', name: 'productSeries', index: 'product_series', width: 80, align: 'center'},
-			{label: '截止日期', name: 'deadline', index: 'deadline', width: 80, align: 'center'}],
+			/*{label: '截止日期', name: 'deadline', index: 'deadline', width: 80, align: 'center'}*/],
 		viewrecords: true,
 		postData: {'mkaId': vm.mkaId},
         height: 550,

+ 4 - 1
kmall-admin/src/main/webapp/js/mk/mkactivitiesscore.js

@@ -27,7 +27,7 @@ $(function () {
 			{label: '商品条码', name: 'prodBarcode', index: 'prod_barcode', width: 150},
 			{label: 'sku', name: 'sku', index: 'sku', width: 150},
 			{label: '门店id', name: 'storeId', index: 'store_id', width: 80},
-			{label: '抵扣比例', name: 'scoreLimit', index: 'score_limit', width: 80},
+			{label: '是否参与', name: 'reject', index: 'reject', width: 80},
 			{label: '营销活动编号', name: 'mkaId', index: 'mka_id', width: 100}
 			// {label: '截止日期', name: 'deadline', index: 'deadline', width: 200,
 			// 	formatter: function (value) {
@@ -91,6 +91,9 @@ let vm = new Vue({
 			],
 			scoreLimit: [
 				{required: true, message: '抵扣比例不能为空', trigger: 'blur'}
+			],
+			reject: [
+				{required: true, message: '必须填0或1', trigger: 'blur'}
 			]
 			// deadLine: [
 			// 	{required: true, message: '截止日期不能为空', trigger: 'blur'}

+ 3 - 3
kmall-admin/src/main/webapp/js/mk/mkactivityform.js

@@ -112,7 +112,7 @@ $(function () {
             {label: '活动优先级', name: 'priority', index: 'priority', width: 100, align: 'center'},
             {label: '开始时间', name: 'mkaStartTime', index: 'mka_start_time', width: 200, align: 'center'},
             {label: '结束时间', name: 'mkdEndTime', index: 'mkd_end_time', width: 200, align: 'center'},
-            {label: '是否提前结束', name: 'mkaEndEarly', index: 'mka_end_early', width: 200, align: 'center',
+            /*{label: '是否提前结束', name: 'mkaEndEarly', index: 'mka_end_early', width: 200, align: 'center',
                 formatter: function (value) {
                     if (value == '0') {
                         return '否';
@@ -121,8 +121,8 @@ $(function () {
                     }
                     return '';
                 }
-            },
-            {label: '提前结束时间', name: 'mkdEndEarlyTime', index: 'mkd_end_early_time', width: 200, align: 'center'}
+            },*/
+            // {label: '提前结束时间', name: 'mkdEndEarlyTime', index: 'mkd_end_early_time', width: 200, align: 'center'}
             ],
         viewrecords: true,
         height: '100%',

+ 6 - 3
kmall-admin/src/main/webapp/js/receipt/receiptCheck.js

@@ -103,7 +103,8 @@ let vm = new Vue({
         q: {
             orderSn: '',
             orderStatus: '',
-            orderType: ''
+            orderType: '',
+            pickUpCodeSn: ''
         },
         refundMoney: 0,
         shipping: {},
@@ -157,7 +158,8 @@ let vm = new Vue({
                 postData: {
                     'orderSn': vm.q.orderSn,
                     'orderStatus': vm.q.orderStatus,
-                    'orderType': vm.q.orderType
+                    'orderType': vm.q.orderType,
+                    'pickUpCodeSn': vm.q.pickUpCodeSn
                 },
                 page: page
             }).trigger("reloadGrid");
@@ -166,7 +168,8 @@ let vm = new Vue({
             vm.q = {
                 orderSn: '',
                 orderStatus: '',
-                orderType: ''
+                orderType: '',
+                pickUpCodeSn: ''
             };
             vm.reload(1);
         },

+ 113 - 55
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -6,8 +6,8 @@ $(function () {
     queryAssistantInfo();
     var cwQrcode = new Image();
     var cwLogo2 = new Image();
-    cwQrcode.src = "http://8.135.102.238:8080/statics/img/cw_qrcode.png";
-    cwLogo2.src = "http://8.135.102.238:8080/statics/img/cw_logo2.png";
+    cwQrcode.src = "http://120.76.119.218:8080/statics/img/cw_qrcode.png";
+    cwLogo2.src = "http://120.76.119.218:8080/statics/img/cw_logo2.png";
     vm.queryGoods();
 });
 
@@ -496,6 +496,13 @@ const delay = (function () {
 });
 
 let vm = new Vue({
+    created : function () {
+        this.$nextTick(() => {
+            setTimeout(() => {
+                this.$refs.saomiao.focus();
+            }, 200);
+        })
+    },
     el: '#rrapp',
     data: {
         showList: true,
@@ -598,6 +605,10 @@ let vm = new Vue({
         memberPhone: '',
         // 订单抵扣积分
         deductionScore: '',
+        // 会员可用积分
+        memberCurrentAvailableScore: 0,
+        // 会员等级名称
+        levelName: '无',
         // 积分抵扣金额
         scoreDeductionPrice: '',
         // 积分抵扣金额
@@ -607,7 +618,10 @@ let vm = new Vue({
         // 抵扣后积分
         afterScore: 0,
         // 会员openid
-        openId: ''
+        openId: '',
+        // 是否点击了加号或减号的标识
+        clickFlag: false,
+        deleteFlag: false
     },
     watch: {
         prodBarcode (){
@@ -681,7 +695,9 @@ let vm = new Vue({
             vm.storeId = sessionStorage.getItem("storeId");
             var thisGoods = {};
             var overflowLi = this.$refs.overflowLi;
-            $.get("../goods/selectSkuDetails/"+vm.prodBarcode+"/"+vm.storeId, function (r) {
+            console.log("vm.$refs.saomiao.value===>" + vm.$refs.saomiao.value);
+            let scanSellVolume = calScanSellVolume(vm.$refs.saomiao.value);
+            $.get("../goods/details/"+vm.prodBarcode+"/"+vm.storeId+"/"+vm.prodBarcode+"/"+scanSellVolume, function (r) {
                 if (r.code == 0) {
                     if(r.goodsDetails.length>1) {
                         r.goodsDetails.sellVolume = 1;
@@ -731,7 +747,9 @@ let vm = new Vue({
         saveOld:function(){
             vm.storeId = sessionStorage.getItem("storeId");
             var overflowLi = this.$refs.overflowLi;
-                $.get("../goods/detailsOld/"+vm.prodBarcode+"/"+vm.storeId, function (r) {
+            console.log("vm.$refs.saomiao.value===>" + vm.$refs.saomiao.value);
+            let scanSellVolume = calScanSellVolume(vm.$refs.saomiao.value);
+                $.get("../goods/detailsOld/"+vm.prodBarcode+"/"+vm.storeId+"/"+scanSellVolume, function (r) {
                     if (r.code == 0) {
                         r.goodsDetails.sellVolume = 1;
                         vm.goodsMap.set(r.goodsDetails.goodsSn,JSON.parse(JSON.stringify(r.goodsDetails)));
@@ -770,6 +788,7 @@ let vm = new Vue({
                     break;
                 }
             }
+            vm.clickFlag = true;
         },
         minus:function(value){
             // 减少数量
@@ -808,12 +827,15 @@ let vm = new Vue({
                     break;
                 }
             }
+            vm.clickFlag = true;
 
         },
         selectItem:function(value) {
             console.log(value);
         },
         deleteItem:function(value){
+            vm.deleteFlag = true;
+            vm.clickFlag = true;
             // 删除这条记录
             for(var i = 0 ; i < this.goodsList.length ; i++){
                 if(this.goodsList[i].id == value){
@@ -853,16 +875,6 @@ let vm = new Vue({
                     // console.log(goods);
                     // console.log(vm.totalPrice);
 
-                    $.get("../goods/number/del/" + sessionStorage.getItem("storeId") + "/" + goods.sku + "/" + goods.prodBarcode, function (res) {
-                        if (res.code === 0) {
-                            alert("删除成功!");
-                        } else if (res.code === 500) {
-                            alert(res.msg);
-                        } else {
-                            alert("未知异常!请联系管理员!");
-                        }
-                    });
-
                     if(vm.freeBardcode.get(goods.prodBarcode) || vm.freeBardcode.get(goods.prodBarcode) == 0){
                         var nnum = (((goods.retailPrice * goods.sellVolume) - goods.actualPaymentAmount)/goods.retailPrice);
                         vm.freeBardcode.set(goods.prodBarcode, nnum);
@@ -887,19 +899,11 @@ let vm = new Vue({
         },
         clearGoodsList:function(){
             confirm('确认清空吗?', function () {
-                $.get("../goods/number/clear/" + sessionStorage.getItem("storeId"), function (res) {
-                    if (res.code === 0) {
-                        layer.confirm("清空成功", {
-                                skin: 'layui-layer-molv', btn: ['确定'], title: "提示"
-                            }, function () {
-                                location.reload();
-                            });
-                    } else if (res.code === 500) {
-                        alert(res.msg);
-                    } else {
-                        alert("未知异常!请联系管理员!");
-                    }
-                })
+                layer.confirm("清空成功", {
+                    skin: 'layui-layer-molv', btn: ['确定'], title: "提示"
+                }, function () {
+                    location.reload();
+                });
             })
 
         },
@@ -961,11 +965,24 @@ let vm = new Vue({
                 alert("请选择商品");
                 return;
             }
+
+            console.log("vm.clickFlag==>" + vm.clickFlag);
+            if (vm.clickFlag) {
+                let value = vm.$refs.couponBarCode.value;
+                if (value != null || value != "" || value != 'undefined' || vm.deleteFlag) {
+                    alert("请重新计算优惠价再提交订单!");
+                    return;
+                }
+            }
             $('#myModal').modal('show')
             // 每次点击提交订单的时候清空姓名和身份证信息和手机号
             vm.$refs.customName.value = "";
             vm.$refs.customIDCard.value = "";
-            vm.$refs.customPhone.value = "";
+            let customPhone = vm.userInfo.customPhone;
+            if (customPhone === null || typeof customPhone === 'undefined') {
+                customPhone = '';
+            }
+            vm.$refs.customPhone.value = customPhone;
             vm.$refs.couponBarCode.value = "";
             if(vm.$refs.couponSn)
                 vm.$refs.couponSn.value = "";
@@ -977,19 +994,25 @@ let vm = new Vue({
                 alert("请选择商品");
                 return;
             }
+
+            vm.clickFlag = false;
             $("#calculateOrderPriceDialog").modal('show');
 
+            this.couponBarCodeChangeFocus();
         },
         // 计算优惠价格,返回订单详情数据
         calculateOrderPriceSubmit : function () {
 
             // console.log("点击计算=====>" + JSON.stringify(vm.goodsList));
 
-            var couponBarCode = vm.$refs.couponBarCode;
+            var couponBarCode = vm.$refs.couponBarCode.value;
             if (couponBarCode === null || couponBarCode === '') {
-                alert("无会员码,不能参加积分抵扣活动!\n计算中...");
+                confirm("无会员码,不能参加积分抵扣活动!<br/>点击确认开始计算...", function () {
+                    calculateOrderPrice();
+                });
+            } else {
+                calculateOrderPrice();
             }
-            calculateOrderPrice();
         },
         // 提交订单
         submitOrder:function(){
@@ -1148,6 +1171,7 @@ let vm = new Vue({
 
             $("#Send").attr("data-dismiss","modal");
             $('#payModal').modal('show');
+            this.payCodeChangeFocus();
             $("#payCode").keydown(function(e){
                 if(e.keyCode==13){
                     $("#submitOrder").click();
@@ -1331,6 +1355,20 @@ let vm = new Vue({
                     toUrl('../logout?_' + $.now());
                 }, 500);
             });
+        },
+        couponBarCodeChangeFocus() {
+            this.$nextTick(() => {
+                setTimeout(() => {
+                    this.$refs.couponBarCode.focus();
+                }, 200);
+            })
+        },
+        payCodeChangeFocus() {
+            this.$nextTick(() => {
+                setTimeout(() => {
+                    this.$refs.payCode.focus();
+                }, 200);
+            })
         }
     }
 });
@@ -1450,9 +1488,11 @@ function openWebSocket() {
         //无法使用wss,浏览器打开WebSocket时报错
         //ws对应http、wss对应https。
         //kmall测试环境
-        webSocket = new WebSocket("ws://183.62.225.124:3080/ws/server/"+storeId);
-        //kmall正式环境
-        // webSocket = new WebSocket("ws://8.135.102.238:8080/ws/server/"+storeId);
+        // webSocket = new WebSocket("ws://183.62.225.124:3080/ws/server/"+storeId);
+        // 预发布环境
+        // webSocket = new WebSocket("ws://14.29.226.8:8080/ws/server/"+storeId);
+        //kmall海控正式环境
+        webSocket = new WebSocket("ws://120.76.119.218:8080/ws/server/"+storeId);
         //kmall本地环境
         // webSocket = new WebSocket("ws://127.0.0.1:8089/ws/server/"+storeId);
         // webSocket = new WebSocket("wss://cb.k1net.cn/ws/server/"+storeId);
@@ -1990,7 +2030,7 @@ function toPayOrder(payCode){
                  'sessionId':vm.sessionId,
                  'machineCode':vm.machineCode,
                  'memberCode': vm.memberCode,
-                 'memberPhone': vm.memberPhone,
+                 'memberPhone': vm.userInfo.customPhone,
                  'deductionScore': deductionScore,
                  'actualPrice': actualPrice,
                  'scoreDeductionPrice': scoreDeductionPrice,
@@ -2060,6 +2100,25 @@ function toRefund(){
     })
 }
 
+calScanSellVolume = function (prodBarcode) {
+    let goodsList = vm.goodsList;
+
+    console.log("prodBarcode typeof===>" + typeof prodBarcode);
+    console.log("prodBarcode===>" + prodBarcode);
+    if (goodsList === null || goodsList.length === 0) {
+        return 1;
+    }
+    let sellVolume = 0;
+    goodsList.forEach(goods => {
+        if (prodBarcode === goods.prodBarcode) {
+            sellVolume = sellVolume + goods.sellVolume;
+        }
+    });
+
+    return sellVolume;
+
+}
+
 /**
  * 计算当前购物栏商品优惠价格
  */
@@ -2089,10 +2148,17 @@ calculateOrderPrice = function() {
                 vm.memberPhone = r.data.memberPhone;
                 vm.openId = r.data.openId;
                 vm.deductionScore = r.data.deductionScore;
+                vm.memberCurrentAvailableScore = r.data.memberCurrentAvailableScore;
+                vm.levelName = r.data.levelName;
                 vm.scoreDeductionPrice = r.data.scoreDeductionPrice;
                 vm.scoreLimit = r.data.scoreLimit;
                 vm.beforeScore = r.data.beforeScore;
                 vm.afterScore = r.data.afterScore;
+                vm.userInfo.customPhone = r.data.memberPhone;
+                vm.$refs.customPhone.value = r.data.memberPhone;
+                // console.log("memberPhone===>" + r.data.memberPhone);
+                // console.log("this.userInfo.customPhone===>" + vm.userInfo.customPhone);
+                // console.log("vm.$refs.customPhone.value===>" + vm.$refs.customPhone.value);
                 // console.log("计算后数据===>" + JSON.stringify(calGoodsList));
                 // console.log("替换后数据===>" + JSON.stringify(vm.goodsList));
 
@@ -2117,20 +2183,20 @@ handleSellVolume = function (currentGoodsDetail, type) {
     // 当前未被处理的商品数量
     let number = currentGoodsDetail.sellVolume;
     // 当前商品应支付金额
-    let currentActualPaymentAmount = new BigNumber(currentGoodsDetail.actualPaymentAmount);
+    let currentActualPaymentAmount = new BigNumber(currentGoodsDetail.actualPaymentAmount, 2, BigNumber.ROUND_HALF_UP);
     // 当前商品税款
     let currentGoodsTax = new BigNumber(currentGoodsDetail.goodstaxes);
     // 当前商品零售价
     let retailPrice = new BigNumber(currentGoodsDetail.retailPrice);
     // 单个商品时的税款
-    let singleTax = currentGoodsTax.divide(number);
+    let singleTax = new BigNumber(currentGoodsTax.divide(number).toString(), 2, BigNumber.ROUND_HALF_UP);
     // 单个商品时的应支付金额
-    let singleActualPaymentAmount = currentActualPaymentAmount.divide(number);
+    let singleActualPaymentAmount = new BigNumber(currentActualPaymentAmount.divide(number).toString(), 2, BigNumber.ROUND_HALF_UP);
 
     // 当前总价
-    let currentTotalPrice = new BigNumber(vm.totalPrice);
+    let currentTotalPrice = new BigNumber(vm.totalPrice, 2, BigNumber.ROUND_HALF_UP);
     // 当前实际支付价
-    let currentActualPrice = new BigNumber(vm.actualPrice);
+    let currentActualPrice = new BigNumber(vm.actualPrice, 2, BigNumber.ROUND_HALF_UP);
     let storeId = sessionStorage.getItem("storeId");
     let sku = currentGoodsDetail.sku;
     let prodBarcode = currentGoodsDetail.prodBarcode;
@@ -2150,20 +2216,12 @@ handleSellVolume = function (currentGoodsDetail, type) {
             }
         });
     } else {
-        $.get("../goods/number/minus/"+ storeId +"/" + sku + "/" + prodBarcode, function (res) {
-            if (res.code === 0) {
-                currentGoodsDetail.sellVolume -= 1;
-                currentGoodsDetail.goodstaxes = currentGoodsTax.subtract(singleTax).toString();
-                currentGoodsDetail.actualPaymentAmount = currentActualPaymentAmount.subtract(singleActualPaymentAmount).toString();
-                vm.totalCount -= 1;
-                vm.totalPrice = currentTotalPrice.subtract(retailPrice).toString();
-                vm.actualPrice = currentActualPrice.subtract(singleActualPaymentAmount).toString();
-            } else if (res.code === 500) {
-                alert(res.msg);
-            } else {
-                alert("未知异常!请联系管理员!");
-            }
-        });
+        currentGoodsDetail.sellVolume -= 1;
+        currentGoodsDetail.goodstaxes = currentGoodsTax.subtract(singleTax).toString();
+        currentGoodsDetail.actualPaymentAmount = currentActualPaymentAmount.subtract(singleActualPaymentAmount).toString();
+        vm.totalCount -= 1;
+        vm.totalPrice = currentTotalPrice.subtract(retailPrice).toString();
+        vm.actualPrice = currentActualPrice.subtract(singleActualPaymentAmount).toString();
     }
 
     for (let i = 0; i < vm.goodsList.length; i++) {

+ 10 - 2
kmall-admin/src/main/webapp/js/shop/interfacesendlog.js

@@ -6,8 +6,16 @@ $(function () {
 			{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
 			{label: '请求/响应系统类型', name: 'sysType', index: 'sys_type', width: 80},
 			{label: '请求/响应接口类型', name: 'interfaceType', index: 'interface_type', width: 80},
-			{label: '请求信息', name: 'requestMsg', index: 'request_msg', width: 100},
-			{label: '响应结果', name: 'responseMsg', index: 'response_msg', width: 100},
+			{label: '请求信息', name: 'requestMsg', index: 'request_msg', width: 100, formatter: function (value) {
+				value = value.replace(/</g, '&lt;');
+				value = value.replace(/>/g, '&gt;');
+				return value;
+			}},
+			{label: '响应结果', name: 'responseMsg', index: 'response_msg', width: 100, formatter: function (value) {
+				value = value.replace(/</g, '&lt;');
+				value = value.replace(/>/g, '&gt;');
+				return value;
+			}},
 			{label: '发送时间', name: 'requestDate', index: 'request_date',align: 'center', width: 70,formatter:function(value){
 					return transDate(value, 'yyyy-MM-dd hh:mm:ss');
 				}},

+ 2 - 2
kmall-admin/src/main/webapp/login.html

@@ -68,7 +68,7 @@
                     <i-input class="userinput"  type="password" v-model="password" @on-enter="login" style="width: 250px;"
                              placeholder="密码"/>
                 </div>
-                <div class="form-group has-feedback" id="authcode">
+                <!--<div class="form-group has-feedback" id="authcode">
                     <div style="display: inline-block;width: 150px;height:45px;padding-left: 2px">
                         <i-input v-model="captcha" @on-enter="login"
                                  placeholder="验证码" class="authcode" />
@@ -77,7 +77,7 @@
                         <img style="height: 45px;width: 96px;border-radius: 4px;" alt="如果看不清楚,请单击图片刷新!" title="点击刷新"
                              class="pointer" :src="src" @click="refreshCode">
                     </div>
-                </div>
+                </div>-->
                 <div>
                     <i-button type="primary" @click="login" style="width: 125px;height: 45px">登录</i-button>
                     <i-button type="primary" @click="changeUserLogin" style="width: 125px;height: 45px">切换店员端登录</i-button>

BIN
kmall-admin/src/main/webapp/statics/file/activities_promotion.xlsx


BIN
kmall-admin/src/main/webapp/statics/file/activities_score.xlsx


+ 2 - 2
kmall-admin/src/main/webapp/userLogin.html

@@ -45,7 +45,7 @@
                     <i-input class="userinput"  type="password" v-model="password" @on-enter="login" style="width: 250px;"
                              placeholder="密码"/>
                 </div>
-                <div class="form-group has-feedback" id="authcode">
+                <!--<div class="form-group has-feedback" id="authcode">
                     <div style="display: inline-block;width: 150px;height:45px;padding-left: 2px">
                         <i-input v-model="captcha" @on-enter="login"
                                  placeholder="验证码" class="authcode" />
@@ -54,7 +54,7 @@
                         <img style="height: 45px;width: 96px;border-radius: 4px;" alt="如果看不清楚,请单击图片刷新!" title="点击刷新"
                              class="pointer" :src="src" @click="refreshCode">
                     </div>
-                </div>
+                </div>-->
                 <div>
                     <i-button type="warning" @click="login" style="width: 125px;height: 45px">登录</i-button>
                     <i-button type="warning" @click="change" style="width: 125px;height: 45px">切换管理端</i-button>

+ 38 - 3
kmall-admin/src/test/java/com/kmall/admin/Test.java

@@ -1,17 +1,18 @@
 package com.kmall.admin;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.kmall.admin.entity.GoodsEntity;
+import com.kmall.admin.entity.haikong.HaiKongSendOrderInfoRecordEntity;
 import com.kmall.admin.haikong.client.HaiKongMemberTemplate;
 import com.kmall.admin.haikong.constant.HaiKongMemberScoreChangeEventEnum;
-import com.kmall.admin.haikong.dto.MemberInfoDTO;
-import com.kmall.admin.haikong.dto.MemberScoreChangeDTO;
-import com.kmall.admin.haikong.dto.MemberScoreChangeResponseDTO;
+import com.kmall.admin.haikong.dto.*;
 import com.kmall.admin.haikong.task.MemberSysAccessTokenRefreshTask;
 import com.kmall.admin.haikong.utils.ListUtils;
 import com.kmall.admin.haikong.utils.Response;
 import com.kmall.admin.haikong.vo.QueryGoodsVO;
 import com.kmall.admin.service.GoodsService;
+import com.kmall.admin.service.haikong.HaiKongSendOrderInfoRecordService;
 import com.kmall.admin.utils.jackson.JacksonUtil;
 import org.junit.runner.RunWith;
 import org.springframework.beans.BeanUtils;
@@ -47,6 +48,9 @@ public class Test {
     @Autowired
     private MemberSysAccessTokenRefreshTask memberSysAccessTokenRefreshTask;
 
+    @Autowired
+    private HaiKongSendOrderInfoRecordService haiKongSendOrderInfoRecordService;
+
     @org.junit.Test
     public void addScore() throws Exception {
 
@@ -106,4 +110,35 @@ public class Test {
 
     }
 
+    @org.junit.Test
+    public void testXmlFormat() throws JsonProcessingException {
+
+        HaiKongSendOrderInfoRecordEntity haiKongSendOrderInfoRecordEntity = haiKongSendOrderInfoRecordService.queryObject(76);
+
+        SendOrderToVmcShopDTO sendOrderToVmcShopDTO = new SendOrderToVmcShopDTO();
+        SeaportInfoDTO seaportInfoDTO = new SeaportInfoDTO();
+        PayInfoDTO payInfoDTO = new PayInfoDTO();
+        OrderInfoDTO orderInfoDTO = new OrderInfoDTO();
+        BeanUtils.copyProperties(haiKongSendOrderInfoRecordEntity, orderInfoDTO);
+        BeanUtils.copyProperties(haiKongSendOrderInfoRecordEntity, payInfoDTO);
+        String response1 = payInfoDTO.getResponse();
+        response1 = response1.replaceAll("\r|\n", "");
+        payInfoDTO.setResponse(response1);
+        seaportInfoDTO.setSeaportCode(haiKongSendOrderInfoRecordEntity.getSeaportCode());
+        seaportInfoDTO.setPlatform(haiKongSendOrderInfoRecordEntity.getPlatform());
+        seaportInfoDTO.setIdentityCard(haiKongSendOrderInfoRecordEntity.getIdentityCard());
+        seaportInfoDTO.setIdentityMobile(haiKongSendOrderInfoRecordEntity.getIdentityMobile());
+        seaportInfoDTO.setIdentityName(haiKongSendOrderInfoRecordEntity.getIdentityName());
+        seaportInfoDTO.setOrderProductInfoList(JacksonUtil.fromListJson(haiKongSendOrderInfoRecordEntity.getOrderProductInfo(), new TypeReference<List<OrderProductInfoDTO>>() {}));
+
+        sendOrderToVmcShopDTO.setPayInfo(payInfoDTO);
+        sendOrderToVmcShopDTO.setSeaportInfo(seaportInfoDTO);
+        sendOrderToVmcShopDTO.setOrderInfo(orderInfoDTO);
+
+        String string = JacksonUtil.getObjectMapper().writeValueAsString(sendOrderToVmcShopDTO);
+
+        System.out.println(string);
+
+    }
+
 }

+ 14 - 13
kmall-framework/src/test/resources/applicationContext-test.xml

@@ -87,7 +87,8 @@
         &lt;!&ndash;<property name="transactionIsolation" value="TRANSACTION_REPEATABLE_READ"/>&ndash;&gt;
     </bean>-->
 
-    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
+    <!-- 2021-12-15改为配置类:com.kmall.admin.config.datasource.DataSourceConfig-->
+    <!--<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
           init-method="init" destroy-method="close">
         <property name="url">
             <value>${jdbc.url}</value>
@@ -107,35 +108,35 @@
         <property name="proxyFilters">
             <list>
                 <ref bean="stat-filter"/>
-                <!--过滤永真条件 防止注入-->
+                &lt;!&ndash;过滤永真条件 防止注入&ndash;&gt;
                 <ref bean="wall-filter"/>
             </list>
         </property>
         <property name="connectionInitSqls" value="set names utf8mb4;"/>
-        <!--&lt;!&ndash; 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 &ndash;&gt;-->
+        &lt;!&ndash;&lt;!&ndash; 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 &ndash;&gt;&ndash;&gt;
         <property name="timeBetweenEvictionRunsMillis" value="60000" />
-        <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
+        &lt;!&ndash; 配置一个连接在池中最小生存的时间,单位是毫秒 &ndash;&gt;
         <property name="minEvictableIdleTimeMillis" value="300000" />
-        <!-- 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效 -->
+        &lt;!&ndash; 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效 &ndash;&gt;
         <property name="testWhileIdle" value="true" />
-        <!-- 指定每个连接上PSCache的大小   -->
+        &lt;!&ndash; 指定每个连接上PSCache的大小   &ndash;&gt;
         <property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
-    </bean>
+    </bean>-->
 
-    <bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter">
+    <!--<bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter">
         <property name="slowSqlMillis" value="1000"/>
         <property name="logSlowSql" value="true"/>
         <property name="mergeSql" value="true"/>
-    </bean>
+    </bean>-->
 
-    <bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter">
+    <!--<bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter">
         <property name="dbType" value="mysql"/>
         <property name="config" ref="wall-filter-config"/>
-    </bean>
+    </bean>-->
 
-    <bean id="wall-filter-config" class="com.alibaba.druid.wall.WallConfig">
+    <!--<bean id="wall-filter-config" class="com.alibaba.druid.wall.WallConfig">
         <property name="multiStatementAllow" value="true"/>
-    </bean>
+    </bean>-->
 
     <bean id="druid-stat-interceptor" class="com.alibaba.druid.support.spring.stat.DruidStatInterceptor"></bean>
     <bean id="druid-stat-pointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut" scope="prototype">

+ 1 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusDevProperties.java

@@ -9,6 +9,7 @@ import java.io.Serializable;
  * @since 1.0
  * 2018-09-27
  */
+@Deprecated
 public class CusDevProperties extends CusProperties implements Serializable {
 
 }

+ 1 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusProdProperties.java

@@ -9,6 +9,7 @@ import java.io.Serializable;
  * @since 1.0
  * 2018-09-27
  */
+@Deprecated
 public class CusProdProperties extends CusProperties implements Serializable {
 
 }

+ 1 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusProperties.java

@@ -7,6 +7,7 @@ import java.io.Serializable;
  * @since 1.0
  * 2018-09-27
  */
+@Deprecated
 public class CusProperties implements Serializable {
 
     private static final long serialVersionUID = 6510286205689738234L;

+ 1 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusPropertiesBuilder.java

@@ -14,6 +14,7 @@ import javax.annotation.PostConstruct;
  * 2018-09-27
  */
 @Component
+@Deprecated
 public class CusPropertiesBuilder {
     private static final Logger logger = LoggerFactory.getLogger(CusPropertiesBuilder.class);
 

+ 1 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/pay/data/open/cus/CusPropertiesConfiguration.java

@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component;
  * 2018-09-27
  */
 @Component
+@Deprecated
 public class CusPropertiesConfiguration {
     private static final String PROD = "prod";
     private static final String DEV = "dev";

+ 1 - 1
kmall-manager/src/main/resources/conf/cus.properties

@@ -1,8 +1,8 @@
 ########## \u6D77\u5173 \u914D\u7F6E ##########
 
+#################### \u5DF2\u5E9F\u5F03 ####################
 # [dev, prod]
 cus.env = prod
-
 # \u5F00\u53D1\u73AF\u5883
 # \u4F01\u4E1A\u8FD4\u56DE\u6D77\u5173\u5B9E\u65F6\u6570\u636E\u63A5\u53E3\u5730\u5740
 cus.dev.payDateUrl=https://swapptest.singlewindow.cn/ceb2grab/grab/realTimeDataUpload

+ 16 - 16
kmall-manager/src/main/resources/conf/db.properties

@@ -1,22 +1,22 @@
 ########## \u6570\u636E\u5E93\u914D\u7F6E ##########
-
-####========== \u5F00\u53D1\u73AF\u5883 ==========
-jdbc.url=jdbc:mysql://14.29.226.8:3306/kmall-haikong?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
-jdbc.username=root
-jdbc.password=G$Debpk^pn
+# \u73AF\u5883\u914D\u7F6E\uFF1A[dev, prod, pre, test]
+jdbc.env=prod
 ####========== \u6D4B\u8BD5\u73AF\u5883 ==========
-#jdbc.url=jdbc:mysql://192.168.1.202:3306/kmall-haikong?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
-#jdbc.username=root
-#jdbc.password=t2GlpD6z
+jdbc.test.url=jdbc:mysql://14.29.226.8:3306/kmall-haikong?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
+jdbc.test.username=root
+jdbc.test.password=G$Debpk^pn
+####========== \u5F00\u53D1\u73AF\u5883 ==========
+jdbc.dev.url=jdbc:mysql://192.168.1.202:3306/kmall-haikong?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
+jdbc.dev.username=root
+jdbc.dev.password=t2GlpD6z
 ####========== \u751F\u4EA7\u73AF\u5883 ==========
-# \u5F85\u5B9A
-#jdbc.url=jdbc:mysql://:3306/kmall-haikong?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
-#jdbc.username=kmall_cw
-#jdbc.password=eb6zHJg%x3
-#\u672C\u5730\u6D4B\u8BD5\u5E93
-#jdbc.url=jdbc:mysql://192.168.1.202:3306/kmall-haikong?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
-#jdbc.username=root
-#jdbc.password=t2GlpD6z
+jdbc.prod.url=jdbc:mysql://rm-wz942te7t69x262100o.mysql.rds.aliyuncs.com:3306/kmall-haikong?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
+jdbc.prod.username=zhdf
+jdbc.prod.password=Greereal@600185
+# \u9884\u53D1\u5E03\u5E93
+jdbc.pre.url=jdbc:mysql://127.0.0.1:3306/kmall_haikong?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
+jdbc.pre.username=root
+jdbc.pre.password=G$Debpk^pn
 
 
 # \u901A\u7528\u914D\u7F6E

+ 1 - 1
kmall-manager/src/main/resources/conf/express-kdn.properties

@@ -1,7 +1,7 @@
 ########## \u5FEB\u9012-\u5FEB\u9012\u9E1F\u914D\u7F6E ##########
 
 # [dev, prod]
-express.kdn.env=prod
+express.kdn.env=dev
 
 #========== \u5F00\u53D1\u73AF\u5883 ==========
 #\u7535\u5546ID

+ 33 - 22
kmall-manager/src/main/resources/conf/haikong.properties

@@ -1,26 +1,37 @@
 # \u683C\u529B\u5730\u4EA7\u4F1A\u5458\u7CFB\u7EDF
-#### \u6D4B\u8BD5\u73AF\u5883
-haikong.member.url=https://test-ump.greedc.com
-haikong.member.appId=mianshuitestzhanxiao
-haikong.member.appSecret=mianshuitestzhanxiao1029
+
+# \u73AF\u5883\uFF1A[test, prod]
+haikong.env=prod
 haikong.retry=3
-haikong.ware.url=http://yjapi.highstore.cn:8202/esbcenter/api/esb
-haikong.ware.appId=GREE
-haikong.ware.appSecret=GREE1001
-haikong.ware.customerId=GREE1001
-haikong.ware.shopCode=wxe186e23f5a8f0dbf
-haikong.ware.companyCode=44048600Y8
-haikong.ware.code=20
-haikong.ware.signMethod=md5
 
-#\u514D\u7A0Emall\u7CFB\u7EDF
-haikong.vmcconnect.url=https://testmall.greedc.com/openapi/vmcconnect/json
-haikong.vmcconnect.appId=5
-haikong.vmcconnect.secretKey=GXfc6ZtDlnxHxmmAHvfRfqvrqgfwRiJX
-haikong.vmcconnect.requestRetry=2
-#### \u751F\u4EA7\u73AF\u5883
-#haikong.member.url=https://ump.greedc.com
-#haikong.member.appId=
-#haikong.member.appSecret=
-#haikong.ware.url=
+#### \u4F1A\u5458\u7CFB\u7EDF\u6D4B\u8BD5\u73AF\u5883
+haikong.test.member.url=https://test-ump.greedc.com
+haikong.test.member.appId=mianshuitestzhanxiao
+haikong.test.member.appSecret=mianshuitestzhanxiao1029
+
+#### \u4F1A\u5458\u7CFB\u7EDF\u751F\u4EA7\u73AF\u5883
+haikong.prod.member.url=https://ump.greedc.com
+haikong.prod.member.appId=wkbgreedchaiKongkuajing
+haikong.prod.member.appSecret=wkbgreedchaiKongkuajingprodP
+
+#### \u4ED3\u5E93\u751F\u4EA7\u7CFB\u7EDF\uFF0C\u53EA\u6709\u751F\u4EA7
+haikong.prod.ware.url=http://yjapi.highstore.cn:8202/esbcenter/api/esb
+haikong.prod.ware.appId=GREE
+haikong.prod.ware.appSecret=GREE1001
+haikong.prod.ware.customerId=GREE1001
+haikong.prod.ware.shopCode=wxe186e23f5a8f0dbf
+haikong.prod.ware.companyCode=44048600Y8
+haikong.prod.ware.code=20
+haikong.prod.ware.signMethod=md5
+
+#### \u514D\u7A0Emall\u6D4B\u8BD5\u73AF\u5883
+haikong.test.vmcconnect.url=https://testmall.greedc.com/openapi/vmcconnect/json
+haikong.test.vmcconnect.appId=5
+haikong.test.vmcconnect.secretKey=GXfc6ZtDlnxHxmmAHvfRfqvrqgfwRiJX
+haikong.test.vmcconnect.requestRetry=2
 
+#### \u514D\u7A0Emall\u751F\u4EA7\u73AF\u5883
+haikong.prod.vmcconnect.url=https://testmall.greedc.com/openapi/vmcconnect/json
+haikong.prod.vmcconnect.appId=5
+haikong.prod.vmcconnect.secretKey=GXfc6ZtDlnxHxmmAHvfRfqvrqgfwRiJX
+haikong.prod.vmcconnect.requestRetry=2

+ 9 - 5
kmall-manager/src/main/resources/conf/redis.properties

@@ -1,14 +1,18 @@
-########## redis \u914D\u7F6E ##########
+########## redis \u914D\u7F6E ##########1
 
-# [dev, prod]
-redis.env=dev
+# [dev, test, prod]
+redis.env=prod
 
 # \u5F00\u53D1\u73AF\u5883
 redis.dev.keyPrefix=platform
 # \u6D4B\u8BD5redis\uFF0C\u6709\u5BC6\u7801
 redis.dev.host=183.62.225.124
+# \u9884\u53D1\u5E03\u73AF\u5883
+#redis.dev.host=14.29.226.8
 #redis.dev.host=127.0.0.1
 redis.dev.port=6379
+#redis.dev.password=fdsjk337sdb
+# \u6D4B\u8BD5\u73AF\u5883\u5BC6\u7801
 redis.dev.password=Abc-123#*.-
 redis.dev.pool.maxIdle=200
 redis.dev.pool.maxWait=1000
@@ -27,9 +31,9 @@ redis.dev.pool.testOnBorrow=true
 
 # \u751F\u4EA7\u73AF\u5883
 redis.prod.keyPrefix=platform
-redis.prod.host=120.78.152.8
+redis.prod.host=127.0.0.1
 redis.prod.port=6379
-redis.prod.password=Abc-123#*.-
+redis.prod.password=e415MBsvV7
 redis.prod.pool.maxIdle=200
 redis.prod.pool.maxWait=1000
 redis.prod.pool.maxTotal=10000

+ 10 - 10
kmall-manager/src/main/resources/conf/wx-mp.properties

@@ -1,10 +1,10 @@
-########## \u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u914D\u7F6E ##########
+########## \u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u652F\u4ED8\u914D\u7F6E ##########
 
 # [dev, prod]
-pay.wx.env=dev
+pay.wx.env=prod
 
 
-#========== \u5F00\u53D1\u73AF\u5883 ==========
+#========== \u5F00\u53D1\u73AF\u5883 \u4E2D\u7F51\u7684\u914D\u7F6E\uFF08\u6D4B\u8BD5\u7528\uFF09 ==========
 #\u5C0F\u7A0B\u5E8FID
 wx.dev.appId=wxb6b30b1b14ee502a
 #\u5C0F\u7A0B\u5E8F\u5BC6\u94A5
@@ -16,7 +16,7 @@ wx.dev.paySignKey=Zx1245uytDLliom12345622222222222
 #\u4EA4\u6613\u7C7B\u578B
 wx.dev.tradeType=JSAPI
 #\u8BC1\u4E66\u540D\u79F0\uFF0C\u5BF9\u5E94\u4E0D\u540C\u7684\u5546\u6237\u53F7
-wx.dev.certName=/cert/apiclient_cert.p12
+wx.dev.certName=/app/project/kmall_pt/cert/apiclient_cert.p12
 #\u652F\u4ED8\u56DE\u8C03\u5730\u5740
 wx.dev.notifyUrl=http://qhdswl.f3322.net:9001/platform-framework/api/pay/notify
 #\u83B7\u53D6code\u7684\u8BF7\u6C42\u5730\u5740
@@ -48,20 +48,20 @@ wx.dev.templateSendUrl=https://api.weixin.qq.com/cgi-bin/message/subscribe/send?
 
 
 
-#========== \u751F\u4EA7\u73AF\u5883 ==========
+#========== \u751F\u4EA7\u73AF\u5883 \u6D77\u63A7\u7684\u914D\u7F6E ==========
 
 #\u5C0F\u7A0B\u5E8FID
-wx.prod.appId=wxb6b30b1b14ee502a
+wx.prod.appId=wxe186e23f5a8f0dbf
 #\u5C0F\u7A0B\u5E8F\u5BC6\u94A5
-wx.prod.secret=be0234dbbbde4ce68df43dd2b5e4c7b1
+wx.prod.secret=137f5c41a2b919a24ddcc2413dddb015
 #\u5546\u6237\u53F7
-wx.prod.mchId=1501125641
+wx.prod.mchId=1574349031
 #\u652F\u4ED8\u7B7E\u540D
-wx.prod.paySignKey=Zx1245uytDLliom12345622222222222
+wx.prod.paySignKey=hkkjkjweixinzhifupassword1234567
 #\u4EA4\u6613\u7C7B\u578B
 wx.prod.tradeType=JSAPI
 #\u8BC1\u4E66\u540D\u79F0\uFF0C\u5BF9\u5E94\u4E0D\u540C\u7684\u5546\u6237\u53F7
-wx.prod.certName=/app/project/kmall_pt/cert/apiclient_cert.p12
+wx.prod.certName=/app/project/haikong/cert/apiclient_cert.p12
 #\u652F\u4ED8\u56DE\u8C03\u5730\u5740
 wx.prod.notifyUrl=https://mp.k1net.cn/api/pay/notify
 #\u83B7\u53D6code\u7684\u8BF7\u6C42\u5730\u5740

+ 12 - 12
kmall-manager/src/main/resources/spring/spring-jdbc.xml

@@ -37,7 +37,7 @@
         &lt;!&ndash;<property name="transactionIsolation" value="TRANSACTION_REPEATABLE_READ"/>&ndash;&gt;
     </bean>-->
 
-    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
+    <!--<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
           init-method="init" destroy-method="close">
         <property name="url" value="${jdbc.url}"/>
         <property name="username" value="${jdbc.username}"/>
@@ -50,31 +50,31 @@
                 <ref bean="wall-filter"/>
             </list>
         </property>
-        <!--&lt;!&ndash; 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 &ndash;&gt;-->
+        &lt;!&ndash;&lt;!&ndash; 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 &ndash;&gt;&ndash;&gt;
         <property name="timeBetweenEvictionRunsMillis" value="60000" />
-        <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
+        &lt;!&ndash; 配置一个连接在池中最小生存的时间,单位是毫秒 &ndash;&gt;
         <property name="minEvictableIdleTimeMillis" value="300000" />
-        <!-- 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效 -->
+        &lt;!&ndash; 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效 &ndash;&gt;
         <property name="testWhileIdle" value="true" />
-        <!-- 指定每个连接上PSCache的大小   -->
+        &lt;!&ndash; 指定每个连接上PSCache的大小   &ndash;&gt;
         <property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
-    </bean>
+    </bean>-->
 
     <!-- 慢sql日志 -->
-    <bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter">
+    <!--<bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter">
         <property name="slowSqlMillis" value="1000"/>
         <property name="logSlowSql" value="true"/>
         <property name="mergeSql" value="true"/>
-    </bean>
+    </bean>-->
 
-    <bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter">
+    <!--<bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter">
         <property name="dbType" value="mysql"/>
         <property name="config" ref="wall-filter-config"/>
-    </bean>
+    </bean>-->
 
-    <bean id="wall-filter-config" class="com.alibaba.druid.wall.WallConfig">
+    <!--<bean id="wall-filter-config" class="com.alibaba.druid.wall.WallConfig">
         <property name="multiStatementAllow" value="true"/>
-    </bean>
+    </bean>-->
 
     <bean id="druid-stat-interceptor" class="com.alibaba.druid.support.spring.stat.DruidStatInterceptor"></bean>
     <bean id="druid-stat-pointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut" scope="prototype">

+ 5 - 4
sql/init/other_table.sql

@@ -177,7 +177,7 @@ CREATE TABLE `haikong_member_order_sync_resend`  (
   `order_amount` decimal(10, 3) DEFAULT NULL COMMENT '订单金额',
   `order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单编号',
   `order_score` int(8) DEFAULT NULL COMMENT '订单抵扣积分数量',
-  `member_sys_order_id` int(11) DEFAULT NULL COMMENT '会员系统订单id,请求成功返回',
+  `member_sys_order_id` varchar(32) DEFAULT NULL COMMENT '会员系统订单id,请求成功返回',
   `resend_status` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '重发状态,0:等待重发 1:重发成功 2:重发失败 3:无需重发',
   `last_resend_time` datetime(0) DEFAULT NULL COMMENT '最后一次重发时间',
   `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
@@ -256,6 +256,7 @@ CREATE TABLE `haikong_send_order_info_detail_record`  (
   `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品名',
   `cost` decimal(10, 3) DEFAULT NULL COMMENT '明细商品的成本,填零售价',
   `price` decimal(10, 3) DEFAULT NULL COMMENT '销售价',
+  `buy_price` decimal(10, 3) DEFAULT NULL COMMENT '成交价',
   `itemcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
   `amount` decimal(10, 3) DEFAULT NULL COMMENT '明细商品总额,销售价*数量',
   `nums` int(8) DEFAULT NULL COMMENT '明细商品购买数量',
@@ -1353,7 +1354,7 @@ CREATE TABLE `mall_merch_user`  (
   `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
   `is_load_goods` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店商品是否有修改,  0:否 1:是',
   PRIMARY KEY (`id`) USING BTREE,
-  INDEX `idx_user_id`(`user_id`) USING BTREE
+  INDEX `idx_user_id`(`user_id`) USING BTREE,
   INDEX `idx_store_id`(`store_id`) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 77671 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户商户关联表' ROW_FORMAT = Compact;
 
@@ -3112,9 +3113,9 @@ CREATE TABLE `mk_activities_score`  (
   `prod_barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品条码',
   `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'sku',
   `store_id` int(11) DEFAULT NULL COMMENT '门店id',
-  `score_limit` decimal(10, 2) DEFAULT NULL COMMENT '积分最大抵扣比例,如:设为0.3,则积分最多抵扣当前订单价的30%',
+--   `score_limit` decimal(10, 2) DEFAULT NULL COMMENT '积分最大抵扣比例,如:设为0.3,则积分最多抵扣当前订单价的30%',
   `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
-  `deadline` datetime(0) DEFAULT NULL COMMENT '截止日期',
+--   `deadline` datetime(0) DEFAULT NULL COMMENT '截止日期',
   `reject` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '\n0:参与\n 1:不参与,如导入的商品为参与积分抵扣,则默认其余商品为不参与积分抵扣,\n如导入的商品为不参与积分抵扣,则默认其余商品为参与积分抵扣\r',
   `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
   `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',

+ 21 - 28
切换环境需要修改的.md

@@ -1,43 +1,36 @@
 切换环境需要修改的:
 
-1. 微信小程序支付配置
+1. 微信支付配置
     文件目录:resources\conf\wx-mp.properties
-        修改env为prod
+        修改env为prod,需要支付签名文件
 2. Redis配置
     文件目录:resources\conf\redis.properties
         修改env为prod
-3. 打印机配置
-    文件目录:resources\conf\print-ticket.properties
-
-4. 快递鸟配置
-    文件目录:resources\conf\express-kdn.properties
-        修改env为prod
-41. sf快递配置
-    文件目录:resources\conf\express-sf.properties
-        
-5. 云片短信配置
-    文件目录:resources\conf\common.properties
-
-6. 数据源配置
+3. 数据源配置
     文件目录:resources\conf\db.properties
-        切换为生产环境配置
-
-7. 商户配置
-    文件目录:resources\conf\oms-merch.properties
-        oms配置切换为生产环境配置
-
-8. 图片上传配置
+        修改为prod
+4. 图片上传配置
     文件目录:resources\conf\fastdfs.properties
-        切换为生产环境配置
-        
-9. Jdk1.8
+        切换为海控生产环境配置
+
+5. Jdk1.8
     服务器安装jdk1.8,微信退款回调信息解密需要在目录“jdk1.8.0_131\jre\lib\security”中
 替换local_policy.jar、US_export_policy.jar两个安全的jar文件
 
-10. cert安装目录配置在wx-mp.properties的certName中
+6. cert安装目录配置在wx-mp.properties的certName中
+
+7. sale.js修改WebSocket地址,海控为120.76.119.218:8080
 
+8. haikong.properties,修改env为prod
 
-11. sale.js修改WebSocket地址
+9. 系统管理-->系统参数中需配置:
+    HAIKONG_MEMBER_SCORE_LIMIT: 30 (海控平台统一30积分1块钱)
+    HAIKONG_MEMBER_MAX_SCORE_RATIO: 0.5 (积分最大抵扣比例(最多能抵扣订单金额的比例))
+    CUSTOMS_PORT_CODE: 5791 (海关口岸代码)
+    HK_NOTICE_KEY: aD9MNIuAATSUazu64nBz (海控通知回调秘钥)
+    HK_NOTICE_NUM: 100 (通知数据阀值)
 
+10. 微信支付推送海关支付凭证
+    cuspay-wx.properties,修改为海控生产环境配置
 
-12. 测试环境注释掉支付OrderServiceImpl第2022行下面支付方法,正式环境切记不要注释支付方法
+11. 如果测试环境需要测试支付,请在OrderServiceImpl的判断付款码之前加上:env = "prod";