Bladeren bron

Merge branch 'master' of http://git.iamberry.com/liuzhiwei/iamberry-common-tooth

wangxiaoming 7 jaren geleden
bovenliggende
commit
8a63da9b94

+ 9 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/integral/IntegralConfig.java

@@ -15,6 +15,7 @@ public class IntegralConfig implements Serializable {
     private String integralConfigName;      //来源名称
     private Integer integralConfigNumber;   //积分数量
     private Integer integralConfigStatus;   //状态
+    private Integer integralConfigColorId;//产品颜色id
     private Date integralConfigCreateTime;  //创建时间
 
     public Integer getIntegralConfigId() {
@@ -56,4 +57,12 @@ public class IntegralConfig implements Serializable {
     public void setIntegralConfigCreateTime(Date integralConfigCreateTime) {
         this.integralConfigCreateTime = integralConfigCreateTime;
     }
+
+    public Integer getIntegralConfigColorId() {
+        return integralConfigColorId;
+    }
+
+    public void setIntegralConfigColorId(Integer integralConfigColorId) {
+        this.integralConfigColorId = integralConfigColorId;
+    }
 }

+ 1 - 1
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/apparatus/ApparatusService.java

@@ -50,7 +50,7 @@ public interface ApparatusService {
      * @param orderId  订单id  IntegralType为3时有值
      * @return
      */
-    boolean addStayIntegral(String openId,Integer IntegralType,Integer orderAllIntegral,String orderId);
+    boolean addStayIntegral(String openId,Integer IntegralType,Integer orderAllIntegral,String orderId,Integer cololId);
 
     /**
      * 添加产品颜色与pts产品关联信息

+ 9 - 5
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/apparatus/ApparatusServiceImpl.java

@@ -62,11 +62,11 @@ public class ApparatusServiceImpl implements ApparatusService {
             //这里判断是否是会员 1.会员 2.普通用户
             if(memberInfo.getUserIdentity() == 2){
                 //赠送新注册积分
-                addStayIntegral(member.getUserOpenid(),1,0,"");
+                addStayIntegral(member.getUserOpenid(),1,0,"",apparatus.getColorId());
 
             }
             //赠送400新增牙刷积分
-            addStayIntegral(member.getUserOpenid(),2,0,"");
+            addStayIntegral(member.getUserOpenid(),2,0,"",apparatus.getColorId());
            //修改用户信息
             member.setUserIdentity(1);
             if(memberMapper.updateMemberByUserId(member) < 1){
@@ -119,7 +119,7 @@ public class ApparatusServiceImpl implements ApparatusService {
      */
     @Override
     @Transactional
-    public boolean addStayIntegral(String openId,Integer IntegralType,Integer orderAllIntegral,String orderId){
+    public boolean addStayIntegral(String openId,Integer IntegralType,Integer orderAllIntegral,String orderId,Integer cololId){
         if(openId == null||openId.equals("") || IntegralType < 1){
             return false;
         }
@@ -138,8 +138,12 @@ public class ApparatusServiceImpl implements ApparatusService {
                 stayIntegral.setStayRecordedTime(calendar.getTime());
                 break;
             case 2:
-                //新增加牙刷赠送积分数量
-                integralConfig = getIntegralId(248);
+                //新增加牙刷赠送积分数量 根据产品颜色id查询规则表
+                IntegralConfig config = new IntegralConfig();
+                config.setIntegralConfigColorId(cololId);
+                //获取会员获取积分配置信息
+                List<IntegralConfig> configList = useIntegralMapper.listIntegralConfig(config);
+                integralConfig = configList.get(0);
                 stayNumber = integralConfig.getIntegralConfigNumber();
                 //规则表查询新注册会员和新增牙刷积分到账时间(多少天到账)
                 ShopSystemRule addToothRule=systemMapper.selectOneShopRuleById(251);

+ 3 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/useIntegralMapper.xml

@@ -73,6 +73,9 @@
             <if test="integralConfigId != null and integralConfigId != ''">
                 integral_config_id = #{integralConfigId}
             </if>
+            <if test="integralConfigColorId != null and integralConfigColorId != ''">
+                integral_config_color_id = #{integralConfigColorId}
+            </if>
         </where>
     </select>
 

+ 1 - 1
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/pay/ResponseWechatPayHandler.java

@@ -243,7 +243,7 @@ public class ResponseWechatPayHandler {
 							allIntegral += -couponAmount * 3;
 						}
 						ratFWLogger.error(this, "订单:" + orderIdMD5 + "订单使用优惠卷金额:" + couponAmount + "所得积分为:" + allIntegral);
-						boolean flag = apparatusService.addStayIntegral(or.getSalesOpenid(), 3, allIntegral, or.getSalesOrderid());
+						boolean flag = apparatusService.addStayIntegral(or.getSalesOpenid(), 3, allIntegral, or.getSalesOrderid(),null);
 						ratFWLogger.info("积分是否入账:" + flag);
 						/*----------计算积分-----------*/
 

File diff suppressed because it is too large
+ 1 - 1
tooth-wechat-web/src/main/resources/ResultInfo.properties