dcs 6 months ago
parent
commit
8a2f9de11d

+ 2 - 1
virgo.api/src/main/java/com/bosshand/virgo/api/operate/controller/OperateFlowDataController.java

@@ -68,7 +68,8 @@ public class OperateFlowDataController {
             if (deviceIds.size() > 0) {
                 operateFlowData.setDeviceIds(deviceIds);
             } else {
-                operateFlowData.setDeviceLevelIds(levelIds);
+                deviceIds.add(-1L);
+                operateFlowData.setDeviceIds(deviceIds);
             }
         }
 

+ 13 - 0
virgo.core/src/main/java/com/bosshand/virgo/core/model/MgrAgent.java

@@ -12,6 +12,11 @@ public class MgrAgent {
      */
     private long organizationId;
 
+    /**
+     * 项目id
+     */
+    private long projectId;
+
     /**
      * 创建者id
      */
@@ -63,6 +68,14 @@ public class MgrAgent {
         this.organizationId = organizationId;
     }
 
+    public long getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(long projectId) {
+        this.projectId = projectId;
+    }
+
     public long getUserId() {
         return userId;
     }

+ 13 - 0
virgo.core/src/main/java/com/bosshand/virgo/core/model/MgrClient.java

@@ -104,6 +104,11 @@ public class MgrClient {
      */
     private long organizationId;
 
+    /**
+     * 项目id
+     */
+    private long projectId;
+
     /**
      * 创建者id
      */
@@ -269,6 +274,14 @@ public class MgrClient {
         this.organizationId = organizationId;
     }
 
+    public long getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(long projectId) {
+        this.projectId = projectId;
+    }
+
     public long getUserId() {
         return userId;
     }

+ 5 - 2
virgo.core/src/main/resources/mapper/MgrAgentMapper.xml

@@ -7,6 +7,7 @@
     <resultMap type="com.bosshand.virgo.core.model.MgrAgent" id="agentResult">
         <id column="id" property="id"/>
         <result column="organizationId" property="organizationId"/>
+        <result column="projectId" property="projectId"/>
         <result column="userId" property="userId"/>
         <result column="name" property="name"/>
         <result column="phone" property="phone"/>
@@ -17,8 +18,8 @@
     </resultMap>
 
     <insert id="insert" parameterType="com.bosshand.virgo.core.model.MgrAgent" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO mgr_agent(`organizationId`, `userId`, `name`, `phone`, `primaryArea`, `remark`, `businessCard`, `status`)
-        VALUES (#{organizationId}, #{userId}, #{name}, #{phone}, #{primaryArea}, #{remark}, #{businessCard}, #{status})
+        INSERT INTO mgr_agent(`organizationId`, `projectId`, `userId`, `name`, `phone`, `primaryArea`, `remark`, `businessCard`, `status`)
+        VALUES (#{organizationId}, #{projectId}, #{userId}, #{name}, #{phone}, #{primaryArea}, #{remark}, #{businessCard}, #{status})
     </insert>
 
     <delete id="delete">
@@ -46,6 +47,7 @@
         SELECT count(*) FROM mgr_agent
         <where>
             <if test="organizationId!=0">and organizationId=#{organizationId}</if>
+            <if test="projectId!=0">and projectId=#{projectId}</if>
             <if test="userId!=0">and userId=#{userId}</if>
             <if test="name!=null">and name=#{name}</if>
             <if test="phone!=null">and phone=#{phone}</if>
@@ -60,6 +62,7 @@
         SELECT * FROM mgr_agent
         <where>
             <if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
+            <if test="p.projectId!=0">and projectId=#{p.projectId}</if>
             <if test="p.userId!=0">and userId=#{p.userId}</if>
             <if test="p.name!=null">and name=#{p.name}</if>
             <if test="p.phone!=null">and phone=#{p.phone}</if>

+ 8 - 4
virgo.core/src/main/resources/mapper/MgrClientMapper.xml

@@ -7,6 +7,7 @@
     <resultMap type="com.bosshand.virgo.core.model.MgrClient" id="clientResult">
         <id column="id" property="id"/>
         <result column="organizationId" property="organizationId"/>
+        <result column="projectId" property="projectId"/>
         <result column="userId" property="userId"/>
         <result column="name" property="name"/>
         <result column="type" property="type"/>
@@ -28,17 +29,17 @@
     </resultMap>
 
     <insert id="insert" parameterType="com.bosshand.virgo.core.model.MgrClient" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO mgr_client(`organizationId`, `userId`, `name`, `type`, `person`, `phone`, `weChatAccount`, `followUpState`, `job`, `demand`, `decorationRequirements`,
+        INSERT INTO mgr_client(`organizationId`, `projectId`, `userId`, `name`, `type`, `person`, `phone`, `weChatAccount`, `followUpState`, `job`, `demand`, `decorationRequirements`,
                                `customerIndustry`, `followUpPerson`, `firsTimeRoom`, `visitingChannels`, `visitingTime`, `remark`, `status`, `highSeas`)
-        VALUES (#{organizationId}, #{userId}, #{name}, #{type}, #{person}, #{phone}, #{weChatAccount}, #{followUpState}, #{job}, #{demand}, #{decorationRequirements},
+        VALUES (#{organizationId}, #{projectId}, #{userId}, #{name}, #{type}, #{person}, #{phone}, #{weChatAccount}, #{followUpState}, #{job}, #{demand}, #{decorationRequirements},
                 #{customerIndustry}, #{followUpPerson}, #{firsTimeRoom}, #{visitingChannels}, #{visitingTime}, #{remark}, #{status}, #{highSeas})
     </insert>
 
     <insert id="batchInsert" parameterType="com.bosshand.virgo.core.model.MgrClient" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO mgr_client(`organizationId`, `userId`, `name`, `type`, `person`, `phone`, `weChatAccount`, `followUpState`, `job`, `demand`, `decorationRequirements`,
+        INSERT INTO mgr_client(`organizationId`, `projectId`, `userId`, `name`, `type`, `person`, `phone`, `weChatAccount`, `followUpState`, `job`, `demand`, `decorationRequirements`,
                                `customerIndustry`, `followUpPerson`, `firsTimeRoom`, `visitingChannels`, `visitingTime`, `remark`, `status`, `highSeas`) VALUES
         <foreach collection="list" item="item" index="index" separator=",">
-               (#{item.organizationId}, #{item.userId}, #{item.name}, #{item.type}, #{item.person}, #{item.phone}, #{item.weChatAccount}, #{item.followUpState}, #{item.job}, #{item.demand}, #{item.decorationRequirements},
+               (#{item.organizationId}, #{projectId}, #{item.userId}, #{item.name}, #{item.type}, #{item.person}, #{item.phone}, #{item.weChatAccount}, #{item.followUpState}, #{item.job}, #{item.demand}, #{item.decorationRequirements},
                 #{item.customerIndustry}, #{item.followUpPerson}, #{item.firsTimeRoom}, #{item.visitingChannels}, #{item.visitingTime}, #{item.remark}, #{item.status}, #{item.highSeas})
         </foreach>
     </insert>
@@ -79,6 +80,7 @@
         SELECT type, COUNT(*) as number FROM mgr_client
         <where>
             <if test="organizationId!=0">and organizationId=#{organizationId}</if>
+            <if test="projectId!=0">and projectId=#{projectId}</if>
             <if test="userId!=0">and userId=#{userId}</if>
             <if test="name!=null">and name=#{name}</if>
             <if test="type!=null">and type=#{type}</if>
@@ -104,6 +106,7 @@
         SELECT count(*) FROM mgr_client
         <where>
             <if test="organizationId!=0">and organizationId=#{organizationId}</if>
+            <if test="projectId!=0">and projectId=#{projectId}</if>
             <if test="userId!=0">and userId=#{userId}</if>
             <if test="name!=null">and name=#{name}</if>
             <if test="type!=null">and type=#{type}</if>
@@ -128,6 +131,7 @@
         SELECT * FROM mgr_client
         <where>
             <if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
+            <if test="p.projectId!=0">and projectId=#{p.projectId}</if>
             <if test="p.userId!=0">and userId=#{p.userId}</if>
             <if test="p.name!=null">and name=#{p.name}</if>
             <if test="p.type!=null">and type=#{p.type}</if>

+ 0 - 2
virgo.manager/src/main/java/com/bosshand/virgo/controller/AgentController.java

@@ -24,8 +24,6 @@ public class AgentController {
     @ApiOperation("获取")
     @RequestMapping(value = "/{currPage}/{pageSize}", method = RequestMethod.POST)
     public Response list(@RequestBody MgrAgent mgrAgent, @PathVariable int currPage, @PathVariable int pageSize) {
-        long id = ContextUtils.getCurrentUser().getId();
-        mgrAgent.setUserId(id);
         int totalCount = agentService.getTotalCount(mgrAgent);
         List<MgrAgent> dataList = agentService.getLimit(mgrAgent, currPage, pageSize);
         Map<String, Object> result = new HashMap<>();

+ 0 - 2
virgo.manager/src/main/java/com/bosshand/virgo/controller/ClientController.java

@@ -34,8 +34,6 @@ public class ClientController {
     @ApiOperation("获取")
     @RequestMapping(value = "/{currPage}/{pageSize}", method = RequestMethod.POST)
     public Response list(@RequestBody MgrClient mgrClient, @PathVariable int currPage, @PathVariable int pageSize) {
-        long id = ContextUtils.getCurrentUser().getId();
-        mgrClient.setUserId(id);
         int totalCount = clientService.getTotalCount(mgrClient);
         List<MgrClient> dataList = clientService.getLimit(mgrClient, currPage, pageSize);
         Map<String, Object> result = new HashMap<>();