Kaynağa Gözat

新增违规人员修改

wangliang 1 yıl önce
ebeveyn
işleme
085842e8da

+ 1 - 2
sop-api/src/main/java/com/qmth/sop/server/api/TBSopInfoController.java

@@ -165,7 +165,6 @@ public class TBSopInfoController {
     @RequestMapping(value = "/user/list", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = SysUser.class) })
     public Result userList(@ApiParam(value = "sopId", required = true) @RequestParam Long sop_info_id) {
-        //        return ResultUtil.ok(tbSopInfoService.userList(sop_info_id));
-        return ResultUtil.ok(true);
+        return ResultUtil.ok(tbSopInfoService.userList(sop_info_id));
     }
 }

+ 9 - 0
sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.sop.business.bean.dto.DataPermissionDto;
 import com.qmth.sop.business.bean.result.SopInfoResult;
+import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.entity.TBSopInfo;
 import org.apache.ibatis.annotations.Param;
 
@@ -120,4 +121,12 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
      * @return
      */
     List<SopInfoResult> findFlowByServiceId(@Param("serviceId") Long serviceId);
+
+    /**
+     * 根据sopId查询用户
+     *
+     * @param id
+     * @return
+     */
+    List<SysUser> userList(@Param("id") Long id);
 }

+ 9 - 4
sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoService.java

@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.sop.business.bean.params.*;
 import com.qmth.sop.business.bean.result.*;
-import com.qmth.sop.business.entity.TBCrmDetail;
-import com.qmth.sop.business.entity.TBSopInfo;
-import com.qmth.sop.business.entity.TFCustomFlow;
-import com.qmth.sop.business.entity.TFCustomFlowEntity;
+import com.qmth.sop.business.entity.*;
 import com.qmth.sop.common.enums.ServiceScopeEnum;
 import com.qmth.sop.common.enums.SopStatusEnum;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
@@ -216,4 +213,12 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      * @return
      */
     SopPlanTimeResult querySopPlanTime(String sopNo);
+
+    /**
+     * 根据sopId查询用户
+     *
+     * @param id
+     * @return
+     */
+    List<SysUser> userList(Long id);
 }

+ 11 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -1431,7 +1431,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
      */
     @Override
     public List<SopInfoResult> findFlowByServiceId(Long serviceId) {
-        Objects.requireNonNull(serviceId, "服务单元id不能为空");
         return this.baseMapper.findFlowByServiceId(serviceId);
     }
 
@@ -1517,4 +1516,15 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         }
         return new SopPlanTimeResult(tfCustomFlow.getType(), beginTime, endTime);
     }
+
+    /**
+     * 根据sopId查询用户
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public List<SysUser> userList(Long id) {
+        return this.baseMapper.userList(id);
+    }
 }

+ 17 - 0
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -233,4 +233,21 @@
                 and tffa.status not in('END')
         </where>
     </select>
+
+    <select id="userList" resultType="com.qmth.sop.business.entity.SysUser">
+        SELECT *  FROM sys_user  WHERE
+                id IN (
+                select tbc.lead_id from t_b_sop_info tbsi join t_b_crm tbc on tbc.crm_no = tbsi.crm_no where tbsi.id = #{id}
+                UNION ALL
+                select tbuaa.user_id  from t_b_sop_info tbsi
+                                               join t_b_crm_detail tbcd on tbcd.sop_no = tbsi.sop_no
+                                               join t_b_user_archives_allocation tbuaa on tbuaa.crm_detail_id = tbcd.id
+                where tbsi.id = #{id} and tbuaa.sop_role_type = 'REGION_COORDINATOR'
+                UNION ALL
+                select tbuaa.user_id  from t_b_sop_info tbsi
+                                               join t_b_crm_detail tbcd on tbcd.sop_no = tbsi.sop_no
+                                               join t_b_user_archives_allocation tbuaa on tbuaa.crm_detail_id = tbcd.id
+                where tbsi.id = #{id} and tbuaa.sop_role_type = 'ENGINEER'
+            )
+    </select>
 </mapper>