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} +