459242451@qq.com 3 年之前
父节点
当前提交
e59bde9aad
共有 23 个文件被更改,包括 416 次插入288 次删除
  1. 7 7
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/NoticeInfoListiner.java
  2. 26 3
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentController.java
  3. 11 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceController.java
  4. 9 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceDetailController.java
  5. 二进制
      ruoyi-admin/src/main/resources/word/incidentDetail.docx
  6. 203 202
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
  7. 0 5
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/Resource.java
  8. 23 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/ResourceDetail.java
  9. 1 1
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/BacklogMessagePushBo.java
  10. 1 1
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/MessagePushBo.java
  11. 2 7
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/ResourceBo.java
  12. 23 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/ResourceDetailBo.java
  13. 23 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/ResourceDetailVo.java
  14. 3 10
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/ResourceVo.java
  15. 2 1
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/mapper/ResourceDetailMapper.java
  16. 1 1
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/IResourceDetailService.java
  17. 1 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/DhServiceImpl.java
  18. 4 3
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentServiceImpl.java
  19. 12 9
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentTaskServiceImpl.java
  20. 26 2
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/ResourceDetailServiceImpl.java
  21. 21 15
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/ResourceServiceImpl.java
  22. 15 11
      ruoyi-zhdd/src/main/resources/mapper/zhdd/ResourceDetailMapper.xml
  23. 2 3
      ruoyi-zhdd/src/main/resources/mapper/zhdd/ResourceMapper.xml

+ 7 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/NoticeInfoListiner.java

@@ -113,7 +113,7 @@ public class NoticeInfoListiner {
             }
             if ("A".equals(type)) {
                 IncidentVo incidentVo = incidentService.queryById(msg.substring(2));
-                title = StrUtil.concat(true, "应急事件:", incidentVo.getName());
+                title = StrUtil.concat(true, incidentVo.getName());
                 synopsis = "请查看派发应急事件消息";
                 content = getDetail(incidentVo).toString();
                 incidentProcess.setDes("事件派发主办单位");
@@ -124,15 +124,15 @@ public class NoticeInfoListiner {
             } else if ("B".equals(type)) {
                 // 查询处置方案
                 IncidentTaskVo incidentTaskVo = incidentTaskService.queryById(msg.substring(2));
-                log.info("查询的处置方案:{}", incidentTaskVo);
+                log.info("查询的处置指令:{}", incidentTaskVo);
                 incidentId = incidentTaskVo.getIncidentId();
                 IncidentVo incidentVo = incidentService.queryById(incidentTaskVo.getIncidentId());
-                title = StrUtil.concat(true, "应急事件:", incidentVo.getName());
+                title = StrUtil.concat(true, incidentVo.getName());
                 synopsis = incidentTaskVo.getTaskName();
                 content = getDetail(incidentVo).toString();
 
                 url = incidentUrl.replace("#incidentId", incidentId).replace("#taskId", incidentTaskVo.getId());
-                incidentProcess.setDes("发送处置方案:" + incidentTaskVo.getTaskName());
+                incidentProcess.setDes("发送处置指令");
                 incidentProcess.setIncidentStatus(3);
                 incidentProcess.setIncidentId(incidentTaskVo.getIncidentId());
                 messageUser = incidentTaskVo.getExprJson();
@@ -148,14 +148,14 @@ public class NoticeInfoListiner {
             if (StrUtil.isBlank(messageUser)) {
                 sendFlag = false;
                 log.info("无发送人员");
-                incidentProcess.setDes("新增处置方案");
+                incidentProcess.setDes("新增处置指令");
                 // 发送的标识,用于是否去查询已读未读人员的
                 incidentProcess.setStatus(0);
             }
             List<MessagePushUser> messagePushUsers = JSONUtil.toList(messageUser, MessagePushUser.class);
             // 针对待办的消息,执行日志还需要把人名显示出来
             if (2 == incidentProcess.getStatus()) {
-                incidentProcess.setDes(incidentProcess.getDes() + " 【待办】 发送给:" + messagePushUsers.stream().map(MessagePushUser::getNickName).collect(Collectors.joining(",")));
+                incidentProcess.setDes(incidentProcess.getDes() + " " + messagePushUsers.stream().map(MessagePushUser::getNickName).collect(Collectors.joining(",")) + "。【待办】");
             }
             incidentProcessService.save(incidentProcess);
             if (sendFlag) {
@@ -311,7 +311,7 @@ public class NoticeInfoListiner {
             incidentProcessService.save(incidentProcess);
 
             IncidentVo incidentVo = incidentService.queryById(incidentId);
-            title = StrUtil.concat(true, "应急事件:", incidentVo.getName());
+            title = StrUtil.concat(true, incidentVo.getName());
             synopsis = "系统给您派发了应急事件,请查看";
 //            text = StrUtil.concat(true, incidentVo.getAddr(), "发生应急事件,请关注消息,做好应急准备");
             text = getDetail(incidentVo).toString();

+ 26 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentController.java

@@ -465,7 +465,6 @@ public class IncidentController extends BaseController {
                 }
                 pics.add(imageEntity);
             }
-            map.put("pics", pics);
 
             // 查询处置过程
             List<IncidentProcess> incidentProcess = processService.list(Wrappers.<IncidentProcess>lambdaQuery()
@@ -477,12 +476,34 @@ public class IncidentController extends BaseController {
             if (incidentTasks != null && incidentTasks.size() > 0) {
                 StringBuilder tasks = new StringBuilder();
                 for (int i = 0; i < incidentTasks.size(); i++) {
-                    tasks.append(i + 1).append("、").append(incidentTasks.get(i).getTaskName()).append(NEW_LINE);
+                    tasks.append(i + 1).append("、");
+//                        .append(incidentTasks.get(i).getTaskName()).append(NEW_LINE)
                     // 查询指令对应的处置过程
                     List<IncidentProcess> processList = processCollect.get(incidentTasks.get(i).getId());
                     if (processList != null && processList.size() > 0) {
                         String collect = processList.stream().map(IncidentProcess::getDes).collect(Collectors.joining(NEW_LINE + "\t"));
-                        tasks.append("    ").append(collect).append(NEW_LINE).append("\t");
+                        tasks.append(collect).append(NEW_LINE).append("\t");
+
+                        String picCollect = processList.stream().map(IncidentProcess::getPic).collect(Collectors.joining(","));
+                        for (String s : StrUtil.split(picCollect, ",")) {
+                            ImageEntity imageEntity = new ImageEntity();
+                            imageEntity.setType(ImageEntity.Data);
+                            imageEntity.setHeight(300);
+                            imageEntity.setWidth(550);
+                            log.info("图片相对地址:{}", s);
+
+                            // 本地资源路径
+                            String localPath = RuoYiConfig.getProfile();
+                            // 数据库资源地址
+                            String downloadPath = localPath + StringUtils.substringAfter(s, Constants.RESOURCE_PREFIX);
+                            try {
+                                imageEntity.setData(FileUtil.readBytes(downloadPath));
+                            } catch (Exception e) {
+                                log.info("读取图片失败:{}", e.getMessage());
+                                continue;
+                            }
+                            pics.add(imageEntity);
+                        }
                     }
                 }
                 map.put("tasks", tasks.toString());
@@ -490,6 +511,8 @@ public class IncidentController extends BaseController {
                 map.put("tasks", "无");
             }
 
+            map.put("pics", pics);
+
         }
 
         String fileName = "incident_" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + ".docx";

+ 11 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceController.java

@@ -74,15 +74,20 @@ public class ResourceController extends BaseController {
     @GetMapping("/list")
     @Security
     public TableDataInfo<ResourceVo> list(@Validated(QueryGroup.class) ResourceBo bo) {
-        if (bo.getResourceType() != null && bo.getResourceType() == 1 && StrUtil.equals(bo.getNotNullFlag(), "1")) {
+        if (StrUtil.equals(bo.getNotNullFlag(), "1")) {
             // 查询存在物资的仓库
-            List<Object> resourceIdExist = iResourceDetailService.queryExistResourceId();
+            List<Object> resourceIdExist = iResourceDetailService.queryExistResourceId(bo.getResourceType());
             bo.setResourceIds(resourceIdExist);
+        } else if (StrUtil.equals(bo.getNotNullFlag(), "2")) {
+            // 查询存在物资的仓库
+            List<Object> resourceIdExist = iResourceDetailService.queryExistResourceId(bo.getResourceType());
+            bo.setResourceNotIds(resourceIdExist);
         }
-        if (bo.getResourceType() != null && bo.getResourceType() == 1 && StrUtil.isNotBlank(bo.getGoodsName())) {
+        if (StrUtil.isNotBlank(bo.getGoodsName())) {
             // 模糊查询有哪些仓库存在此物资
             List<Object> objects = iResourceDetailService.listObjs(new QueryWrapper<ResourceDetail>()
                 .select("distinct resource_id")
+                .eq(bo.getResourceType() != null, "resource_type", bo.getResourceType())
                 .like("name", bo.getGoodsName()));
             if (objects != null && objects.size() > 0) {
                 if (ObjectUtil.isNotEmpty(bo.getResourceIds())) {
@@ -139,8 +144,8 @@ public class ResourceController extends BaseController {
         rspData.setMsg("查询成功");
         rspData.setRows(resourceDetail);
         rspData.setTotal(resourceDetail.size());
-        rspData.setPageSize(bo.getPageSize());
-        rspData.setPageNum(bo.getPageNum());
+//        rspData.setPageSize(bo.getPageSize());
+//        rspData.setPageNum(bo.getPageNum());
         return rspData;
     }
 
@@ -201,7 +206,7 @@ public class ResourceController extends BaseController {
     public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody ResourceBo bo) {
         // 判断名称是否存在
         ResourceVo resourceVo = iResourceService.queryById(bo.getId());
-        if (!resourceVo.getName().equals(bo.getName())) {
+        if (bo.getResourceType() != 3 && !resourceVo.getName().equals(bo.getName())) {
             ResourceVo voOne = iResourceService.getVoOne(Wrappers.<Resource>lambdaQuery().eq(Resource::getName, bo.getName()));
             if (voOne != null) {
                 return AjaxResult.error("名称已存在!");

+ 9 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceDetailController.java

@@ -4,16 +4,19 @@ import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
 import cn.afterturn.easypoi.view.PoiBaseView;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.validate.AddGroup;
 import com.ruoyi.common.core.validate.EditGroup;
 import com.ruoyi.common.core.validate.QueryGroup;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.service.ISysDictTypeService;
 import com.ruoyi.zhdd.domain.Resource;
 import com.ruoyi.zhdd.domain.ResourceDetail;
 import com.ruoyi.zhdd.domain.bo.ResourceDetailBo;
@@ -62,6 +65,7 @@ public class ResourceDetailController extends BaseController {
 
     private final IResourceDetailService iResourceDetailService;
     private final IResourceService resourceService;
+    private final ISysDictTypeService dictTypeService;
 
     /**
      * 查询应急资源明细列表
@@ -89,11 +93,15 @@ public class ResourceDetailController extends BaseController {
 
         Map<String, List<ResourceDetailVo>> collect1 = list.stream().collect(Collectors.groupingBy(ResourceDetailVo::getResourceId));
 
+        // 行业主管单位
+        List<SysDictData> zhdd_admin_org = dictTypeService.selectDictDataByType("zhdd_admin_org");
+        Map<String, String> adminOrgCollect = zhdd_admin_org.stream().collect(Collectors.toMap(SysDictData::getDictValue, SysDictData::getDictLabel));
+
         List<ResourceDetailExport> exportList = new ArrayList<>();
         for (Map.Entry<String, List<ResourceDetailVo>> stringListEntry : collect1.entrySet()) {
             ResourceDetailExport bean = new ResourceDetailExport();
             Resource resource = collect.get(stringListEntry.getKey());
-            bean.setAdminOrgName(resource.getAdminOrgName());
+            bean.setAdminOrgName(StrUtil.isNotBlank(resource.getAdminOrgName()) ? adminOrgCollect.get(resource.getAdminOrgName()) : "");
             bean.setResourceName(resource.getName());
             bean.setManageUnit(resource.getManageUnit());
             bean.setContactName(resource.getContactName());

二进制
ruoyi-admin/src/main/resources/word/incidentDetail.docx


+ 203 - 202
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java

@@ -1,7 +1,7 @@
 package com.ruoyi.system.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
-import com.ruoyi.common.utils.StringUtils;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.ruoyi.common.constant.UserConstants;
@@ -12,6 +12,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DictUtils;
 import com.ruoyi.common.utils.PageUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.mapper.SysDictDataMapper;
 import com.ruoyi.system.mapper.SysDictTypeMapper;
 import com.ruoyi.system.service.ISysDictTypeService;
@@ -32,205 +33,205 @@ import java.util.Map;
 @Service
 public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, SysDictType, SysDictType> implements ISysDictTypeService {
 
-	@Autowired
-	private SysDictDataMapper dictDataMapper;
-
-	/**
-	 * 项目启动时,初始化字典到缓存
-	 */
-	@PostConstruct
-	public void init() {
-		loadingDictCache();
-	}
-
-	@Override
-	public TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType) {
-		Map<String, Object> params = dictType.getParams();
-		LambdaQueryWrapper<SysDictType> lqw = new LambdaQueryWrapper<SysDictType>()
-			.like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName())
-			.eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
-			.like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
-			.apply(StringUtils.isNotEmpty(params.get("beginTime")),
-				"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
-				params.get("beginTime"))
-			.apply(StringUtils.isNotEmpty(params.get("endTime")),
-				"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
-				params.get("endTime"));
-		return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
-	}
-
-	/**
-	 * 根据条件分页查询字典类型
-	 *
-	 * @param dictType 字典类型信息
-	 * @return 字典类型集合信息
-	 */
-	@Override
-	public List<SysDictType> selectDictTypeList(SysDictType dictType) {
-		Map<String, Object> params = dictType.getParams();
-		return list(new LambdaQueryWrapper<SysDictType>()
-			.like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName())
-			.eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
-			.like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
-			.apply(StringUtils.isNotEmpty(params.get("beginTime")),
-				"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
-				params.get("beginTime"))
-			.apply(StringUtils.isNotEmpty(params.get("endTime")),
-				"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
-				params.get("endTime")));
-	}
-
-	/**
-	 * 根据所有字典类型
-	 *
-	 * @return 字典类型集合信息
-	 */
-	@Override
-	public List<SysDictType> selectDictTypeAll() {
-		return list();
-	}
-
-	/**
-	 * 根据字典类型查询字典数据
-	 *
-	 * @param dictType 字典类型
-	 * @return 字典数据集合信息
-	 */
-	@Override
-	public List<SysDictData> selectDictDataByType(String dictType) {
-		List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
-		if (CollUtil.isNotEmpty(dictDatas)) {
-			return dictDatas;
-		}
-		dictDatas = dictDataMapper.selectDictDataByType(dictType);
-		if (CollUtil.isNotEmpty(dictDatas)) {
-			DictUtils.setDictCache(dictType, dictDatas);
-			return dictDatas;
-		}
-		return null;
-	}
-
-	/**
-	 * 根据字典类型ID查询信息
-	 *
-	 * @param dictId 字典类型ID
-	 * @return 字典类型
-	 */
-	@Override
-	public SysDictType selectDictTypeById(Long dictId) {
-		return getById(dictId);
-	}
-
-	/**
-	 * 根据字典类型查询信息
-	 *
-	 * @param dictType 字典类型
-	 * @return 字典类型
-	 */
-	@Override
-	public SysDictType selectDictTypeByType(String dictType) {
-		return getOne(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
-	}
-
-	/**
-	 * 批量删除字典类型信息
-	 *
-	 * @param dictIds 需要删除的字典ID
-	 * @return 结果
-	 */
-	@Override
-	public void deleteDictTypeByIds(Long[] dictIds) {
-		for (Long dictId : dictIds) {
-			SysDictType dictType = selectDictTypeById(dictId);
-			if (dictDataMapper.selectCount(new LambdaQueryWrapper<SysDictData>()
-				.eq(SysDictData::getDictType, dictType.getDictType())) > 0) {
-				throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
-			}
-			DictUtils.removeDictCache(dictType.getDictType());
-		}
-		baseMapper.deleteBatchIds(Arrays.asList(dictIds));
-	}
-
-	/**
-	 * 加载字典缓存数据
-	 */
-	@Override
-	public void loadingDictCache() {
-		List<SysDictType> dictTypeList = list();
-		for (SysDictType dictType : dictTypeList) {
-			List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
-			DictUtils.setDictCache(dictType.getDictType(), dictDatas);
-		}
-	}
-
-	/**
-	 * 清空字典缓存数据
-	 */
-	@Override
-	public void clearDictCache() {
-		DictUtils.clearDictCache();
-	}
-
-	/**
-	 * 重置字典缓存数据
-	 */
-	@Override
-	public void resetDictCache() {
-		clearDictCache();
-		loadingDictCache();
-	}
-
-	/**
-	 * 新增保存字典类型信息
-	 *
-	 * @param dict 字典类型信息
-	 * @return 结果
-	 */
-	@Override
-	public int insertDictType(SysDictType dict) {
-		int row = baseMapper.insert(dict);
-		if (row > 0) {
-			DictUtils.setDictCache(dict.getDictType(), null);
-		}
-		return row;
-	}
-
-	/**
-	 * 修改保存字典类型信息
-	 *
-	 * @param dict 字典类型信息
-	 * @return 结果
-	 */
-	@Override
-	@Transactional
-	public int updateDictType(SysDictType dict) {
-		SysDictType oldDict = getById(dict.getDictId());
-		dictDataMapper.update(null, new LambdaUpdateWrapper<SysDictData>()
-			.set(SysDictData::getDictType, dict.getDictType())
-			.eq(SysDictData::getDictType, oldDict.getDictType()));
-		int row = baseMapper.updateById(dict);
-		if (row > 0) {
-			List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
-			DictUtils.setDictCache(dict.getDictType(), dictDatas);
-		}
-		return row;
-	}
-
-	/**
-	 * 校验字典类型称是否唯一
-	 *
-	 * @param dict 字典类型
-	 * @return 结果
-	 */
-	@Override
-	public String checkDictTypeUnique(SysDictType dict) {
-		Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
-		SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>()
-			.eq(SysDictType::getDictType, dict.getDictType())
-			.last("limit 1"));
-		if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
-			return UserConstants.NOT_UNIQUE;
-		}
-		return UserConstants.UNIQUE;
-	}
+    @Autowired
+    private SysDictDataMapper dictDataMapper;
+
+    /**
+     * 项目启动时,初始化字典到缓存
+     */
+    @PostConstruct
+    public void init() {
+        loadingDictCache();
+    }
+
+    @Override
+    public TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType) {
+        Map<String, Object> params = dictType.getParams();
+        LambdaQueryWrapper<SysDictType> lqw = new LambdaQueryWrapper<SysDictType>()
+            .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName())
+            .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
+            .in(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, StrUtil.split(dictType.getDictType(), ','))
+            .apply(StringUtils.isNotEmpty(params.get("beginTime")),
+                "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
+                params.get("beginTime"))
+            .apply(StringUtils.isNotEmpty(params.get("endTime")),
+                "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
+                params.get("endTime"));
+        return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
+    }
+
+    /**
+     * 根据条件分页查询字典类型
+     *
+     * @param dictType 字典类型信息
+     * @return 字典类型集合信息
+     */
+    @Override
+    public List<SysDictType> selectDictTypeList(SysDictType dictType) {
+        Map<String, Object> params = dictType.getParams();
+        return list(new LambdaQueryWrapper<SysDictType>()
+            .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName())
+            .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
+            .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
+            .apply(StringUtils.isNotEmpty(params.get("beginTime")),
+                "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
+                params.get("beginTime"))
+            .apply(StringUtils.isNotEmpty(params.get("endTime")),
+                "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
+                params.get("endTime")));
+    }
+
+    /**
+     * 根据所有字典类型
+     *
+     * @return 字典类型集合信息
+     */
+    @Override
+    public List<SysDictType> selectDictTypeAll() {
+        return list();
+    }
+
+    /**
+     * 根据字典类型查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    @Override
+    public List<SysDictData> selectDictDataByType(String dictType) {
+        List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
+        if (CollUtil.isNotEmpty(dictDatas)) {
+            return dictDatas;
+        }
+        dictDatas = dictDataMapper.selectDictDataByType(dictType);
+        if (CollUtil.isNotEmpty(dictDatas)) {
+            DictUtils.setDictCache(dictType, dictDatas);
+            return dictDatas;
+        }
+        return null;
+    }
+
+    /**
+     * 根据字典类型ID查询信息
+     *
+     * @param dictId 字典类型ID
+     * @return 字典类型
+     */
+    @Override
+    public SysDictType selectDictTypeById(Long dictId) {
+        return getById(dictId);
+    }
+
+    /**
+     * 根据字典类型查询信息
+     *
+     * @param dictType 字典类型
+     * @return 字典类型
+     */
+    @Override
+    public SysDictType selectDictTypeByType(String dictType) {
+        return getOne(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
+    }
+
+    /**
+     * 批量删除字典类型信息
+     *
+     * @param dictIds 需要删除的字典ID
+     * @return 结果
+     */
+    @Override
+    public void deleteDictTypeByIds(Long[] dictIds) {
+        for (Long dictId : dictIds) {
+            SysDictType dictType = selectDictTypeById(dictId);
+            if (dictDataMapper.selectCount(new LambdaQueryWrapper<SysDictData>()
+                .eq(SysDictData::getDictType, dictType.getDictType())) > 0) {
+                throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
+            }
+            DictUtils.removeDictCache(dictType.getDictType());
+        }
+        baseMapper.deleteBatchIds(Arrays.asList(dictIds));
+    }
+
+    /**
+     * 加载字典缓存数据
+     */
+    @Override
+    public void loadingDictCache() {
+        List<SysDictType> dictTypeList = list();
+        for (SysDictType dictType : dictTypeList) {
+            List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
+            DictUtils.setDictCache(dictType.getDictType(), dictDatas);
+        }
+    }
+
+    /**
+     * 清空字典缓存数据
+     */
+    @Override
+    public void clearDictCache() {
+        DictUtils.clearDictCache();
+    }
+
+    /**
+     * 重置字典缓存数据
+     */
+    @Override
+    public void resetDictCache() {
+        clearDictCache();
+        loadingDictCache();
+    }
+
+    /**
+     * 新增保存字典类型信息
+     *
+     * @param dict 字典类型信息
+     * @return 结果
+     */
+    @Override
+    public int insertDictType(SysDictType dict) {
+        int row = baseMapper.insert(dict);
+        if (row > 0) {
+            DictUtils.setDictCache(dict.getDictType(), null);
+        }
+        return row;
+    }
+
+    /**
+     * 修改保存字典类型信息
+     *
+     * @param dict 字典类型信息
+     * @return 结果
+     */
+    @Override
+    @Transactional
+    public int updateDictType(SysDictType dict) {
+        SysDictType oldDict = getById(dict.getDictId());
+        dictDataMapper.update(null, new LambdaUpdateWrapper<SysDictData>()
+            .set(SysDictData::getDictType, dict.getDictType())
+            .eq(SysDictData::getDictType, oldDict.getDictType()));
+        int row = baseMapper.updateById(dict);
+        if (row > 0) {
+            List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
+            DictUtils.setDictCache(dict.getDictType(), dictDatas);
+        }
+        return row;
+    }
+
+    /**
+     * 校验字典类型称是否唯一
+     *
+     * @param dict 字典类型
+     * @return 结果
+     */
+    @Override
+    public String checkDictTypeUnique(SysDictType dict) {
+        Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
+        SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>()
+            .eq(SysDictType::getDictType, dict.getDictType())
+            .last("limit 1"));
+        if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
 }

+ 0 - 5
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/Resource.java

@@ -75,11 +75,6 @@ public class Resource implements Serializable {
     private Integer num;
 
     /**
-     * 携带物资(应急时)
-     */
-    private String carryGoods;
-
-    /**
      * 联系人
      */
     private String contactName;

+ 23 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/ResourceDetail.java

@@ -39,6 +39,8 @@ public class ResourceDetail implements Serializable {
      */
     private String resourceId;
 
+    private Integer resourceType;
+
     /**
      * 名称
      */
@@ -84,4 +86,25 @@ public class ResourceDetail implements Serializable {
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;
 
+    private String sex;
+
+    private String idcard;
+
+    private String birth;
+
+    private String age;
+
+    private String position;
+
+    private String political;
+
+    private String contactPhone;
+
+    // 车船类型(车辆、船舶)
+    private String carType;
+
+    private String carDetailType;
+    // 限载量
+    private String carLimit;
+
 }

+ 1 - 1
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/BacklogMessagePushBo.java

@@ -14,7 +14,7 @@ import java.util.List;
 @Data
 public class BacklogMessagePushBo {
     // 应用id号(与注册到统一登陆平台的一致)
-    private String appId = "3bcb760743ea456faba29a1dfb247bf4";
+    private String appId = "fa6f711286474bff8b1aae7d89775f03";
     private String uuId;
     // 签名(值为MD5(AppId+ SendTime +Content)
     private String verify;

+ 1 - 1
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/MessagePushBo.java

@@ -13,7 +13,7 @@ import java.util.List;
  */
 @Data
 public class MessagePushBo {
-    private String appId = "3bcb760743ea456faba29a1dfb247bf4";
+    private String appId = "fa6f711286474bff8b1aae7d89775f03";
     private String uuId;
     // 签名(值为MD5(AppId+ SendTime +Content)
     private String verify;

+ 2 - 7
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/ResourceBo.java

@@ -46,7 +46,7 @@ public class ResourceBo extends BaseEntity {
      * 名称
      */
     @ApiModelProperty(value = "名称")
-    @NotBlank(message = "name不能为空", groups = {AddGroup.class, EditGroup.class})
+//    @NotBlank(message = "name不能为空", groups = {AddGroup.class, EditGroup.class})
     private String name;
 
     /**
@@ -86,12 +86,6 @@ public class ResourceBo extends BaseEntity {
     private Integer num;
 
     /**
-     * 携带物资(应急时)
-     */
-    @ApiModelProperty(value = "携带物资(应急时)")
-    private String carryGoods;
-
-    /**
      * 联系人
      */
     @ApiModelProperty(value = "联系人")
@@ -146,6 +140,7 @@ public class ResourceBo extends BaseEntity {
     private String goodsName;
 
     private List<Object> resourceIds;
+    private List<Object> resourceNotIds;
 
     // 等于1的情况下,查询存在物资的仓库
     private String notNullFlag;

+ 23 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/ResourceDetailBo.java

@@ -32,6 +32,8 @@ public class ResourceDetailBo extends BaseEntity {
     @ApiModelProperty(value = "资源id")
     private String resourceId;
 
+    private Integer resourceType;
+
     /**
      * 名称
      */
@@ -66,6 +68,27 @@ public class ResourceDetailBo extends BaseEntity {
 
     private String pic;
 
+    private String sex;
+
+    private String idcard;
+
+    private String birth;
+
+    private String age;
+
+    private String position;
+
+    private String political;
+
+    private String contactPhone;
+
+    // 车船类型(车辆、船舶)
+    private String carType;
+
+    private String carDetailType;
+    // 限载量
+    private String carLimit;
+
     /**
      * $column.columnComment
      */

+ 23 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/ResourceDetailVo.java

@@ -32,6 +32,8 @@ public class ResourceDetailVo {
     @ApiModelProperty("资源id")
     private String resourceId;
 
+    private Integer resourceType;
+
     /**
      * 名称
      */
@@ -72,5 +74,26 @@ public class ResourceDetailVo {
     @ApiModelProperty("单位")
     private String unit;
 
+    private String sex;
+
+    private String idcard;
+
+    private String birth;
+
+    private String age;
+
+    private String position;
+
+    private String political;
+
+    private String contactPhone;
+
+    // 车船类型(车辆、船舶)
+    private String carType;
+
+    private String carDetailType;
+    // 限载量
+    private String carLimit;
+
 
 }

+ 3 - 10
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/ResourceVo.java

@@ -2,7 +2,6 @@ package com.ruoyi.zhdd.domain.vo;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import com.ruoyi.common.annotation.ExcelDictFormat;
 import com.ruoyi.common.core.domain.TreeSelect;
 import com.ruoyi.zhdd.domain.ResourceDetail;
 import io.swagger.annotations.ApiModel;
@@ -85,17 +84,11 @@ public class ResourceVo {
     /**
      * 人数
      */
-    @Excel(name = "人数")
-    @ApiModelProperty("人数")
+    @ApiModelProperty("物资数量、队伍数量、车辆数量")
     private Integer num;
 
-    /**
-     * 携带物资(应急时)
-     */
-    @Excel(name = "携带物资")
-    @ExcelDictFormat(readConverterExp = "应=急时")
-    @ApiModelProperty("携带物资(应急时)")
-    private String carryGoods;
+    @ApiModelProperty("船舶数量")
+    private Integer shipNum;
 
     /**
      * 联系人

+ 2 - 1
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/mapper/ResourceDetailMapper.java

@@ -6,6 +6,7 @@ import com.ruoyi.zhdd.domain.Resource;
 import com.ruoyi.zhdd.domain.ResourceDetail;
 import com.ruoyi.zhdd.domain.bo.ResourceDetailBo;
 import com.ruoyi.zhdd.domain.vo.ResourceDetailStatic;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -21,7 +22,7 @@ public interface ResourceDetailMapper extends BaseMapperPlus<ResourceDetail> {
 
     List<JSONObject> queryResourceAvailable(List<String> resourceId);
 
-    List<Object> queryExistResourceId();
+    List<Object> queryExistResourceId(@Param("resouceType") Integer resouceType);
 
     List<ResourceDetailStatic> queryResourceTotalNum();
 }

+ 1 - 1
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/IResourceDetailService.java

@@ -65,7 +65,7 @@ public interface IResourceDetailService extends IServicePlus<ResourceDetail, Res
 
     List<JSONObject> queryResourceAvailable(String id);
 
-    List<Object> queryExistResourceId();
+    List<Object> queryExistResourceId(Integer resouceType);
 
     List<ResourceDetailStatic> queryResourceTotalNum();
 }

+ 1 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/DhServiceImpl.java

@@ -71,6 +71,7 @@ public class DhServiceImpl implements IDhService {
             throw new ServiceException("大华融合通信平台无法连接,请联系大华融合通信平台维护人员检查!");
         }
         JSONObject postOneJson = JSONUtil.parseObj(postOne);
+        log.info("大华创建会话的返回结果:{}", postOneJson);
         if (postOneJson.containsKey("realm")) {
             String randomKey = postOneJson.getStr("randomKey");
             String realm = postOneJson.getStr("realm");

+ 4 - 3
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentServiceImpl.java

@@ -330,16 +330,17 @@ public class IncidentServiceImpl extends ServicePlusImpl<IncidentMapper, Inciden
                     StrUtil.blankToDefault(taskUserCollect, "无")));
                 task.setSendFlag("1");
                 task.setMessagePushUsers(new ArrayList<>(sendUser));
-                task.setTaskSend("1");
+                task.setTaskSend("0");
                 incidentTaskService.insertByBo(task);
 
-                sendJsonObject.set("des", "发送总指挥及协办部门");
+                // fix: 2022-06-07 14:49:37 调整默认不发送
+                /*sendJsonObject.set("des", "发送总指挥及协办部门");
                 sendJsonObject.set("incidentStatus", bo.getStatus());
                 sendJsonObject.set("incidentId", bo.getId());
                 sendJsonObject.set("messagePushUsers", sendUser);
                 sendJsonObject.set("taskId", task.getId());
 //                sendJsonObject.set("senderId", );
-                RedisUtils.publish(Constants.NOTICE_PUSH_SINGLE, sendJsonObject);
+                RedisUtils.publish(Constants.NOTICE_PUSH_SINGLE, sendJsonObject);*/
             }
 
         } else if (flag && bo.getStatus() == 4) {

+ 12 - 9
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentTaskServiceImpl.java

@@ -122,8 +122,8 @@ public class IncidentTaskServiceImpl extends ServicePlusImpl<IncidentTaskMapper,
                 update.setChemicalsHtml(sb.toString().replace("、</td></tr>", "</td></tr>"));
             }
             updateById(update);
-            jsonObject.set("des", "更新处置方案:" + bo.getTaskName());
-            jsonObject.set("taskId", update.getId());
+//            jsonObject.set("des", "更新处置指令:" + bo.getTaskName());
+//            jsonObject.set("taskId", update.getId());
             // 校验原有的人员和新的人员的区别
             List<String> oldUserId = JSONUtil.toList(StrUtil.blankToDefault(incidentTaskVo.getExprJson(), "[]"), MessagePushUser.class).stream().map(MessagePushUser::getUserId).collect(Collectors.toList());
             List<String> newUserId = CollUtil.defaultIfEmpty(bo.getMessagePushUsers(), new ArrayList<>()).stream().map(MessagePushUser::getUserId).collect(Collectors.toList());
@@ -197,7 +197,7 @@ public class IncidentTaskServiceImpl extends ServicePlusImpl<IncidentTaskMapper,
             save(add);
             // 为了发送时知道方案的id
             bo.setId(add.getId());
-            jsonObject.set("des", "新增处置方案:" + bo.getTaskName());
+            jsonObject.set("des", "新增处置指令:" + bo.getTaskName());
             jsonObject.set("taskId", add.getId());
 
             List<String> newUserId = CollUtil.defaultIfEmpty(bo.getMessagePushUsers(), new ArrayList<>()).stream().map(MessagePushUser::getUserId).collect(Collectors.toList());
@@ -208,11 +208,14 @@ public class IncidentTaskServiceImpl extends ServicePlusImpl<IncidentTaskMapper,
                 save.setSource(StrUtil.equals(bo.getSendFlag(), "1") ? "1" : "2");
                 saveJsonArray.add(save);
             }
+            // 只在新增时加入日志 2022-06-08 16:58:46修改
+
+            // 发送消息(1-应急处置消息、2-应急处置待办、3-资源管理待办)
+            jsonObject.set("incidentId", bo.getIncidentId());
+            jsonObject.set("incidentStatus", 3);
+            RedisUtils.publish(Constants.PROCESS_RECORD, jsonObject);
         }
-        // 发送消息(1-应急处置消息、2-应急处置待办、3-资源管理待办)
-        jsonObject.set("incidentId", bo.getIncidentId());
-        jsonObject.set("incidentStatus", 3);
-        RedisUtils.publish(Constants.PROCESS_RECORD, jsonObject);
+
 
         if (removeJsonArray.size() > 0) {
             RedisUtils.publish(Constants.INCIDENT_USER_DELETE, removeJsonArray);
@@ -331,12 +334,12 @@ public class IncidentTaskServiceImpl extends ServicePlusImpl<IncidentTaskMapper,
                 throw new ServiceException("该消息已发送,不能删除!");
             }
             JSONObject jsonObject = new JSONObject();
-            jsonObject.set("des", "处置方案:" + incidentTaskVo.getTaskName() + "删除");
+            jsonObject.set("des", "处置指令:" + incidentTaskVo.getTaskName() + "删除");
             jsonObject.set("incidentId", incidentTaskVo.getIncidentId());
             jsonObject.set("taskId", incidentTaskVo.getId());
             jsonObject.set("incidentStatus", 3);
             RedisUtils.publish(Constants.PROCESS_RECORD, jsonObject, msg -> {
-                log.info("事件处置方案删除消息 => " + msg);
+                log.info("事件处置指令删除消息 => " + msg);
             });
         }
         return removeByIds(ids);

+ 26 - 2
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/ResourceDetailServiceImpl.java

@@ -79,6 +79,18 @@ public class ResourceDetailServiceImpl extends ServicePlusImpl<ResourceDetailMap
     public Boolean insertByBo(ResourceDetailBo bo) {
         ResourceDetail add = BeanUtil.toBean(bo, ResourceDetail.class);
         validEntityBeforeSave(add);
+        ResourceVo voById = resourceService.getVoById(bo.getResourceId());
+        if (voById != null) {
+            add.setResourceType(voById.getResourceType());
+        }
+        /*if (StrUtil.isNotBlank(bo.getIdcard())) {
+            boolean validCard = IdcardUtil.isValidCard(bo.getIdcard());
+            if (!validCard) {
+                throw new ServiceException("输入的身份证号(" + bo.getIdcard() + ")非法!");
+            }
+            add.setBirth(IdcardUtil.getBirth(bo.getIdcard()));
+            add.setAge(Convert.toStr(IdcardUtil.getAgeByIdCard(bo.getIdcard())));
+        }*/
         return save(add);
     }
 
@@ -86,6 +98,18 @@ public class ResourceDetailServiceImpl extends ServicePlusImpl<ResourceDetailMap
     public Boolean updateByBo(ResourceDetailBo bo) {
         ResourceDetail update = BeanUtil.toBean(bo, ResourceDetail.class);
         validEntityBeforeSave(update);
+        ResourceVo voById = resourceService.getVoById(bo.getResourceId());
+        if (voById != null) {
+            update.setResourceType(voById.getResourceType());
+        }
+        /*if (StrUtil.isNotBlank(bo.getIdcard())) {
+            boolean validCard = IdcardUtil.isValidCard(bo.getIdcard());
+            if (!validCard) {
+                throw new ServiceException("输入的身份证号(" + bo.getIdcard() + ")非法!");
+            }
+            update.setBirth(IdcardUtil.getBirth(bo.getIdcard()));
+            update.setAge(Convert.toStr(IdcardUtil.getAgeByIdCard(bo.getIdcard())));
+        }*/
         return updateById(update);
     }
 
@@ -152,8 +176,8 @@ public class ResourceDetailServiceImpl extends ServicePlusImpl<ResourceDetailMap
      * @return
      */
     @Override
-    public List<Object> queryExistResourceId() {
-        return baseMapper.queryExistResourceId();
+    public List<Object> queryExistResourceId(Integer resouceType) {
+        return baseMapper.queryExistResourceId(resouceType);
     }
 
     @Override

+ 21 - 15
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/ResourceServiceImpl.java

@@ -52,11 +52,11 @@ public class ResourceServiceImpl extends ServicePlusImpl<ResourceMapper, Resourc
         if (voById == null) {
             return voById;
         }
-        if (voById.getResourceType() == 1) {
-            // 应急仓库的类型查询仓库物资
-            List<ResourceDetail> list = resourceDetailService.list(Wrappers.<ResourceDetail>lambdaQuery().eq(ResourceDetail::getResourceId, id));
-            voById.setResourceDetailList(list);
-        }
+//        if (voById.getResourceType() == 1) {
+        // 应急仓库的类型查询仓库物资
+        List<ResourceDetail> list = resourceDetailService.list(Wrappers.<ResourceDetail>lambdaQuery().eq(ResourceDetail::getResourceId, id).orderByAsc(ResourceDetail::getName));
+        voById.setResourceDetailList(list);
+//        }
         // 对管理单位使用数组返回
         List<TreeSelect> unitList = new ArrayList<>();
         if (StrUtil.isNotBlank(voById.getManageUnitId())) {
@@ -76,9 +76,12 @@ public class ResourceServiceImpl extends ServicePlusImpl<ResourceMapper, Resourc
         List<ResourceDetailStatic> resourceDetailStatics = resourceDetailService.queryResourceTotalNum();
         Map<String, Integer> collect = resourceDetailStatics.stream().collect(Collectors.toMap(ResourceDetailStatic::getResourceId, ResourceDetailStatic::getNum));
         for (ResourceVo resourceVo : result.getRecordsVo()) {
-            if (resourceVo.getResourceType() == 1) {
+            if (resourceVo.getResourceType() == 1 || resourceVo.getResourceType() == 2) {
                 Integer integer = collect.get(resourceVo.getId());
                 resourceVo.setNum(integer == null ? 0 : integer);
+            } else if (resourceVo.getResourceType() == 3) {
+                resourceVo.setNum(collect.get(resourceVo.getId() + "车辆") == null ? 0 : collect.get(resourceVo.getId() + "车辆"));
+                resourceVo.setShipNum(collect.get(resourceVo.getId() + "船舶") == null ? 0 : collect.get(resourceVo.getId() + "船舶"));
             }
         }
         return PageUtils.buildDataInfo(result);
@@ -95,16 +98,17 @@ public class ResourceServiceImpl extends ServicePlusImpl<ResourceMapper, Resourc
         lqw.eq(bo.getResourceType() != null, Resource::getResourceType, bo.getResourceType());
         lqw.eq(StringUtils.isNotBlank(bo.getLocationType()), Resource::getLocationType, bo.getLocationType());
         lqw.like(StringUtils.isNotBlank(bo.getName()), Resource::getName, bo.getName());
+        lqw.eq(StringUtils.isNotBlank(bo.getAdminOrgName()), Resource::getAdminOrgName, bo.getAdminOrgName());
         lqw.eq(StringUtils.isNotBlank(bo.getAddress()), Resource::getAddress, bo.getAddress());
         lqw.eq(StringUtils.isNotBlank(bo.getLongitude()), Resource::getLongitude, bo.getLongitude());
         lqw.eq(StringUtils.isNotBlank(bo.getLatitude()), Resource::getLatitude, bo.getLatitude());
         lqw.like(StringUtils.isNotBlank(bo.getManageUnit()), Resource::getManageUnit, bo.getManageUnit());
         lqw.eq(bo.getNum() != null, Resource::getNum, bo.getNum());
-        lqw.eq(StringUtils.isNotBlank(bo.getCarryGoods()), Resource::getCarryGoods, bo.getCarryGoods());
         lqw.like(StringUtils.isNotBlank(bo.getContactName()), Resource::getContactName, bo.getContactName());
         lqw.eq(StringUtils.isNotBlank(bo.getContactPhone()), Resource::getContactPhone, bo.getContactPhone());
         lqw.eq(StringUtils.isNotBlank(bo.getManageUnitId()), Resource::getManageUnitId, bo.getManageUnitId());
         lqw.in(ObjectUtil.isNotEmpty(bo.getResourceIds()), Resource::getId, bo.getResourceIds());
+        lqw.notIn(ObjectUtil.isNotEmpty(bo.getResourceNotIds()), Resource::getId, bo.getResourceNotIds());
         lqw.in(ObjectUtil.isNotEmpty(bo.getDeptIds()), Resource::getDeptId, bo.getDeptIds());
         lqw.orderByDesc(Resource::getCreateTime);
         return lqw;
@@ -153,10 +157,10 @@ public class ResourceServiceImpl extends ServicePlusImpl<ResourceMapper, Resourc
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean insertResource(ResourceBo bo) {
-        if (bo.getResourceType() == 3) {
-            // 车牌号转大写
-            bo.setName(bo.getName().toUpperCase());
-        }
+//        if (bo.getResourceType() == 3) {
+//            // 车牌号转大写
+//            bo.setName(bo.getName().toUpperCase());
+//        }
         Resource add = BeanUtil.toBean(bo, Resource.class);
         if (StrUtil.isNotBlank(add.getManageUnitId())) {
             // 查询管理单位对应的名称
@@ -173,6 +177,7 @@ public class ResourceServiceImpl extends ServicePlusImpl<ResourceMapper, Resourc
                 for (ResourceDetailBo resourceDetailBo : bo.getResourceDetailList()) {
                     resourceDetailBo.setResourceId(add.getId());
                     ResourceDetail resourceDetail = BeanUtil.toBean(resourceDetailBo, ResourceDetail.class);
+                    resourceDetail.setResourceType(bo.getResourceType());
                     list.add(resourceDetail);
                 }
                 resourceDetailService.saveAll(list);
@@ -190,10 +195,10 @@ public class ResourceServiceImpl extends ServicePlusImpl<ResourceMapper, Resourc
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean updateResource(ResourceBo bo) {
-        if (bo.getResourceType() == 3) {
-            // 车牌号转大写
-            bo.setName(bo.getName().toUpperCase());
-        }
+//        if (bo.getResourceType() == 3) {
+//            // 车牌号转大写
+//            bo.setName(bo.getName().toUpperCase());
+//        }
         Resource update = BeanUtil.toBean(bo, Resource.class);
         if (StrUtil.isNotBlank(update.getManageUnitId())) {
             // 查询管理单位对应的名称
@@ -213,6 +218,7 @@ public class ResourceServiceImpl extends ServicePlusImpl<ResourceMapper, Resourc
                     resourceDetailBo.setResourceId(update.getId());
                     resourceDetailBo.setId(null);
                     ResourceDetail resourceDetail = BeanUtil.toBean(resourceDetailBo, ResourceDetail.class);
+                    resourceDetail.setResourceType(bo.getResourceType());
                     list.add(resourceDetail);
                 }
                 resourceDetailService.saveAll(list);

+ 15 - 11
ruoyi-zhdd/src/main/resources/mapper/zhdd/ResourceDetailMapper.xml

@@ -19,19 +19,17 @@
 
     <select id="searchWarehouseByGoods" resultType="com.ruoyi.zhdd.domain.Resource">
         select distinct t2.id,
-                        resource_type resourceType,
+                        t2.resource_type resourceType,
                         t2.name,
                         address,
                         longitude,
                         latitude,
-                        manage_unit   manageUnit,
+                        manage_unit      manageUnit,
                         t2.num,
-                        carry_goods   carryGoods,
-                        contact_name  contactName,
-                        contact_phone contactPhone,
-                        car_type      carType,
-                        location_type locationType,
-                        update_time   updateTime
+                        contact_name     contactName,
+                        t1.contact_phone contactPhone,
+                        location_type    locationType,
+                        update_time      updateTime
         from b_resource_detail t1
                  left join b_resource t2 on t1.resource_id = t2.id
         where t1.name like concat('%', #{name}, '%')
@@ -56,15 +54,21 @@
         select resource_id
         from b_resource_detail
         where del_flag = '0'
-          and resource_id in (select id from b_resource where resource_type = 1)
+        and resource_id in (select id from b_resource
+        <if test="resouceType != null">
+            <where>
+                resource_type = #{resouceType}
+            </where>
+        </if>
+        )
         group by resource_id
     </select>
 
     <select id="queryResourceTotalNum" resultType="com.ruoyi.zhdd.domain.vo.ResourceDetailStatic">
-        select resource_id as resourceId, count(1) as num
+        select resource_id || car_type as resourceId, count(1) as num
         from b_resource_detail
         where del_flag = '0'
-        group by resource_id
+        group by resource_id, car_type
     </select>
 
 

+ 2 - 3
ruoyi-zhdd/src/main/resources/mapper/zhdd/ResourceMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.zhdd.mapper.ResourceMapper">
 
     <resultMap type="com.ruoyi.zhdd.domain.Resource" id="ResourceResult">
@@ -13,7 +13,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="latitude" column="latitude"/>
         <result property="manageUnit" column="manage_unit"/>
         <result property="num" column="num"/>
-        <result property="carryGoods" column="carry_goods"/>
         <result property="contactName" column="contact_name"/>
         <result property="contactPhone" column="contact_phone"/>
         <result property="delFlag" column="del_flag"/>