18792927508 2 лет назад
Родитель
Сommit
0c4b3df7f8

+ 2
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java Просмотреть файл

@@ -182,7 +182,8 @@ public class MsCaseApplicationController extends BaseController {
182 182
     public AjaxResult verifyMediator(@RequestBody BookingVO vo ) {
183 183
         if((vo.getId() == null && StrUtil.isEmpty(vo.getBatchNumber()))
184 184
                 || vo.getCaseFlowId()==null
185
-                || CollectionUtil.isEmpty(vo.getUserList())){
185
+                || vo.getMediatorId()==null
186
+                || StrUtil.isEmpty(vo.getMediatorName())){
186 187
             return error("参数校验失败");
187 188
         }
188 189
         return caseApplicationService.verifyMediator(vo);

+ 23
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserDept.java Просмотреть файл

@@ -0,0 +1,23 @@
1
+package com.ruoyi.common.core.domain.entity;
2
+
3
+import com.ruoyi.common.core.domain.BaseEntity;
4
+import lombok.Data;
5
+
6
+/**
7
+ * 用户和部门关联表 ms_sys_user_dept
8
+ * 
9
+ * @author ruoyi
10
+ */
11
+@Data
12
+public class SysUserDept extends BaseEntity
13
+{
14
+    private static final long serialVersionUID = 1L;
15
+
16
+    /** 部门ID */
17
+    private Long deptId;
18
+
19
+    /** 父部门ID */
20
+    private Long userId;
21
+
22
+
23
+}

+ 54
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserDeptMapper.java Просмотреть файл

@@ -0,0 +1,54 @@
1
+package com.ruoyi.system.mapper;
2
+
3
+import com.ruoyi.common.core.domain.entity.SysUserDept;
4
+import org.apache.ibatis.annotations.Param;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * 用户部门表 数据层
10
+ * 
11
+ * @author ruoyi
12
+ */
13
+public interface SysUserDeptMapper
14
+{
15
+    /**
16
+     * 通过用户ID查询
17
+     * 
18
+     * @param userId 用户ID
19
+     * @return 用户对象信息
20
+     */
21
+    public List<SysUserDept> selectUserById(Long userId);
22
+
23
+    /**
24
+     * 新增
25
+     * 
26
+     * @param sysUserDept
27
+     * @return 结果
28
+     */
29
+    public int insert(SysUserDept sysUserDept);
30
+
31
+    /**
32
+     * 批量新增
33
+     * @param sysUserDept
34
+     * @return
35
+     */
36
+    public int batchSave(@Param("list") List<SysUserDept> sysUserDept);
37
+
38
+    /**
39
+     * 通过用户ID删除
40
+     * 
41
+     * @param userId 用户ID
42
+     * @return 结果
43
+     */
44
+    public int deleteUserById(@Param("userId)") Long userId);
45
+
46
+    /**
47
+     * 批量删除
48
+     * 
49
+     * @param userIds 需要删除的用户ID
50
+     * @return 结果
51
+     */
52
+    public int deleteUserByIds(@Param("ids") Long[] userIds);
53
+
54
+}

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/BookingVO.java Просмотреть файл

@@ -26,7 +26,7 @@ public class BookingVO {
26 26
     /**
27 27
      * 被申请人调解员列表
28 28
      */
29
-    private List<MsCaseMediator>resMediatorList;
29
+    private List<MsCaseMediator> resMediatorList;
30 30
     /**
31 31
      * 开庭日期集合
32 32
      */

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java Просмотреть файл

@@ -23,7 +23,7 @@ public class MsCaseApplicationVO extends MsCaseApplication {
23 23
     /**
24 24
      * 申请机构名称
25 25
      */
26
-    private String applicationOrganName;
26
+    private String applicationName;
27 27
     /**
28 28
      * 被申请人姓名
29 29
      */

+ 21
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Просмотреть файл

@@ -212,8 +212,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
212 212
         }
213 213
         startPage();
214 214
         // 查询案件列表
215
-        List<MsCaseApplicationVO> caseApplicationList = msCaseApplicationMapper.list(req, caseStatusNames);
216
-        return caseApplicationList;
215
+        return  msCaseApplicationMapper.list(req, caseStatusNames);
217 216
     }
218 217
 
219 218
     @Override
@@ -271,12 +270,15 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
271 270
             List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
272 271
             // 保存案件相关人员
273 272
             if (affiliate != null) {
274
-                // 设置申请
273
+                // 设置申请机构
275 274
                 if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
276 275
                     // 组装申请机构
277 276
                     insertDept(affiliate);
278 277
                     // 新增申请机构代理人
279 278
                     insertAgentUser(affiliate);
279
+                }else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
280
+                    // 申请人为自然人
281
+                    //
280 282
                 }
281 283
                 // 压缩包导入,则根据身份证号获取性别和出生日期
282 284
                 String identityNum = affiliate.getRespondentIdentityNum();
@@ -915,6 +917,15 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
915 917
         if (currentFlow == null) {
916 918
             return AjaxResult.error("当前流程不存在");
917 919
         }
920
+        Integer miniProgressFlag = vo.getMiniProgressFlag() == null ? MediatorTypeEnum.PC.getCode() : vo.getMiniProgressFlag();
921
+        // 先删除已选择的调解员,在新增
922
+        Example mediatorExample = new Example(MsCaseMediator.class);
923
+        Example.Criteria mediatorCriteria = mediatorExample.createCriteria();
924
+        mediatorCriteria.andEqualTo("caseAppliId", vo.getId());
925
+        mediatorCriteria.andEqualTo("type", miniProgressFlag);
926
+
927
+        msCaseMediatorMapper.deleteByExample(mediatorExample);
928
+
918 929
         // 获取选择的调解员id
919 930
         List<Long> userIds = vo.getUserList().stream().map(SysUser::getUserId).collect(Collectors.toList());
920 931
         // 新增案件预约表
@@ -923,7 +934,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
923 934
             mediator.setCaseAppliId(vo.getId());
924 935
             mediator.setMediatorId(sysUser.getUserId());
925 936
             mediator.setMediatorName(sysUser.getNickName());
926
-            mediator.setType(vo.getMiniProgressFlag()==null?MediatorTypeEnum.PC.getCode() : vo.getMiniProgressFlag());
937
+            mediator.setType(miniProgressFlag);
927 938
             msCaseMediatorMapper.insert(mediator);
928 939
         }
929 940
 
@@ -977,10 +988,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
977 988
         Example.Criteria criteria = example.createCriteria();
978 989
         if(vo.getMiniProgressFlag() == null) {
979 990
             // 申请人预约,需要查询被申请人是否预约,identity_type不为空
980
-            criteria.andIsNotNull("type");
991
+            criteria.andEqualTo("type", MediatorTypeEnum.MI_NI_PROGRESS.getCode());
981 992
         }else {
982 993
             // 被申请人预约,需要查询申请人是否预约,identity_type为空
983
-            criteria.andIsNull("type");
994
+            criteria.andEqualTo("type", MediatorTypeEnum.PC.getCode());
984 995
         }
985 996
         criteria.andEqualTo("caseAppliId", vo.getId());
986 997
      //   criteria.andEqualTo("mediatorId", user.getUserId());
@@ -1836,8 +1847,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1836 1847
             throw new ServiceException("未找到下一个流程节点");
1837 1848
         }
1838 1849
      //   setMediatorAndDate(application,vo);
1839
-        application.setMediatorId(vo.getUserList().get(0).getUserId());
1840
-        application.setMediatorName(vo.getUserList().get(0).getNickName());
1850
+        application.setMediatorId(vo.getMediatorId());
1851
+        application.setMediatorName(vo.getMediatorName());
1841 1852
         application.setCaseFlowId(nextFlow.getNodeId());
1842 1853
         application.setCaseStatusName(nextFlow.getCaseStatusName());
1843 1854
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
@@ -2190,6 +2201,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2190 2201
             agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
2191 2202
             userMapper.insertUser(agentUser);
2192 2203
             userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
2204
+            // 新增部门用户关联表
2205
+//            sysUserMapper.insertUser()
2193 2206
         } else if (null == agentUser.getDeptId() ) {
2194 2207
             // todo 未关联部门,关联部门
2195 2208
             agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));

+ 57
- 0
ruoyi-system/src/main/resources/mapper/system/SysUserDeptMapper.xml Просмотреть файл

@@ -0,0 +1,57 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.system.mapper.SysUserDeptMapper">
6
+
7
+    <resultMap type="com.ruoyi.common.core.domain.entity.SysUserDept" id="resultMap">
8
+        <id     property="userId"       column="user_id"      />
9
+        <result property="deptId"       column="dept_id"      />
10
+    </resultMap>
11
+
12
+
13
+
14
+
15
+
16
+	<select id="selectUserById" parameterType="Long" resultMap="resultMap">
17
+		select * from ms_sys_user_dept
18
+		where user_id = #{userId}
19
+	</select>
20
+
21
+
22
+
23
+    <insert id="insert" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept">
24
+ 		insert into ms_sys_user_dept(
25
+ 			user_id,
26
+ 			dept_id
27
+ 		)values(
28
+ 			#{userId},
29
+ 			#{deptId}
30
+ 		)
31
+	</insert>
32
+    <insert id="batchSave">
33
+		insert into ms_sys_user_dept(
34
+		user_id,
35
+		dept_id
36
+		)values
37
+		<foreach item="item" index="index" collection="list" separator=",">
38
+		(
39
+		#{item.userId},
40
+		#{item.deptId}
41
+		)
42
+		</foreach>;
43
+	</insert>
44
+
45
+
46
+	<delete id="deleteUserById" parameterType="Long">
47
+		delete from ms_sys_user_dept  where user_id = #{userId}
48
+ 	</delete>
49
+
50
+ 	<delete id="deleteUserByIds" parameterType="Long">
51
+		delete from ms_sys_user_dept  where user_id in
52
+ 		<foreach collection="ids" item="userId" open="(" separator="," close=")">
53
+ 			#{userId}
54
+        </foreach>
55
+ 	</delete>
56
+
57
+</mapper>