From 69cd9f59a0fabf12f8c9147fcba7f69817a870b3 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期一, 06 十一月 2023 23:40:59 +0800 Subject: [PATCH] 更新仓内抓拍2 --- igds-security/src/main/java/com/ld/igds/sec/view/SecSnapDepotPR.java | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 101 insertions(+), 4 deletions(-) diff --git a/igds-security/src/main/java/com/ld/igds/sec/view/SecSnapDepotPR.java b/igds-security/src/main/java/com/ld/igds/sec/view/SecSnapDepotPR.java index e99feef..313da6a 100644 --- a/igds-security/src/main/java/com/ld/igds/sec/view/SecSnapDepotPR.java +++ b/igds-security/src/main/java/com/ld/igds/sec/view/SecSnapDepotPR.java @@ -1,14 +1,22 @@ package com.ld.igds.sec.view; import com.bstek.dorado.annotation.DataProvider; +import com.bstek.dorado.annotation.DataResolver; +import com.bstek.dorado.annotation.Expose; import com.bstek.dorado.data.provider.Page; +import com.ld.igds.models.SecSnapConf; import com.ld.igds.models.SecSnapDepot; import com.ld.igds.sec.service.SecSnapDepotService; import com.ld.igds.util.ContextUtil; + import org.springframework.stereotype.Component; import javax.annotation.Resource; + +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -33,12 +41,101 @@ public void pageSnapDepot(Page<SecSnapDepot> page, Map<String, Object> param) throws Exception { - if(null == param) param = new HashMap<>(); + if (null == param) param = new HashMap<>(); param.put("companyId", ContextUtil.getCompanyId()); param.put("deptId", ContextUtil.subDeptId(null)); - snapDepotService.pageSnapDepot(page,param); + snapDepotService.pageSnapDepot(page, param); + + //娣诲姞4鏉℃祴璇曟暟鎹� + if (null == page.getEntities() || page.getEntities().isEmpty()) { + Collection<SecSnapDepot> list = new ArrayList<>(); + list.add(new SecSnapDepot("TEST")); + list.add(new SecSnapDepot("TEST")); + list.add(new SecSnapDepot("TEST")); + list.add(new SecSnapDepot("TEST")); + + page.setEntities(list); + } } - - + + + + /** + * secSnapDepotPR#getConfActHour + * + * 榛樿鑾峰彇绗竴鏉℃暟鎹殑閰嶇疆淇℃伅锛屽鏋滄病鏈夊氨杩斿洖涓�涓┖鐨勫璞� + * @param page + * @param param + * @return + * @throws Exception + */ + @DataProvider + public SecSnapConf getConfActHour()throws Exception { + List<SecSnapConf> list = snapDepotService.listSnapConf(ContextUtil.getCompanyId(), ContextUtil.subDeptId(null)); + if(null == list || list.isEmpty()) return new SecSnapConf(); + return list.get(0); + } + + + /** + * secSnapDepotPR#listConf + * + * 榛樿鑾峰彇绗竴鏉℃暟鎹殑閰嶇疆淇℃伅锛屽鏋滄病鏈夊氨杩斿洖涓�涓┖鐨勫璞� + * @param page + * @param param + * @return + * @throws Exception + */ + @DataProvider + public List<SecSnapConf> listConf()throws Exception { + return snapDepotService.listSnapConf(ContextUtil.getCompanyId(), ContextUtil.subDeptId(null)); + } + + + /** + * secSnapDepotPR#updateConf + * @param items + * @throws Exception + */ + @DataResolver + public void updateConf(List<SecSnapConf> items)throws Exception { + if(null ==items || items.isEmpty() ) return; + for(SecSnapConf conf:items){ + if(null == conf.getId()){ + if(null == conf.getCompanyId()){ + conf.setCompanyId(ContextUtil.getCompanyId()); + } + if(null == conf.getDeptId()){ + conf.setDeptId(ContextUtil.subDeptId(null)); + } + + snapDepotService.addConf(conf); + }else{ + snapDepotService.updateConf(conf); + } + } + + } + + + /** + * secSnapDepotPR#updateActHour + * @param items + * @throws Exception + */ + @Expose + public void updateActHour(SecSnapConf conf)throws Exception { + + if(null == conf.getCompanyId()){ + conf.setCompanyId(ContextUtil.getCompanyId()); + } + if(null == conf.getDeptId()){ + conf.setDeptId(ContextUtil.subDeptId(null)); + } + + //鍚屾鏇存柊鎵�鏈夌殑鎵ц鏃堕棿涓�鑷� + snapDepotService.updateActHour(conf); + + } } -- Gitblit v1.9.3