处理网格员编辑报错问题

This commit is contained in:
wanggeng 2023-02-20 15:42:43 +08:00
parent 1af0a498aa
commit d2ccca3bf4
7 changed files with 182 additions and 99 deletions

46
pom.xml
View File

@ -175,8 +175,54 @@
<build>
<plugins>
<plugin>
<!-- 打包时去除第三方依赖 -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
<includes>
<include>
<groupId>non-exists</groupId>
<artifactId>non-exists</artifactId>
</include>
</includes>
</configuration>
</plugin>
<!-- 拷贝第三方依赖文件到指定目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- target/lib 是依赖jar包的输出目录根据自己喜好配置 -->
<outputDirectory>target/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<!-- 排除静态资源,静态资源自行拷贝 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*.properties</exclude>
<exclude>**/*.xml</exclude>
<exclude>**/*.yml</exclude>
<exclude>static/**</exclude>
<exclude>templates/**</exclude>
<exclude>mybatis/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -22,7 +22,6 @@ import com.cm.systemcity.pojo.dtos.areapoints.GridAndPointsDTO;
import com.cm.systemcity.pojo.dtos.bindingdepartment.BindingDepartmentDTO;
import com.cm.systemcity.pojo.dtos.bindingdepartment.DepartmentDTO;
import com.cm.systemcity.pojo.dtos.community.CommunityDTO;
import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossDTO;
import com.cm.systemcity.pojo.dtos.dict.DictDTO;
import com.cm.systemcity.pojo.dtos.reportcase.ReportCaseDTO;
import com.cm.systemcity.pojo.dtos.userpoints.UserDTO;
@ -41,6 +40,7 @@ import java.util.*;
/**
* 案件类型绑定部门Impl
*
* @author xwangs
* @create 2020-10-27 16:52
* @description
@ -50,10 +50,10 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
@Autowired
private IBindingDepartmentDao bindingDepartmentDao;
@Autowired
private IDepartmentService departmentService;
@Autowired
private IUserService userService;
@Autowired
@ -72,14 +72,14 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
PageHelper.startPage(page.getPage(), page.getRows());
List<BindingDepartmentDTO> dtos = bindingDepartmentDao.listBindingDepartment(page.getParams());
Map<String, Object> params = new HashMap<>(4);
for(BindingDepartmentDTO item : dtos){
for (BindingDepartmentDTO item : dtos) {
params.put("departmentIds", item.getDepartmentId());
List<Map<String, Object>> deptList = bindingDepartmentDao.listDepartment(params);
item.setDepartmentName(deptList == null ? "" : deptList.get(0).get("departmentName").toString());
if(item.getAreaId() != null){
if (item.getAreaId() != null) {
String[] areaIds = item.getAreaId().split(",");
String areaNames = "";
for (String str : areaIds){
for (String str : areaIds) {
params.clear();
params.put("dictId", str);
DictDTO dict = dictService.getDict(params);
@ -89,15 +89,15 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
}
}
PageInfo<BindingDepartmentDTO> pageInfo = new PageInfo<>(dtos);
return new SuccessResultList(dtos,pageInfo.getPageNum(),pageInfo.getTotal());
return new SuccessResultList(dtos, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public List<DepartmentDTO> listAllDepartment(Map<String, Object> params) {
params.put("parentId","0");
params.put("parentId", "0");
JSONArray array = departmentService.listDepartments(params);
List<DepartmentDTO> dtos = new ArrayList<>();
for(int i = 0; i < array.size(); i++){
for (int i = 0; i < array.size(); i++) {
DepartmentDTO dto = new DepartmentDTO();
JSONObject obj = array.getJSONObject(i);
dto.setDepartmentId(obj.getString("id"));
@ -111,7 +111,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
public SuccessResult save(BindingDepartmentDTO dto) throws Exception {
Map<String, Object> param = HashMapUtil.beanToMap(dto);
String bindingDepartmentId = UUIDUtil.getUUID();
param.put("bindingDepartmentId",bindingDepartmentId);
param.put("bindingDepartmentId", bindingDepartmentId);
setSaveInfo(param);
bindingDepartmentDao.save(param);
return new SuccessResult();
@ -129,7 +129,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
@Override
public BindingDepartmentDTO getBindingDepartmentByCaseType(String caseTypeId) {
Map<String, Object> params = getHashMap(4);
params.put("caseType",caseTypeId);
params.put("caseType", caseTypeId);
return bindingDepartmentDao.getBindingDepartment(params);
}
@ -140,16 +140,16 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
}
@Override
public UserDTO getDepartmentUserReturnOne(String departmentId,String token) {
public UserDTO getDepartmentUserReturnOne(String departmentId, String token) {
List<String> roles = new ArrayList<>();
//N员角色
roles.add("bc405346-8714-4ded-89ac-9cc4d755f66a");
List<UserDepartmentResourceBO> userDepartmentResourceBOS = userService.listUserDepartmentResourceByRoleIds(roles);
List<UserDTO> userDTOList = new ArrayList<>();
for(UserDepartmentResourceBO bo : userDepartmentResourceBOS){
for (UserDepartmentResourceBO bo : userDepartmentResourceBOS) {
List<DepartmentResourceBO> departmentList = bo.getDepartments();
for(DepartmentResourceBO departmentItem : departmentList){
if(departmentId.equals(departmentItem.getDepartmentId())){
for (DepartmentResourceBO departmentItem : departmentList) {
if (departmentId.equals(departmentItem.getDepartmentId())) {
UserDTO item = new UserDTO();
item.setUserId(bo.getUserId());
item.setUserName(bo.getUserName());
@ -158,10 +158,10 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
}
}
}
if(userDTOList.size() == 0){
if (userDTOList.size() == 0) {
return null;
}
if(userDTOList.size() > 1){
if (userDTOList.size() > 1) {
Random r = new Random();
int randNum = r.nextInt(userDTOList.size());
return userDTOList.get(randNum);
@ -173,7 +173,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
public List<UserDTO> getCaseTypeDepartmentUsers(Map<String, Object> params) {
String caseTypeId = params.get("caseTypeId").toString();
BindingDepartmentDTO departmentDTO = getBindingDepartmentByCaseType(caseTypeId);
if(departmentDTO == null){
if (departmentDTO == null) {
return new ArrayList<>();
}
//N员角色
@ -181,10 +181,10 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
roles.add("bc405346-8714-4ded-89ac-9cc4d755f66a");
List<UserDepartmentResourceBO> userDepartmentResourceBOS = userService.listUserDepartmentResourceByRoleIds(roles);
List<UserDTO> userDTOList = new ArrayList<>();
for(UserDepartmentResourceBO bo : userDepartmentResourceBOS){
for (UserDepartmentResourceBO bo : userDepartmentResourceBOS) {
List<DepartmentResourceBO> departmentList = bo.getDepartments();
for(DepartmentResourceBO departmentItem : departmentList){
if(departmentDTO.getDepartmentId().equals(departmentItem.getDepartmentId())){
for (DepartmentResourceBO departmentItem : departmentList) {
if (departmentDTO.getDepartmentId().equals(departmentItem.getDepartmentId())) {
UserDTO item = new UserDTO();
item.setUserId(bo.getUserId());
item.setUserName(bo.getUserName());
@ -200,11 +200,11 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
public List<DepartmentSortDTO> listDepartmentForMainPanel(Map<String, Object> query) {
List<DepartmentSortDTO> list = bindingDepartmentDao.listDepartmentForMainPanel(query);
List<DepartmentSortDTO> resList = new ArrayList<>();
for (DepartmentSortDTO item : list){
for (DepartmentSortDTO item : list) {
// 剔除街道 剔除委办局中网格办
if( !"f0bf2d8a-e736-4895-a9c8-80f530068c3a".equals(item.getDepartmentId())
if (!"f0bf2d8a-e736-4895-a9c8-80f530068c3a".equals(item.getDepartmentId())
&& !"52fecef4-f0f5-4077-999c-39db09872718".equals(item.getDepartmentId())
&& !"1a9b5a0c-d842-46ff-b0c5-36a29b9055df".equals(item.getDepartmentId())){
&& !"1a9b5a0c-d842-46ff-b0c5-36a29b9055df".equals(item.getDepartmentId())) {
resList.add(item);
}
}
@ -237,17 +237,17 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
// 先查找部门
List<Map<String, Object>> deptList = bindingDepartmentDao.listDepartment(params);
List<Map<String, Object>> nPersonDept = new ArrayList<>();
for (Map<String, Object> item : deptList){
if(!"f0bf2d8a-e736-4895-a9c8-80f530068c3a".equals(item.get("departmentId"))
for (Map<String, Object> item : deptList) {
if (!"f0bf2d8a-e736-4895-a9c8-80f530068c3a".equals(item.get("departmentId"))
&& !"52fecef4-f0f5-4077-999c-39db09872718".equals(item.get("departmentId"))
&& !"1a9b5a0c-d842-46ff-b0c5-36a29b9055df".equals(item.get("departmentId"))
&& !"1066b4d1-8d72-4b35-ba1a-f59c54eba021".equals(item.get("departmentId"))){
&& !"1066b4d1-8d72-4b35-ba1a-f59c54eba021".equals(item.get("departmentId"))) {
nPersonDept.add(item);
}
}
// 处理职能部门
List<ZTreeDTO> zTreeDTOS = new ArrayList<>();
for (Map<String, Object> item : nPersonDept){
for (Map<String, Object> item : nPersonDept) {
ZTreeDTO zTreeDTO = new ZTreeDTO();
zTreeDTO.setpId("0");
zTreeDTO.setId(item.get("departmentId").toString());
@ -256,17 +256,17 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
zTreeDTOS.add(zTreeDTO);
}
// 根据当前案件类型匹配职能部门优先情况
if(params.get("reportCaseId") != null && !"".equals(params.get("reportCaseId").toString())){
if (params.get("reportCaseId") != null && !"".equals(params.get("reportCaseId").toString())) {
Map<String, Object> query = new HashMap<>(0);
query.put("reportCaseId", params.get("reportCaseId").toString());
ReportCaseDTO reportCase = reportCaseDao.getReportCase(query);
query.put("caseType", reportCase.getCaseTypeId());
query.put("areaId", reportCase.getAreaId());
List<BindingDepartmentDTO> list = bindingDepartmentDao.listBindingDepartmentByCaseType(query);
for(BindingDepartmentDTO item : list){
for (BindingDepartmentDTO item : list) {
String departmentId = item.getDepartmentId();
for(ZTreeDTO treeNode : zTreeDTOS){
if(departmentId.equals(treeNode.getId())){
for (ZTreeDTO treeNode : zTreeDTOS) {
if (departmentId.equals(treeNode.getId())) {
treeNode.setName(treeNode.getName() + "---->【优先分派】");
break;
}
@ -310,26 +310,26 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
public List<ZTreeDTO> listAreaCommunityTree(Map<String, Object> params) {
List<ZTreeDTO> zTreeDTOS = new ArrayList<>();
ReportCaseDTO reportCase = null;
if(params.get("reportCaseId") !=null && !"".equals(params.get("reportCaseId").toString())){
if (params.get("reportCaseId") != null && !"".equals(params.get("reportCaseId").toString())) {
Map<String, Object> query = new HashMap<>(4);
String reportCaseId = params.get("reportCaseId").toString();
query.put("reportCaseId", reportCaseId);
reportCase = reportCaseDao.getReportCase(query);
}
if(params.get("id") == null && reportCase != null){
if (params.get("id") == null && reportCase != null) {
// 从字典表中查询街镇
params.put("dictParentId", "9d179f05-3ea0-48f7-853c-d3b7124b791c");
List<DictDTO> dictDTOS = dictService.listDict(params);
for (DictDTO item : dictDTOS){
for (DictDTO item : dictDTOS) {
// 剔除掉画网格添加的专管员区域节点
if("e64a0a05-45ca-4452-a869-a4dcbff74593".equals(item.getDictId())){
if ("e64a0a05-45ca-4452-a869-a4dcbff74593".equals(item.getDictId())) {
continue;
}
ZTreeDTO zTreeDTO = new ZTreeDTO();
zTreeDTO.setpId("0");
zTreeDTO.setId(item.getDictId());
zTreeDTO.setName(item.getDictName());
if(reportCase.getAreaId().equals(item.getDictId())){
if (reportCase.getAreaId().equals(item.getDictId())) {
zTreeDTO.setName(item.getDictName() + "---->【优先分派】");
}
zTreeDTO.setIsParent(true);
@ -337,17 +337,17 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
}
return zTreeDTOS;
}
if(params.get("id") != null && params.get("id").toString().length() > 0){
if (params.get("id") != null && params.get("id").toString().length() > 0) {
// 从社区表中查询社区列表
Map<String, Object> query = new HashMap<>(4);
query.put("areaId", params.get("id").toString());
List<CommunityDTO> communityDTOS = communityService.listCommunity(query);
for(CommunityDTO item : communityDTOS){
for (CommunityDTO item : communityDTOS) {
ZTreeDTO zTreeDTO = new ZTreeDTO();
zTreeDTO.setpId(params.get("id").toString());
zTreeDTO.setId(item.getCommunityId());
zTreeDTO.setName(item.getCommunityName());
if(reportCase.getCommunityId().equals(item.getCommunityId())){
if (reportCase.getCommunityId().equals(item.getCommunityId())) {
zTreeDTO.setName(item.getCommunityName() + "---->【优先分派】");
}
zTreeDTO.setIsParent(false);
@ -362,44 +362,44 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
public List<UserDTO> listGridUser(Map<String, Object> params) {
List<UserDTO> userDTOList = new ArrayList<>();
// 查询四级网格长
params.put("communityBossLevel","3");
params.put("communityBossLevel", "3");
List<Map<String, Object>> userList4 = reportCaseDao.listUserFromCommunityBoss(params);
for (Map<String, Object> u : userList4){
for (Map<String, Object> u : userList4) {
UserDTO userDTO = new UserDTO();
userDTO.setPrefixUserName("(4级网格长) ");
userDTO.setUserId(u.get("userId").toString());
userDTO.setUserName(u.get("userName").toString());
userDTO.setPhone(u.get("userPhone") == null ? "" : u.get("userPhone").toString());
if(u.get("userPhone") == null || "".equals(u.get("userPhone").toString())){
if (u.get("userPhone") == null || "".equals(u.get("userPhone").toString())) {
userDTO.setPhone(u.get("userUsername") == null ? "" : u.get("userUsername").toString());
}
userDTO.setUserAvatar(u.get("userAvatar") == null ? "" : u.get("userAvatar").toString());
userDTOList.add(userDTO);
}
// 查询五级网格员
params.put("communityBossLevel","4");
params.put("communityBossLevel", "4");
List<Map<String, Object>> userList5 = reportCaseDao.listUserFromCommunityBoss(params);
for (Map<String, Object> u : userList5){
for (Map<String, Object> u : userList5) {
UserDTO userDTO = new UserDTO();
userDTO.setPrefixUserName("(5级网格员) ");
userDTO.setUserId(u.get("userId").toString());
userDTO.setUserName(u.get("userName").toString());
userDTO.setPhone(u.get("userPhone") == null ? "" : u.get("userPhone").toString());
if(u.get("userPhone") == null || "".equals(u.get("userPhone").toString())){
if (u.get("userPhone") == null || "".equals(u.get("userPhone").toString())) {
userDTO.setPhone(u.get("userUsername") == null ? "" : u.get("userUsername").toString());
}
userDTO.setUserAvatar(u.get("userAvatar") == null ? "" : u.get("userAvatar").toString());
userDTOList.add(userDTO);
}
// 根据当前案件定位 匹配网格人员优先情况
if(params.get("reportCaseId") != null && !"".equals(params.get("reportCaseId").toString())) {
if (params.get("reportCaseId") != null && !"".equals(params.get("reportCaseId").toString())) {
Map<String, Object> query = new HashMap<>(0);
String reportCaseId = params.get("reportCaseId").toString();
query.put("reportCaseId", reportCaseId);
ReportCaseDTO reportCase = reportCaseDao.getReportCase(query);
// 查询网格员片区
List<UserDTO> userLinkList = new LinkedList<>();
for(UserDTO item : userDTOList){
for (UserDTO item : userDTOList) {
query.put("userId", item.getUserId());
List<GridAndPointsDTO> gridList = userPointsService.listUserGrid(query);
if (gridList.isEmpty()) {
@ -408,7 +408,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
}
boolean addFirst = false;
for (GridAndPointsDTO pointItem : gridList) {
if(pointItem.getAreaPoints().size() == 0){
if (pointItem.getAreaPoints().size() == 0) {
continue;
}
boolean flag = isOverstep(Double.parseDouble(reportCase.getCaseLongitude()),
@ -420,7 +420,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
break;
}
}
if(addFirst){
if (addFirst) {
((LinkedList<UserDTO>) userLinkList).addFirst(item);
} else {
userLinkList.add(item);
@ -436,7 +436,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
List<UserDTO> userList = new ArrayList<>();
// 查询部门所有专管员
List<Map<String, Object>> nPersonList = reportCaseDao.listUserByDeptId(params.get("id").toString());
for(Map<String, Object> u : nPersonList){
for (Map<String, Object> u : nPersonList) {
UserDTO userDTO = new UserDTO();
userDTO.setUserId(u.get("userId") == null ? "" : u.get("userId").toString());
userDTO.setUserName(u.get("userName") == null ? "" : u.get("userName").toString());
@ -446,14 +446,14 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
userList.add(userDTO);
}
// 根据当前案件定位 匹配专管员优先情况
if(params.get("reportCaseId") != null && !"".equals(params.get("reportCaseId").toString())){
Map<String, Object> query = new HashMap<>(0);
if (params.get("reportCaseId") != null && !"".equals(params.get("reportCaseId").toString())) {
String reportCaseId = params.get("reportCaseId").toString();
query.put("reportCaseId",reportCaseId);
Map<String, Object> query = new HashMap<>(0);
query.put("reportCaseId", reportCaseId);
ReportCaseDTO reportCase = reportCaseDao.getReportCase(query);
// 查询专管员片区
List<UserDTO> userLinkList = new LinkedList<>();
for(UserDTO item : userList){
for (UserDTO item : userList) {
query.put("userId", item.getUserId());
List<GridAndPointsDTO> gridList = userPointsService.listUserGrid(query);
if (gridList.isEmpty()) {
@ -462,7 +462,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
}
boolean addFirst = false;
for (GridAndPointsDTO pointItem : gridList) {
if(pointItem.getAreaPoints().size() == 0){
if (pointItem.getAreaPoints().size() == 0) {
continue;
}
boolean flag = isOverstep(Double.parseDouble(reportCase.getCaseLongitude()),
@ -474,7 +474,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
break;
}
}
if(addFirst){
if (addFirst) {
((LinkedList<UserDTO>) userLinkList).addFirst(item);
} else {
userLinkList.add(item);
@ -538,27 +538,27 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
public SuccessResultList<List<Map<String, Object>>> listPageNPerson(ListPage page) {
Map<String, Object> params = page.getParams();
String departmentId = "0";
if(params.get("departmentId") != null){
if (params.get("departmentId") != null) {
departmentId = params.get("departmentId").toString();
}
PageHelper.startPage(page.getPage(), page.getRows());
List<Map<String, Object>> nPersonList = reportCaseDao.listUserByDeptId(departmentId);
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(nPersonList);
return new SuccessResultList(nPersonList,pageInfo.getPageNum(),pageInfo.getTotal());
return new SuccessResultList(nPersonList, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public List<Map<String, Object>> listNPerson(Map<String, Object> params) {
String departmentId = "";
if(params.get("departmentId") != null
&& params.get("departmentId").toString().length() > 0){
if (params.get("departmentId") != null
&& params.get("departmentId").toString().length() > 0) {
departmentId = params.get("departmentId").toString();
}
Map<String, Object> query = new HashMap<>(8);
query.put("departmentId", departmentId);
List<Map<String, Object>> list = bindingDepartmentDao.listNPerson(params);
for(Map<String, Object> item : list){
if(item.get("relationId") != null && item.get("relationId").toString().length() > 0){
for (Map<String, Object> item : list) {
if (item.get("relationId") != null && item.get("relationId").toString().length() > 0) {
item.put("userName", "[有网格] " + item.get("userName").toString());
}
}

View File

@ -17,7 +17,6 @@ import com.cm.common.utils.UUIDUtil;
import com.cm.plugin.map.service.IGridService;
import com.cm.systemcity.dao.bindingdepartment.IBindingDepartmentDao;
import com.cm.systemcity.dao.communityboss.ICommunityBossDao;
import com.cm.systemcity.dao.userlocation.IUserLocationDao;
import com.cm.systemcity.dao.userpoints.IUserPointsDao;
import com.cm.systemcity.enums.MongoCollections;
import com.cm.systemcity.pojo.dtos.citybuilding.CityBuildingDTO;
@ -26,7 +25,6 @@ import com.cm.systemcity.pojo.dtos.community.CommunityDTO;
import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossAreaDTO;
import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossDTO;
import com.cm.systemcity.pojo.pos.communityboss.CommunityBossPO;
import com.cm.systemcity.service.bindingdepartment.IBindingDepartmentService;
import com.cm.systemcity.service.citybuilding.ICityBuildingService;
import com.cm.systemcity.service.citydistrict.ICityDistrictService;
import com.cm.systemcity.service.community.ICommunityService;
@ -40,7 +38,6 @@ import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.nio.channels.SelectableChannel;
import java.util.*;
/**
@ -88,12 +85,12 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
Map<String, Object> saveMap = new HashMap<>(8);
saveMap.put("communityBossId", communityBossId);
saveMap.put("communityBossUserId", params.get("communityBossUserId").toString());
saveMap.put("communityBossParentId",params.get("communityBossParentId").toString());
saveMap.put("communityBossParentUserId",params.get("communityBossParentUserId").toString());
saveMap.put("communityBossLevel",params.get("communityBossLevel").toString());
saveMap.put("areaId",params.get("areaId").toString());
saveMap.put("areaName",params.get("areaName").toString());
saveMap.put("gridSummary",params.get("gridSummary").toString());
saveMap.put("communityBossParentId", params.get("communityBossParentId").toString());
saveMap.put("communityBossParentUserId", params.get("communityBossParentUserId").toString());
saveMap.put("communityBossLevel", params.get("communityBossLevel").toString());
saveMap.put("areaId", params.get("areaId").toString());
saveMap.put("areaName", params.get("areaName").toString());
saveMap.put("gridSummary", params.get("gridSummary").toString());
setSaveInfo(saveMap);
communityBossDao.saveCommunityBoss(saveMap);
// 三级网格长开始需要绑定社区关系
@ -119,7 +116,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
List<String> list = Arrays.asList(params.get("communityBossIds").toString().split("_"));
Map<String, Object> query = new HashMap<>(8);
// 查询当前删除的人是否还有其他网格身份,如果没有将该人员下所有片区删除
for (String communityBossId : list){
for (String communityBossId : list) {
// 查询用户ID
query.clear();
query.put("communityBossId", communityBossId);
@ -139,7 +136,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
communityBossUserIds.add(communityBossUserId);
query.put("communityBossUserIds", communityBossUserIds);
List<CommunityBossDTO> communityBossDTOS = communityBossService.listCommunityBoss(query);
if(communityBossDTOS == null || communityBossDTOS.size() == 0){
if (communityBossDTOS == null || communityBossDTOS.size() == 0) {
// 若没有其他网格身份,删除所有片区
List<String> userIds = new ArrayList<>();
userIds.add(communityBoss.getCommunityBossId());
@ -149,7 +146,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
List<Map<String, Object>> gridList = userPointsDao.listMapGrid(query);
// 将查询到的所有网格删掉
List<String> delArray = new ArrayList<>();
for(Map<String, Object> delItem : gridList ){
for (Map<String, Object> delItem : gridList) {
String delGridId = delItem.get("grid_id").toString();
delArray.add(delGridId);
gridService.deleteGridByGridIds(delArray);
@ -166,13 +163,13 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
setUpdateInfo(params);
communityBossDao.updateCommunityBoss(params);
// 处理网格人员社区绑定关系
if(params.get("communityId") != null && params.get("communityId").toString().length() > 0){
if (params.get("communityId") != null && params.get("communityId").toString().length() > 0) {
Map<String, Object> query = new HashMap<>(8);
query.put("communityBossId", params.get("communityBossId").toString());
query.put("communityId", params.get("communityId").toString());
// 先查询 查不到新增查得到修改
Map<String, Object> bindInfo = bindDao.getCommunityAndGridUserBind(params);
if(bindInfo == null && bindInfo.get("community_boss_id") == null){
if (bindInfo == null && bindInfo.get("community_boss_id") == null) {
bindDao.saveCommunityAndGridUserBind(query);
} else {
bindDao.updateCommunityAndGridUserBind(query);
@ -337,8 +334,15 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
@Override
public List<CommunityBossDTO> listCommunityBoss(Map<String, Object> params) throws SearchException {
List<CommunityBossDTO> list = communityBossDao.listCommunityBoss(params);
for(CommunityBossDTO item : list){
for (int i = 0; i < list.size(); i++) {
CommunityBossDTO item = list.get(i);
Map<String, Object> currentUser = bindDao.getSysUserById(item.getCommunityBossUserId());
if (currentUser == null) {
LOG.error("网格员不存在username, 【{}】, userId【{}】", item.getCommunityBossName(), item.getCommunityBossPhone(), item.getCommunityBossId());
list.remove(i);
i--;
continue;
}
item.setCommunityBossName(currentUser.get("user_name").toString());
item.setCommunityBossUsername(currentUser.get("user_username").toString());
item.setCommunityBossPhone(currentUser.get("user_phone").toString());
@ -346,7 +350,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
Map<String, Object> parentUser = bindDao.getSysUserById(item.getCommunityBossParentUserId());
item.setCommunityBossParentName(parentUser == null ? "" : parentUser.get("user_name").toString());
// 设置社区()
if(item.getCommunityId() != null && item.getCommunityId().length() > 0){
if (item.getCommunityId() != null && item.getCommunityId().length() > 0) {
params.clear();
params.put("communityId", item.getCommunityId());
CommunityDTO community = communityService.getCommunity(params);
@ -395,13 +399,13 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
String areaId = "";
String communityId = "";
String communityBossLevel = "";
if(params.get("areaId") != null && params.get("areaId").toString().length() != 0){
if (params.get("areaId") != null && params.get("areaId").toString().length() != 0) {
areaId = params.get("areaId").toString();
}
if(params.get("communityId") != null && params.get("communityId").toString().length() != 0){
if (params.get("communityId") != null && params.get("communityId").toString().length() != 0) {
communityId = params.get("communityId").toString();
}
if(params.get("communityBossLevel") != null && params.get("communityBossLevel").toString().length() != 0){
if (params.get("communityBossLevel") != null && params.get("communityBossLevel").toString().length() != 0) {
communityBossLevel = params.get("communityBossLevel").toString();
}
Map<String, Object> query = new HashMap<>();
@ -409,17 +413,17 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
query.put("communityId", communityId);
query.put("communityBossLevel", communityBossLevel);
List<Map<String, Object>> gridUserList = communityBossDao.listGridUser(query);
if(gridUserList == null || gridUserList.size() == 0){
if (gridUserList == null || gridUserList.size() == 0) {
return new ArrayList<>(0);
}
List<CommunityBossDTO> list = new ArrayList<>();
for (Map<String, Object> item : gridUserList){
for (Map<String, Object> item : gridUserList) {
query.put("userId", item.get("community_boss_user_id").toString());
List<Map<String, Object>> relationGridList = userPointsDao.listUserGrid(query);
CommunityBossDTO gridUser = new CommunityBossDTO();
gridUser.setCommunityBossName(item.get("user_name").toString());
if(relationGridList != null && relationGridList.size() > 0){
if (relationGridList != null && relationGridList.size() > 0) {
gridUser.setCommunityBossName("[有网格] " + item.get("user_name").toString());
}
gridUser.setCommunityBossUserId(item.get("community_boss_user_id").toString());

View File

@ -24,7 +24,7 @@ spring:
max-request-size: 1GB
datasource:
druid:
url: jdbc:mysql://127.0.0.1:3306/db_btgxq_usercenter?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
url: jdbc:mysql://192.168.0.103:3306/db_btgxq_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
db-type: mysql
driver-class-name: com.mysql.jdbc.Driver
username: root
@ -55,7 +55,7 @@ spring:
config: classpath:ehcache.xml
data:
mongodb:
uri: mongodb://city:city@127.0.0.1:27017/systemcity
uri: mongodb://city:city@192.168.0.103:27017/systemcity
# 数据库
mybatis:

View File

@ -144,14 +144,18 @@
initCommunity('');
initCaseType();
initChildCaseType('');
restAjax.get('app/data-external-release/get-report-case-by-number/' + caseNumber, {}, null, function(code, data) {
if(typeof (data['caseFlowType']) != 'undefined' && data['caseFlowType'] != ''){
$('#caseFlowType').val(data['caseFlowType']);
initTable();
}
form.render('select');
}, function(code, data) {
});
if(caseNumber) {
restAjax.get('app/data-external-release/get-report-case-by-number/' + caseNumber, {}, null, function(code, data) {
if(typeof (data['caseFlowType']) != 'undefined' && data['caseFlowType'] != ''){
$('#caseFlowType').val(data['caseFlowType']);
initTable();
}
form.render('select');
}, function(code, data) {
});
} else {
initTable();
}
}
init();

View File

@ -112,6 +112,20 @@
$('#areaId').val(areaId);
$('#areaName').val(areaName);
layer.open({
type: 2,
title: '案件转派',
closeBtn: 1,
area: ['50%', '80%'],
shadeClose: false,
shade : 0.3,
anim: 2,
content: top.restAjax.path('route/reportcase/case_assign.html?reportCaseId=0208cfb8-07fa-478c-8c65-80a944371e04', []),
end: function() {
reloadTable();
}
});
// 初始化表格
function initTable() {
dataLoading = true;

View File

@ -22,6 +22,12 @@
background-color: #009688;
border-color: #009688;
}
.selector-tree-wrapper {
overflow: auto;
}
.selector-body-wrapper {
overflow: auto;
}
</style>
</head>
<body>
@ -43,7 +49,7 @@
<div class="selector-body-search">
<input type="text" class="form-control" id="name" placeholder="检索用户名" oninput="searchUser()"/>
</div>
<div id="users" class="selector-body-content list-group"></div>
<div id="users" class="selector-body-content"></div>
</div>
</div>
<div class="edit-button-footer2">
@ -56,8 +62,10 @@
<script type="text/javascript" src="assets/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="assets/js/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="assets/js/vendor/zTree3/js/jquery.ztree.all.js"></script>
<script type="text/javascript" src="assets/js/vendor/layer/layer.js"></script>
<script type="text/javascript" src="assets/js/common.js"></script>
<script type="text/javascript">
var $win = $(window);
var hrefParams = top.restAjax.params(window.location.href);
var selectedUserIds = hrefParams.selectedUserIds;
var reportCaseId = hrefParams.reportCaseId;
@ -74,6 +82,7 @@
var selectDepartmentUserArray = [];
$(function() {
$('#users').css({height: ($win.height() - 155) +'px', overflow: 'auto'})
$('#app').fadeTo(1000, 1);
initThree();
initSelectedUsers();
@ -126,8 +135,10 @@
// 初始化人员列表
function initUsers(parentId, id) {
top.restAjax.get(top.restAjax.path('api/bindingdepartment/list-org-community-grid-user/{parentId}/{id}',
[parentId, id]), {reportCaseId : reportCaseId}, null, function(code, data) {
let layerIndex;
top.restAjax.get(top.restAjax.path('api/bindingdepartment/list-org-community-grid-user/{parentId}/{id}', [parentId, id]), {
reportCaseId : reportCaseId
}, null, function(code, data) {
$('#users').empty();
var userDom = '';
for(var i = 0, item; item = data[i++];) {
@ -142,7 +153,11 @@
$('#users').append(userDom);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}, function() {
layerIndex = layer.msg('正在加载', {icon: 16, shade: 0.01, time: 0})
}, function() {
layer.close(layerIndex);
});
}
// 人员是否已经选择