Browse Source

运营人员管理bugfix

chao 4 years ago
parent
commit
6a844d0a15

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

@@ -68,6 +68,7 @@ public class OperationApi {
      *                         id        运营人员Id
      *                     }
      */
+    @ApiOperation("删除运营人员(解绑)")
     @PostMapping("/delete")
     public ResponseJson deleteOperation(OperationDto 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)
      */
     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();
             if (StringUtils.isNotEmpty(mobile)) {
-                AliyunSmsUtil.sendSms(mobile, 11, "{name:"+ name +",code:" + invitationCode + "}");
+                AliyunSmsUtil.sendSms(mobile, 11, "{name:\""+ name +"\",code:" + invitationCode + "}");
                 log.info("欢迎成为"+ name +"的运营人员,您的邀请码为:" + invitationCode);
             }
         }
@@ -130,8 +130,8 @@ public class OperationServiceImpl implements OperationService {
             }
             String mobile = operation.getMobile();
             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);
         }
@@ -176,7 +176,7 @@ public class OperationServiceImpl implements OperationService {
             // 判断邀请码是否有效
             for (OperationVo operation : operationList) {
                 // 1未绑定,2已绑定
-                if (operation.getStatus() == 2) {
+                if (operation.getStatus() != null && operation.getStatus() == 2) {
                     // 邀请码是否有效 1有效,2已使用,3已失效
                     operation.setEffectiveFlag(2);
                 } else {

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

@@ -35,7 +35,7 @@
     </select>
     <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,
-            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
         from cm_mall_operation_user
         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 into cm_mall_operation_user
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="userOrganizeID != null">
+            <if test="organizeId != null">
                 userOrganizeID,
             </if>
-            <if test="userID != null">
+            <if test="userId != null">
                 userID,
             </if>
             <if test="userType != null">
                 userType,
             </if>
-            <if test="shopID != null">
+            <if test="shopId != null">
                 shopID,
             </if>
-            <if test="clubID != null">
+            <if test="clubId != null">
                 clubID,
             </if>
             <if test="account != null">
@@ -122,7 +122,7 @@
             <if test="linkName != null">
                 linkName,
             </if>
-            <if test="headimgurl != null">
+            <if test="avatarUrl != null">
                 headimgurl,
             </if>
             <if test="invitationCode != null">
@@ -137,13 +137,13 @@
             <if test="unionId != null">
                 unionId,
             </if>
-            <if test="openid != null">
+            <if test="openId != null">
                 openid,
             </if>
-            <if test="crmOpenid != null">
+            <if test="crmOpenId != null">
                 crmOpenid,
             </if>
-            <if test="pcOpenid != null">
+            <if test="pcOpenId != null">
                 pcOpenid,
             </if>
             <if test="invitationCodeTime != null">
@@ -172,10 +172,10 @@
             <if test="userType != null">
                 #{userType},
             </if>
-            <if test="shopID != null">
+            <if test="shopId != null">
                 #{shopId},
             </if>
-            <if test="clubID != null">
+            <if test="clubId != null">
                 #{clubId},
             </if>
             <if test="account != null">
@@ -187,6 +187,9 @@
             <if test="linkName != null">
                 #{linkName},
             </if>
+            <if test="avatarUrl != null">
+                #{avatarUrl},
+            </if>
             <if test="invitationCode != null">
                 #{invitationCode},
             </if>
@@ -270,13 +273,13 @@
             <if test="unionId != null">
                 unionId = #{unionId},
             </if>
-            <if test="openid != null">
+            <if test="openId != null">
                 openid = #{openId},
             </if>
-            <if test="crmOpenid != null">
+            <if test="crmOpenId != null">
                 crmOpenid = #{crmOpenId},
             </if>
-            <if test="pcOpenid != null">
+            <if test="pcOpenId != null">
                 pcOpenid = #{pcOpenId},
             </if>
             <if test="invitationCodeTime != null">

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

@@ -19,7 +19,10 @@ class UserApplicationTests {
 //    void sms(){
 //        String mobile = "15814011616";
 //        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 + "}");
+//
 //    }