From d86ed693200491fe85d73506a6b561b0f49d102c Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Thu, 1 Feb 2024 14:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AB=E9=A1=B9=E4=BD=9C=E4=B8=9A=E9=AB=98?= =?UTF-8?q?=E5=A4=84=E6=B7=BB=E5=8A=A0=E4=BD=8D=E7=BD=AE=EF=BC=8CPC?= =?UTF-8?q?=E7=AB=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightwork/HighworkController.java | 91 +++++++++++++++++++ .../datasource/eightwork/HighworkMapper.java | 2 + .../eightwork/impl/HighworkServiceImpl.java | 23 ++--- .../datasource/eightwork/HighWorkMapper.xml | 12 +++ 4 files changed, 115 insertions(+), 13 deletions(-) create mode 100644 src/main/java/com/zcloud/controller/eightwork/HighworkController.java diff --git a/src/main/java/com/zcloud/controller/eightwork/HighworkController.java b/src/main/java/com/zcloud/controller/eightwork/HighworkController.java new file mode 100644 index 0000000..9f90022 --- /dev/null +++ b/src/main/java/com/zcloud/controller/eightwork/HighworkController.java @@ -0,0 +1,91 @@ +package com.zcloud.controller.eightwork; + +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.HighworkService; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Tools; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:高处作业 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/highwork") +public class HighworkController extends BaseController { + + @Autowired + private HighworkService highworkService; + + + /**列表 + * @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 = highworkService.list(page); //列出highwork列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + + return map; + } + + /**获取高处作业流程 + * @param + * @throws Exception + */ + @RequestMapping(value="/getFlowList") + @ResponseBody + @LogAnno(menuType= "高危作业管理",menuServer= "高处作业",instructionsOperate = "高处作业",instructionsType = "获取高处作业流程") + public Object getFlowList() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + List flowList = highworkService.getFlowList(pd); + map.put("flowList", flowList); + map.put("result", errInfo); //返回结果 + return map; + } + + @RequestMapping("/findById") + @ResponseBody + @LogAnno(menuType= "高危作业管理",menuServer= "高处作业",instructionsOperate = "高处作业",instructionsType = "获取详情") + public Object findById() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = highworkService.findById(pd); + PageData signs = highworkService.listSignFinished(pd); + List finishMeasuresList = highworkService.listSignFinishMeasures(pd); + map.put("measuresList",finishMeasuresList); + map.put("signs",signs); + map.put("pd",pd); + map.put("result",errInfo); + return map; + } + +} diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java index 81de8eb..f6ebf7a 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java @@ -23,4 +23,6 @@ public interface HighworkMapper { List checkWorkCount(PageData pd); List getFlowList(PageData pd); + + void setPosition(PageData pd); } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java index 9475ff0..980e1e6 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java @@ -6,10 +6,7 @@ import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.eightwork.*; import com.zcloud.service.eightwork.HotworkService; -import com.zcloud.util.Const; -import com.zcloud.util.DateUtil; -import com.zcloud.util.Smb; -import com.zcloud.util.UuidUtil; +import com.zcloud.util.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -69,6 +66,7 @@ public class HighworkServiceImpl implements HighworkService { PageData flow = getStep(pd.get("TASK_ID"),"1"); saveLog(pd,pd.getString("CREATOR"),"1"); saveNextSigner(pd,flow); + setPosition(pd); } } @@ -84,6 +82,7 @@ public class HighworkServiceImpl implements HighworkService { PageData flow = getStep(pd.get("TASK_ID"),"1"); saveLog(pd,pd.getString("CREATOR"),"1"); saveNextSigner(pd,flow); + setPosition(pd); } } @@ -321,14 +320,12 @@ public class HighworkServiceImpl implements HighworkService { eightWorkFlowLogMapper.save(log); } -// private void saveNext(PageData pd,PageData flow) throws Exception { -// PageData log = new PageData(); -// log.put("LOG_ID", UuidUtil.get32UUID()); -// log.put("WORK_ID", pd.get(primary_key)); -// log.put("TASK_ID", pd.get("TASK_ID")); -// log.put("STEP_ID", flow.get("NEXT_STEP_ID")); -// log.put("STATUS", "0"); -// eightWorkFlowLogMapper.save(log); -// } + private void setPosition(PageData pd) throws Exception { + JSONObject body = PLSUtil.getRyRegionInfo(Jurisdiction.getCORPINFO_ID(),Integer.parseInt(pd.getString("PLS_ID"))); + List pointList = (List)((Map) body.get("data")).get("list"); + List positions = PLSUtil.getRandomPointInPolygon(pointList); + pd.put("WORK_POSITION", String.join(",",positions)); + highworkMapper.setPosition(pd); + } } diff --git a/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml index bdcfcc7..202481f 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml @@ -379,6 +379,7 @@ endo.`NAME` as WORK_END_DEPARTMENT_NAME, endu.`NAME` as WORK_END_USER_NAME, log.STEP_NAME, + log.NEXT_STEP_ID, log.NEXT_STEP_NAME, log.STATUS from @@ -488,4 +489,15 @@ order by flow.ORDER_BY + + + + + update + + set + WORK_POSITION = #{WORK_POSITION} + where + HIGHWORK_ID = #{HIGHWORK_ID} +