八项作业高处添加位置,PC端显示

pull/4/head
chenxinying 2024-02-01 14:46:17 +08:00
parent 862461a376
commit d86ed69320
4 changed files with 115 additions and 13 deletions

View File

@ -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<String,Object> map = new HashMap<String,Object>();
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<PageData> 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<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> 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<String,Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = highworkService.findById(pd);
PageData signs = highworkService.listSignFinished(pd);
List<PageData> finishMeasuresList = highworkService.listSignFinishMeasures(pd);
map.put("measuresList",finishMeasuresList);
map.put("signs",signs);
map.put("pd",pd);
map.put("result",errInfo);
return map;
}
}

View File

@ -23,4 +23,6 @@ public interface HighworkMapper {
List<PageData> checkWorkCount(PageData pd); List<PageData> checkWorkCount(PageData pd);
List<PageData> getFlowList(PageData pd); List<PageData> getFlowList(PageData pd);
void setPosition(PageData pd);
} }

View File

@ -6,10 +6,7 @@ import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.eightwork.*; import com.zcloud.mapper.datasource.eightwork.*;
import com.zcloud.service.eightwork.HotworkService; import com.zcloud.service.eightwork.HotworkService;
import com.zcloud.util.Const; import com.zcloud.util.*;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Smb;
import com.zcloud.util.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -69,6 +66,7 @@ public class HighworkServiceImpl implements HighworkService {
PageData flow = getStep(pd.get("TASK_ID"),"1"); PageData flow = getStep(pd.get("TASK_ID"),"1");
saveLog(pd,pd.getString("CREATOR"),"1"); saveLog(pd,pd.getString("CREATOR"),"1");
saveNextSigner(pd,flow); saveNextSigner(pd,flow);
setPosition(pd);
} }
} }
@ -84,6 +82,7 @@ public class HighworkServiceImpl implements HighworkService {
PageData flow = getStep(pd.get("TASK_ID"),"1"); PageData flow = getStep(pd.get("TASK_ID"),"1");
saveLog(pd,pd.getString("CREATOR"),"1"); saveLog(pd,pd.getString("CREATOR"),"1");
saveNextSigner(pd,flow); saveNextSigner(pd,flow);
setPosition(pd);
} }
} }
@ -321,14 +320,12 @@ public class HighworkServiceImpl implements HighworkService {
eightWorkFlowLogMapper.save(log); eightWorkFlowLogMapper.save(log);
} }
// private void saveNext(PageData pd,PageData flow) throws Exception { private void setPosition(PageData pd) throws Exception {
// PageData log = new PageData(); JSONObject body = PLSUtil.getRyRegionInfo(Jurisdiction.getCORPINFO_ID(),Integer.parseInt(pd.getString("PLS_ID")));
// log.put("LOG_ID", UuidUtil.get32UUID()); List pointList = (List)((Map) body.get("data")).get("list");
// log.put("WORK_ID", pd.get(primary_key)); List<String> positions = PLSUtil.getRandomPointInPolygon(pointList);
// log.put("TASK_ID", pd.get("TASK_ID")); pd.put("WORK_POSITION", String.join(",",positions));
// log.put("STEP_ID", flow.get("NEXT_STEP_ID")); highworkMapper.setPosition(pd);
// log.put("STATUS", "0"); }
// eightWorkFlowLogMapper.save(log);
// }
} }

View File

@ -379,6 +379,7 @@
endo.`NAME` as WORK_END_DEPARTMENT_NAME, endo.`NAME` as WORK_END_DEPARTMENT_NAME,
endu.`NAME` as WORK_END_USER_NAME, endu.`NAME` as WORK_END_USER_NAME,
log.STEP_NAME, log.STEP_NAME,
log.NEXT_STEP_ID,
log.NEXT_STEP_NAME, log.NEXT_STEP_NAME,
log.STATUS log.STATUS
from from
@ -488,4 +489,15 @@
order by order by
flow.ORDER_BY flow.ORDER_BY
</select> </select>
<!-- 修改位置 -->
<update id="setPosition" parameterType="pd">
update
<include refid="tableName"></include>
set
WORK_POSITION = #{WORK_POSITION}
where
HIGHWORK_ID = #{HIGHWORK_ID}
</update>
</mapper> </mapper>