diff --git a/src/main/java/com/dreamchaser/depository_manage/config/PortConfig.java b/src/main/java/com/dreamchaser/depository_manage/config/PortConfig.java index b9dbe1f7..716fd5a5 100644 --- a/src/main/java/com/dreamchaser/depository_manage/config/PortConfig.java +++ b/src/main/java/com/dreamchaser/depository_manage/config/PortConfig.java @@ -23,6 +23,7 @@ import java.util.Map; */ @Data public class PortConfig { + // 部署数据库depository NhE47edekBHxhjYk // 接口地址 public static String external_url = "http://172.20.2.87:39168"; // public static String external_url = "http://127.0.0.1:39168"; @@ -122,4 +123,29 @@ public class PortConfig { JSONObject data = jsonObject.getJSONObject("data"); return data; } + + + /** + * 通过工号获取用户 + * @param number + * @return + */ + public static UserByPort findUserByPortByNumber(String number){ + String url = PortConfig.external_url + "/staff/archiveslist"; + Map map = new HashMap<>(); + map.put("number",number); + String jsonString = JSONObject.toJSONString(map); + String s = HttpUtils.doPost(url, jsonString); + JSONObject jsonObject = JSONObject.parseObject(s); + JSONObject data = jsonObject.getJSONObject("data"); + JSONArray list = data.getJSONArray("list"); + UserByPort userByPort = null; + for (int i = 0; i < list.size(); i++) { + userByPort = JSONObject.toJavaObject((JSON) list.get(i), UserByPort.class); + if(userByPort != null){ + break; + } + } + return userByPort; + } } diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java index b8ec0b87..0559d912 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -294,10 +294,10 @@ public class DepositoryRecordController { List departmentHeadByUsers = findDepartmentHeadByUser(userToken); StringBuilder departmentHeadId = new StringBuilder(); StringBuilder departMentHeadQyWxName = new StringBuilder(); - for (int i = 0; i < departmentHeadByUsers.size(); i++) { - departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); +// for (int i = 0; i < departmentHeadByUsers.size(); i++) { +// departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); // departMentHeadQyWxName.append(departmentHeadByUsers.get(i).getWorkwechat()+","); - } +// } departmentHeadId.append("78").append(","); departMentHeadQyWxName.append("PangFuZhen").append(","); map.put("departmenthead",departmentHeadId.toString()); @@ -670,10 +670,10 @@ public class DepositoryRecordController { String crypt = Md5.crypt(header); StringBuilder departmentHeadId = new StringBuilder(); StringBuilder departMentHeadQyWxName = new StringBuilder(); - /*for (int i = 0; i < departmentHeadByUsers.size(); i++) { - departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); - departMentHeadQyWxName.append(departmentHeadByUsers.get(i).getWorkwechat()+","); - }*/ +// for (int i = 0; i < departmentHeadByUsers.size(); i++) { +// departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); +// departMentHeadQyWxName.append(departmentHeadByUsers.get(i).getWorkwechat()+","); +// } departmentHeadId.append("78").append(","); departMentHeadQyWxName.append("PangFuZhen").append(","); map.put("departmenthead",departmentHeadId.toString()); @@ -890,10 +890,10 @@ public class DepositoryRecordController { List departmentHeadByUsers = findDepartmentHeadByUser(userToken); StringBuilder departmentHeadId = new StringBuilder(); StringBuilder departMentHeadQyWxName = new StringBuilder(); - /*for (int i = 0; i < departmentHeadByUsers.size(); i++) { - departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); - departMentHeadQyWxName.append(departmentHeadByUsers.get(i).getWorkwechat()+","); - }*/ +// for (int i = 0; i < departmentHeadByUsers.size(); i++) { +// departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); +// departMentHeadQyWxName.append(departmentHeadByUsers.get(i).getWorkwechat()+","); +// } departmentHeadId.append("78").append(","); departMentHeadQyWxName.append("PangFuZhen").append(","); map.put("departmenthead",departmentHeadId.toString()); @@ -1021,10 +1021,10 @@ public class DepositoryRecordController { List departmentHeadByUsers = findDepartmentHeadByUser(userToken); StringBuilder departmentHeadId = new StringBuilder(); StringBuilder departMentHeadQyWxName = new StringBuilder(); - /*for (int i = 0; i < departmentHeadByUsers.size(); i++) { - departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); - departMentHeadQyWxName.append(departmentHeadByUsers.get(i).getWorkwechat()+","); - }*/ +// for (int i = 0; i < departmentHeadByUsers.size(); i++) { +// departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); +// departMentHeadQyWxName.append(departmentHeadByUsers.get(i).getWorkwechat()+","); +// } departmentHeadId.append("78").append(","); departMentHeadQyWxName.append("PangFuZhen").append(","); mainRecord.put("applicantId",userToken.getId()); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java index 5c20f501..c2223364 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java @@ -1463,4 +1463,19 @@ public class MaterialController { } return new RestResponse(list); } + + /** + * 用于关闭当前打开的树 + * @param map + * @param request + */ + @PostMapping("/closeTreeChildren") + public void closeTreeChildren(@RequestBody Map map,HttpServletRequest request){ + if(map.containsKey("mtId")){ + Long mtId = Long.valueOf(map.get("mtId").toString()); + materialService.closeTreeChildren(mtId); + }else{ + throw new MyException("缺少必要参数"); + } + } } diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/StockTakingController.java b/src/main/java/com/dreamchaser/depository_manage/controller/StockTakingController.java index 6f9f2f6b..c1a219d9 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/StockTakingController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/StockTakingController.java @@ -2,6 +2,7 @@ package com.dreamchaser.depository_manage.controller; import com.alibaba.fastjson.JSONObject; +import com.dreamchaser.depository_manage.config.PortConfig; import com.dreamchaser.depository_manage.entity.Place; import com.dreamchaser.depository_manage.entity.UserByPort; import com.dreamchaser.depository_manage.pojo.RestResponse; @@ -73,7 +74,7 @@ public class StockTakingController { if("".equals(s)){ continue; } - UserByPort departmentManager = PageController.FindUserById(ObjectFormatUtil.toInteger(s), userToken); + UserByPort departmentManager = PortConfig.findUserByPortByNumber(s); // QyWxDepartmentManager.append(departmentManager.getWorkwechat()+","); } QyWxDepartmentManager.append("PangFuZhen").append(","); diff --git a/src/main/java/com/dreamchaser/depository_manage/entity/ThreeAboutMan.java b/src/main/java/com/dreamchaser/depository_manage/entity/ThreeAboutMan.java new file mode 100644 index 00000000..4bc0822c --- /dev/null +++ b/src/main/java/com/dreamchaser/depository_manage/entity/ThreeAboutMan.java @@ -0,0 +1,24 @@ +package com.dreamchaser.depository_manage.entity; + +import lombok.Data; + +import java.util.List; + + +/** + * 用于接口中获取的树即成员 + */ +@Data +public class ThreeAboutMan { + private String id; + private String name; + private String number; + private String icon; + private String parentId; + private String orgId; + private Integer isman; + private Integer sort; + private Integer identify; + private String all_name; + private List child; +} diff --git a/src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java b/src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java index 6598e5b1..744cf1a9 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java @@ -282,4 +282,10 @@ public interface MaterialService { * @return */ MaterialAndProducedDate findMaterialAndProducedDateByMidAndProducedDate(Map map); + + /** + * 用于关闭当前打开的树 + * @param mtId + */ + void closeTreeChildren(Long mtId); } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/CompanyServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/CompanyServiceImpl.java index cbf220c1..36f1b020 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/CompanyServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/CompanyServiceImpl.java @@ -152,26 +152,26 @@ public class CompanyServiceImpl implements CompanyService { */ @Override public List InitTreeMenus(UserByPort userToken) { - // 获取当前用户登录的公司 - Map map = new HashMap<>(); - map.put("superior",userToken.getCompany().toString()); - List administrationPList = findAllCompanyByParent(map, userToken); + Integer company = userToken.getCompany(); + List allUserByAdministration = findAllUserByAdministration(company.toString(), userToken); // 开启对应数量的线程 - ExecutorService exs = Executors.newFixedThreadPool(administrationPList.size()); + ExecutorService exs = Executors.newFixedThreadPool(allUserByAdministration.size()); // 结果集 List list = new ArrayList<>(); List> futureList = new ArrayList>(); - // 1.定义CompletionService CompletionService completionService = new ExecutorCompletionService(exs); - for (int i = 0; i < administrationPList.size(); i++) { - AdministrationP administrationP = administrationPList.get(i); - Future future = completionService.submit(new InitManagerForAdministration(administrationP,userToken)); - futureList.add(future); + // 开启对应数目的线程 + for (int i = 0; i < allUserByAdministration.size(); i++) { + ThreeAboutMan threeAboutMan = allUserByAdministration.get(i); + // 开启线程 + Future submit = completionService.submit(new InitManagerTree(threeAboutMan)); + futureList.add(submit); } - for (int i = 0; i < administrationPList.size(); i++) { + // 收集结果 + for (int i = 0; i < allUserByAdministration.size(); i++) { Object result = null; try { result = completionService.take().get(); @@ -185,74 +185,40 @@ public class CompanyServiceImpl implements CompanyService { return list; } - class InitManagerForAdministration implements Callable{ + /** + * 用于构造人员树 + */ + class InitManagerTree implements Callable{ - AdministrationP administrationP; - UserByPort userToken; + ThreeAboutMan threeAboutMan; - InitManagerForAdministration(AdministrationP administrationP,UserByPort userToken){ - this.administrationP = administrationP; - this.userToken = userToken; + InitManagerTree(ThreeAboutMan threeAboutMan){ + this.threeAboutMan = threeAboutMan; } @Override public Object call() throws Exception { - List allUserByAdministration = findAllUserByAdministration(administrationP.getId(), userToken); - List objectList = addDepartmentHead(administrationP, allUserByAdministration); - Map map = InitTreeMenus(administrationP, objectList); + // 获取当前树结构的children + List children = InitTrees(threeAboutMan); + // 构造结构 + Map map = InitTree(threeAboutMan, children); return map; } } - /** - * 用于获取当前公司下所有部门 - * @param map 查询条件 - * @param userToken 登录用户 - * @return - */ - public List findAllCompanyByParent(Map map, UserByPort userToken){ - String url = PortConfig.external_url +"/org/govlist"; - String superior = (String) map.get("superior"); - if(superior == null || "".equals(superior)){ - superior = "309"; - } - map.put("superior",superior); - map.put("state",1); - map.put("level",4); - String jsonString = JSONObject.toJSONString(map); - JSONObject paramObject = JSONObject.parseObject(jsonString); - String post = null; - try { - post = HttpUtils.send(url,paramObject, HTTP.UTF_8,userToken); - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.parseObject(post); - JSONObject data = (JSONObject) jsonObject.get("data"); - JSONArray list = (JSONArray) data.get("list"); - if(list == null){ - list = new JSONArray(); - } - List administrationPList = new ArrayList<>(); - for (int i = 0; i < list.size(); i++) { - Administration administration = JSONObject.toJavaObject((JSONObject)list.get(i), Administration.class); - AdministrationP administrationP = new AdministrationP(administration); - administrationPList.add(administrationP); - } - return administrationPList; - } - /** - * 用于获取当前部门下所有的人 - * @param adminorg 部门id + * 用于获取行政组织树(包括成员) + * @param id 查询id * @param userToken 登录用户 * @return */ - public List findAllUserByAdministration(Integer adminorg,UserByPort userToken){ - String url = PortConfig.external_url +"/staff/archiveslist"; + public List findAllUserByAdministration(String id,UserByPort userToken){ + String url = PortConfig.external_url +"/org/govthreeaboutman"; Map map = new HashMap<>(); - map.put("adminorg",adminorg); + map.put("id",id); + map.put("level",0); + map.put("all",1); String jsonString = JSONObject.toJSONString(map); JSONObject paramObject = JSONObject.parseObject(jsonString); String post = null; @@ -263,50 +229,65 @@ public class CompanyServiceImpl implements CompanyService { } JSONObject jsonObject = JSONObject.parseObject(post); JSONObject data = (JSONObject) jsonObject.get("data"); - JSONArray list = (JSONArray) data.get("list"); + JSONArray list = (JSONArray) data.get("three"); if(list == null){ list = new JSONArray(); } - List userByPortList = new ArrayList<>(); + List threeAboutManList = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { - UserByPort userByPort = JSONObject.toJavaObject((JSON) list.get(i), UserByPort.class); - if(Integer.compare(userByPort.getPersonincharge(),1) == 0) { - userByPortList.add(userByPort); - } + ThreeAboutMan threeAboutMan = JSONObject.toJavaObject((JSON) list.get(i), ThreeAboutMan.class); + threeAboutManList.add(threeAboutMan); } - return userByPortList; + return threeAboutManList; } /** - * 用于给当前部门添加部门负责人 - * @param ap + * 用于构造人员列表 + * @param threeAboutMan * @return */ - public List addDepartmentHead(AdministrationP ap,List departmentHeadByUser){ + public List InitTrees(ThreeAboutMan threeAboutMan){ // 获取当前部门的部门负责人 - Map map = new HashMap<>(); - map.put("adminorg",ap.getId()); List result = new ArrayList<>(); - for (int i = 0; i < departmentHeadByUser.size(); i++) { - UserByPort user = departmentHeadByUser.get(i); - Map children = new HashMap<>(); - children.put("title",user.getName()); - children.put("id",user.getId()); - result.add(children); + List child = threeAboutMan.getChild(); + if(child != null){ + for (int i = 0; i < child.size(); i++) { + ThreeAboutMan threeAboutMan1 = child.get(i); + if(Integer.compare(threeAboutMan1.getIsman(),1) == 0){ + // 如果当前数据是部门 + + // 递归查询当前树 + List childrenList = InitTrees(threeAboutMan1); + Map map = InitTree(threeAboutMan1, childrenList); + result.add(map); + }else{ + // 如果是人员 + + Map children = new HashMap<>(); + children.put("title",threeAboutMan1.getName()); + children.put("id",threeAboutMan1.getNumber()); + result.add(children); + } + } } return result; } - // 构造树形组件数据模板 - public Map InitTreeMenus(AdministrationP ap, List children){ - if(ap != null) { + + /** + * 用于构造树形模板 + * @param threeAboutMan + * @param children + * @return + */ + public Map InitTree(ThreeAboutMan threeAboutMan,List children){ + if (threeAboutMan != null) { Map map = new HashMap<>(); - map.put("title",ap.getName()); - map.put("id", ap.getId()); - map.put("children",children); + map.put("title", threeAboutMan.getName()); + map.put("id", threeAboutMan.getNumber()); + map.put("children", children); return map; - } - else{ + } else { return null; } } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java index bf38d65d..c0c65917 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java @@ -70,8 +70,8 @@ public class MaterialServiceImpl implements MaterialService { Integer shelfLife = 0; if (map.containsKey("shelfLife")) { String shelfLife1 = (String) map.get("shelfLife"); - if(!("".equals(shelfLife1))){ - shelfLife = ObjectFormatUtil.toInteger(shelfLife1); + if (!("".equals(shelfLife1))) { + shelfLife = ObjectFormatUtil.toInteger(shelfLife1); } } if (map.containsKey("producedDate")) { @@ -80,13 +80,13 @@ public class MaterialServiceImpl implements MaterialService { } String dateType = (String) map.get("dateType"); // 1年2月3天 - if("day".equals(dateType) && shelfLife != 0){ - map.put("shelfLife",ObjectFormatUtil.toInteger("3"+shelfLife)); - }else if("month".equals(dateType) && shelfLife != 0){ - map.put("shelfLife",ObjectFormatUtil.toInteger("2"+shelfLife)); - }else if("year".equals(dateType) && shelfLife != 0){ - map.put("shelfLife",ObjectFormatUtil.toInteger("1"+shelfLife)); - }else{ + if ("day".equals(dateType) && shelfLife != 0) { + map.put("shelfLife", ObjectFormatUtil.toInteger("3" + shelfLife)); + } else if ("month".equals(dateType) && shelfLife != 0) { + map.put("shelfLife", ObjectFormatUtil.toInteger("2" + shelfLife)); + } else if ("year".equals(dateType) && shelfLife != 0) { + map.put("shelfLife", ObjectFormatUtil.toInteger("1" + shelfLife)); + } else { map.remove("shelfLife"); } // 获取当前类型 @@ -141,14 +141,14 @@ public class MaterialServiceImpl implements MaterialService { // 1年2月3天 Integer shelfLife = 0; if (map.containsKey("shelfLife")) { - shelfLife = ObjectFormatUtil.toInteger(map.get("shelfLife")); + shelfLife = ObjectFormatUtil.toInteger(map.get("shelfLife")); } - if("day".equals(dateType)){ - map.put("shelfLife",ObjectFormatUtil.toInteger("3"+shelfLife)); - }else if("month".equals(dateType)){ - map.put("shelfLife",ObjectFormatUtil.toInteger("2"+shelfLife)); - }else if("year".equals(dateType)){ - map.put("shelfLife",ObjectFormatUtil.toInteger("1"+shelfLife)); + if ("day".equals(dateType)) { + map.put("shelfLife", ObjectFormatUtil.toInteger("3" + shelfLife)); + } else if ("month".equals(dateType)) { + map.put("shelfLife", ObjectFormatUtil.toInteger("2" + shelfLife)); + } else if ("year".equals(dateType)) { + map.put("shelfLife", ObjectFormatUtil.toInteger("1" + shelfLife)); } if (map.containsKey("producedDate")) { Long producedDate = DateUtil.DateTimeByMonthToTimeStamp(map.get("producedDate").toString()); @@ -325,19 +325,19 @@ public class MaterialServiceImpl implements MaterialService { material.setShowProducedDate(DateUtil.TimeStampToDateTimeForMonth(producedDate)); } Long life = material.getShelfLife(); - if(life != null) { + if (life != null) { String shelfLife = String.valueOf(life); String dateType = shelfLife.substring(0, 1); - if("1".equals(dateType)){ + if ("1".equals(dateType)) { material.setShowShelfLife("year"); - }else if("2".equals(dateType)){ + } else if ("2".equals(dateType)) { material.setShowShelfLife("month"); - }else if("3".equals(dateType)){ + } else if ("3".equals(dateType)) { material.setShowShelfLife("day"); } //1年2月3天,后面为数目 - material.setShelfLife(Long.valueOf(shelfLife.substring(1, shelfLife.length()))); + material.setShelfLife(Long.valueOf(shelfLife.substring(1))); } return material; } @@ -455,19 +455,19 @@ public class MaterialServiceImpl implements MaterialService { // 获取当天时间 Long nowDay = DateUtil.DateTimeByMonthToTimeStamp(currentDate); Long life = material.getShelfLife(); - if(life != null) { - String shelfLife = String.valueOf(life); + if (life != null) { + String shelfLife = String.valueOf(life); String dateType = shelfLife.substring(0, 1); - String dateTime = shelfLife.substring(1, shelfLife.length()); - if("1".equals(dateType)){ - m.setShelfLife(dateTime+"年"); + String dateTime = shelfLife.substring(1); + if ("1".equals(dateType)) { + m.setShelfLife(dateTime + "年"); calcShelfLife = ObjectFormatUtil.toLong(dateTime) * 365 * DateUtil.dayTime; - }else if("2".equals(dateType)){ - m.setShelfLife(dateTime+"月"); + } else if ("2".equals(dateType)) { + m.setShelfLife(dateTime + "月"); calcShelfLife = ObjectFormatUtil.toLong(dateTime) * 30 * DateUtil.dayTime; - }else if("3".equals(dateType)){ - m.setShelfLife(dateTime+"天"); - calcShelfLife = ObjectFormatUtil.toLong(dateTime) * DateUtil.dayTime; + } else if ("3".equals(dateType)) { + m.setShelfLife(dateTime + "天"); + calcShelfLife = ObjectFormatUtil.toLong(dateTime) * DateUtil.dayTime; } // 获取当前没有使用完成的物料对应的生产日期对应 List materialAndProducedDateByMid = materialMapper.findMaterialAndProducedDateByMid(m.getId()); @@ -475,7 +475,7 @@ public class MaterialServiceImpl implements MaterialService { // 获取当前入库时的生产日期 Long producedDate1 = materialAndProducedDate.getProducedDate(); // 如果可使用时间(生产时间+保质期)减去当天时间 小于预警时间 - if((producedDate1 + calcShelfLife) - nowDay < DateUtil.warningTime){ + if ((producedDate1 + calcShelfLife) - nowDay < DateUtil.warningTime) { warningCount += materialAndProducedDate.getInventory(); } } @@ -746,9 +746,9 @@ public class MaterialServiceImpl implements MaterialService { */ @Override public List AddInitTreeMenus(Map map) { - Integer mtId = ObjectFormatUtil.toInteger(map.get("mtId")); + Long mtId = Long.valueOf(map.get("mtId").toString()); List result = new ArrayList<>(); - MaterialType mt = materialTypeMapper.findMaterialTypeById(mtId); + MaterialType mt = materialTypeMapper.findMaterialTypeByOldId(mtId); List materialTypeByParent = materialTypeMapper.findMaterialTypeByParent(mt.getOldId()); // 获取当前类别级别 Integer mtLevel = getMtLevel(mt, 1); @@ -787,17 +787,19 @@ public class MaterialServiceImpl implements MaterialService { if (Long.compare(parentMt.getOldId(), id) == 0) { if (mtLevel == 1) { + jsonObject.remove("spread"); + stringObjectMap.remove("spread"); redisTemplate.opsForList().set("wms_materialTree_result", i, JSONObject.toJSONString(jsonObject)); -// redisTemplate.opsForList().leftPop("wms_materialTree_result"); -// redisTemplate.opsForList().leftPush("wms_materialTree_result",JSONObject.toJSONString(jsonObject)); jsonObject.put("spread", true); stringObjectMap.put("spread", true); result.add(stringObjectMap); continue; } else { List childList = (List) jsonObject.get("children"); - List objectList1 = rewriteTree(childList, stringObjectMap, mtLevel - 1, mt); + List objectList1 = rewriteTree(childList, stringObjectMap, mtLevel - 1, mt,1); jsonObject.put("children", objectList1); + jsonObject.remove("spread"); + stringObjectMap.remove("spread"); redisTemplate.opsForList().set("wms_materialTree_result", i, JSONObject.toJSONString(jsonObject)); jsonObject.put("spread", true); stringObjectMap.put("spread", true); @@ -833,6 +835,16 @@ public class MaterialServiceImpl implements MaterialService { } } + + /** + * 设置当前树结构为打开状态 + * + * @param jsonObject + * @param mt + * @param level + * @param map + * @return + */ public JSONObject setTreeChildrenSpreadIsTrue(JSONObject jsonObject, MaterialType mt, Integer level, Map map) { if (level != 0) { MaterialType parent = mt; @@ -916,6 +928,7 @@ public class MaterialServiceImpl implements MaterialService { /** * 根据物料id与生产日期获取对应关系 + * * @param map * @return */ @@ -924,32 +937,119 @@ public class MaterialServiceImpl implements MaterialService { return materialMapper.findMaterialAndProducedDateByMidAndProducedDate(map); } + /** + * 用于关闭当前打开的树 + * + * @param mtId + */ + @Override + public void closeTreeChildren(Long mtId) { + // 获取当前要关闭的物料类型 + MaterialType mt = materialTypeMapper.findMaterialTypeByOldId(mtId); + // 获取当前物料类型所在树的级别 + Integer mtLevel = getMtLevel(mt, 1); + List materialTypeByParent = materialTypeMapper.findMaterialTypeByParent(mtId); + + // 获取当前redis中的树 + List objectList = redisTemplate.opsForList().range("wms_materialTree_result", 0, -1); + + // 获取当前最高级 + MaterialType parentMt = mt; + for (int i = 0; i < mtLevel - 1; i++) { + parentMt = materialTypeMapper.findMaterialTypeByOldId(parentMt.getParentId()); + } + for (int i = 0; i < objectList.size(); i++) { + String s = objectList.get(i); + JSONObject jsonObject = JSONObject.parseObject(s); + Long id = Long.valueOf(jsonObject.getString("id")); + if (Long.compare(id, parentMt.getOldId()) == 0) { + // 如果是打开的顶级 + JSONArray children = closeTree(jsonObject.getJSONArray("children"), mtLevel - 1, mt); + jsonObject.put("children",children); + redisTemplate.opsForList().set("wms_materialTree_result",i,JSONObject.toJSONString(jsonObject)); + break; + } + } + } + + /** + * 用于真实关闭打开的树 + * @param jsonArray 传入的子列表 + * @param mtLevel 当前关闭的物料类型等级 + * @param mt 要关闭的类型 + */ + public JSONArray closeTree(JSONArray jsonArray,Integer mtLevel,MaterialType mt){ + MaterialType parent = mt; + // 定义返回结果 + JSONArray ja = new JSONArray(); + if(mtLevel == 1){ + // 如果到当前等级 + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject object = jsonArray.getJSONObject(i); + Long oId = Long.valueOf(object.getString("id")); + if(Long.compare(oId, mt.getOldId()) == 0){ + // 如果是当前关闭类别 + object.remove("spread"); + } + ja.add(object); + } + }else { + for (int i = 0; i < mtLevel - 1; i++) { + parent = materialTypeMapper.findMaterialTypeByOldId(parent.getParentId()); + } + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject object = jsonArray.getJSONObject(i); + Long oId = Long.valueOf(object.getString("id")); + if (Long.compare(oId, parent.getOldId()) == 0) { + // 如果是当前要关闭的父类 + JSONArray children = object.getJSONArray("children"); + JSONArray objects = closeTree(children, mtLevel - 1, mt); + object.put("children",objects); + } + ja.add(object); + } + } + return ja; + } + + /** * 重构树结构 - * @param childrenList - * @param stringObjectMap - * @param flag - * @param mt + * + * @param childrenList 需要重构的列表 + * @param stringObjectMap 重构数据 + * @param flag 当前等级 + * @param mt 类型 + * @param level 当前递归次数 * @return */ - public List rewriteTree(List childrenList, Map stringObjectMap, Integer flag, MaterialType mt) { + public List rewriteTree(List childrenList, Map stringObjectMap, Integer flag, MaterialType mt,Integer level) { if (flag != 1) { + // 获取当前类型父类 mt = materialTypeMapper.findMaterialTypeByOldId(mt.getParentId()); - return rewriteTree(childrenList, stringObjectMap, flag - 1, mt); + return rewriteTree(childrenList, stringObjectMap, flag - 1, mt,level + 1); } else { + // 定义现在的等级 + Integer nowLevel = 1; List list = new ArrayList<>(); + // 获取当前类型id Long somId = mt.getOldId(); for (int i = 0; i < childrenList.size(); i++) { + // 获取当前树形菜单数据 JSONObject jsonObject = (JSONObject) childrenList.get(i); + // 获取当前菜单id Long id = Long.valueOf(jsonObject.getString("id")); + // 如果当前类型id与菜单id一致 if (Long.compare(somId, id) == 0) { + Long childrenId = Long.valueOf(stringObjectMap.get("id").toString()); if (Long.compare(childrenId, id) == 0) { list.add(stringObjectMap); } else { + nowLevel++; // 获取当前下的子列表 JSONArray children = jsonObject.getJSONArray("children"); - List objectList = updateTreeChildren(children, stringObjectMap, childrenId); + List objectList = updateTreeChildren(children, stringObjectMap, level,nowLevel); jsonObject.put("children", objectList); jsonObject.put("spread", true); list.add(jsonObject); @@ -962,16 +1062,49 @@ public class MaterialServiceImpl implements MaterialService { } } - public List updateTreeChildren(List childrenList, Map map, Long mtId) { + /** + * 修改树 + * + * @param childrenList 需要修改的子列表 + * @param map 修改的数据 + * @param level 之前递归的cis + * @param nowLevel 现在的层次 + * @return + */ + public List updateTreeChildren(List childrenList, Map map, Integer level,Integer nowLevel) { + // 获取数据中的id Long somId = Long.valueOf(map.get("id").toString()); - List children = new ArrayList<>(); - for (int i = 0; i < childrenList.size(); i++) { - JSONObject o = (JSONObject) childrenList.get(i); - Long id = Long.valueOf(o.getString("id")); - if (Long.compare(somId, id) == 0) { - children.add(map); - } else { + if(level - nowLevel == 0) { + // 如果不需要递归 + for (int i = 0; i < childrenList.size(); i++) { + JSONObject o = (JSONObject) childrenList.get(i); + // 获取当前子列表中的数据id + Long id = Long.valueOf(o.getString("id")); + if (Long.compare(somId, id) == 0) { + // 如果当前数据需要进行修改 + children.add(map); + } else { + // 添加 + children.add(o); + } + } + }else{ + // 获取当前修改时的类型 + MaterialType parent = materialTypeMapper.findMaterialTypeByOldId(somId); + for (int i = 0; i < level - nowLevel; i++) { + // 获取父类 + parent = materialTypeMapper.findMaterialTypeByOldId(parent.getParentId()); + } + for (int i = 0; i < childrenList.size(); i++) { + JSONObject o = (JSONObject) childrenList.get(i); + // 获取当前子列表中的数据id + Long id = Long.valueOf(o.getString("id")); + if(Long.compare(id,parent.getOldId()) == 0){ + List objectList = updateTreeChildren(o.getJSONArray("children"), map, level, nowLevel + 1); + o.put("children",objectList); + o.put("spread",true); + } children.add(o); } } @@ -1432,14 +1565,14 @@ public class MaterialServiceImpl implements MaterialService { Object result = null; try { result = completionService.take().get(); - redisTemplate.opsForList().leftPush("wms_materialTree_result", JSON.toJSONString(result)); - redisTemplate.expire("wms_materialTree_result", DateUtil.getSecondsNextEarlyMorning(), TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } list.add(result); + redisTemplate.opsForList().leftPush("wms_materialTree_result", JSON.toJSONString(result)); + redisTemplate.expire("wms_materialTree_result", DateUtil.getSecondsNextEarlyMorning(), TimeUnit.SECONDS); } return list; } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java index dc92024c..e62bf1e5 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java @@ -1895,7 +1895,8 @@ public class QyWxOperationService { approvalTemplate.setApply_data(approval_template_apply_data); List notifyerList = new ArrayList<>(); - notifyerList.add("PangFuZhen"); + workwechat = "PangFuZhen"; + notifyerList.add(workwechat); approvalTemplate.setNotifyer(notifyerList); //抄送方式:1-提单时抄送(默认值); 2-单据通过后抄送;3-提单和单据通过后抄送。仅use_template_approver为0时生效。 diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java index fb7a3d6d..b42a01f0 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java @@ -319,6 +319,7 @@ public class StockTakingServiceImpl implements StockTakingService { UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(s), userToken); QyWxUid.append(userByPort.getWorkwechat()).append(","); } + // 如果同意 if (Integer.compare(departmentManagerState, 1) == 0) { // 如果审核通过 stockTakingResult = "通过"; @@ -451,31 +452,35 @@ public class StockTakingServiceImpl implements StockTakingService { result.put("errMsg", errMsg); } + if(normalMinId.size() > 0) { - // 抄送盘点调账记录给盘点人员 - new Thread(new Runnable() { - @Override - public void run() { - // 获取盘点人员 - UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), userToken); - String workwechat = originator.getWorkwechat(); - JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", mainId, normalMinId, userAgent); + // 抄送盘点调账记录给盘点人员 + new Thread(new Runnable() { + @Override + public void run() { + // 获取盘点人员 + UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), userToken); + String workwechat = originator.getWorkwechat(); + JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", mainId, normalMinId, userAgent); // JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage(workwechat, mainId,normalMinId); - // 将当前返回结果保存到redis中 - if (jsonObject != null) { - Map QyWxMessageMap = new HashMap<>(); - QyWxMessageMap.put("MsgId", jsonObject.getString("msgid")); - QyWxMessageMap.put("responseCode", jsonObject.getString("response_code")); - // key user:300450:QyWxOut:1 - redisTemplate.opsForHash().putAll("user:" + userToken.getNumber() + ":QyWxStockTakingCompleteId:" + mainId, QyWxMessageMap); - // 设置过期时间为三天 - redisTemplate.expire("user:" + userToken.getNumber() + ":QyWxStockTakingCompleteId:" + mainId, 72, TimeUnit.HOURS); + // 将当前返回结果保存到redis中 + if (jsonObject != null) { + Map QyWxMessageMap = new HashMap<>(); + QyWxMessageMap.put("MsgId", jsonObject.getString("msgid")); + QyWxMessageMap.put("responseCode", jsonObject.getString("response_code")); + // key user:300450:QyWxOut:1 + redisTemplate.opsForHash().putAll("user:" + userToken.getNumber() + ":QyWxStockTakingCompleteId:" + mainId, QyWxMessageMap); + // 设置过期时间为三天 + redisTemplate.expire("user:" + userToken.getNumber() + ":QyWxStockTakingCompleteId:" + mainId, 72, TimeUnit.HOURS); + } } - } - }).start(); - + }).start(); + }else{ + map.put("state",1); + } - } else { + } + else { map.put("state", departmentManagerState); map.put("completeTime", DateUtil.DateTimeToTimeStamp(simpleTime)); } @@ -1321,6 +1326,8 @@ public class StockTakingServiceImpl implements StockTakingService { } }).start(); + }else{ + map.put("state",1); } } diff --git a/src/main/resources/templates/pages/application/application-in.html b/src/main/resources/templates/pages/application/application-in.html index 1a5093d7..75e6c969 100644 --- a/src/main/resources/templates/pages/application/application-in.html +++ b/src/main/resources/templates/pages/application/application-in.html @@ -577,6 +577,13 @@ content: '/getMaterialAll?mname=' + mname + '&type=1&clickObj=' + parentId, move: '.layui-layer-title', fixed: false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ @@ -814,6 +821,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepositoryByCard?type=1&clickObj=' + parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }; diff --git a/src/main/resources/templates/pages/application/application-in_back.html b/src/main/resources/templates/pages/application/application-in_back.html index 163d898e..10e69fd3 100644 --- a/src/main/resources/templates/pages/application/application-in_back.html +++ b/src/main/resources/templates/pages/application/application-in_back.html @@ -220,6 +220,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=1', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -253,6 +260,13 @@ } }); + }, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); } }); }); diff --git a/src/main/resources/templates/pages/application/application-in_scanQrCode.html b/src/main/resources/templates/pages/application/application-in_scanQrCode.html index afea0d0f..b4537d87 100644 --- a/src/main/resources/templates/pages/application/application-in_scanQrCode.html +++ b/src/main/resources/templates/pages/application/application-in_scanQrCode.html @@ -675,6 +675,13 @@ content: '/getMaterialAll?mname=' + mname + '&type=1&clickObj=' + parentId, move: '.layui-layer-title', fixed: false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ @@ -815,6 +822,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepositoryByCard?type=1&clickObj=' + parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); } diff --git a/src/main/resources/templates/pages/application/application-out.html b/src/main/resources/templates/pages/application/application-out.html index 7be09ce5..6119fb35 100644 --- a/src/main/resources/templates/pages/application/application-out.html +++ b/src/main/resources/templates/pages/application/application-out.html @@ -555,6 +555,13 @@ content: '/getMaterialAll?mname=' + mname + '&type=2&clickObj=' + parentId, move: '.layui-layer-title', fixed: false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ diff --git a/src/main/resources/templates/pages/application/application-out_back.html b/src/main/resources/templates/pages/application/application-out_back.html index 683e297c..a5ecfcce 100644 --- a/src/main/resources/templates/pages/application/application-out_back.html +++ b/src/main/resources/templates/pages/application/application-out_back.html @@ -219,6 +219,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -235,6 +242,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectMaterial?mname='+mname+'&type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = $("#mid").val(); $.ajax({ diff --git a/src/main/resources/templates/pages/application/application-out_scanQrCode.html b/src/main/resources/templates/pages/application/application-out_scanQrCode.html index 187cb756..27dee488 100644 --- a/src/main/resources/templates/pages/application/application-out_scanQrCode.html +++ b/src/main/resources/templates/pages/application/application-out_scanQrCode.html @@ -504,6 +504,13 @@ area: ['70%', '70%'], // content: '/selectMaterialByCard?mname='+mname+'&type=2&clickObj='+parentId, content: '/getMaterialAll?mname='+mname+'&type=2&clickObj='+parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, move : '.layui-layer-title', fixed:false, end: function () { diff --git a/src/main/resources/templates/pages/application/application-transfer.html b/src/main/resources/templates/pages/application/application-transfer.html index 79be7a3c..568f9dcd 100644 --- a/src/main/resources/templates/pages/application/application-transfer.html +++ b/src/main/resources/templates/pages/application/application-transfer.html @@ -646,6 +646,13 @@ content: '/getMaterialAll?mname='+mname+'&type=2&clickObj='+parentId, move : '.layui-layer-title', fixed:false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ @@ -759,6 +766,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepositoryByCard?type=1&clickObj='+parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); } // 用于扫描入库位置 diff --git a/src/main/resources/templates/pages/application/application-transfer_back.html b/src/main/resources/templates/pages/application/application-transfer_back.html index 495a8b9b..6c93fb4a 100644 --- a/src/main/resources/templates/pages/application/application-transfer_back.html +++ b/src/main/resources/templates/pages/application/application-transfer_back.html @@ -388,6 +388,13 @@ content: '/getMaterialAll?mname='+mname+'&type=2&clickObj='+parentId, move : '.layui-layer-title', fixed:false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ @@ -473,6 +480,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepositoryByCard?type=1&clickObj='+parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); } diff --git a/src/main/resources/templates/pages/application/application_in_multi.html b/src/main/resources/templates/pages/application/application_in_multi.html index 7320aa31..e4dd062f 100644 --- a/src/main/resources/templates/pages/application/application_in_multi.html +++ b/src/main/resources/templates/pages/application/application_in_multi.html @@ -104,6 +104,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=1', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -120,6 +127,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectMaterial?mname='+mname+'&type=1', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = $("#mid").val(); $.ajax({ diff --git a/src/main/resources/templates/pages/depository/table-out.html b/src/main/resources/templates/pages/depository/table-out.html index 3ed0af4b..7038f87f 100644 --- a/src/main/resources/templates/pages/depository/table-out.html +++ b/src/main/resources/templates/pages/depository/table-out.html @@ -102,6 +102,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //用于实现物料名称搜索 @@ -119,7 +126,14 @@ area: ['70%', '70%'], content: '/selectMaterial?type=1&mname=""', move: '.layui-layer-title', - fixed: false + fixed: false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }; diff --git a/src/main/resources/templates/pages/depository/table-stock.html b/src/main/resources/templates/pages/depository/table-stock.html index 1d22682f..90193370 100644 --- a/src/main/resources/templates/pages/depository/table-stock.html +++ b/src/main/resources/templates/pages/depository/table-stock.html @@ -90,6 +90,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/src/main/resources/templates/pages/material/material-add.html b/src/main/resources/templates/pages/material/material-add.html index 44e5bade..0e8c69d6 100644 --- a/src/main/resources/templates/pages/material/material-add.html +++ b/src/main/resources/templates/pages/material/material-add.html @@ -180,7 +180,16 @@ area: ['70%', '70%'], move : '.layui-layer-title', fixed:false, + shade: 0.8, content: '/selectType', + zIndex:1, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -196,6 +205,14 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + zIndex:1, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -249,7 +266,7 @@ "texture":"" }) } - }) + }); return false; }); diff --git a/src/main/resources/templates/pages/material/material-add_back.html b/src/main/resources/templates/pages/material/material-add_back.html index a873296a..62e8ffd8 100644 --- a/src/main/resources/templates/pages/material/material-add_back.html +++ b/src/main/resources/templates/pages/material/material-add_back.html @@ -105,6 +105,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -119,6 +126,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/src/main/resources/templates/pages/material/material-out.html b/src/main/resources/templates/pages/material/material-out.html index 1035142d..62f5283a 100644 --- a/src/main/resources/templates/pages/material/material-out.html +++ b/src/main/resources/templates/pages/material/material-out.html @@ -125,6 +125,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/src/main/resources/templates/pages/material/material-out_back.html b/src/main/resources/templates/pages/material/material-out_back.html index b65eca10..70bd57cd 100644 --- a/src/main/resources/templates/pages/material/material-out_back.html +++ b/src/main/resources/templates/pages/material/material-out_back.html @@ -128,6 +128,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -142,6 +149,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/src/main/resources/templates/pages/material/material-view.html b/src/main/resources/templates/pages/material/material-view.html index 7f2c231f..1dc6b075 100644 --- a/src/main/resources/templates/pages/material/material-view.html +++ b/src/main/resources/templates/pages/material/material-view.html @@ -174,6 +174,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //提交 @@ -224,6 +231,7 @@ move: '.layui-layer-title', fixed: false, content: '/checkBarCode?mid='+mid, + }) }; diff --git a/src/main/resources/templates/pages/material/selectMaterialByApproval.html b/src/main/resources/templates/pages/material/selectMaterialByApproval.html index 77c0a2f9..dbf672e3 100644 --- a/src/main/resources/templates/pages/material/selectMaterialByApproval.html +++ b/src/main/resources/templates/pages/material/selectMaterialByApproval.html @@ -56,6 +56,10 @@ } addTreeChildren(param); }else{ + // console.log("隐藏"); + var param = {}; + param.mtId = id; + closeTreeChildren(param); return false } }else{ @@ -103,6 +107,9 @@ var childrenName = this.childNodes[0].childNodes[0].childNodes[0].className; if(childrenName.includes("layui-icon-addition")){ // console.log("隐藏") + var param = {}; + param.mtId = id; + closeTreeChildren(param); }else if(childrenName.includes("layui-icon-subtraction")){ var param = {}; param.mtId = id; @@ -117,6 +124,9 @@ } }else if(context.includes("layui-icon")){ if(context.includes("layui-icon-addition")){ + var param = {}; + param.mtId = id; + closeTreeChildren(param); // console.log("隐藏") }else if(context.includes("layui-icon-subtraction")){ var param = {}; @@ -153,6 +163,16 @@ }); } }); + }; + + closeTreeChildren = function (param) { + $.ajax({ + url: "/material/closeTreeChildren", + data: JSON.stringify(param), + type: 'post', + dataType: 'json', + contentType: "application/json;charset=utf-8" + }); } }) diff --git a/src/main/resources/templates/pages/materialtype/materialType_add.html b/src/main/resources/templates/pages/materialtype/materialType_add.html index 378688ec..c384a688 100644 --- a/src/main/resources/templates/pages/materialtype/materialType_add.html +++ b/src/main/resources/templates/pages/materialtype/materialType_add.html @@ -84,6 +84,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/src/main/resources/templates/pages/materialtype/materialType_edit.html b/src/main/resources/templates/pages/materialtype/materialType_edit.html index 209430d4..c8df5f88 100644 --- a/src/main/resources/templates/pages/materialtype/materialType_edit.html +++ b/src/main/resources/templates/pages/materialtype/materialType_edit.html @@ -68,6 +68,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/src/main/resources/templates/pages/post/postRole_add.html b/src/main/resources/templates/pages/post/postRole_add.html index 9e89cbd0..e990b88b 100644 --- a/src/main/resources/templates/pages/post/postRole_add.html +++ b/src/main/resources/templates/pages/post/postRole_add.html @@ -70,6 +70,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //日期 diff --git a/src/main/resources/templates/pages/post/postRole_edit.html b/src/main/resources/templates/pages/post/postRole_edit.html index 86315f0a..306ec1a4 100644 --- a/src/main/resources/templates/pages/post/postRole_edit.html +++ b/src/main/resources/templates/pages/post/postRole_edit.html @@ -77,6 +77,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //日期 diff --git a/src/main/resources/templates/pages/stockTaking/stockTaking.html b/src/main/resources/templates/pages/stockTaking/stockTaking.html index f253236f..f2fd8ec5 100644 --- a/src/main/resources/templates/pages/stockTaking/stockTaking.html +++ b/src/main/resources/templates/pages/stockTaking/stockTaking.html @@ -358,6 +358,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var nowDepositoryId = $("#depositoryId").val(); var nowPlaceId = $("#placeId").val(); @@ -392,6 +399,13 @@ content: '/selectManager', end: function () { departmentManagerId = $("#departmentManagerId").val() + }, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); } }); }); @@ -696,6 +710,13 @@ fixed: false, content: '/getMaterialAll?mname=' + mname + '&type=3&clickObj=' + parentId + '&placeId=' + placeId + '&depositoryId=' + depositoryId, // content: '/selectMaterialByCardForTaking?mname=' + mname + '&type=3&clickObj=' + parentId + '&placeId=' + placeId + '&depositoryId=' + depositoryId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ diff --git a/src/main/resources/templates/pages/stockTaking/stockTransfer.html b/src/main/resources/templates/pages/stockTaking/stockTransfer.html index 11c3e389..5fe090c8 100644 --- a/src/main/resources/templates/pages/stockTaking/stockTransfer.html +++ b/src/main/resources/templates/pages/stockTaking/stockTransfer.html @@ -244,6 +244,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var nowDepositoryId = $("#depositoryId").val(); var nowPlaceId = $("#placeId").val(); @@ -324,6 +331,13 @@ move: '.layui-layer-title', fixed: false, content: '/scanCodeByTaking', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var nowDepositoryId = $("#depositoryId").val(); var nowPlaceId = $("#placeId").val(); diff --git a/src/main/resources/templates/pages/user/user-add.html b/src/main/resources/templates/pages/user/user-add.html index 94a514a8..bbc6da98 100644 --- a/src/main/resources/templates/pages/user/user-add.html +++ b/src/main/resources/templates/pages/user/user-add.html @@ -66,6 +66,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //日期 diff --git a/src/main/resources/templates/pages/user/user-role-edit.html b/src/main/resources/templates/pages/user/user-role-edit.html index f9ba73ab..b9dc907e 100644 --- a/src/main/resources/templates/pages/user/user-role-edit.html +++ b/src/main/resources/templates/pages/user/user-role-edit.html @@ -71,6 +71,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //日期 diff --git a/src/main/resources/templates/pages/warehouse/depository_add.html b/src/main/resources/templates/pages/warehouse/depository_add.html index 54606a41..539e54d8 100644 --- a/src/main/resources/templates/pages/warehouse/depository_add.html +++ b/src/main/resources/templates/pages/warehouse/depository_add.html @@ -139,6 +139,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/src/test/java/com/dreamchaser/depository_manage/TestForManagerTree.java b/src/test/java/com/dreamchaser/depository_manage/TestForManagerTree.java index 803c8d22..8cae96d2 100644 --- a/src/test/java/com/dreamchaser/depository_manage/TestForManagerTree.java +++ b/src/test/java/com/dreamchaser/depository_manage/TestForManagerTree.java @@ -4,18 +4,18 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.dreamchaser.depository_manage.config.PortConfig; -import com.dreamchaser.depository_manage.entity.Administration; -import com.dreamchaser.depository_manage.entity.User; -import com.dreamchaser.depository_manage.entity.UserByPort; +import com.dreamchaser.depository_manage.entity.*; import com.dreamchaser.depository_manage.pojo.AdministrationP; import com.dreamchaser.depository_manage.service.impl.CompanyServiceImpl; import com.dreamchaser.depository_manage.utils.HttpUtils; +import com.sun.org.apache.xml.internal.security.Init; import org.apache.http.protocol.HTTP; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import javax.management.relation.RelationSupport; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -29,28 +29,29 @@ public class TestForManagerTree { @Test public void test(){ - Map map =new HashMap<>(); - List administrationPList = findAllCompanyByParent(map, null); + List allUserByAdministration = findAllUserByAdministration("309", null); // 开启对应数量的线程 - ExecutorService exs = Executors.newFixedThreadPool(administrationPList.size()); + ExecutorService exs = Executors.newFixedThreadPool(allUserByAdministration.size()); // 结果集 List list = new ArrayList<>(); List> futureList = new ArrayList>(); - // 1.定义CompletionService CompletionService completionService = new ExecutorCompletionService(exs); - for (int i = 0; i < administrationPList.size(); i++) { - AdministrationP administrationP = administrationPList.get(i); - Future future = completionService.submit(new InitManagerForAdministration(administrationP,null)); - futureList.add(future); + // 开启对应数目的线程 + for (int i = 0; i < allUserByAdministration.size(); i++) { + ThreeAboutMan threeAboutMan = allUserByAdministration.get(i); + // 开启线程 + Future submit = completionService.submit(new InitManagerTree(threeAboutMan)); + futureList.add(submit); } - for (int i = 0; i < administrationPList.size(); i++) { + // 收集结果 + for (int i = 0; i < allUserByAdministration.size(); i++) { Object result = null; try { - result = completionService.take().get(); + result = completionService.take().get(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { @@ -59,78 +60,43 @@ public class TestForManagerTree { list.add(result); } System.out.println(JSONObject.toJSONString(list)); - } - class InitManagerForAdministration implements Callable{ + /** + * 用于构造人员树 + */ + class InitManagerTree implements Callable{ - AdministrationP administrationP; - UserByPort userToken; + ThreeAboutMan threeAboutMan; - InitManagerForAdministration(AdministrationP administrationP,UserByPort userToken){ - this.administrationP = administrationP; - this.userToken = userToken; + InitManagerTree(ThreeAboutMan threeAboutMan){ + this.threeAboutMan = threeAboutMan; } @Override public Object call() throws Exception { - List allUserByAdministration = findAllUserByAdministration(administrationP.getId(), userToken); - List objectList = addDepartmentHead(administrationP, allUserByAdministration); - Map map = InitTreeMenus(administrationP, objectList); + // 获取当前树结构的children + List children = InitTrees(threeAboutMan); + // 构造结构 + Map map = InitTree(threeAboutMan, children); return map; } } - /** - * 用于获取当前公司下所有部门 - * @param map 查询条件 - * @param userToken 登录用户 - * @return - */ - public List findAllCompanyByParent(Map map, UserByPort userToken){ - String url = PortConfig.external_url +"/org/govlist"; - String superior = (String) map.get("superior"); - if(superior == null || "".equals(superior)){ - superior = "309"; - } - map.put("superior",superior); - map.put("state",1); - map.put("level",4); - String jsonString = JSONObject.toJSONString(map); - JSONObject paramObject = JSONObject.parseObject(jsonString); - String post = null; - try { - post = HttpUtils.send(url,paramObject, HTTP.UTF_8,userToken); - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.parseObject(post); - JSONObject data = (JSONObject) jsonObject.get("data"); - JSONArray list = (JSONArray) data.get("list"); - if(list == null){ - list = new JSONArray(); - } - List administrationPList = new ArrayList<>(); - for (int i = 0; i < list.size(); i++) { - Administration administration = JSONObject.toJavaObject((JSONObject)list.get(i), Administration.class); - AdministrationP administrationP = new AdministrationP(administration); - administrationPList.add(administrationP); - } - return administrationPList; - } - /** - * 用于获取当前部门下所有的人 - * @param adminorg 部门id + * 用于获取行政组织树(包括成员) + * @param id 查询id * @param userToken 登录用户 * @return */ - public List findAllUserByAdministration(Integer adminorg,UserByPort userToken){ - String url = PortConfig.external_url +"/staff/archiveslist"; + public List findAllUserByAdministration(String id,UserByPort userToken){ + String url = PortConfig.external_url +"/org/govthreeaboutman"; Map map = new HashMap<>(); - map.put("adminorg",adminorg); + map.put("id",id); + map.put("level",0); + map.put("all",1); String jsonString = JSONObject.toJSONString(map); JSONObject paramObject = JSONObject.parseObject(jsonString); String post = null; @@ -141,51 +107,66 @@ public class TestForManagerTree { } JSONObject jsonObject = JSONObject.parseObject(post); JSONObject data = (JSONObject) jsonObject.get("data"); - JSONArray list = (JSONArray) data.get("list"); + JSONArray list = (JSONArray) data.get("three"); if(list == null){ list = new JSONArray(); } - List userByPortList = new ArrayList<>(); + List threeAboutManList = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { - UserByPort userByPort = JSONObject.toJavaObject((JSON) list.get(i), UserByPort.class); - if(Integer.compare(userByPort.getPersonincharge(),1) == 0) { - userByPortList.add(userByPort); - } + ThreeAboutMan threeAboutMan = JSONObject.toJavaObject((JSON) list.get(i), ThreeAboutMan.class); + threeAboutManList.add(threeAboutMan); } - return userByPortList; + return threeAboutManList; } /** - * 用于给当前部门添加部门负责人 - * @param ap + * 用于构造人员列表 + * @param threeAboutMan * @return */ - public List addDepartmentHead(AdministrationP ap,List departmentHeadByUser){ + public List InitTrees(ThreeAboutMan threeAboutMan){ // 获取当前部门的部门负责人 - Map map = new HashMap<>(); - map.put("adminorg",ap.getId()); List result = new ArrayList<>(); - for (int i = 0; i < departmentHeadByUser.size(); i++) { - UserByPort user = departmentHeadByUser.get(i); - Map children = new HashMap<>(); - children.put("title",user.getName()); - children.put("id",user.getId()); - result.add(children); + List child = threeAboutMan.getChild(); + if(child != null){ + for (int i = 0; i < child.size(); i++) { + ThreeAboutMan threeAboutMan1 = child.get(i); + if(Integer.compare(threeAboutMan1.getIsman(),1) == 0){ + // 如果当前数据是部门 + + // 递归查询当前树 + List childrenList = InitTrees(threeAboutMan1); + Map map = InitTree(threeAboutMan1, childrenList); + result.add(map); + }else{ + // 如果是人员 + + Map children = new HashMap<>(); + children.put("title",threeAboutMan1.getName()); + children.put("id",threeAboutMan1.getNumber()); + result.add(children); + } + } } return result; } - // 构造树形组件数据模板 - public Map InitTreeMenus(AdministrationP ap, List children){ - if(ap != null) { - Map map = new HashMap<>(); - map.put("title",ap.getName()); - map.put("id", ap.getId()); - map.put("children",children); - return map; - } - else{ - return null; - } + + /** + * 用于构造树形模板 + * @param threeAboutMan + * @param children + * @return + */ + public Map InitTree(ThreeAboutMan threeAboutMan,List children){ + if (threeAboutMan != null) { + Map map = new HashMap<>(); + map.put("title", threeAboutMan.getName()); + map.put("id", threeAboutMan.getNumber()); + map.put("children", children); + return map; + } else { + return null; + } } } diff --git a/target/classes/templates/pages/application/application-in.html b/target/classes/templates/pages/application/application-in.html index 1a5093d7..75e6c969 100644 --- a/target/classes/templates/pages/application/application-in.html +++ b/target/classes/templates/pages/application/application-in.html @@ -577,6 +577,13 @@ content: '/getMaterialAll?mname=' + mname + '&type=1&clickObj=' + parentId, move: '.layui-layer-title', fixed: false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ @@ -814,6 +821,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepositoryByCard?type=1&clickObj=' + parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }; diff --git a/target/classes/templates/pages/application/application-in_back.html b/target/classes/templates/pages/application/application-in_back.html index 163d898e..10e69fd3 100644 --- a/target/classes/templates/pages/application/application-in_back.html +++ b/target/classes/templates/pages/application/application-in_back.html @@ -220,6 +220,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=1', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -253,6 +260,13 @@ } }); + }, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); } }); }); diff --git a/target/classes/templates/pages/application/application-in_scanQrCode.html b/target/classes/templates/pages/application/application-in_scanQrCode.html index afea0d0f..b4537d87 100644 --- a/target/classes/templates/pages/application/application-in_scanQrCode.html +++ b/target/classes/templates/pages/application/application-in_scanQrCode.html @@ -675,6 +675,13 @@ content: '/getMaterialAll?mname=' + mname + '&type=1&clickObj=' + parentId, move: '.layui-layer-title', fixed: false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ @@ -815,6 +822,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepositoryByCard?type=1&clickObj=' + parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); } diff --git a/target/classes/templates/pages/application/application-out.html b/target/classes/templates/pages/application/application-out.html index 7be09ce5..6119fb35 100644 --- a/target/classes/templates/pages/application/application-out.html +++ b/target/classes/templates/pages/application/application-out.html @@ -555,6 +555,13 @@ content: '/getMaterialAll?mname=' + mname + '&type=2&clickObj=' + parentId, move: '.layui-layer-title', fixed: false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ diff --git a/target/classes/templates/pages/application/application-out_back.html b/target/classes/templates/pages/application/application-out_back.html index 683e297c..a5ecfcce 100644 --- a/target/classes/templates/pages/application/application-out_back.html +++ b/target/classes/templates/pages/application/application-out_back.html @@ -219,6 +219,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -235,6 +242,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectMaterial?mname='+mname+'&type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = $("#mid").val(); $.ajax({ diff --git a/target/classes/templates/pages/application/application-out_scanQrCode.html b/target/classes/templates/pages/application/application-out_scanQrCode.html index 187cb756..27dee488 100644 --- a/target/classes/templates/pages/application/application-out_scanQrCode.html +++ b/target/classes/templates/pages/application/application-out_scanQrCode.html @@ -504,6 +504,13 @@ area: ['70%', '70%'], // content: '/selectMaterialByCard?mname='+mname+'&type=2&clickObj='+parentId, content: '/getMaterialAll?mname='+mname+'&type=2&clickObj='+parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, move : '.layui-layer-title', fixed:false, end: function () { diff --git a/target/classes/templates/pages/application/application-transfer.html b/target/classes/templates/pages/application/application-transfer.html index 79be7a3c..568f9dcd 100644 --- a/target/classes/templates/pages/application/application-transfer.html +++ b/target/classes/templates/pages/application/application-transfer.html @@ -646,6 +646,13 @@ content: '/getMaterialAll?mname='+mname+'&type=2&clickObj='+parentId, move : '.layui-layer-title', fixed:false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ @@ -759,6 +766,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepositoryByCard?type=1&clickObj='+parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); } // 用于扫描入库位置 diff --git a/target/classes/templates/pages/application/application-transfer_back.html b/target/classes/templates/pages/application/application-transfer_back.html index 495a8b9b..6c93fb4a 100644 --- a/target/classes/templates/pages/application/application-transfer_back.html +++ b/target/classes/templates/pages/application/application-transfer_back.html @@ -388,6 +388,13 @@ content: '/getMaterialAll?mname='+mname+'&type=2&clickObj='+parentId, move : '.layui-layer-title', fixed:false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ @@ -473,6 +480,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepositoryByCard?type=1&clickObj='+parentId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); } diff --git a/target/classes/templates/pages/application/application_in_multi.html b/target/classes/templates/pages/application/application_in_multi.html index 7320aa31..e4dd062f 100644 --- a/target/classes/templates/pages/application/application_in_multi.html +++ b/target/classes/templates/pages/application/application_in_multi.html @@ -104,6 +104,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=1', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -120,6 +127,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectMaterial?mname='+mname+'&type=1', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = $("#mid").val(); $.ajax({ diff --git a/target/classes/templates/pages/depository/table-out.html b/target/classes/templates/pages/depository/table-out.html index 3ed0af4b..7038f87f 100644 --- a/target/classes/templates/pages/depository/table-out.html +++ b/target/classes/templates/pages/depository/table-out.html @@ -102,6 +102,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //用于实现物料名称搜索 @@ -119,7 +126,14 @@ area: ['70%', '70%'], content: '/selectMaterial?type=1&mname=""', move: '.layui-layer-title', - fixed: false + fixed: false, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }; diff --git a/target/classes/templates/pages/depository/table-stock.html b/target/classes/templates/pages/depository/table-stock.html index 1d22682f..90193370 100644 --- a/target/classes/templates/pages/depository/table-stock.html +++ b/target/classes/templates/pages/depository/table-stock.html @@ -90,6 +90,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/target/classes/templates/pages/material/material-add.html b/target/classes/templates/pages/material/material-add.html index 44e5bade..0e8c69d6 100644 --- a/target/classes/templates/pages/material/material-add.html +++ b/target/classes/templates/pages/material/material-add.html @@ -180,7 +180,16 @@ area: ['70%', '70%'], move : '.layui-layer-title', fixed:false, + shade: 0.8, content: '/selectType', + zIndex:1, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -196,6 +205,14 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + zIndex:1, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -249,7 +266,7 @@ "texture":"" }) } - }) + }); return false; }); diff --git a/target/classes/templates/pages/material/material-add_back.html b/target/classes/templates/pages/material/material-add_back.html index a873296a..62e8ffd8 100644 --- a/target/classes/templates/pages/material/material-add_back.html +++ b/target/classes/templates/pages/material/material-add_back.html @@ -105,6 +105,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -119,6 +126,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/target/classes/templates/pages/material/material-out.html b/target/classes/templates/pages/material/material-out.html index 1035142d..62f5283a 100644 --- a/target/classes/templates/pages/material/material-out.html +++ b/target/classes/templates/pages/material/material-out.html @@ -125,6 +125,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/target/classes/templates/pages/material/material-out_back.html b/target/classes/templates/pages/material/material-out_back.html index b65eca10..70bd57cd 100644 --- a/target/classes/templates/pages/material/material-out_back.html +++ b/target/classes/templates/pages/material/material-out_back.html @@ -128,6 +128,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); @@ -142,6 +149,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/target/classes/templates/pages/material/material-view.html b/target/classes/templates/pages/material/material-view.html index 7f2c231f..1dc6b075 100644 --- a/target/classes/templates/pages/material/material-view.html +++ b/target/classes/templates/pages/material/material-view.html @@ -174,6 +174,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //提交 @@ -224,6 +231,7 @@ move: '.layui-layer-title', fixed: false, content: '/checkBarCode?mid='+mid, + }) }; diff --git a/target/classes/templates/pages/material/selectMaterialByApproval.html b/target/classes/templates/pages/material/selectMaterialByApproval.html index 77c0a2f9..dbf672e3 100644 --- a/target/classes/templates/pages/material/selectMaterialByApproval.html +++ b/target/classes/templates/pages/material/selectMaterialByApproval.html @@ -56,6 +56,10 @@ } addTreeChildren(param); }else{ + // console.log("隐藏"); + var param = {}; + param.mtId = id; + closeTreeChildren(param); return false } }else{ @@ -103,6 +107,9 @@ var childrenName = this.childNodes[0].childNodes[0].childNodes[0].className; if(childrenName.includes("layui-icon-addition")){ // console.log("隐藏") + var param = {}; + param.mtId = id; + closeTreeChildren(param); }else if(childrenName.includes("layui-icon-subtraction")){ var param = {}; param.mtId = id; @@ -117,6 +124,9 @@ } }else if(context.includes("layui-icon")){ if(context.includes("layui-icon-addition")){ + var param = {}; + param.mtId = id; + closeTreeChildren(param); // console.log("隐藏") }else if(context.includes("layui-icon-subtraction")){ var param = {}; @@ -153,6 +163,16 @@ }); } }); + }; + + closeTreeChildren = function (param) { + $.ajax({ + url: "/material/closeTreeChildren", + data: JSON.stringify(param), + type: 'post', + dataType: 'json', + contentType: "application/json;charset=utf-8" + }); } }) diff --git a/target/classes/templates/pages/materialtype/materialType_add.html b/target/classes/templates/pages/materialtype/materialType_add.html index 378688ec..c384a688 100644 --- a/target/classes/templates/pages/materialtype/materialType_add.html +++ b/target/classes/templates/pages/materialtype/materialType_add.html @@ -84,6 +84,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/target/classes/templates/pages/materialtype/materialType_edit.html b/target/classes/templates/pages/materialtype/materialType_edit.html index 209430d4..c8df5f88 100644 --- a/target/classes/templates/pages/materialtype/materialType_edit.html +++ b/target/classes/templates/pages/materialtype/materialType_edit.html @@ -68,6 +68,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectType', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); diff --git a/target/classes/templates/pages/post/postRole_add.html b/target/classes/templates/pages/post/postRole_add.html index 9e89cbd0..e990b88b 100644 --- a/target/classes/templates/pages/post/postRole_add.html +++ b/target/classes/templates/pages/post/postRole_add.html @@ -70,6 +70,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //日期 diff --git a/target/classes/templates/pages/post/postRole_edit.html b/target/classes/templates/pages/post/postRole_edit.html index 86315f0a..306ec1a4 100644 --- a/target/classes/templates/pages/post/postRole_edit.html +++ b/target/classes/templates/pages/post/postRole_edit.html @@ -77,6 +77,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //日期 diff --git a/target/classes/templates/pages/stockTaking/stockTaking.html b/target/classes/templates/pages/stockTaking/stockTaking.html index f253236f..f2fd8ec5 100644 --- a/target/classes/templates/pages/stockTaking/stockTaking.html +++ b/target/classes/templates/pages/stockTaking/stockTaking.html @@ -358,6 +358,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var nowDepositoryId = $("#depositoryId").val(); var nowPlaceId = $("#placeId").val(); @@ -392,6 +399,13 @@ content: '/selectManager', end: function () { departmentManagerId = $("#departmentManagerId").val() + }, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); } }); }); @@ -696,6 +710,13 @@ fixed: false, content: '/getMaterialAll?mname=' + mname + '&type=3&clickObj=' + parentId + '&placeId=' + placeId + '&depositoryId=' + depositoryId, // content: '/selectMaterialByCardForTaking?mname=' + mname + '&type=3&clickObj=' + parentId + '&placeId=' + placeId + '&depositoryId=' + depositoryId, + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var mid = materialId.value; $.ajax({ diff --git a/target/classes/templates/pages/stockTaking/stockTransfer.html b/target/classes/templates/pages/stockTaking/stockTransfer.html index 11c3e389..5fe090c8 100644 --- a/target/classes/templates/pages/stockTaking/stockTransfer.html +++ b/target/classes/templates/pages/stockTaking/stockTransfer.html @@ -244,6 +244,13 @@ move: '.layui-layer-title', fixed: false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var nowDepositoryId = $("#depositoryId").val(); var nowPlaceId = $("#placeId").val(); @@ -324,6 +331,13 @@ move: '.layui-layer-title', fixed: false, content: '/scanCodeByTaking', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + }, end: function () { var nowDepositoryId = $("#depositoryId").val(); var nowPlaceId = $("#placeId").val(); diff --git a/target/classes/templates/pages/user/user-add.html b/target/classes/templates/pages/user/user-add.html index 94a514a8..bbc6da98 100644 --- a/target/classes/templates/pages/user/user-add.html +++ b/target/classes/templates/pages/user/user-add.html @@ -66,6 +66,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //日期 diff --git a/target/classes/templates/pages/user/user-role-edit.html b/target/classes/templates/pages/user/user-role-edit.html index f9ba73ab..b9dc907e 100644 --- a/target/classes/templates/pages/user/user-role-edit.html +++ b/target/classes/templates/pages/user/user-role-edit.html @@ -71,6 +71,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); }); //日期 diff --git a/target/classes/templates/pages/warehouse/depository_add.html b/target/classes/templates/pages/warehouse/depository_add.html index 54606a41..539e54d8 100644 --- a/target/classes/templates/pages/warehouse/depository_add.html +++ b/target/classes/templates/pages/warehouse/depository_add.html @@ -139,6 +139,13 @@ move : '.layui-layer-title', fixed:false, content: '/selectDepository?type=2', + success: function(layero, index){ + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height','100%'); + iframeChildren.css('height','100%'); + } }); });