dcs 1 年之前
父节点
当前提交
6551d9397d

+ 16 - 3
virgo.api/src/main/java/com/bosshand/virgo/api/model/WorkOrder.java

@@ -79,7 +79,12 @@ public class WorkOrder {
     /**
      * 跟进人
      */
-    private String followUpPerson;
+    private long followUpPerson;
+
+    /**
+     * 跟进人名称
+     */
+    private String followUpPersonName;
 
     /**
      * 联系电话
@@ -242,14 +247,22 @@ public class WorkOrder {
         this.deviceName = deviceName;
     }
 
-    public String getFollowUpPerson() {
+    public long getFollowUpPerson() {
         return followUpPerson;
     }
 
-    public void setFollowUpPerson(String followUpPerson) {
+    public void setFollowUpPerson(long followUpPerson) {
         this.followUpPerson = followUpPerson;
     }
 
+    public String getFollowUpPersonName() {
+        return followUpPersonName;
+    }
+
+    public void setFollowUpPersonName(String followUpPersonName) {
+        this.followUpPersonName = followUpPersonName;
+    }
+
     public String getFollowUpPersonPhone() {
         return followUpPersonPhone;
     }

+ 8 - 9
virgo.api/src/main/resources/mapper/WorkOrderMapper.xml

@@ -18,6 +18,7 @@
         <result column="contractCode" property="contractCode"/>
         <result column="deviceName" property="deviceName"/>
         <result column="followUpPerson" property="followUpPerson"/>
+        <result column="followUpPersonName" property="followUpPersonName"/>
         <result column="followUpPersonPhone" property="followUpPersonPhone"/>
         <result column="workWay" property="workWay"/>
         <result column="compendious" property="compendious"/>
@@ -32,9 +33,9 @@
 
     <insert id="insert" parameterType="com.bosshand.virgo.api.model.WorkOrder" useGeneratedKeys="true" keyProperty="id">
         INSERT INTO work_order(`projectId`, `projectItemTargetRoomIds`, `tenantType`, `merchantId`, `clientId`, `userId`, `contractId`, `contractCode`, `deviceName`, `followUpPerson`,
-                               `followUpPersonPhone`, `workWay`, `compendious`, `picture`, `date`, `name`, `type`, `status`, `attachment`, `data`)
+                               `workWay`, `compendious`, `picture`, `date`, `name`, `type`, `status`, `attachment`, `data`)
         VALUES (#{projectId}, #{projectItemTargetRoomIds}, #{tenantType}, #{merchantId}, #{clientId}, #{userId}, #{contractId}, #{contractCode}, #{deviceName}, #{followUpPerson},
-                #{followUpPersonPhone}, #{workWay}, #{compendious}, #{picture}, now(), #{name}, #{type}, #{status}, #{attachment}, #{data})
+                #{workWay}, #{compendious}, #{picture}, now(), #{name}, #{type}, #{status}, #{attachment}, #{data})
     </insert>
 
     <delete id="delete">
@@ -53,8 +54,7 @@
             <if test="contractId!=0">contractId=#{contractId},</if>
             <if test="contractCode!=null">contractCode=#{contractCode},</if>
             <if test="deviceName!=null">deviceName=#{deviceName},</if>
-            <if test="followUpPerson!=null">followUpPerson=#{followUpPerson},</if>
-            <if test="followUpPersonPhone!=null">followUpPersonPhone=#{followUpPersonPhone},</if>
+            <if test="followUpPerson!=0">followUpPerson=#{followUpPerson},</if>
             <if test="workWay!=null">workWay=#{workWay},</if>
             <if test="compendious!=null">compendious=#{compendious},</if>
             <if test="picture!=null">picture=#{picture},</if>
@@ -68,7 +68,8 @@
     </update>
 
     <sql id="query">
-        SELECT a.*, c.name as merchantName, d.name as clientName FROM work_order a
+        SELECT a.*, b.name as followUpPersonName, b.phone as followUpPersonPhone, c.name as merchantName, d.name as clientName FROM work_order a
+        LEFT JOIN mgr_user b ON a.followUpPerson = b.id
         LEFT JOIN merchant c ON a.merchantId = c.id
         LEFT JOIN mgr_client d ON a.clientId = d.id
     </sql>
@@ -90,8 +91,7 @@
             <if test="contractId!=0">and contractId=#{contractId}</if>
             <if test="contractCode!=null">and contractCode=#{contractCode}</if>
             <if test="deviceName!=null">and deviceName=#{deviceName}</if>
-            <if test="followUpPerson!=null">and followUpPerson=#{followUpPerson}</if>
-            <if test="followUpPersonPhone!=null">and followUpPersonPhone=#{followUpPersonPhone}</if>
+            <if test="followUpPerson!=0">and followUpPerson=#{followUpPerson}</if>
             <if test="workWay!=null">and workWay=#{workWay}</if>
             <if test="compendious!=null">and compendious=#{compendious}</if>
             <if test="picture!=null">and picture=#{picture}</if>
@@ -120,8 +120,7 @@
             <if test="p.contractId!=0">and a.contractId=#{p.contractId}</if>
             <if test="p.contractCode!=null">and a.contractCode=#{p.contractCode}</if>
             <if test="p.deviceName!=null">and a.deviceName=#{p.deviceName}</if>
-            <if test="p.followUpPerson!=null">and a.followUpPerson=#{p.followUpPerson}</if>
-            <if test="p.followUpPersonPhone!=null">and a.followUpPersonPhone=#{p.followUpPersonPhone}</if>
+            <if test="p.followUpPerson!=0">and a.followUpPerson=#{p.followUpPerson}</if>
             <if test="p.workWay!=null">and a.workWay=#{p.workWay}</if>
             <if test="p.compendious!=null">and a.compendious=#{p.compendious}</if>
             <if test="p.picture!=null">and a.picture=#{p.picture}</if>

+ 1 - 1
virgo.api/src/main/resources/mapper/WorkOrderProcessMapper.xml

@@ -42,7 +42,7 @@
 
     <select id="getWorkOrderId" resultMap="workOrderProcessResult">
         <include refid="query"/>
-        where a.workOrderId = #{workOrderId} order by a.date desc
+        where a.workOrderId = #{workOrderId} order by a.date asc
     </select>
 
 </mapper>

+ 3 - 1
virgo.core/src/main/java/com/bosshand/virgo/core/shiro/UserRealm.java

@@ -44,7 +44,9 @@ public class UserRealm extends AuthorizingRealm {
 		if (mgrUser.getStatus() == 1) {
 			throw new AuthenticationException("该用户已被封号");
 		}
-		return new SimpleAuthenticationInfo(phone, CodeCache.getKey(phone), "UserRealm");
+		//return new SimpleAuthenticationInfo(phone, CodeCache.getKey(phone), "UserRealm");
+		// TODO 测试用的,上面的测试好放开
+		return new SimpleAuthenticationInfo(phone, CodeCache.DefaultPhoneCode, "UserRealm");
 	}
 
 	@Override

+ 3 - 1
virgo.core/src/main/java/com/bosshand/virgo/core/shiro/VirgoAuthenticationFilter.java

@@ -116,7 +116,9 @@ public class VirgoAuthenticationFilter extends AuthenticatingFilter {
 			}
 
 			// 手机号验证码注册登录
-			phoneCode = CodeCache.getKey(dto.getPhone());
+			//phoneCode = CodeCache.getKey(dto.getPhone());
+			// TODO 测试用的,上面的测试好放开
+			phoneCode = CodeCache.DefaultPhoneCode;
 			if (!dto.getPhoneCode().equals(phoneCode)) {
 				log.error("手机号验证码注册登录,验证码有误");
 				return createToken(null, null, request, response);