From 6b46ce0337922e4a1cb6bae42ee6cc6811765a98 Mon Sep 17 00:00:00 2001 From: zhangqihang Date: Tue, 20 Feb 2024 14:26:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=82=B9=E5=B7=A5=E7=A8=8B=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/AppKeyProjectsController.java | 127 ++++++++++++++ .../relatedparty/OutSourcedController.java | 20 +++ .../relatedparty/UnitsController.java | 14 ++ .../relatedparty/OutSourcedMapper.java | 6 + .../relatedparty/OutSourcedService.java | 11 ++ .../impl/OutSourcedServiceImpl.java | 19 +++ .../relatedparty/OutSourcedMapper.xml | 155 ++++++++++++++++++ 7 files changed, 352 insertions(+) diff --git a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java index 39e1271..5c4627b 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java @@ -278,4 +278,131 @@ public class AppKeyProjectsController extends BaseController { // map.put("result", errInfo); // return map; // } + + /**列表 + * @throws Exception + */ + @RequestMapping(value="/outSouceslistPage") + @ResponseBody + public Object outSouceslistPage(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()); + String UserId = pd.getString("UserId"); + if(!StringUtils.equals("1",UserId)){ + String CORPINFO_ID = pd.getString("CORPINFO_ID"); +// -- 河港机械 河港港工 河港检测 + if(!StringUtils.equals(CORPINFO_ID,"1e6dbbe16004402f8d2c0e52afd9a676") + &&!StringUtils.equals(CORPINFO_ID,"3a854eefa7894e06aaa1a2611bca80f6")&& + !StringUtils.equals(CORPINFO_ID,"020578a4c1f04bc692ee25145c2efbe5") + &&!StringUtils.equals(CORPINFO_ID,"90966974de3c4b83aca6f8fd6432d5c2")){ + pd.put("DeptId",outsourcedService.getDeptId(UserId)); + pd.put("UserId",UserId); + + } + } + page.setPd(pd); + List varList = outsourcedService.outSouceslistPage(page); //列出OutSourced列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** 检验视频是否全部定位以及工程是否定位 + * @param + * @throws Exception + */ + @RequestMapping(value="/getDingWeiSum") + @ResponseBody + public Object getDingWeiSum() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + Integer co = outsourcedService.getDingWeiSum(pd); //获取未定位的工程和视频总量 >1 则不让申请开工 + if(co>0){ + map.put("code", "500"); + }else { + map.put("code", "0"); + } + map.put("result", errInfo); + return map; + } + + /** 修改工程状态 + * @param + * @throws Exception + */ + @RequestMapping(value="/updateState") + @ResponseBody + public Object updateState() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + outsourcedService.updateState(pd); //获取同时绑定的重点工程信息如果大于1表示还有其他重点工程 + map.put("result", errInfo); + return map; + } + + /** + * 校验当前重点工程是否可以结束 + * @return + * @throws Exception + */ + @RequestMapping(value = "/checkEnd") + @ResponseBody + public Object jie() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + //校验当前重点工程是否存在未完成的隐患 (包含未整改,未处罚,ai报警未处置的) + PageData pageData = outsourcedService.jieshuOutSourced(pd); + if(!StringUtils.equals("0",pageData.getString("qr"))){ + map.put("result", errInfo); + map.put("message","当前重点工程还有"+pageData.getString("qr")+"项待确认安全环保检查,请处理以后再结束"); + map.put("code","500"); + return map; + } + if(!StringUtils.equals("0",pageData.getString("zg"))){ + map.put("result", errInfo); + map.put("message","当前重点工程还有"+pageData.getString("zg")+"项需整改的隐患,请处理以后再结束"); + map.put("code","500"); + return map; + } + if(!StringUtils.equals("0",pageData.getString("ys"))){ + map.put("result", errInfo); + map.put("message","当前重点工程还有"+pageData.getString("ys")+"项待验收隐患,请处理以后再结束"); + map.put("code","500"); + return map; + } + if(!StringUtils.equals("0",pageData.getString("cf"))){ + map.put("result", errInfo); + map.put("message","当前重点工程还有"+pageData.getString("cf")+"项待处罚隐患,请处理以后再结束"); + map.put("code","500"); + return map; + } + if(!StringUtils.equals("0",pageData.getString("fk"))){ + map.put("result", errInfo); + map.put("message","当前重点工程还有"+pageData.getString("fk")+"项处罚待反馈隐患,请处理以后再结束"); + map.put("code","500"); + return map; + } + if(!StringUtils.equals("0",pageData.getString("ai"))){ + map.put("result", errInfo); + map.put("message","当前重点工程还有"+pageData.getString("ai")+"项AI报警待处置,请处理以后再结束"); + map.put("code","500"); + return map; + } + map.put("code","0"); + map.put("result", errInfo); //返回结果 + return map; + } + + } diff --git a/src/main/java/com/zcloud/controller/relatedparty/OutSourcedController.java b/src/main/java/com/zcloud/controller/relatedparty/OutSourcedController.java index b29d3e3..ad97dca 100644 --- a/src/main/java/com/zcloud/controller/relatedparty/OutSourcedController.java +++ b/src/main/java/com/zcloud/controller/relatedparty/OutSourcedController.java @@ -544,4 +544,24 @@ public class OutSourcedController extends BaseController { return mv; } + /** + * 批量删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/updateState") + @ResponseBody + public Object updateState() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("OPERATOR", Jurisdiction.getUsername()); + outsourcedService.updateState(pd); + map.put("result", errInfo); //返回结果 + return map; + } + + } diff --git a/src/main/java/com/zcloud/controller/relatedparty/UnitsController.java b/src/main/java/com/zcloud/controller/relatedparty/UnitsController.java index 0cb4546..e30c975 100644 --- a/src/main/java/com/zcloud/controller/relatedparty/UnitsController.java +++ b/src/main/java/com/zcloud/controller/relatedparty/UnitsController.java @@ -63,6 +63,20 @@ public class UnitsController extends BaseController { } pd.put("UNITS_ID", pd.getString("UNITS_ID")); List list = unitsService.listAll(pd); + for (PageData pageData : list) { + if (pageData.get("CODE").equals(pd.get("CODE"))){ + errInfo = "fail"; + map.put("result", errInfo); + map.put("msg", "统一社会信用代码重复"); + return map; + } + if (pageData.get("UNITS_NAME").equals(pd.get("UNITS_NAME"))){ + errInfo = "fail"; + map.put("result", errInfo); + map.put("msg", "相关方单位名称重复"); + return map; + } + } unitsService.save(pd); map.put("result", errInfo); return map; diff --git a/src/main/java/com/zcloud/mapper/datasource/relatedparty/OutSourcedMapper.java b/src/main/java/com/zcloud/mapper/datasource/relatedparty/OutSourcedMapper.java index 2f4dabc..d5c7b3e 100644 --- a/src/main/java/com/zcloud/mapper/datasource/relatedparty/OutSourcedMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/relatedparty/OutSourcedMapper.java @@ -84,5 +84,11 @@ public interface OutSourcedMapper{ void jie(PageData pd); void start(PageData pd); + + void updateState(PageData pd); + + List outSouceslistPage(Page page); + + Integer getDingWeiSum(PageData pd); } diff --git a/src/main/java/com/zcloud/service/relatedparty/OutSourcedService.java b/src/main/java/com/zcloud/service/relatedparty/OutSourcedService.java index c57b674..0516c34 100644 --- a/src/main/java/com/zcloud/service/relatedparty/OutSourcedService.java +++ b/src/main/java/com/zcloud/service/relatedparty/OutSourcedService.java @@ -84,5 +84,16 @@ public interface OutSourcedService{ public void jie(PageData pd)throws Exception; void start(PageData pd); + + void updateState(PageData pd); + + /** + * 重点工程管理列表 + * @param page + * @return + */ + List outSouceslistPage(Page page); + + Integer getDingWeiSum(PageData pd); } diff --git a/src/main/java/com/zcloud/service/relatedparty/impl/OutSourcedServiceImpl.java b/src/main/java/com/zcloud/service/relatedparty/impl/OutSourcedServiceImpl.java index ab65130..186bea6 100644 --- a/src/main/java/com/zcloud/service/relatedparty/impl/OutSourcedServiceImpl.java +++ b/src/main/java/com/zcloud/service/relatedparty/impl/OutSourcedServiceImpl.java @@ -4,10 +4,13 @@ import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.relatedparty.OutSourcedMapper; import com.zcloud.service.relatedparty.OutSourcedService; +import com.zcloud.util.DateUtil; +import com.zcloud.util.Jurisdiction; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Date; import java.util.List; /** @@ -127,6 +130,22 @@ public class OutSourcedServiceImpl implements OutSourcedService{ outsourcedMapper.start(pd); } + @Override + public void updateState(PageData pd) { + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); + + outsourcedMapper.updateState(pd); + } + + @Override + public List outSouceslistPage(Page page) { + return outsourcedMapper.outSouceslistPage(page); + } + + @Override + public Integer getDingWeiSum(PageData pd) { + return outsourcedMapper.getDingWeiSum(pd); + } } diff --git a/src/main/resources/mybatis/datasource/relatedparty/OutSourcedMapper.xml b/src/main/resources/mybatis/datasource/relatedparty/OutSourcedMapper.xml index fbf4830..7213599 100644 --- a/src/main/resources/mybatis/datasource/relatedparty/OutSourcedMapper.xml +++ b/src/main/resources/mybatis/datasource/relatedparty/OutSourcedMapper.xml @@ -645,6 +645,134 @@ WHERE o.OUTSOURCED_ID=#{OUTSOURCED_ID} + + + update @@ -695,4 +823,31 @@ OUTSOURCED_ID = #{OUTSOURCED_ID} + + update + + set + STATE = #{STATE}, + OPERATOR = #{OPERATOR}, + OPERATTIME = #{OPERATTIME} + where + OUTSOURCED_ID = #{OUTSOURCED_ID} + + +