diff --git a/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java b/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java index e3ba483..0cb2006 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java @@ -34,6 +34,24 @@ public class AppEightWorkController extends BaseController { @Autowired private UsersService usersService; + /**八项作业列表 + * @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(); + List varList = eightWorkService.list(pd); //列出confinedspace列表 + map.put("varList", varList); + map.put("result", errInfo); + return map; + } + /** * description: * accidentType-风险点 diff --git a/src/main/java/com/zcloud/service/eightwork/EightWorkService.java b/src/main/java/com/zcloud/service/eightwork/EightWorkService.java index f693764..64f878a 100644 --- a/src/main/java/com/zcloud/service/eightwork/EightWorkService.java +++ b/src/main/java/com/zcloud/service/eightwork/EightWorkService.java @@ -15,4 +15,6 @@ public interface EightWorkService { PageData checkWork(PageData pd); ReturnMap getEightWorks()throws Exception; + + List list(PageData pd)throws Exception; } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java index e7f0e65..372f617 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java @@ -14,6 +14,7 @@ import com.zcloud.mapper.datasource.eightwork.EightWorkMapper; import java.time.YearMonth; import java.time.format.DateTimeFormatter; import java.util.*; +import java.util.stream.Collectors; /** * @author fangjiakai @@ -61,6 +62,7 @@ public class EightWorkServiceImpl implements EightWorkService { PageData corp = new PageData(); corp.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); List eightworks = eightworkMapper.getEightWorks(corp); + if(eightworks != null && eightworks.size() > 0){ eightworks.stream().forEach(e -> { staMap.get("total").add(e); @@ -93,4 +95,17 @@ public class EightWorkServiceImpl implements EightWorkService { return returnMap; } + /**列表 + * @throws Exception + */ + @Override + public List list(PageData pd)throws Exception{ + List eightworks = eightworkMapper.getEightWorks(pd); + List returnList = eightworks.stream().filter(item -> { + return !item.getString("NEXT_STEP_ID").equals("99") && item.getString("STATUS").equals("1"); + }).collect(Collectors.toList()); + return returnList; + } + + } diff --git a/src/main/resources/mybatis/datasource/eightwork/EightWorkTaskMapper.xml b/src/main/resources/mybatis/datasource/eightwork/EightWorkTaskMapper.xml index bfb84fa..e4f3e76 100644 --- a/src/main/resources/mybatis/datasource/eightwork/EightWorkTaskMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/EightWorkTaskMapper.xml @@ -47,7 +47,10 @@ where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') HOTWORK_COUNT, (select count(1) COUNT from bus_confinedspace_sign sign left join bus_confinedspace work on work.CONFINEDSPACE_ID = sign.CONFINEDSPACE_ID - where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') CONFINEDSPACE_COUNT + where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') CONFINEDSPACE_COUNT, + (select count(1) COUNT from bus_highwork_sign sign + left join bus_highwork work on work.HIGHWORK_ID = sign.HIGHWORK_ID + where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') HIGHWORK_COUNT