src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.java
@@ -56,4 +56,11 @@ */ @SqlParser(filter = true) Integer getDispatcherCount(@Param("dispatcherUnitVO1")DispatcherUnitVO dispatcherUnitVO1); /** * 查询用的派遣信息 * @param userId 用户id * @return */ DispatcherVO getDispatcherInfoByUserId(@Param("userId") Long userId); } src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml
@@ -81,4 +81,18 @@ and dispatcher_unit_id = #{dispatcherUnitVO1.id} </select> <!--查询用的派遣信息--> <select id="getDispatcherInfoByUserId" resultType="org.springblade.modules.dispatcher.vo.DispatcherVO"> select sd.* from sys_dispatcher sd left join sys_dispatcher_unit sdu on sdu.id = sd.dispatcher_unit_id where sd.user_ids = #{userId} and sd.status = 0 </select> </mapper> src/main/java/org/springblade/modules/dispatcher/service/IDispatcherService.java
@@ -52,4 +52,11 @@ * @return */ Integer getDispatcherCount(DispatcherUnitVO dispatcherUnitVO1); /** * 查询用的派遣信息 * @param userId 用户id * @return */ DispatcherVO getDispatcherInfoByUserId(Long userId); } src/main/java/org/springblade/modules/dispatcher/service/impl/DispatcherServiceImpl.java
@@ -87,4 +87,14 @@ public Integer getDispatcherCount(DispatcherUnitVO dispatcherUnitVO1) { return baseMapper.getDispatcherCount(dispatcherUnitVO1); } /** * 查询用的派遣信息 * @param userId 用户id * @return */ @Override public DispatcherVO getDispatcherInfoByUserId(Long userId) { return baseMapper.getDispatcherInfoByUserId(userId); } } src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -662,8 +662,8 @@ * @return */ @GetMapping("/seleL") public R seleL(String type,String deptid, String jurisdiction) { List<Map<String, Object>> list = userService.seleL(type,deptid, jurisdiction); public R seleL(String type,String deptid, String jurisdiction,Long userId) { List<Map<String, Object>> list = userService.seleL(type,deptid, jurisdiction,userId); return R.data(list); } src/main/java/org/springblade/modules/system/mapper/UserMapper.java
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Param; import org.springblade.modules.dispatcher.vo.DispatcherVO; import org.springblade.modules.system.excel.UserExcel; import org.springblade.modules.system.entity.User; import org.springblade.modules.system.node.TreeNode; @@ -150,6 +151,14 @@ */ List<Map<String, Object>> getWorkReportInfo(@Param("type")String type, @Param("deptid")String deptid, @Param("jurisdiction")String jurisdiction); /** * 工作汇报人员(向民警) * @param deptid * @param jurisdiction * @return */ List<Map<String, Object>> getWorkReportInfos(@Param("type")String type, @Param("deptid")String deptid, @Param("jurisdiction")String jurisdiction); /** @@ -165,4 +174,7 @@ * @return */ UserVO getUserDetails(@Param("user") User user); DispatcherVO getDispatcherInfoByUserId(Long userId); } src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -447,4 +447,40 @@ and dept_category=2 </if> </select> <!--获取工作汇报 向民警--> <select id="getWorkReportInfos" resultType="java.util.HashMap"> select bu.* from blade_user bu left join blade_dept bd on bd.id = bu.dept_id where 1=1 and bu.status = 1 and bu.is_deleted = 0 <if test="deptid!=null and deptid!=''"> and bu.dept_id = #{deptid} </if> <if test="jurisdiction!=null and jurisdiction!=''"> and bu.jurisdiction = #{jurisdiction} and dept_category=2 </if> </select> <!--查询用的派遣信息--> <select id="getDispatcherInfoByUserId" resultType="org.springblade.modules.dispatcher.vo.DispatcherVO"> select sd.id,sdu.jurisdiction from sys_dispatcher sd left join sys_dispatcher_unit sdu on sdu.id = sd.dispatcher_unit_id where sd.user_ids = #{userId} and sd.status = 0 </select> </mapper> src/main/java/org/springblade/modules/system/service/IUserService.java
@@ -298,5 +298,5 @@ * @return */ UserVO getUserDetails(User user); List<Map<String, Object>> seleL(String type,String deptid,String jurisdiction); List<Map<String, Object>> seleL(String type,String deptid,String jurisdiction,Long userId); } src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -41,6 +41,9 @@ import org.springblade.core.tool.support.Kv; import org.springblade.core.tool.utils.*; import org.springblade.modules.auth.enums.UserEnum; import org.springblade.modules.dispatcher.service.IDispatcherService; import org.springblade.modules.dispatcher.vo.DispatcherUnitVO; import org.springblade.modules.dispatcher.vo.DispatcherVO; import org.springblade.modules.information.entity.Information; import org.springblade.modules.information.service.IInformationService; import org.springblade.modules.jurisdiction.entity.Jurisdiction; @@ -56,6 +59,7 @@ import org.springblade.modules.system.wrapper.UserWrapper; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import sun.plugin.com.DispatchClient; import java.util.*; @@ -633,7 +637,7 @@ * @return */ @Override public List<Map<String, Object>> seleL(String type,String deptid, String jurisdiction) { public List<Map<String, Object>> seleL(String type,String deptid, String jurisdiction,Long userId) { List<Map<String, Object>> list = new ArrayList<>(); //派遣 if (Integer.parseInt(type)==1){ @@ -646,10 +650,31 @@ } //保安向民警 if (Integer.parseInt(type)==3){ Information information = new Information(); information.setDepartmentid(deptid); Information one = iInformationService.getOne(Condition.getQueryWrapper(information)); list = baseMapper.getWorkReportInfo(type,null, one.getJurisdiction()); //查询用户信息 User user = this.getById(userId); //判断用户是否被派遣 if (null!=user.getDispatch()){ if (user.getDispatch().equals("0")) { //在派遣中,向派遣所在地辖区民警汇报 //查询派遣信息 DispatcherVO dispatcherVO = baseMapper.getDispatcherInfoByUserId(userId); list = baseMapper.getWorkReportInfos(null, null, dispatcherVO.getJurisdiction()); } if (user.getDispatch().equals("1")){ //未派遣或已派遣结束,向单位所在辖区民警汇报 Information information = new Information(); information.setDepartmentid(user.getDeptId()); Information one = iInformationService.getOne(Condition.getQueryWrapper(information)); list = baseMapper.getWorkReportInfos(type,null, one.getJurisdiction()); } }else { //未派遣或已派遣结束,向单位所在辖区民警汇报 Information information = new Information(); information.setDepartmentid(user.getDeptId()); Information one = iInformationService.getOne(Condition.getQueryWrapper(information)); list = baseMapper.getWorkReportInfos(type,null, one.getJurisdiction()); } } //民警对民警 if (Integer.parseInt(type)==4){