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 c53a4362..82d3390f 100644 --- a/src/main/java/com/dreamchaser/depository_manage/config/PortConfig.java +++ b/src/main/java/com/dreamchaser/depository_manage/config/PortConfig.java @@ -3,15 +3,14 @@ package com.dreamchaser.depository_manage.config; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.dreamchaser.depository_manage.controller.PageController; import com.dreamchaser.depository_manage.entity.Administration; import com.dreamchaser.depository_manage.entity.Post; import com.dreamchaser.depository_manage.entity.UserByPort; import com.dreamchaser.depository_manage.utils.HttpUtils; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import lombok.Data; import org.apache.http.protocol.HTTP; -import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -66,7 +65,7 @@ public class PortConfig { Map param = new HashMap<>(); Post userPost = userPostList.get(i); param.put("position",userPost.getId()); - List userByPorts = PageController.FindUserByMap(param,userToken); + List userByPorts = LinkInterfaceUtil.FindUserByMap(param,userToken); userByPortList.addAll(userByPorts); } return userByPortList; diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/CompanyController.java b/src/main/java/com/dreamchaser/depository_manage/controller/CompanyController.java index 3702760c..6e439119 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/CompanyController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/CompanyController.java @@ -9,14 +9,13 @@ import com.dreamchaser.depository_manage.pojo.*; import com.dreamchaser.depository_manage.service.CompanyService; import com.dreamchaser.depository_manage.service.DepositoryService; import com.dreamchaser.depository_manage.service.RoleService; -import com.dreamchaser.depository_manage.service.impl.CompanyServiceImpl; import com.dreamchaser.depository_manage.utils.CrudUtil; import com.dreamchaser.depository_manage.utils.HttpUtils; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; import org.apache.http.protocol.HTTP; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import java.io.IOException; @@ -40,7 +39,8 @@ public class CompanyController { /** * 查询组织架构 - * @param + * @param map 查询条件 + * @param request 请求体 * @return */ @PostMapping("/allCompanyByParent") @@ -85,8 +85,8 @@ public class CompanyController { /** * 根据条件查询公司 - * @param map - * @return + * @param map 查询条件 + * @return 返回结果 */ @PostMapping("/companyByCondition") public RestResponse findcompanyByCondition(@RequestParam Map map,HttpServletRequest request){ @@ -125,8 +125,8 @@ public class CompanyController { } /** - * 获取所有岗位 - * @param map + * 根据条件查询岗位 + * @param map 查询条件 * @return */ @PostMapping("/allPostByOrganization") @@ -183,12 +183,18 @@ public class CompanyController { return new RestResponse(postList,total,200); } + + /** + * 给岗位设置权限 + * @param map 条件 + * @return 设置结果 + */ @PostMapping("/post_role") public RestResponse addUser(@RequestBody Map map,HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); Map userParam = new HashMap<>(); userParam.put("position",ObjectFormatUtil.toInteger(map.get("userid"))); - List userByPortList = PageController.FindUserByMap(userParam,userToken); + List userByPortList = LinkInterfaceUtil.FindUserByMap(userParam,userToken); Integer success = 0; if(map.containsKey("depositoryId")) { for (int i = 0; i < userByPortList.size(); i++) { @@ -233,6 +239,11 @@ public class CompanyController { return CrudUtil.postHandle(success,success); } + /** + * 修改岗位的权限 + * @param map 修改条件 + * @return + */ @PostMapping("/postRole_edit") public RestResponse editPostRole(@RequestBody Map map) { Map userParam = new HashMap<>(); @@ -256,7 +267,7 @@ public class CompanyController { } /** * 根据主键删除权限类型 - * @param map + * @param map 删除条件 * @return */ @PostMapping("/postRole_del") @@ -295,13 +306,18 @@ public class CompanyController { } } + /** + * 查询岗位对应的权限 + * @param postId 要查询的岗位id + * @return + */ @GetMapping("/findPostRole") public RestResponse findPostRole(@RequestParam("postId") Integer postId,HttpServletRequest request){ UserByPort userToken = (UserByPort) request.getAttribute("userToken"); Map userParam = new HashMap<>(); userParam.put("position",postId); - List userByPortList = PageController.FindUserByMap(userParam,userToken); - Post postById = PageController.findPostById(postId,userToken); + List userByPortList = LinkInterfaceUtil.FindUserByMap(userParam,userToken); + Post postById = LinkInterfaceUtil.findPostById(postId,userToken); List roleAndDepositoryByCondition = new ArrayList<>(); if(userByPortList.size() != 0){ Map param = new HashMap<>(); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java index 12ce6df4..617e9130 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java @@ -8,12 +8,7 @@ import com.dreamchaser.depository_manage.entity.*; import com.dreamchaser.depository_manage.exception.MyException; import com.dreamchaser.depository_manage.pojo.*; import com.dreamchaser.depository_manage.service.*; -import com.dreamchaser.depository_manage.service.impl.DepositoryRecordServiceImpl; -import com.dreamchaser.depository_manage.service.impl.DepositoryServiceImpl; -import com.dreamchaser.depository_manage.utils.CrudUtil; -import com.dreamchaser.depository_manage.utils.DateUtil; -import com.dreamchaser.depository_manage.utils.HttpUtils; -import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; +import com.dreamchaser.depository_manage.utils.*; import lombok.Data; import org.apache.http.protocol.HTTP; import org.springframework.beans.factory.annotation.Autowired; @@ -401,7 +396,7 @@ public class DepositoryController { List list = depositoryService.findDepositoryRecordPByCondition(map, userByPort); for (int i = 0; i < list.size(); i++) { Depository depository = list.get(i); - Administration company = PageController.getCompany(depository.getCid(), userByPort); + Administration company = LinkInterfaceUtil.getCompany(depository.getCid(), userByPort); list.get(i).setCname(company.getName()); } return new RestResponse(list, depositoryService.findCountByCondition(map), 200); @@ -1593,7 +1588,7 @@ public class DepositoryController { List userIdByDid = roleService.findUserIdByDid(did); List userByPortList = new ArrayList<>(); for (int i = 0; i < userIdByDid.size(); i++) { - UserByPort userByPort = PageController.FindUserById(userIdByDid.get(i), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(userIdByDid.get(i), userToken); userByPortList.add(userByPort); } return new RestResponse(userByPortList, userByPortList.size(), 200); @@ -1603,7 +1598,7 @@ public class DepositoryController { @GetMapping("/findPostByCompany") public RestResponse findPostByCompany(@RequestParam("company") String company, HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); - List administrationPList = PageController.findCompanyBySuperior(company, userToken); + List administrationPList = LinkInterfaceUtil.findCompanyBySuperior(company, userToken); int size = administrationPList.size(); return new RestResponse(administrationPList, size, 200); } 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 0559d912..85ee907b 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -496,7 +496,7 @@ public class DepositoryRecordController { ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(applicationOutMinById.getParentId()); // 获取申请人 - UserByPort userByPort = PageController.FindUserById(applicationOutRecordPById.getApplicantId(),userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationOutRecordPById.getApplicantId(),userToken); // 创建展示对象 SimpleApplicationOutMinRecordP simpleApplicationOutMinRecordP = new SimpleApplicationOutMinRecordP(applicationOutMinById); // 获取申请的物料信息 @@ -508,7 +508,7 @@ public class DepositoryRecordController { if(checkId != null){ // 如果该订单已经处理 // 获取处理人 - UserByPort checker = PageController.FindUserById(checkId,userToken); + UserByPort checker = LinkInterfaceUtil.FindUserById(checkId,userToken); simpleApplicationOutMinRecordP.setCheckerName(checker.getName()); } List materialAndProducedDateByMid = materialService.findMaterialAndProducedDateByMid(materialById.getId()); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index 052009dd..eaa0bab0 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -1,43 +1,27 @@ package com.dreamchaser.depository_manage.controller; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.dreamchaser.depository_manage.config.JM_3DES; import com.dreamchaser.depository_manage.config.PortConfig; -import com.dreamchaser.depository_manage.config.QyWxConfig; import com.dreamchaser.depository_manage.entity.*; import com.dreamchaser.depository_manage.exception.MyException; import com.dreamchaser.depository_manage.pojo.*; import com.dreamchaser.depository_manage.security.bean.UserToken; -import com.dreamchaser.depository_manage.security.pool.AuthenticationTokenPool; -import com.dreamchaser.depository_manage.security.pool.UserKeyAndTokenPool; import com.dreamchaser.depository_manage.service.*; import com.dreamchaser.depository_manage.utils.*; -import com.sun.org.apache.xpath.internal.operations.Mod; -import javafx.geometry.Pos; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.lang.RandomStringUtils; import org.apache.http.protocol.HTTP; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.mobile.device.Device; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; -import javax.servlet.ServletException; -import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import java.io.IOException; import java.math.BigDecimal; import java.text.SimpleDateFormat; -import java.time.Instant; import java.util.*; -import java.util.concurrent.TimeUnit; /** * 专门用来展示页面的controller @@ -84,22 +68,6 @@ public class PageController { private StockTakingService stockTakingService; - public static JSONObject Captcha(HttpServletRequest request) { - UserByPort userByPort = (UserByPort) request.getAttribute("userToken"); - String url = PortConfig.external_url_6666 + "/base/captcha"; - JSONObject param = new JSONObject(); - String post = null; - try { - post = HttpUtils.send(url, param, HTTP.UTF_8, userByPort); - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.parseObject(post); - JSONObject data = (JSONObject) jsonObject.get("data"); - return data; - } - - @GetMapping("/") public ModelAndView Init(HttpServletRequest request) { ModelAndView mv = new ModelAndView(); @@ -126,7 +94,7 @@ public class PageController { @GetMapping("/login") public ModelAndView login(HttpServletRequest request) { ModelAndView mv = new ModelAndView(); - JSONObject captcha = Captcha(request); + JSONObject captcha = LinkInterfaceUtil.Captcha(request); String picPath = (String) captcha.get("picPath"); String captchaid = (String) captcha.get("captchaid"); mv.addObject("picPath", picPath); @@ -666,13 +634,15 @@ public class PageController { public ModelAndView chart_in() { ModelAndView mv = new ModelAndView(); mv.setViewName("pages/chart/chart-in"); - mv.addObject("depositories", depositoryService.findDepositoryAll()); - mv.addObject("reviewers", userService.findReviewers()); - mv.addObject("materials", materialService.findMaterialAll()); - mv.addObject("InCount", depositoryRecordService.CalculateAllCount(1, "已入库")); - mv.addObject("allInCount", depositoryRecordService.CalculateAllCount(1, "")); - mv.addObject("InPrice", depositoryRecordService.CalculateAllPrice(1, "已入库")); - mv.addObject("allInPrice", depositoryRecordService.CalculateAllPrice(1, "")); + // 转入物料数量 + mv.addObject("InCount", depositoryRecordService.CalculateAllApplicationInCount()); + + // 转入物料总额 + mv.addObject("allInCount", depositoryRecordService.CalculateAllApplicationInCount()); + // 购入物料数量 + mv.addObject("InPrice", depositoryRecordService.CalculateAllApplicationInPrice()); + // 购入物料总额 + mv.addObject("allInPrice", depositoryRecordService.CalculateAllApplicationInPrice()); return mv; } @@ -731,62 +701,13 @@ public class PageController { return mv; } - /** - * 根据条件查询用户 - * - * @param map - * @return - */ - public static List FindUserByMap(Map map, UserByPort userToken) { - String url = PortConfig.external_url + "/staff/archiveslist"; - 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"); - List result = new ArrayList<>(); - if (list == null) { - list = new JSONArray(); - } - for (int i = 0; i < list.size(); i++) { - UserByPort userByPort = JSONObject.toJavaObject((JSONObject) list.get(i), UserByPort.class); - result.add(userByPort); - } - return result; - } - - public static UserByPort FindUserById(Integer id, UserByPort userToken) { - String url = PortConfig.external_url + "/staff/archivescont"; - Map map = new HashMap<>(); - map.put("id", id); - 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"); - UserByPort userByPort = JSONObject.toJavaObject(data, UserByPort.class); - return userByPort; - } - @GetMapping("/user_add") public ModelAndView user_add(Integer userId, HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); ModelAndView mv = new ModelAndView(); mv.setViewName("pages/user/user-add"); - UserByPort userByPort = FindUserById(userId, userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(userId, userToken); UserByPortP userByPortP = new UserByPortP(userByPort); mv.addObject("userByPort", userByPortP); mv.addObject("roles", roleService.findAllRole()); @@ -802,7 +723,7 @@ public class PageController { RoleAndDepository roleAndDepositoryById = roleService.findRoleAndDepositoryById(id); UserByPortP userByPortP = null; if (roleAndDepositoryById != null) { - UserByPort userByPort = FindUserById(roleAndDepositoryById.getUserId(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(roleAndDepositoryById.getUserId(), userToken); userByPortP = new UserByPortP(userByPort); userByPortP.setRolename(roleAndDepositoryById.getRoleName()); userByPortP.setDepositoryName(roleAndDepositoryById.getDepositoryName()); @@ -822,8 +743,8 @@ public class PageController { mv.setViewName("pages/post/postRole_edit"); Map userParam = new HashMap<>(); userParam.put("position", id); - List userByPortList = PageController.FindUserByMap(userParam, userToken); - Post postById = findPostById(id, userToken); + List userByPortList = LinkInterfaceUtil.FindUserByMap(userParam, userToken); + Post postById = LinkInterfaceUtil.findPostById(id, userToken); PostP pp = new PostP(postById); Map param = new HashMap<>(); param.put("depositoryId", depositoryId); @@ -846,7 +767,7 @@ public class PageController { mv.addObject("depositories", depositoryService.findDepositoryAll()); Map map = new HashMap<>(); map.put("number", id.toString()); - UserByPort userByPort = FindUserByMap(map, userToken).get(0); + UserByPort userByPort = LinkInterfaceUtil.FindUserByMap(map, userToken).get(0); mv.addObject("user", userByPort); return mv; } @@ -863,7 +784,7 @@ public class PageController { mv.addObject("record", depositoryRecordById); Integer cid = depositoryRecordById.getCid(); - List postList = findCompanyBySuperior(cid.toString(), userToken); + List postList = LinkInterfaceUtil.findCompanyBySuperior(cid.toString(), userToken); List administrationPList = findAllCompany(userToken); // 部门列表 mv.addObject("postList", postList); @@ -1084,13 +1005,13 @@ public class PageController { sumPrice += (materialById.getPrice()); } // 申请人 - UserByPort userByPort = FindUserById(recordP.getApplicantId(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(recordP.getApplicantId(), userToken); // 部门负责人 String departmentheads = recordP.getDepartmenthead(); String[] split = departmentheads.split(","); StringBuilder departmentHeadName = new StringBuilder(); for (int i = 0; i < split.length; i++) { - UserByPort departmenthead = FindUserById(ObjectFormatUtil.toInteger(split[i]), userToken); + UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(split[i]), userToken); departmentHeadName.append(departmenthead.getName()).append(","); } @@ -1104,7 +1025,7 @@ public class PageController { String depositoryManagerNames = ""; for (int i = 0; i < depositoryManagerId.length; i++) { Integer managerid = ObjectFormatUtil.toInteger(depositoryManagerId[i]); - UserByPort user = FindUserById(managerid, userToken); + UserByPort user = LinkInterfaceUtil.FindUserById(managerid, userToken); depositoryManager.add(user); depositoryManagerNames += user.getName() + ","; } @@ -1133,7 +1054,7 @@ public class PageController { mv.setViewName("pages/application/form-step-look"); if (id != null) { ApplicationInRecordP applicationInRecordPById = depositoryRecordService.findApplicationInRecordPById(id); - UserByPort userByPort = FindUserById(applicationInRecordPById.getApplicantId(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationInRecordPById.getApplicantId(), userToken); applicationInRecordPById.setApplicantName(userByPort.getName()); applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime()))); applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100); @@ -1161,7 +1082,7 @@ public class PageController { // 获取出库库位 Place placeById = placeService.findPlaceById(recordMin.getPlaceId()); // 获取处理人 - UserByPort userByPort = FindUserById(recordMin.getCheckId(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(recordMin.getCheckId(), userToken); // 设置处理人姓名 recordMinP.setCheckerName(userByPort.getName()); recordMinP.setDepositoryName(depository.getDname()); @@ -1231,7 +1152,7 @@ public class PageController { if (checkId != null) { // 如果当前子订单已经处理 // 获取当前处理人 - UserByPort disposer = FindUserById(checkId, userToken); + UserByPort disposer = LinkInterfaceUtil.FindUserById(checkId, userToken); outDisposer.append(disposer.getName() + ","); recordMinP.setCheckerName(disposer.getName()); } else { @@ -1247,7 +1168,7 @@ public class PageController { recordMinPList.add(recordMinP); } // 申请人 - UserByPort userByPort = FindUserById(applicationOutRecordPById.getApplicantId(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationOutRecordPById.getApplicantId(), userToken); // 部门负责人 String departmentHead = applicationOutRecordPById.getDepartmenthead(); String[] split = departmentHead.split(","); @@ -1257,7 +1178,7 @@ public class PageController { } StringBuilder departmentHeadName = new StringBuilder(); for (int i = 0; i < split.length; i++) { - UserByPort departmenthead = FindUserById(ObjectFormatUtil.toInteger(split[i]), userToken); + UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(split[i]), userToken); departmentHeadName.append(departmenthead.getName()).append(","); } // 仓储中心负责人 @@ -1270,7 +1191,7 @@ public class PageController { String depositoryManagerNames = ""; for (int i = 0; i < depositoryManagerId.length; i++) { Integer managerid = ObjectFormatUtil.toInteger(depositoryManagerId[i]); - UserByPort user = FindUserById(managerid, userToken); + UserByPort user = LinkInterfaceUtil.FindUserById(managerid, userToken); depositoryManager.add(user); depositoryManagerNames += user.getName(); } @@ -1311,7 +1232,7 @@ public class PageController { stp.setCreateTime(DateUtil.TimeStampToDateTime(stockTaking.getCreateTime())); // 获取申请人 - UserByPort userByPort = FindUserById(stockTaking.getOriginator(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(stockTaking.getOriginator(), userToken); // 设置盘点发起人姓名 stp.setOriginatorName(userByPort.getName()); @@ -1323,7 +1244,7 @@ public class PageController { if ("".equals(s)) { continue; } - UserByPort manager = FindUserById(ObjectFormatUtil.toInteger(s), userToken); + UserByPort manager = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), userToken); managerName.append(manager.getName() + ","); } stp.setDepartmentManagerName(managerName.toString()); @@ -1390,7 +1311,7 @@ public class PageController { // 获取申请人 - UserByPort userByPort = FindUserById(stockTaking.getOriginator(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(stockTaking.getOriginator(), userToken); // 设置盘点发起人姓名 stp.setOriginatorName(userByPort.getName()); @@ -1402,7 +1323,7 @@ public class PageController { if ("".equals(s)) { continue; } - UserByPort manager = FindUserById(ObjectFormatUtil.toInteger(s), userToken); + UserByPort manager = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), userToken); managerName.append(manager.getName() + ","); } stp.setDepartmentManagerName(managerName.toString()); @@ -1534,7 +1455,7 @@ public class PageController { JSONObject jsonObject = JSONObject.parseObject(post); JSONObject data = (JSONObject) jsonObject.get("data"); Administration administration = JSONObject.toJavaObject(data, Administration.class); - String SuperiorName = getCompany(administration.getSuperior(), userByPort).getName(); + String SuperiorName = LinkInterfaceUtil.getCompany(administration.getSuperior(), userByPort).getName(); mv.addObject("record", administration); mv.addObject("SuperiorName", SuperiorName); } else { @@ -1543,53 +1464,6 @@ public class PageController { return mv; } - public static Administration getCompany(Integer id, UserByPort userByPort) { - String url = PortConfig.external_url + "/org/getgovcont"; - Map map = new HashMap<>(); - map.put("id", id); - map.put("idstr", id.toString()); - String jsonString = JSONObject.toJSONString(map); - JSONObject paramObject = JSONObject.parseObject(jsonString); - String post = null; - try { - post = HttpUtils.send(url, paramObject, HTTP.UTF_8, userByPort); - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.parseObject(post); - JSONObject data = (JSONObject) jsonObject.get("data"); - Administration administration = JSONObject.toJavaObject(data, Administration.class); - return administration; - } - - - public static List findCompanyBySuperior(String superior, UserByPort userByPort) { - String url = PortConfig.external_url + "/org/govlist"; - Map map = new HashMap<>(); - map.put("superior", superior); - String jsonString = JSONObject.toJSONString(map); - JSONObject paramObject = JSONObject.parseObject(jsonString); - String post = null; - try { - post = HttpUtils.send(url, paramObject, HTTP.UTF_8, userByPort); - } 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(); - } - Integer total = ObjectFormatUtil.toInteger(data.get("total")); - 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; - } @GetMapping("/findCompanyByParentId") public ModelAndView findCompanyByParentId(Integer parentId,Integer level, HttpServletRequest request) { @@ -1598,7 +1472,7 @@ public class PageController { if (parentId != null) { mv.addObject("parentId", parentId); mv.addObject("level", level+1); - List administrationPList = findCompanyBySuperior(parentId.toString(), userToken); + List administrationPList = LinkInterfaceUtil.findCompanyBySuperior(parentId.toString(), userToken); if (administrationPList.size() > 0) { mv.addObject("administrationPList", administrationPList); mv.setViewName("pages/company/company-out"); @@ -1655,7 +1529,7 @@ public class PageController { ModelAndView mv = new ModelAndView(); mv.setViewName("pages/post/post-view"); if (id != null) { - Post object = findPostById(id, userToken); + Post object = LinkInterfaceUtil.findPostById(id, userToken); mv.addObject("record", object); } else { throw new MyException("缺少必要参数!"); @@ -1663,25 +1537,6 @@ public class PageController { return mv; } - public static Post findPostById(Integer id, UserByPort userByPort) { - String url = PortConfig.external_url + "/org/getpositioncont"; - Map map = new HashMap<>(); - map.put("id", id); - map.put("idstr", id.toString()); - String jsonString = JSONObject.toJSONString(map); - JSONObject paramObject = JSONObject.parseObject(jsonString); - String post = null; - try { - post = HttpUtils.send(url, paramObject, HTTP.UTF_8, userByPort); - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.parseObject(post); - JSONObject data = (JSONObject) jsonObject.get("data"); - Post object = JSONObject.toJavaObject(data, Post.class); - return object; - } - @GetMapping("/findPostByParentId") public ModelAndView findPostByParentId(Integer parentId, HttpServletRequest request) { @@ -1731,7 +1586,7 @@ public class PageController { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); ModelAndView mv = new ModelAndView(); mv.setViewName("pages/post/postRole_add"); - Post postById = findPostById(id, userToken); + Post postById = LinkInterfaceUtil.findPostById(id, userToken); mv.addObject("post", postById); mv.addObject("roles", roleService.findAllRole()); mv.addObject("depositories", depositoryService.findDepositoryAll()); @@ -1948,7 +1803,7 @@ public class PageController { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); ModelAndView mv = new ModelAndView(); // 获取仓储中心详情 - Administration company = PageController.getCompany(361, userToken); + Administration company = LinkInterfaceUtil.getCompany(361, userToken); // 获取仓储中心负责人 List departmentHeadByUser = PortConfig.findDepartmentHeadByUser(company, userToken); StringBuilder departmentHeadName = new StringBuilder(); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java b/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java index 7250c0be..d3007278 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java @@ -19,6 +19,7 @@ import com.dreamchaser.depository_manage.service.CallBackLogService; import com.dreamchaser.depository_manage.service.DepositoryRecordService; import com.dreamchaser.depository_manage.service.StockTakingService; import com.dreamchaser.depository_manage.service.impl.QyWxOperationService; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import com.dreamchaser.depository_manage.utils.Md5; import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; import com.dreamchaser.depository_manage.utils.QyWxXMLUtils; @@ -302,7 +303,7 @@ public class QyWxOperationController { e.printStackTrace(); } } else { - JSONObject captcha = PageController.Captcha(request); + JSONObject captcha = LinkInterfaceUtil.Captcha(request); String picPath = (String) captcha.get("picPath"); String captchaid = (String) captcha.get("captchaid"); mv.addObject("picPath", picPath); @@ -310,14 +311,14 @@ public class QyWxOperationController { mv.addObject("userWxId", userId); } } else { - JSONObject captcha = PageController.Captcha(request); + JSONObject captcha = LinkInterfaceUtil.Captcha(request); String picPath = (String) captcha.get("picPath"); String captchaid = (String) captcha.get("captchaid"); mv.addObject("picPath", picPath); mv.addObject("captchaid", captchaid); } } else { - JSONObject captcha = PageController.Captcha(request); + JSONObject captcha = LinkInterfaceUtil.Captcha(request); String picPath = (String) captcha.get("picPath"); String captchaid = (String) captcha.get("captchaid"); mv.addObject("picPath", picPath); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/UserController.java b/src/main/java/com/dreamchaser/depository_manage/controller/UserController.java index 06410fd4..3532a7dc 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/UserController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/UserController.java @@ -1,6 +1,5 @@ package com.dreamchaser.depository_manage.controller; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.dreamchaser.depository_manage.config.PortConfig; @@ -22,19 +21,9 @@ import com.dreamchaser.depository_manage.security.pool.VerificationCodePool; import com.dreamchaser.depository_manage.service.DepositoryService; import com.dreamchaser.depository_manage.service.RoleService; import com.dreamchaser.depository_manage.service.UserService; -import com.dreamchaser.depository_manage.utils.CrudUtil; -import com.dreamchaser.depository_manage.utils.HttpUtils; -import com.dreamchaser.depository_manage.utils.Md5; -import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; -import com.fasterxml.jackson.core.sym.NameN; +import com.dreamchaser.depository_manage.utils.*; import org.apache.http.protocol.HTTP; -import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.repository.query.ReactiveQueryByExampleExecutor; -import org.springframework.mail.SimpleMailMessage; -import org.springframework.mail.javamail.JavaMailSender; -import org.springframework.mobile.device.Device; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; @@ -488,7 +477,7 @@ public class UserController { */ @GetMapping("/getCaptchaid") public JSONObject getCaptchaid(HttpServletRequest httpServletRequest){ - JSONObject captcha = PageController.Captcha(httpServletRequest); + JSONObject captcha = LinkInterfaceUtil.Captcha(httpServletRequest); return captcha; } @@ -501,7 +490,7 @@ public class UserController { List userByPortPList = new ArrayList<>(); List roleAndDepositoryByCondition = roleService.findRoleAndDepositoryByCondition(param); for (int i = 0; i < roleAndDepositoryByCondition.size(); i++) { - UserByPort userByPort = PageController.FindUserById(roleAndDepositoryByCondition.get(i).getUserId(),userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(roleAndDepositoryByCondition.get(i).getUserId(),userToken); UserByPortP up = new UserByPortP(userByPort); up.setId(roleAndDepositoryByCondition.get(i).getId()); up.setDepositoryName(roleAndDepositoryByCondition.get(i).getDepositoryName()); diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java index 718f7a6f..afb90d1d 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java @@ -2,7 +2,6 @@ package com.dreamchaser.depository_manage.service.impl; import com.alibaba.fastjson.JSONObject; import com.dreamchaser.depository_manage.config.PortConfig; -import com.dreamchaser.depository_manage.controller.PageController; import com.dreamchaser.depository_manage.entity.*; import com.dreamchaser.depository_manage.exception.MyException; import com.dreamchaser.depository_manage.mapper.*; @@ -205,7 +204,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { dname = depositoryRecordById.getDname(); } - Administration company = PageController.getCompany(userToken.getMaindeparment(), userToken); + Administration company = LinkInterfaceUtil.getCompany(userToken.getMaindeparment(), userToken); String code = createCode(dname, "outOrderNumber", "out", company.getName()); map.put("code", code); map.put("pass", 3); @@ -615,9 +614,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 获取主订单单号 StringBuilder code = new StringBuilder(record.getCode()); // 获取申请用户信息 - UserByPort applicantUser = PageController.FindUserById(record.getApplicantId(), userByPort); + UserByPort applicantUser = LinkInterfaceUtil.FindUserById(record.getApplicantId(), userByPort); // 获取申请用户行政组织 - Administration company = PageController.getCompany(applicantUser.getMaindeparment(), userByPort); + Administration company = LinkInterfaceUtil.getCompany(applicantUser.getMaindeparment(), userByPort); // 获取部门名称简写 String conpanyName = WordUtil.getPinYinHeadChar(company.getName()); // 获取仓库名称简写 @@ -667,7 +666,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { StringBuilder depositoryManagerByQyWx = new StringBuilder(); for (int i = 0; i < depositoryManagers.length; i++) { Integer uid = ObjectFormatUtil.toInteger(depositoryManagers[i]); - UserByPort depositoryManager = PageController.FindUserById(uid, userByPort); + UserByPort depositoryManager = LinkInterfaceUtil.FindUserById(uid, userByPort); // depositoryManagerByQyWx.append(depositoryManager.getWorkwechat()+","); } depositoryManagerByQyWx.append("PangFuZhen,"); @@ -817,7 +816,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { StringBuilder QyWxUid = new StringBuilder(); for (int j = 0; j < userIdByDid.size(); j++) { // 获取仓库管理员信息 - UserByPort manager = PageController.FindUserById(userIdByDid.get(j), null); + UserByPort manager = LinkInterfaceUtil.FindUserById(userIdByDid.get(j), null); // 仓库管理员订单信息 Map userRecord = new HashMap<>(); // 用户当前子订单 @@ -854,7 +853,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { List userIdByDid = roleService.findUserIdByDid(depositoryIdList.get(i)); StringBuilder QyWxUid = new StringBuilder(); for (int j = 0; j < userIdByDid.size(); j++) { - UserByPort manager = PageController.FindUserById(userIdByDid.get(j), userByPort); + UserByPort manager = LinkInterfaceUtil.FindUserById(userIdByDid.get(j), userByPort); // QyWxUid.append(manager.getWorkwechat()+","); } QyWxUid.append("PangFuZhen,"); @@ -905,7 +904,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { map.put("departmentheadPass", 1); map.put("state", "待仓储中心负责人审核"); // 获取仓储中心详情 - Administration company = PageController.getCompany(361, null); + Administration company = LinkInterfaceUtil.getCompany(361, null); // 获取仓储中心负责人 List departmentHeadByUser = PortConfig.findDepartmentHeadByUser(company, null); StringBuilder depositoryManager = new StringBuilder(); @@ -973,7 +972,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { map.put("transferId", transferId); // 获取当前转移物料仓库 Depository depositoryRecordById = depositoryMapper.findDepositoryById(material.getDepositoryId()); - Administration company = PageController.getCompany(userByPort.getMaindeparment(), userByPort); + Administration company = LinkInterfaceUtil.getCompany(userByPort.getMaindeparment(), userByPort); // 生成出库订单 map.put("code", createCode(depositoryRecordById.getDname(), "outOrderNumber", "out", company.getName())); Object placeId = map.get("fromPlaceId"); @@ -1018,7 +1017,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 获取仓储中心详情 - Administration company = PageController.getCompany(361, userToken); + Administration company = LinkInterfaceUtil.getCompany(361, userToken); // 获取仓储中心负责人 List departmentHeadByUser = PortConfig.findDepartmentHeadByUser(company, userToken); StringBuilder depositoryManager = new StringBuilder(); @@ -1060,7 +1059,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { public void run() { // 获取responseCode(key为申请人number) //获取申请人信息 - UserByPort applicantUser = PageController.FindUserById(record.getApplicantId(), userToken); + UserByPort applicantUser = LinkInterfaceUtil.FindUserById(record.getApplicantId(), userToken); String key = "user:" + applicantUser.getNumber() + ":QyWxOutId:" + id; String responseCode = (String) redisTemplate.opsForHash().get(key, "responseCode"); qyWxOperationService.updateTemplateCard(responseCode, userToken.getName(), finalResult, userAgent); @@ -1079,7 +1078,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { if ("".equals(s)) { continue; } - UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(s), null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), null); QyWxUid.append(userByPort.getWorkwechat()).append(","); } String s = QyWxUid.toString(); @@ -1152,7 +1151,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { for (int j = 0; j < userIdByDid.size(); j++) { // 获取当前用户信息 - UserByPort userByPort = PageController.FindUserById(userIdByDid.get(j), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(userIdByDid.get(j), userToken); // 仓库管理员订单信息 Map userRecord = new HashMap<>(); // 用户当前子订单 @@ -1191,7 +1190,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { List userIdByDid = roleService.findUserIdByDid(depositoryIdList.get(i)); StringBuilder QyWxUid = new StringBuilder(); for (int j = 0; j < userIdByDid.size(); j++) { - UserByPort manager = PageController.FindUserById(userIdByDid.get(j), userToken); + UserByPort manager = LinkInterfaceUtil.FindUserById(userIdByDid.get(j), userToken); // QyWxUid.append(manager.getWorkwechat()+","); } QyWxUid.append("PangFuZhen,"); @@ -1225,7 +1224,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { if ("".equals(s)) { continue; } - UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(s), null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), null); QyWxUid.append(userByPort.getWorkwechat()).append(","); } String s = QyWxUid.toString(); @@ -1249,7 +1248,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { public void run() { // 获取responseCode(key为申请人number) //获取部门负责人信息 - UserByPort departHead = PageController.FindUserById(ObjectFormatUtil.toInteger(record.getDepartmenthead()), userToken); + UserByPort departHead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(record.getDepartmenthead()), userToken); String key = "user:" + departHead.getNumber() + ":QyWxOutId:" + id; String responseCode = (String) redisTemplate.opsForHash().get(key, "responseCode"); qyWxOperationService.updateTemplateCard(responseCode, userToken.getName(), finalResult, userAgent); @@ -1302,7 +1301,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { map.put("departmentheadPass", 1); map.put("state", "待仓储中心负责人审核"); // 获取仓储中心详情 - Administration company = PageController.getCompany(361, null); + Administration company = LinkInterfaceUtil.getCompany(361, null); // 获取仓储中心负责人 List departmentHeadByUser = PortConfig.findDepartmentHeadByUser(company, null); StringBuilder depositoryManager = new StringBuilder(); @@ -1386,7 +1385,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { StringBuilder QyWxUid = new StringBuilder(); for (int j = 0; j < userIdByDid.size(); j++) { // 获取仓库管理员信息 - UserByPort manager = PageController.FindUserById(userIdByDid.get(j), userByPort); + UserByPort manager = LinkInterfaceUtil.FindUserById(userIdByDid.get(j), userByPort); // 仓库管理员订单信息 Map userRecord = new HashMap<>(); // 用户当前子订单 @@ -1423,7 +1422,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { List userIdByDid = roleService.findUserIdByDid(depositoryIdList.get(i)); StringBuilder QyWxUid = new StringBuilder(); for (int j = 0; j < userIdByDid.size(); j++) { - UserByPort manager = PageController.FindUserById(userIdByDid.get(j), userByPort); + UserByPort manager = LinkInterfaceUtil.FindUserById(userIdByDid.get(j), userByPort); // QyWxUid.append(manager.getWorkwechat()+","); } QyWxUid.append("PangFuZhen,"); diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryServiceImpl.java index 1ccf4fee..9f5df488 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryServiceImpl.java @@ -1,6 +1,5 @@ package com.dreamchaser.depository_manage.service.impl; -import com.dreamchaser.depository_manage.controller.PageController; import com.dreamchaser.depository_manage.entity.*; import com.dreamchaser.depository_manage.mapper.DepositoryMapper; import com.dreamchaser.depository_manage.mapper.PlaceMapper; @@ -9,6 +8,7 @@ import com.dreamchaser.depository_manage.mapper.RoleMapper; import com.dreamchaser.depository_manage.pojo.InventoryByDname; import com.dreamchaser.depository_manage.pojo.RoleAndDepository; import com.dreamchaser.depository_manage.service.DepositoryService; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; import com.dreamchaser.depository_manage.utils.WordUtil; import org.springframework.beans.factory.annotation.Autowired; @@ -55,12 +55,12 @@ public class DepositoryServiceImpl implements DepositoryService { List condition = depositoryMapper.findDepositoryRecordPByCondition(temp); // 公司编号 Integer cid = ObjectFormatUtil.toInteger(map.get("cid")); - String companyName = PageController.getCompany(cid, userByPort).getName(); + String companyName = LinkInterfaceUtil.getCompany(cid, userByPort).getName(); String adminorgName = ""; // 部门编号 if (!"".equals(map.get("adminorg"))) { Integer adminorg = ObjectFormatUtil.toInteger(map.get("adminorg")); - adminorgName = PageController.getCompany(adminorg, userByPort).getName(); + adminorgName = LinkInterfaceUtil.getCompany(adminorg, userByPort).getName(); } // 公司简称 companyName = WordUtil.getPinYinHeadChar(companyName); @@ -92,7 +92,7 @@ public class DepositoryServiceImpl implements DepositoryService { // 部门编号 if (!"".equals(map.get("adminorg"))) { Integer adminorg = ObjectFormatUtil.toInteger(map.get("adminorg")); - adminorgName = PageController.getCompany(adminorg, userByPort).getName(); + adminorgName = LinkInterfaceUtil.getCompany(adminorg, userByPort).getName(); adminorgName = WordUtil.getPinYinHeadChar(adminorgName).substring(0, 2); } // 获取父仓库编码 @@ -134,7 +134,7 @@ public class DepositoryServiceImpl implements DepositoryService { for (int i = 0; i < list.size(); i++) { Depository depository = list.get(i); if (!depository.getAdminorg().isEmpty()) { - Administration company = PageController.getCompany(ObjectFormatUtil.toInteger(depository.getAdminorg()), userByPort); + Administration company = LinkInterfaceUtil.getCompany(ObjectFormatUtil.toInteger(depository.getAdminorg()), userByPort); depository.setAdminorgName(company.getName()); } } 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 abf957de..823031b2 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 @@ -7,14 +7,13 @@ import com.dreamchaser.depository_manage.config.PortConfig; import com.dreamchaser.depository_manage.config.QyWxConfig; import com.dreamchaser.depository_manage.config.QyWx_approval_template.*; import com.dreamchaser.depository_manage.config.QyWx_template_card.*; -import com.dreamchaser.depository_manage.controller.PageController; import com.dreamchaser.depository_manage.entity.*; import com.dreamchaser.depository_manage.mapper.*; import com.dreamchaser.depository_manage.pojo.ApplicationOutRecordP; import com.dreamchaser.depository_manage.pojo.StockTakingChildP; -import com.dreamchaser.depository_manage.service.MaterialTypeService; import com.dreamchaser.depository_manage.utils.DateUtil; import com.dreamchaser.depository_manage.utils.HttpUtils; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; @@ -66,7 +65,7 @@ public class QyWxOperationService { // 申请人id Integer applicantId = applicationOutRecordPById.getApplicantId(); // 申请人 - UserByPort applicant = PageController.FindUserById(applicantId, null); + UserByPort applicant = LinkInterfaceUtil.FindUserById(applicantId, null); // 获取所有子订单 List applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(outId); @@ -260,7 +259,7 @@ public class QyWxOperationService { // 申请人id Integer getOriginator = mainRecord.getOriginator(); // 申请人 - UserByPort originator = PageController.FindUserById(getOriginator, null); + UserByPort originator = LinkInterfaceUtil.FindUserById(getOriginator, null); // 盘点物料名称 StringBuilder mname = new StringBuilder(); @@ -510,7 +509,7 @@ public class QyWxOperationService { // 申请人id Integer getOriginator = mainRecord.getOriginator(); // 申请人 - UserByPort originator = PageController.FindUserById(getOriginator, null); + UserByPort originator = LinkInterfaceUtil.FindUserById(getOriginator, null); // 盘点物料名称 StringBuilder mname = new StringBuilder(); @@ -745,7 +744,7 @@ public class QyWxOperationService { // 申请人id Integer applicantId = recordP.getApplicantId(); // 申请人 - UserByPort applicant = PageController.FindUserById(applicantId, null); + UserByPort applicant = LinkInterfaceUtil.FindUserById(applicantId, null); // 获取所有子订单 List applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(outId); @@ -778,7 +777,7 @@ public class QyWxOperationService { // 获取仓库信息 Depository depositoryRecordById = depositoryMapper.findDepositoryById(recordMin.getDepositoryId()); // 获取处理人信息 - UserByPort userByPort = PageController.FindUserById(recordMin.getCheckId(), null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(recordMin.getCheckId(), null); content.append(">- 物料名称:").append(materialById.getMname()).append("%n"); content.append(">- 申请数量:").append(recordMin.getQuantity()).append("%n"); content.append(">- 所处仓库:").append(depositoryRecordById.getDname()).append("%n"); @@ -842,7 +841,7 @@ public class QyWxOperationService { // 抄送内容 StringBuilder content = new StringBuilder("## `抄送信息:`%n"); // 获取发起人信息 - UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), userToken); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), userToken); // 设置content content.append(">### **" + originator.getName() + "的物料调账记录** %n时间:" + DateUtil.TimeStampToDateTime(mainRecord.getCreateTime()) + " %n"); @@ -946,7 +945,7 @@ public class QyWxOperationService { // 抄送内容 StringBuilder content = new StringBuilder("## `盘点发生错误:`%n"); // 获取发起人信息 - UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), userToken); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), userToken); // 设置content content.append(">### **" + originator.getName() + "的物料盘点记录** %n时间:" + DateUtil.TimeStampToDateTime(mainRecord.getCreateTime()) + " %n"); @@ -1044,7 +1043,7 @@ public class QyWxOperationService { // 抄送内容 StringBuilder content = new StringBuilder("## `抄送信息:`%n"); // 获取发起人信息 - UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), userToken); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), userToken); // 设置content content.append(">### **" + originator.getName() + "的物料转移记录** %n时间:" + DateUtil.TimeStampToDateTime(mainRecord.getCreateTime()) + " %n"); @@ -1162,7 +1161,7 @@ public class QyWxOperationService { // 申请人id Integer applicantId = outRecordP.getApplicantId(); // 申请人 - UserByPort applicant = PageController.FindUserById(applicantId, null); + UserByPort applicant = LinkInterfaceUtil.FindUserById(applicantId, null); // 定义文本通知型卡片 TextNotice textNotice = new TextNotice(); @@ -1658,7 +1657,7 @@ public class QyWxOperationService { // 获取申请人的userId - UserByPort userByPort = PageController.FindUserById(mainRecord.getApplicantId(), null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(mainRecord.getApplicantId(), null); String workwechat = userByPort.getWorkwechat(); if(workwechat == null || "".equals(workwechat)){ workwechat = userByPort.getWechat(); @@ -2083,7 +2082,7 @@ public class QyWxOperationService { continue; } // 获取负责人信息 - UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(departmentManagers[i]), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(departmentManagers[i]), userToken); Map contact_principal = new HashMap<>(); contact_principal.put("userid",userByPort.getWorkwechat()); contact_principal.put("name",userByPort.getName()); @@ -2433,7 +2432,7 @@ public class QyWxOperationService { applicantTime = stockTaking.getCreateTime(); tempMessageTitle = "库存盘点审批"; } - UserByPort userByPort = PageController.FindUserById(applicantId, null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicantId, null); // 设置content content.append(">### **%n对于"+userByPort.getName()+"在"+DateUtil.TimeStampToDateTime(applicantTime)+"提起"+tempMessageTitle+"的转至应用发送的消息进行审批,审批应用中的流程请忽略 %n**"); content.append("%n---%n"); 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 7907d63d..0055f09d 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 @@ -2,7 +2,6 @@ package com.dreamchaser.depository_manage.service.impl; import com.alibaba.fastjson.JSONObject; import com.dreamchaser.depository_manage.config.PortConfig; -import com.dreamchaser.depository_manage.controller.PageController; import com.dreamchaser.depository_manage.entity.*; import com.dreamchaser.depository_manage.exception.MyException; import com.dreamchaser.depository_manage.mapper.DepositoryMapper; @@ -17,6 +16,7 @@ import com.dreamchaser.depository_manage.pojo.callBackXml.callBackXml_button_tem import com.dreamchaser.depository_manage.service.DepositoryRecordService; import com.dreamchaser.depository_manage.service.StockTakingService; import com.dreamchaser.depository_manage.utils.DateUtil; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; import com.dreamchaser.depository_manage.utils.WordUtil; import org.redisson.api.RLock; @@ -159,7 +159,7 @@ public class StockTakingServiceImpl implements StockTakingService { SimpleStockTakingP ssp = new SimpleStockTakingP(stockTaking); Depository depositoryRecordById = depositoryMapper.findDepositoryById(stockTaking.getDepositoryId()); ssp.setDepositoryName(depositoryRecordById.getDname()); - UserByPort userByPort = PageController.FindUserById(stockTaking.getOriginator(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(stockTaking.getOriginator(), userToken); ssp.setOriginatorName(userByPort.getName()); stockTakingPS.add(ssp); } @@ -203,7 +203,7 @@ public class StockTakingServiceImpl implements StockTakingService { SimpleStockTakingP ssp = new SimpleStockTakingP(stockTaking); Depository depositoryRecordById = depositoryMapper.findDepositoryById(stockTaking.getDepositoryId()); ssp.setDepositoryName(depositoryRecordById.getDname()); - UserByPort userByPort = PageController.FindUserById(stockTaking.getOriginator(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(stockTaking.getOriginator(), userToken); ssp.setOriginatorName(userByPort.getName()); stockTakingPS.add(ssp); } @@ -318,7 +318,7 @@ public class StockTakingServiceImpl implements StockTakingService { if ("".equals(s)) { continue; } - UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(s), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), userToken); QyWxUid.append(userByPort.getWorkwechat()).append(","); } // 如果同意 @@ -461,7 +461,7 @@ public class StockTakingServiceImpl implements StockTakingService { @Override public void run() { // 获取盘点人员 - UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), userToken); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), userToken); String workwechat = originator.getWorkwechat(); JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", mainId, normalMinId, userAgent); // JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage(workwechat, mainId,normalMinId); @@ -500,7 +500,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 获取responseCode(key为申请人number) //获取申请人信息 Integer originator = mainRecord.getOriginator(); - UserByPort userByPort = PageController.FindUserById(originator, userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(originator, userToken); String key = "user:" + userByPort.getNumber() + ":QyWxStockTakingId:" + mainId; String responseCode = (String) redisTemplate.opsForHash().get(key, "responseCode"); qyWxOperationService.updateTemplateCard(responseCode, userToken.getName(), finalStockTakingResult, userAgent); @@ -519,7 +519,7 @@ public class StockTakingServiceImpl implements StockTakingService { if("".equals(s)){ continue; } - UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(s), null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), null); QyWxUid.append(userByPort.getWorkwechat()).append(","); } String s = QyWxUid.toString(); @@ -568,7 +568,7 @@ public class StockTakingServiceImpl implements StockTakingService { if ("".equals(s)) { continue; } - UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(s), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), userToken); QyWxUid.append(userByPort.getWorkwechat()).append(","); } @@ -800,7 +800,7 @@ public class StockTakingServiceImpl implements StockTakingService { public void run() { // 获取responseCode(key为申请人number) Integer originator = mainRecord.getOriginator(); - UserByPort userByPort = PageController.FindUserById(originator, userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(originator, userToken); //获取申请人信息 String key = "user:" + userByPort.getNumber() + ":QyWxStockTakingCompleteId:" + mainId; String responseCode = (String) redisTemplate.opsForHash().get(key, "responseCode"); @@ -1106,7 +1106,7 @@ public class StockTakingServiceImpl implements StockTakingService { if ("".equals(s)) { continue; } - UserByPort userByPort1 = PageController.FindUserById(ObjectFormatUtil.toInteger(s), null); + UserByPort userByPort1 = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), null); QyWxUid.append(userByPort1.getWorkwechat()).append(","); } String s = QyWxUid.toString(); @@ -1168,7 +1168,7 @@ public class StockTakingServiceImpl implements StockTakingService { if ("".equals(s)) { continue; } - UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(s), null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(s), null); QyWxUid.append(userByPort.getWorkwechat()).append(","); } if ("2".equals(spStatus)) { @@ -1311,7 +1311,7 @@ public class StockTakingServiceImpl implements StockTakingService { @Override public void run() { // 获取盘点人员 - UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), null); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), null); String workwechat = originator.getWorkwechat(); JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", ObjectFormatUtil.toInteger(mainId), normalMinId, userAgent); // JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage(workwechat, mainId,normalMinId); @@ -1548,7 +1548,7 @@ public class StockTakingServiceImpl implements StockTakingService { Integer originator = finalMainRecord.getOriginator(); map.put("minIds", minRecorIds); StringBuilder departMentHeadQyWxName = new StringBuilder(); - UserByPort userByPort = PageController.FindUserById(ObjectFormatUtil.toInteger(originator), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(originator), userToken); // departMentHeadQyWxName.append(userByPort.getWorkwechat()+","); departMentHeadQyWxName.append("PangFuZhen,"); JSONObject jsonObject = qyWxOperationService.sendCcStockTakingTransferMessageToHead(departMentHeadQyWxName.toString(), map, userToken, finalMainRecord, userAgent); @@ -1752,7 +1752,7 @@ public class StockTakingServiceImpl implements StockTakingService { @Override public void run() { // 获取盘点人员 - UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), null); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), null); // String workwechat = originator.getWorkwechat(); JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", mainId, normalMinIds, userAgent); // JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage(workwechat, mainId, normalMinIds); @@ -1776,7 +1776,7 @@ public class StockTakingServiceImpl implements StockTakingService { @Override public void run() { // 获取盘点人员 - UserByPort originator = PageController.FindUserById(mainRecord.getOriginator(), null); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), null); // String workwechat = originator.getWorkwechat(); qyWxOperationService.sendStockTakingErrMessageToHead("PangFuZhen,", errIds, mainRecord, null, userAgent); // qyWxOperationService.sendStockTakingErrMessageToHead(workwechat, errIds, mainRecord,null); diff --git a/src/main/java/com/dreamchaser/depository_manage/utils/LinkInterfaceUtil.java b/src/main/java/com/dreamchaser/depository_manage/utils/LinkInterfaceUtil.java new file mode 100644 index 00000000..f1fa77da --- /dev/null +++ b/src/main/java/com/dreamchaser/depository_manage/utils/LinkInterfaceUtil.java @@ -0,0 +1,182 @@ +package com.dreamchaser.depository_manage.utils; + +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.Post; +import com.dreamchaser.depository_manage.entity.UserByPort; +import com.dreamchaser.depository_manage.pojo.AdministrationP; +import org.apache.http.protocol.HTTP; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 用于对接HR系统的工具类 + */ +public class LinkInterfaceUtil { + + /** + * 根据条件查询用户 + * @param map 条件 + * @param userToken 当前登录用户 + * @return 查询结果 + */ + public static List FindUserByMap(Map map, UserByPort userToken) { + String url = PortConfig.external_url + "/staff/archiveslist"; + 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"); + List result = new ArrayList<>(); + if (list == null) { + list = new JSONArray(); + } + for (int i = 0; i < list.size(); i++) { + UserByPort userByPort = JSONObject.toJavaObject((JSONObject) list.get(i), UserByPort.class); + result.add(userByPort); + } + return result; + } + + /** + * 根据用户id查询对应用户 + * @param id 待查讯用户id + * @param userToken 登录用户 + * @return 查询结果 + */ + public static UserByPort FindUserById(Integer id, UserByPort userToken) { + String url = PortConfig.external_url + "/staff/archivescont"; + Map map = new HashMap<>(); + map.put("id", id); + 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"); + UserByPort userByPort = JSONObject.toJavaObject(data, UserByPort.class); + return userByPort; + } + + /** + * 根据id查询对应的行政组织 + * @param id 待查讯组织id + * @param userByPort 登录用户 + * @return 查询结果 + */ + public static Administration getCompany(Integer id, UserByPort userByPort) { + String url = PortConfig.external_url + "/org/getgovcont"; + Map map = new HashMap<>(); + map.put("id", id); + map.put("idstr", id.toString()); + String jsonString = JSONObject.toJSONString(map); + JSONObject paramObject = JSONObject.parseObject(jsonString); + String post = null; + try { + post = HttpUtils.send(url, paramObject, HTTP.UTF_8, userByPort); + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.parseObject(post); + JSONObject data = (JSONObject) jsonObject.get("data"); + Administration administration = JSONObject.toJavaObject(data, Administration.class); + return administration; + } + + /** + * 根据上级查询对应的行政组织 + * @param superior 上级编号 + * @param userByPort 登录用户 + * @return 查询结果 + */ + public static List findCompanyBySuperior(String superior, UserByPort userByPort) { + String url = PortConfig.external_url + "/org/govlist"; + Map map = new HashMap<>(); + map.put("superior", superior); + String jsonString = JSONObject.toJSONString(map); + JSONObject paramObject = JSONObject.parseObject(jsonString); + String post = null; + try { + post = HttpUtils.send(url, paramObject, HTTP.UTF_8, userByPort); + } 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(); + } + Integer total = ObjectFormatUtil.toInteger(data.get("total")); + 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; + } + + /** + * 根据岗位id查询对应的岗位信息 + * @param id 岗位id + * @param userByPort 登录用户 + * @return 查询结果 + */ + public static Post findPostById(Integer id, UserByPort userByPort) { + String url = PortConfig.external_url + "/org/getpositioncont"; + Map map = new HashMap<>(); + map.put("id", id); + map.put("idstr", id.toString()); + String jsonString = JSONObject.toJSONString(map); + JSONObject paramObject = JSONObject.parseObject(jsonString); + String post = null; + try { + post = HttpUtils.send(url, paramObject, HTTP.UTF_8, userByPort); + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.parseObject(post); + JSONObject data = (JSONObject) jsonObject.get("data"); + Post object = JSONObject.toJavaObject(data, Post.class); + return object; + } + + /** + * 获取对应的验证码信息 + * @param request 请求体 + * @return 结果 + */ + public static JSONObject Captcha(HttpServletRequest request) { + UserByPort userByPort = (UserByPort) request.getAttribute("userToken"); + String url = PortConfig.external_url_6666 + "/base/captcha"; + JSONObject param = new JSONObject(); + String post = null; + try { + post = HttpUtils.send(url, param, HTTP.UTF_8, userByPort); + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.parseObject(post); + JSONObject data = (JSONObject) jsonObject.get("data"); + return data; + } +} diff --git a/src/main/resources/templates/pages/chart/chart-in.html b/src/main/resources/templates/pages/chart/chart-in.html index 79bdef55..16e30471 100644 --- a/src/main/resources/templates/pages/chart/chart-in.html +++ b/src/main/resources/templates/pages/chart/chart-in.html @@ -1,5 +1,5 @@ - + 首页三 @@ -15,18 +15,23 @@ border-radius: 5px; text-align: center; } - .top-panel > .layui-card-body{ + + .top-panel > .layui-card-body { height: 60px; } - .top-panel-number{ - line-height:60px; + + .top-panel-number { + line-height: 60px; font-size: 30px; - border-right:1px solid #eceff9; + border-right: 1px solid #eceff9; } - .top-panel-tips{ - line-height:30px; + + .top-panel-tips { + line-height: 30px; font-size: 12px } + + @@ -44,8 +49,8 @@
- 比昨天 ▲0.12
- 比七日 ▼0.06 + +
@@ -62,8 +67,8 @@
- 比昨天 ▲0.12
- 比七日 ▼0.06 + +
@@ -80,8 +85,8 @@
- 比昨天 ▲0.12
- 比七日 ▼0.06 + +
@@ -98,8 +103,8 @@
- 比昨天 ▲0.12
- 比七日 ▼0.06 + +
@@ -109,25 +114,45 @@ -
-
-
+
+ +
+

折线图

+
+ + +
+
+
-
-
+ +
+

饼图

+
+
+
-
-
-
-
+
+

柱状图

+
+
+
-
-
+ +
+

折线比例图

+
+
+
-
+
@@ -135,19 +160,20 @@ diff --git a/src/main/resources/templates/pages/chart/chart-in_back.html b/src/main/resources/templates/pages/chart/chart-in_back.html index 0079bf98..7961e7fb 100644 --- a/src/main/resources/templates/pages/chart/chart-in_back.html +++ b/src/main/resources/templates/pages/chart/chart-in_back.html @@ -30,6 +30,8 @@ line-height: 30px; font-size: 12px } + + @@ -112,32 +114,45 @@
-
-
- - -
+
+ +
+

折线图

+
+ + +
+
-
-
+ +
+

饼图

+
+
+
-
-
-
-
+
+

柱状图

+
+
+
-
-
+ +
+

折线比例图

+
+
+
-
+
@@ -145,10 +160,11 @@ diff --git a/src/main/resources/templates/pages/chart/chart-out_back.html b/src/main/resources/templates/pages/chart/chart-out_back.html index 5a6d7415..dfdf943c 100644 --- a/src/main/resources/templates/pages/chart/chart-out_back.html +++ b/src/main/resources/templates/pages/chart/chart-out_back.html @@ -112,29 +112,44 @@
-
-
- - -
+
+ +
+

折线图

+
+ + +
+
+
-
-
+ +
+

饼图

+
+
+
-
-
-
-
+
+

柱状图

+
+
+
-
-
+ +
+

折线比例图

+
+
+
+
diff --git a/src/main/resources/templates/pages/chart/chart-stock_back.html b/src/main/resources/templates/pages/chart/chart-stock_back.html index b8c8d3c8..886dbc45 100644 --- a/src/main/resources/templates/pages/chart/chart-stock_back.html +++ b/src/main/resources/templates/pages/chart/chart-stock_back.html @@ -36,29 +36,44 @@
-
-
- - -
+
+ +
+

折线图

+
+ + +
+
+
-
-
+ +
+

饼图

+
+
+
-
-
-
-
+
+

柱状图

+
+
+
-
-
+ +
+

折线比例图

+
+
+
+
diff --git a/src/main/resources/templates/pages/other/welcome.html b/src/main/resources/templates/pages/other/welcome.html index 3b21b82d..1bf7135e 100644 --- a/src/main/resources/templates/pages/other/welcome.html +++ b/src/main/resources/templates/pages/other/welcome.html @@ -55,7 +55,7 @@

4

- 当前分类总记录数 + 当前仓库总记录数
@@ -69,7 +69,7 @@

12032

- 当前分类总记录数 + 当前库存总数
@@ -83,7 +83,7 @@

- 当前分类总记录数 + 当前物料总记录数
@@ -97,7 +97,7 @@

- 当前分类总记录数 + 当前流水总记录数
diff --git a/src/test/java/com/dreamchaser/depository_manage/TestForThisWeekInventory.java b/src/test/java/com/dreamchaser/depository_manage/TestForThisWeekInventory.java index 44b7cf25..d7938e22 100644 --- a/src/test/java/com/dreamchaser/depository_manage/TestForThisWeekInventory.java +++ b/src/test/java/com/dreamchaser/depository_manage/TestForThisWeekInventory.java @@ -1,21 +1,17 @@ package com.dreamchaser.depository_manage; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.dreamchaser.depository_manage.controller.PageController; -import com.dreamchaser.depository_manage.entity.Depository; -import com.dreamchaser.depository_manage.entity.MaterialType; import com.dreamchaser.depository_manage.entity.UserByPort; import com.dreamchaser.depository_manage.mapper.DepositoryMapper; import com.dreamchaser.depository_manage.mapper.DepositoryRecordMapper; import com.dreamchaser.depository_manage.mapper.MaterialTypeMapper; import com.dreamchaser.depository_manage.mapper.RoleMapper; import com.dreamchaser.depository_manage.pojo.InventoryByDname; -import com.dreamchaser.depository_manage.pojo.RoleAndDepository; import com.dreamchaser.depository_manage.service.DepositoryRecordService; import com.dreamchaser.depository_manage.service.DepositoryService; import com.dreamchaser.depository_manage.service.MaterialTypeService; import com.dreamchaser.depository_manage.utils.DateUtil; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +20,6 @@ import org.springframework.test.context.junit4.SpringRunner; import java.text.SimpleDateFormat; import java.util.*; -import java.util.concurrent.*; @SpringBootTest @RunWith(SpringRunner.class) @@ -55,7 +50,7 @@ public class TestForThisWeekInventory { public void test(){ - UserByPort userByPort = PageController.FindUserById(78, null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(78, null); Map beforeInventoryOnMap = getThisWeekInventoryByDName(depositoryService, depositoryRecordService, userByPort); System.out.println(JSONObject.toJSONString(beforeInventoryOnMap)); diff --git a/src/test/java/com/dreamchaser/depository_manage/TestForgetMapData.java b/src/test/java/com/dreamchaser/depository_manage/TestForgetMapData.java index ba5829ca..cdedccd2 100644 --- a/src/test/java/com/dreamchaser/depository_manage/TestForgetMapData.java +++ b/src/test/java/com/dreamchaser/depository_manage/TestForgetMapData.java @@ -1,14 +1,12 @@ package com.dreamchaser.depository_manage; -import com.dreamchaser.depository_manage.controller.DepositoryController; -import com.dreamchaser.depository_manage.controller.PageController; import com.dreamchaser.depository_manage.entity.MaterialType; import com.dreamchaser.depository_manage.entity.UserByPort; import com.dreamchaser.depository_manage.service.DepositoryRecordService; import com.dreamchaser.depository_manage.service.DepositoryService; import com.dreamchaser.depository_manage.service.MaterialTypeService; import com.dreamchaser.depository_manage.utils.DateUtil; -import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -33,7 +31,7 @@ public class TestForgetMapData { @Test public void Test(){ - UserByPort userByPort = PageController.FindUserById(78, null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(78, null); Map depositoryAllNameAndId = depositoryService.findDepositoryAllNameAndId(userByPort); Iterator it = depositoryAllNameAndId.keySet().iterator(); List depositoryName = new ArrayList<>(); diff --git a/src/test/java/com/dreamchaser/depository_manage/TestForgetShowData.java b/src/test/java/com/dreamchaser/depository_manage/TestForgetShowData.java index 42a77c1a..48cf00ee 100644 --- a/src/test/java/com/dreamchaser/depository_manage/TestForgetShowData.java +++ b/src/test/java/com/dreamchaser/depository_manage/TestForgetShowData.java @@ -1,9 +1,6 @@ package com.dreamchaser.depository_manage; import com.alibaba.fastjson.JSONObject; -import com.dreamchaser.depository_manage.controller.DepositoryController; -import com.dreamchaser.depository_manage.controller.PageController; -import com.dreamchaser.depository_manage.entity.MaterialType; import com.dreamchaser.depository_manage.entity.UserByPort; import com.dreamchaser.depository_manage.mapper.DepositoryMapper; import com.dreamchaser.depository_manage.mapper.DepositoryRecordMapper; @@ -13,8 +10,8 @@ import com.dreamchaser.depository_manage.service.DepositoryRecordService; import com.dreamchaser.depository_manage.service.DepositoryService; import com.dreamchaser.depository_manage.service.MaterialTypeService; import com.dreamchaser.depository_manage.utils.DateUtil; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; import lombok.Data; -import org.apache.xmlbeans.impl.jam.mutable.MPackage; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -53,7 +50,7 @@ public class TestForgetShowData { @Test public void Test() { - UserByPort userByPort = PageController.FindUserById(78, null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(78, null); Map yesterdayData = new HashMap<>(); List depositoryName = new ArrayList<>(); Map showData = getShowData("1", userByPort, yesterdayData, depositoryName);