فهرست منبع

运营人员管理bugfix

chao 4 سال پیش
والد
کامیت
6a844d0a15

+ 1 - 0
src/main/java/com/caimei365/user/controller/OperationApi.java

@@ -68,6 +68,7 @@ public class OperationApi {
      *                         id        运营人员Id
      *                         id        运营人员Id
      *                     }
      *                     }
      */
      */
+    @ApiOperation("删除运营人员(解绑)")
     @PostMapping("/delete")
     @PostMapping("/delete")
     public ResponseJson deleteOperation(OperationDto operationDto) {
     public ResponseJson deleteOperation(OperationDto operationDto) {
         return operationService.unbindOperation(operationDto);
         return operationService.unbindOperation(operationDto);

+ 4 - 0
src/main/java/com/caimei365/user/model/po/OperationPo.java

@@ -87,6 +87,10 @@ public class OperationPo implements Serializable {
      * 微信openId(Pc)
      * 微信openId(Pc)
      */
      */
     private String pcOpenId;
     private String pcOpenId;
+    /**
+     * 微信openId(crm)
+     */
+    private String crmOpenId;
     /**
     /**
      * 添加时间
      * 添加时间
      */
      */

+ 4 - 4
src/main/java/com/caimei365/user/service/impl/OperationServiceImpl.java

@@ -78,7 +78,7 @@ public class OperationServiceImpl implements OperationService {
             }
             }
             String mobile = operationDto.getMobile();
             String mobile = operationDto.getMobile();
             if (StringUtils.isNotEmpty(mobile)) {
             if (StringUtils.isNotEmpty(mobile)) {
-                AliyunSmsUtil.sendSms(mobile, 11, "{name:"+ name +",code:" + invitationCode + "}");
+                AliyunSmsUtil.sendSms(mobile, 11, "{name:\""+ name +"\",code:" + invitationCode + "}");
                 log.info("欢迎成为"+ name +"的运营人员,您的邀请码为:" + invitationCode);
                 log.info("欢迎成为"+ name +"的运营人员,您的邀请码为:" + invitationCode);
             }
             }
         }
         }
@@ -130,8 +130,8 @@ public class OperationServiceImpl implements OperationService {
             }
             }
             String mobile = operation.getMobile();
             String mobile = operation.getMobile();
             if (StringUtils.isNotEmpty(mobile)) {
             if (StringUtils.isNotEmpty(mobile)) {
-                AliyunSmsUtil.sendSms(mobile, 11, "{name:"+ name +",code:" + invitationCode + "}");
-                log.info("欢迎成为"+ name +"的运营人员,您的邀请码为:" + invitationCode);
+                AliyunSmsUtil.sendSms(mobile, 11, "{name:\""+ name +"\",code:" + invitationCode + "}");
+                log.info("欢迎成为"+ name +"的运营人员,您更新的邀请码为:" + invitationCode);
             }
             }
             flag = operationMapper.updateOperation(operation);
             flag = operationMapper.updateOperation(operation);
         }
         }
@@ -176,7 +176,7 @@ public class OperationServiceImpl implements OperationService {
             // 判断邀请码是否有效
             // 判断邀请码是否有效
             for (OperationVo operation : operationList) {
             for (OperationVo operation : operationList) {
                 // 1未绑定,2已绑定
                 // 1未绑定,2已绑定
-                if (operation.getStatus() == 2) {
+                if (operation.getStatus() != null && operation.getStatus() == 2) {
                     // 邀请码是否有效 1有效,2已使用,3已失效
                     // 邀请码是否有效 1有效,2已使用,3已失效
                     operation.setEffectiveFlag(2);
                     operation.setEffectiveFlag(2);
                 } else {
                 } else {

+ 17 - 14
src/main/resources/mapper/OperationMapper.xml

@@ -35,7 +35,7 @@
     </select>
     </select>
     <select id="getOperationListByUserId" resultType="com.caimei365.user.model.vo.OperationVo">
     <select id="getOperationListByUserId" resultType="com.caimei365.user.model.vo.OperationVo">
         select id, userID as userId, userType, userOrganizeID as organizeId, clubID as clubId, shopID as shopId, account, mobile,
         select id, userID as userId, userType, userOrganizeID as organizeId, clubID as clubId, shopID as shopId, account, mobile,
-            linkName, headimgurl as avatarUrl, invitationCode, status nickName, unionId, openid as openId, crmOpenid as crmOpenId, pcOpenid as pcOpenId,
+            linkName, headimgurl as avatarUrl, invitationCode, status, nickName, unionId, openid as openId, crmOpenid as crmOpenId, pcOpenid as pcOpenId,
             invitationCodeTime, bindTime, updateTime, addTime, delFlag
             invitationCodeTime, bindTime, updateTime, addTime, delFlag
         from cm_mall_operation_user
         from cm_mall_operation_user
         where userID = #{userId} and delFlag = 0
         where userID = #{userId} and delFlag = 0
@@ -98,19 +98,19 @@
     <insert id="insertOperation" keyColumn="id" keyProperty="id" parameterType="com.caimei365.user.model.po.OperationPo">
     <insert id="insertOperation" keyColumn="id" keyProperty="id" parameterType="com.caimei365.user.model.po.OperationPo">
         insert into cm_mall_operation_user
         insert into cm_mall_operation_user
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="userOrganizeID != null">
+            <if test="organizeId != null">
                 userOrganizeID,
                 userOrganizeID,
             </if>
             </if>
-            <if test="userID != null">
+            <if test="userId != null">
                 userID,
                 userID,
             </if>
             </if>
             <if test="userType != null">
             <if test="userType != null">
                 userType,
                 userType,
             </if>
             </if>
-            <if test="shopID != null">
+            <if test="shopId != null">
                 shopID,
                 shopID,
             </if>
             </if>
-            <if test="clubID != null">
+            <if test="clubId != null">
                 clubID,
                 clubID,
             </if>
             </if>
             <if test="account != null">
             <if test="account != null">
@@ -122,7 +122,7 @@
             <if test="linkName != null">
             <if test="linkName != null">
                 linkName,
                 linkName,
             </if>
             </if>
-            <if test="headimgurl != null">
+            <if test="avatarUrl != null">
                 headimgurl,
                 headimgurl,
             </if>
             </if>
             <if test="invitationCode != null">
             <if test="invitationCode != null">
@@ -137,13 +137,13 @@
             <if test="unionId != null">
             <if test="unionId != null">
                 unionId,
                 unionId,
             </if>
             </if>
-            <if test="openid != null">
+            <if test="openId != null">
                 openid,
                 openid,
             </if>
             </if>
-            <if test="crmOpenid != null">
+            <if test="crmOpenId != null">
                 crmOpenid,
                 crmOpenid,
             </if>
             </if>
-            <if test="pcOpenid != null">
+            <if test="pcOpenId != null">
                 pcOpenid,
                 pcOpenid,
             </if>
             </if>
             <if test="invitationCodeTime != null">
             <if test="invitationCodeTime != null">
@@ -172,10 +172,10 @@
             <if test="userType != null">
             <if test="userType != null">
                 #{userType},
                 #{userType},
             </if>
             </if>
-            <if test="shopID != null">
+            <if test="shopId != null">
                 #{shopId},
                 #{shopId},
             </if>
             </if>
-            <if test="clubID != null">
+            <if test="clubId != null">
                 #{clubId},
                 #{clubId},
             </if>
             </if>
             <if test="account != null">
             <if test="account != null">
@@ -187,6 +187,9 @@
             <if test="linkName != null">
             <if test="linkName != null">
                 #{linkName},
                 #{linkName},
             </if>
             </if>
+            <if test="avatarUrl != null">
+                #{avatarUrl},
+            </if>
             <if test="invitationCode != null">
             <if test="invitationCode != null">
                 #{invitationCode},
                 #{invitationCode},
             </if>
             </if>
@@ -270,13 +273,13 @@
             <if test="unionId != null">
             <if test="unionId != null">
                 unionId = #{unionId},
                 unionId = #{unionId},
             </if>
             </if>
-            <if test="openid != null">
+            <if test="openId != null">
                 openid = #{openId},
                 openid = #{openId},
             </if>
             </if>
-            <if test="crmOpenid != null">
+            <if test="crmOpenId != null">
                 crmOpenid = #{crmOpenId},
                 crmOpenid = #{crmOpenId},
             </if>
             </if>
-            <if test="pcOpenid != null">
+            <if test="pcOpenId != null">
                 pcOpenid = #{pcOpenId},
                 pcOpenid = #{pcOpenId},
             </if>
             </if>
             <if test="invitationCodeTime != null">
             <if test="invitationCodeTime != null">

+ 4 - 1
src/test/java/com/caimei365/user/UserApplicationTests.java

@@ -19,7 +19,10 @@ class UserApplicationTests {
 //    void sms(){
 //    void sms(){
 //        String mobile = "15814011616";
 //        String mobile = "15814011616";
 //        String randomCode = CodeUtil.generateCodeInt(6);
 //        String randomCode = CodeUtil.generateCodeInt(6);
-//        AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
+//        String name ="dsfsd";
+//        //AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
+//        AliyunSmsUtil.sendSms(mobile, 11, "{name:\""+ name +"\",code:" + randomCode + "}");
+//
 //    }
 //    }