18792927508 vor 2 Jahren
Ursprung
Commit
0c4b3df7f8

+ 2
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java Datei anzeigen

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

+ 23
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserDept.java Datei anzeigen

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 Datei anzeigen

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 Datei anzeigen

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 Datei anzeigen

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 Datei anzeigen

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

+ 57
- 0
ruoyi-system/src/main/resources/mapper/system/SysUserDeptMapper.xml Datei anzeigen

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>