diff --git a/src/main/java/com/zcloud/controller/gf/AppEightWorkController.java b/src/main/java/com/zcloud/controller/gf/AppEightWorkController.java new file mode 100644 index 00000000..0a47751a --- /dev/null +++ b/src/main/java/com/zcloud/controller/gf/AppEightWorkController.java @@ -0,0 +1,89 @@ +package com.zcloud.controller.gf; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.logs.LogAnno; +import com.zcloud.service.eightWork.*; +import com.zcloud.service.gf.EightWorkService; +import com.zcloud.service.system.DictionariesService; +import com.zcloud.util.*; +import com.zcloud.entity.Response; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +/** + * 说明:八项作业 + * 作者:luoxiaobao + * 时间:2021-08-31 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/app/eightwork") +public class AppEightWorkController extends BaseController { + + @Autowired + private EightWorkService eightworkService; + @Autowired + private DictionariesService dictionariesService; + + /**八项作业列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/list") + @ResponseBody + @LogAnno(menuType= "手机",menuServer= "八项作业",instructionsOperate = "八项作业",instructionsType = "列表") + public Object list(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); +// pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + page.setPd(pd); + List varList = eightworkService.list(page); //列出confinedspace列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * description: + * accidentType-风险点 + * hiddenLevel-隐患级别 + * + * @return tree or list + * @throws Exception all + */ + @RequestMapping(value = "/getInfo") + @ResponseBody + public Response getInfo() throws Exception { + Response response = Response.getResponse(); + try { + PageData request = this.getPageData(); + if (StringUtils.isBlank(request.getString("vectors"))) throw new RuntimeException("未找到要获取的数据字典类型"); + List vectors = Warden.getList(request.getString("vectors"),String.class); + for (String vector: vectors) { + switch (vector) { + case "accidentType": + //事故类型 + response.put("accidentType", dictionariesService.getTreeById("cee1190ea96a4ca9b7bca81e11f0d0f8")); + continue; + default: + } + } + return response.OK(); + } catch (Exception e) { + e.printStackTrace(); + return response.errorMessage(e.getMessage()); + } + } + +} diff --git a/src/main/java/com/zcloud/mapper/datasource/gf/EightWorkMapper.java b/src/main/java/com/zcloud/mapper/datasource/gf/EightWorkMapper.java new file mode 100644 index 00000000..8a964f74 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/gf/EightWorkMapper.java @@ -0,0 +1,25 @@ +package com.zcloud.mapper.datasource.gf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:有限空间作业 + * 作者:luoxiaobao + * 时间:2021-09-13 + * 官网:www.zcloudchina.com + */ +public interface EightWorkMapper { + + + + /**列表 + * @param page + * @throws Exception + */ + List datalist(Page page); + +} + diff --git a/src/main/java/com/zcloud/service/gf/EightWorkService.java b/src/main/java/com/zcloud/service/gf/EightWorkService.java new file mode 100644 index 00000000..fbfd0243 --- /dev/null +++ b/src/main/java/com/zcloud/service/gf/EightWorkService.java @@ -0,0 +1,25 @@ +package com.zcloud.service.gf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:有限空间作业 + * 作者:luoxiaobao + * 时间:2021-09-13 + * 官网:www.zcloudchina.com + */ +public interface EightWorkService { + + + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/gf/impl/EightWorkServiceImpl.java b/src/main/java/com/zcloud/service/gf/impl/EightWorkServiceImpl.java new file mode 100644 index 00000000..5da1e4c8 --- /dev/null +++ b/src/main/java/com/zcloud/service/gf/impl/EightWorkServiceImpl.java @@ -0,0 +1,36 @@ +package com.zcloud.service.gf.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.gf.EightWorkMapper; +import com.zcloud.service.gf.EightWorkService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 说明:有限空间作业 + * 作者:luoxiaobao + * 时间:2021-09-13 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class EightWorkServiceImpl implements EightWorkService { + + @Autowired + private EightWorkMapper eightworkMapper; + + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return eightworkMapper.datalist(page); + } + +} + diff --git a/src/main/java/com/zcloud/service/system/DictionariesService.java b/src/main/java/com/zcloud/service/system/DictionariesService.java index c4163465..a0e72a1f 100644 --- a/src/main/java/com/zcloud/service/system/DictionariesService.java +++ b/src/main/java/com/zcloud/service/system/DictionariesService.java @@ -148,4 +148,7 @@ public interface DictionariesService { * @throws Exception */ public List getIdsByParentIds(List parentIds) throws Exception; + + + public List getTreeById(String id) throws Exception; } diff --git a/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java b/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java index baceaed7..1e13a329 100644 --- a/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java +++ b/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -243,4 +244,16 @@ public class DictionariesServiceImpl implements DictionariesService { return dictionariesMapper.getIdsByParentIds(parentIds); } + @Override + public List getTreeById(String id) throws Exception { + List _list = this.listSubDictByParentId(id); //用传过来的ID获取此ID下的子列表数据 + return _list.stream().map(n -> { + PageData entity = new PageData(); + entity.put("DICTIONARIES_ID", n.getDICTIONARIES_ID()); + entity.put("BIANMA", n.getBIANMA()); + entity.put("NAME", n.getNAME()); + return entity; + }).collect(Collectors.toList()); + } + } diff --git a/src/main/java/com/zcloud/util/Warden.java b/src/main/java/com/zcloud/util/Warden.java index 9fc496ab..8f2b9c81 100644 --- a/src/main/java/com/zcloud/util/Warden.java +++ b/src/main/java/com/zcloud/util/Warden.java @@ -42,6 +42,10 @@ public class Warden { return JSON.parseObject(raw.toJSONString(), PageData.class); } + public static List getList(String raw, Class clazz) { + return JSON.parseArray(raw, clazz); + } + public static void initData(PageData entity) { entity.put("CREATE_TIME", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); entity.put("CRATED_DATE", new Date()); diff --git a/src/main/resources/mybatis/datasource/gf/CutRoadMapper.xml b/src/main/resources/mybatis/datasource/gf/CutRoadMapper.xml index fe19ddf6..fa60e7f9 100644 --- a/src/main/resources/mybatis/datasource/gf/CutRoadMapper.xml +++ b/src/main/resources/mybatis/datasource/gf/CutRoadMapper.xml @@ -339,8 +339,8 @@ f.CHECK_NO, f.PROJECT_MANAGER, f.WORK_CONTENT, - f.WORK_START_DATE, - f.WORK_END_DATE, + replace(f.WORK_START_DATE,'-','/') as WORK_START_DATE, + replace(f.WORK_END_DATE,'-','/') as WORK_END_DATE, f.CONSTRUCTION_DEPARTMENT_ID, f.CONSTRUCTION_USER_ID, f.CONSTRUCTION_USER_SIGNER_PATH, @@ -372,7 +372,7 @@ f.HAZARD_IDENTIFICATION, f.CONFESS_USER, f.ACCEPT_CONFESS_USER, - f.SPECIAL_WORK, + IFNULL(f.SPECIAL_WORK,'无') as SPECIAL_WORK, f.GUARDIAN_USER, f.JOB_CONTENT, f.APPLY_USER_SIGNER_PATH, @@ -457,8 +457,80 @@ diff --git a/src/main/resources/mybatis/datasource/gf/EightWorkMapper.xml b/src/main/resources/mybatis/datasource/gf/EightWorkMapper.xml new file mode 100644 index 00000000..878efb06 --- /dev/null +++ b/src/main/resources/mybatis/datasource/gf/EightWorkMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/gf/HighWorkMapper.xml b/src/main/resources/mybatis/datasource/gf/HighWorkMapper.xml index 8b77f9dc..cd583107 100644 --- a/src/main/resources/mybatis/datasource/gf/HighWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/gf/HighWorkMapper.xml @@ -327,8 +327,8 @@ f.CHECK_NO, f.PROJECT_MANAGER, f.WORK_CONTENT, - f.WORK_START_DATE, - f.WORK_END_DATE, + replace(f.WORK_START_DATE,'-','/') as WORK_START_DATE, + replace(f.WORK_END_DATE,'-','/') as WORK_END_DATE, f.CONSTRUCTION_DEPARTMENT_ID, f.CONSTRUCTION_USER_ID, f.CONSTRUCTION_USER_SIGNER_PATH, @@ -362,7 +362,7 @@ f.LEADER_USER_SIGNER_TIME, f.CONFESS_USER, f.ACCEPT_CONFESS_USER, - f.SPECIAL_WORK, + IFNULL(f.SPECIAL_WORK,'无') as SPECIAL_WORK, f.GUARDIAN_USER, f.WORK_HIGH, f.WORK_LEVEL, @@ -443,7 +443,75 @@ diff --git a/src/main/resources/mybatis/datasource/gf/HoistingMapper.xml b/src/main/resources/mybatis/datasource/gf/HoistingMapper.xml index eac0ca5c..4a4658d6 100644 --- a/src/main/resources/mybatis/datasource/gf/HoistingMapper.xml +++ b/src/main/resources/mybatis/datasource/gf/HoistingMapper.xml @@ -77,6 +77,7 @@ f.ACCEPT_CONFESS_USER_ID, f.ACCEPT_CONFESS_USER_SIGNER_PATH, f.ACCEPT_CONFESS_USER_SIGNER_TIME, + f.SPECIAL_WORK, f.WORK_LONGITUDE, f.WORK_LATITUDE @@ -146,6 +147,7 @@ ACCEPT_CONFESS_USER_ID, ACCEPT_CONFESS_USER_SIGNER_PATH, ACCEPT_CONFESS_USER_SIGNER_TIME, + SPECIAL_WORK, WORK_LONGITUDE, WORK_LATITUDE @@ -215,6 +217,7 @@ #{ACCEPT_CONFESS_USER_ID}, #{ACCEPT_CONFESS_USER_SIGNER_PATH}, #{ACCEPT_CONFESS_USER_SIGNER_TIME}, + #{SPECIAL_WORK}, #{WORK_LONGITUDE}, #{WORK_LATITUDE} @@ -308,6 +311,7 @@ ACCEPT_CONFESS_USER_SIGNER_PATH = #{ACCEPT_CONFESS_USER_SIGNER_PATH}, ACCEPT_CONFESS_USER_SIGNER_TIME = #{ACCEPT_CONFESS_USER_SIGNER_TIME}, HOISTING_ID = HOISTING_ID, + SPECIAL_WORK = #{SPECIAL_WORK}, WORK_LONGITUDE = #{WORK_LONGITUDE}, WORK_LATITUDE = #{WORK_LATITUDE} where @@ -328,8 +332,8 @@ f.CHECK_NO, f.PROJECT_MANAGER, f.WORK_CONTENT, - f.WORK_START_DATE, - f.WORK_END_DATE, + replace(f.WORK_START_DATE,'-','/') as WORK_START_DATE, + replace(f.WORK_END_DATE,'-','/') as WORK_END_DATE, f.CONSTRUCTION_DEPARTMENT_ID, f.CONSTRUCTION_USER_ID, f.CONSTRUCTION_USER_SIGNER_PATH, @@ -382,6 +386,7 @@ f.ACCEPT_CONFESS_USER_SIGNER_TIME, f.WORK_LATITUDE, f.WORK_LONGITUDE, + f.SPECIAL_WORK, ad.NAME as APPLY_DEPARTMENT_NAME, getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL, @@ -443,7 +448,74 @@