Browse Source

修改查看我的申请时盘点申请查看错误的问题

lwx_dev
erdanergou 3 years ago
parent
commit
7183b4b5b3
  1. 9
      src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java
  2. 261
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  3. 34
      src/main/java/com/dreamchaser/depository_manage/utils/LinkInterfaceUtil.java

9
src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java

@ -596,6 +596,15 @@ public class GroupController {
} }
} }
@PostMapping("/findGroupById")
public RestResponse findGroupById(@RequestBody Map<String,String> map){
if(map.containsKey("id")){
return new RestResponse(groupService.findGroupOnlyById(ObjectFormatUtil.toInteger(map.get("id"))));
}else{
throw new MyException("缺少必要参数");
}
}
/** /**
* 用于获取当前物料在组合中的详细信息 * 用于获取当前物料在组合中的详细信息

261
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -955,7 +955,7 @@ public class PageController {
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
mv.setViewName("pages/user/table-user"); mv.setViewName("pages/user/table-user");
List<AdministrationP> administrationPList = findAllCompany(userToken); List<AdministrationP> administrationPList = LinkInterfaceUtil.findAllCompany(userToken);
mv.addObject("administrationPList", administrationPList); mv.addObject("administrationPList", administrationPList);
return mv; return mv;
} }
@ -1168,6 +1168,13 @@ public class PageController {
return mv; return mv;
} }
/**
* 组合信息编辑
* @param id 待编辑组合信息
* @param request
* @return
*/
@GetMapping("/group_edit") @GetMapping("/group_edit")
public ModelAndView groupEdit(Integer id, HttpServletRequest request) { public ModelAndView groupEdit(Integer id, HttpServletRequest request) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1266,6 +1273,11 @@ public class PageController {
} }
/**
* 出库可视化
* @param request
* @return
*/
@GetMapping("chart_out_back") @GetMapping("chart_out_back")
public ModelAndView chart_out_back(HttpServletRequest request) { public ModelAndView chart_out_back(HttpServletRequest request) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1333,6 +1345,11 @@ public class PageController {
return mv; return mv;
} }
/**
* 库存可视化
* @param request
* @return
*/
@GetMapping("/chart_stock_back") @GetMapping("/chart_stock_back")
public ModelAndView chart_stock(HttpServletRequest request) { public ModelAndView chart_stock(HttpServletRequest request) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1346,16 +1363,14 @@ public class PageController {
return mv; return mv;
} }
@GetMapping("/user_password")
public ModelAndView user_password(HttpServletRequest request) {
ModelAndView mv = new ModelAndView();
mv.setViewName("pages/user/user-password");
UserToken userToken = (UserToken) request.getAttribute("userToken");
mv.addObject("user", userToken.getUser());
return mv;
}
/**
* 添加给用户添加权限
* @param userId 用户id
* @param classes 类型
* @param request
* @return
*/
@GetMapping("/user_add") @GetMapping("/user_add")
public ModelAndView user_add(Integer userId, Integer classes, HttpServletRequest request) { public ModelAndView user_add(Integer userId, Integer classes, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1372,6 +1387,13 @@ public class PageController {
return mv; return mv;
} }
/**
* 跟用户添加类型权限
* @param userId
* @param classes
* @param request
* @return
*/
@GetMapping("/user_addForIn") @GetMapping("/user_addForIn")
public ModelAndView user_addForIn(Integer userId, Integer classes, HttpServletRequest request) { public ModelAndView user_addForIn(Integer userId, Integer classes, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1389,6 +1411,12 @@ public class PageController {
} }
/**
* 编辑用户仓库权限
* @param id 待编辑权限id
* @param request
* @return
*/
@GetMapping("/user_role_edit") @GetMapping("/user_role_edit")
public ModelAndView user_role_edit(Integer id, HttpServletRequest request) { public ModelAndView user_role_edit(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1411,6 +1439,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 编辑用户类型权限
* @param id 待编辑权限id
* @param request
* @return
*/
@GetMapping("/user_role_editForIn") @GetMapping("/user_role_editForIn")
public ModelAndView user_role_editForIn(Integer id, HttpServletRequest request) { public ModelAndView user_role_editForIn(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1434,6 +1468,13 @@ public class PageController {
} }
/**
* 给岗位权限
* @param id 待赋权岗位
* @param depositoryId 赋权仓库
* @param request
* @return
*/
@GetMapping("/post_role_edit") @GetMapping("/post_role_edit")
public ModelAndView post_role_edit(Integer id, Integer depositoryId, HttpServletRequest request) { public ModelAndView post_role_edit(Integer id, Integer depositoryId, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1460,6 +1501,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 用户详情
* @param id 待查询用户id
* @param request
* @return
*/
@GetMapping("/user_detail") @GetMapping("/user_detail")
public ModelAndView user_edit(Integer id, HttpServletRequest request) { public ModelAndView user_edit(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1478,6 +1525,12 @@ public class PageController {
} }
/**
* 编辑仓库
* @param id 待编辑仓库id
* @param request
* @return
*/
@GetMapping("/warehouse_view") @GetMapping("/warehouse_view")
public ModelAndView warehouse_view(Integer id, HttpServletRequest request) { public ModelAndView warehouse_view(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1494,7 +1547,7 @@ public class PageController {
mv.addObject("record", depositoryRecordById); mv.addObject("record", depositoryRecordById);
Integer cid = depositoryRecordById.getCid(); Integer cid = depositoryRecordById.getCid();
List<AdministrationP> postList = LinkInterfaceUtil.findCompanyBySuperior(cid.toString(), userToken); List<AdministrationP> postList = LinkInterfaceUtil.findCompanyBySuperior(cid.toString(), userToken);
List<AdministrationP> administrationPList = findAllCompany(userToken); List<AdministrationP> administrationPList = LinkInterfaceUtil.findAllCompany(userToken);
// 部门列表 // 部门列表
mv.addObject("postList", postList); mv.addObject("postList", postList);
// 公司列表 // 公司列表
@ -1506,6 +1559,12 @@ public class PageController {
return mv; return mv;
} }
/**
*查询当前仓库的子仓库
* @param parentId 当前仓库id
* @param request
* @return
*/
@GetMapping("/warehouseByParentId") @GetMapping("/warehouseByParentId")
public ModelAndView warehouseByParentId(Integer parentId, HttpServletRequest request) { public ModelAndView warehouseByParentId(Integer parentId, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1526,6 +1585,11 @@ public class PageController {
return mv; return mv;
} }
/**
* 库位或托盘编辑
* @param id 库位id
* @return
*/
@GetMapping("/placeView") @GetMapping("/placeView")
public ModelAndView placeView(Integer id) { public ModelAndView placeView(Integer id) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1544,6 +1608,11 @@ public class PageController {
return mv; return mv;
} }
/**
* 给仓库插入库位或托盘
* @param depositoryId 待插入的仓库id
* @return
*/
@GetMapping("/insertPlace") @GetMapping("/insertPlace")
public ModelAndView insertPlace(Integer depositoryId) { public ModelAndView insertPlace(Integer depositoryId) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1556,6 +1625,11 @@ public class PageController {
return mv; return mv;
} }
/**
* 批量为仓库插入库位或托盘
* @param depositoryId 仓库id
* @return
*/
@GetMapping("/insertListPlace") @GetMapping("/insertListPlace")
public ModelAndView insertListPlace(Integer depositoryId) { public ModelAndView insertListPlace(Integer depositoryId) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1568,6 +1642,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 查看当前仓库的子仓库若没有子仓库则跳转到库位列表
* @param parentId 当前仓库id
* @param request
* @return
*/
@GetMapping("/findWareHouseByParentId") @GetMapping("/findWareHouseByParentId")
public ModelAndView findWareHouseByParentId(Integer parentId, HttpServletRequest request) { public ModelAndView findWareHouseByParentId(Integer parentId, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1608,6 +1688,11 @@ public class PageController {
return mv; return mv;
} }
/**
* 查看当前仓库的管理员
* @param id 待查看id
* @return
*/
@GetMapping("/ManagerView") @GetMapping("/ManagerView")
public ModelAndView findManagerView(Integer id) { public ModelAndView findManagerView(Integer id) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1644,6 +1729,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 查看当前岗位拥有的仓库权限
* @param id 待查看岗位id
* @param classes 类别
* @return
*/
@GetMapping("/postRoleView") @GetMapping("/postRoleView")
public ModelAndView findPostRoleView(Integer id, Integer classes) { public ModelAndView findPostRoleView(Integer id, Integer classes) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1653,15 +1744,26 @@ public class PageController {
return mv; return mv;
} }
/**
* 查看当前库存所在仓库的管理员未使用
* @param id 库存id
* @return
*/
@GetMapping("/ManagerViewByMid") @GetMapping("/ManagerViewByMid")
public ModelAndView findManagerViewByMid(Integer id) { public ModelAndView findManagerViewByMid(Integer id) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
Material materialById = materialService.findMaterialById(id); Inventory materialById = materialService.findInventoryById(id);
mv.addObject("did", materialById.getDepositoryId()); mv.addObject("did", materialById.getDepositoryId());
mv.setViewName("pages/warehouse/manager"); mv.setViewName("pages/warehouse/manager");
return mv; return mv;
} }
/**
* 查看当前物料类型下的子类型
* @param parentId 当前类型id
* @param request
* @return
*/
@GetMapping("/findMaterialTypeByParentId") @GetMapping("/findMaterialTypeByParentId")
public ModelAndView findMaterialTypeByParentId(Integer parentId, HttpServletRequest request) { public ModelAndView findMaterialTypeByParentId(Integer parentId, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1697,6 +1799,11 @@ public class PageController {
} }
/**
* 查看当前物料类型详情
* @param id 类型id
* @return
*/
@GetMapping("/materialType_detail") @GetMapping("/materialType_detail")
public ModelAndView materialType_detail(Integer id) { public ModelAndView materialType_detail(Integer id) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -1712,6 +1819,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 出库申请审批
* @param id 待审批id
* @param request
* @return
*/
@GetMapping("/application_review") @GetMapping("/application_review")
public ModelAndView application_review(Integer id, HttpServletRequest request) { public ModelAndView application_review(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1843,6 +1956,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 出库出库申请详情
* @param id 待查看id
* @param request
* @return
*/
@GetMapping("/form_step_look") @GetMapping("/form_step_look")
public ModelAndView form_step_look(Integer id, HttpServletRequest request) { public ModelAndView form_step_look(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1912,6 +2031,12 @@ public class PageController {
} }
/**
* 入库申请审批
* @param id 待审批id
* @param request
* @return
*/
@GetMapping("/application_in_review") @GetMapping("/application_in_review")
public ModelAndView application_in_review(Integer id, HttpServletRequest request) { public ModelAndView application_in_review(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -1981,6 +2106,12 @@ public class PageController {
} }
/**
* 出库申请的申请物料详情
* @param id 待查看详情id
* @param request
* @return
*/
@GetMapping("/form_step_lookByminRecordOut") @GetMapping("/form_step_lookByminRecordOut")
public ModelAndView form_step_lookByminRecordOut(Integer id, HttpServletRequest request) { public ModelAndView form_step_lookByminRecordOut(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -2273,6 +2404,13 @@ public class PageController {
} }
/**
* 跳转到组合出库申请
* @param gid 组合id
* @param type 类型
* @param request
* @return
*/
@GetMapping("/applicationOutForGroup") @GetMapping("/applicationOutForGroup")
public ModelAndView applicationOutForGroup(Integer gid, String type, HttpServletRequest request) { public ModelAndView applicationOutForGroup(Integer gid, String type, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -2295,6 +2433,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 组合申请入库id
* @param gid 组合id
* @param type 类型
* @return
*/
@GetMapping("/applicationInForGroup") @GetMapping("/applicationInForGroup")
public ModelAndView applicationInForGroup(Integer gid, String type) { public ModelAndView applicationInForGroup(Integer gid, String type) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -2309,6 +2453,12 @@ public class PageController {
} }
/**
* 库存盘点审批
* @param id 待审批id
* @param request
* @return
*/
@GetMapping("/StockTakingReview") @GetMapping("/StockTakingReview")
public ModelAndView StockTakingReview(Integer id, HttpServletRequest request) { public ModelAndView StockTakingReview(Integer id, HttpServletRequest request) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -2486,35 +2636,11 @@ public class PageController {
} }
public List<AdministrationP> findAllCompany(UserByPort userByPort) { /**
String url = PortConfig.external_url + "/org/govlist"; * 公司查看弃用
Map<String, Object> map = new HashMap<>(); * @param request
map.put("superior", "313"); * @return
map.put("level", 3); */
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<AdministrationP> 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("/company_out") @GetMapping("/company_out")
public ModelAndView Company_Out(HttpServletRequest request) { public ModelAndView Company_Out(HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -2524,13 +2650,17 @@ public class PageController {
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
mv.setViewName("pages/company/company-out"); mv.setViewName("pages/company/company-out");
List<AdministrationP> administrationPList = findAllCompany(userToken); List<AdministrationP> administrationPList = LinkInterfaceUtil.findAllCompany(userToken);
mv.addObject("administrationPList", administrationPList); mv.addObject("administrationPList", administrationPList);
mv.addObject("level", 3); mv.addObject("level", 3);
mv.addObject("parentId", "313"); mv.addObject("parentId", "313");
return mv; return mv;
} }
/**
* 公司添加弃用
* @return
*/
@GetMapping("/company_add") @GetMapping("/company_add")
public ModelAndView company_add() { public ModelAndView company_add() {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -2541,6 +2671,12 @@ public class PageController {
} }
/**
* 查看公司详情
* @param id 待查看公司id
* @param request
* @return
*/
@GetMapping("/company_detail") @GetMapping("/company_detail")
public ModelAndView company_detail(Integer id, HttpServletRequest request) { public ModelAndView company_detail(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -2576,6 +2712,13 @@ public class PageController {
} }
/**
* 获取当前公司下的子公司
* @param parentId 待查看id
* @param level 等级
* @param request
* @return
*/
@GetMapping("/findCompanyByParentId") @GetMapping("/findCompanyByParentId")
public ModelAndView findCompanyByParentId(Integer parentId, Integer level, HttpServletRequest request) { public ModelAndView findCompanyByParentId(Integer parentId, Integer level, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -2600,6 +2743,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 获取当前行政组织下的岗位
* @param organization 待查看行政组织
* @param request
* @return
*/
@GetMapping("/findPostByOrganization") @GetMapping("/findPostByOrganization")
public ModelAndView findPostByOrganization(Integer organization, HttpServletRequest request) { public ModelAndView findPostByOrganization(Integer organization, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -2641,6 +2790,12 @@ public class PageController {
return mv; return mv;
} }
/**
* 行政组织详情
* @param id id
* @param request
* @return
*/
@GetMapping("/post_detail") @GetMapping("/post_detail")
public ModelAndView post_detail(Integer id, HttpServletRequest request) { public ModelAndView post_detail(Integer id, HttpServletRequest request) {
String token = request.getHeader("user-token"); String token = request.getHeader("user-token");
@ -3156,11 +3311,20 @@ public class PageController {
} }
/**
* 跳转到行政组织
* @return
*/
@GetMapping("/selectDepartment") @GetMapping("/selectDepartment")
public String selectDepartment() { public String selectDepartment() {
return "pages/notice/selectDepartment"; return "pages/notice/selectDepartment";
} }
/**
* 全部公告页
* @param request
* @return
*/
@GetMapping("/noticeAll") @GetMapping("/noticeAll")
public ModelAndView noticeAll(HttpServletRequest request) { public ModelAndView noticeAll(HttpServletRequest request) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
@ -3190,17 +3354,30 @@ public class PageController {
return mv; return mv;
} }
/**
* 添加施工单位页
* @return
*/
@GetMapping("/constructionUnitAdd") @GetMapping("/constructionUnitAdd")
public String constructionUnitAdd() { public String constructionUnitAdd() {
return "pages/constructionunit/constructionunit_add"; return "pages/constructionunit/constructionunit_add";
} }
/**
* 施工单位查询
* @return
*/
@GetMapping("/constructionUnitOut") @GetMapping("/constructionUnitOut")
public String constructionUnitOut() { public String constructionUnitOut() {
return "pages/constructionunit/constructionunit_out"; return "pages/constructionunit/constructionunit_out";
} }
/**
* 施工单位编辑
* @param id 施工单位id
* @return
*/
@GetMapping("/constructionUnitEdit") @GetMapping("/constructionUnitEdit")
public ModelAndView constructionUnitEdit(Integer id) { public ModelAndView constructionUnitEdit(Integer id) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();

34
src/main/java/com/dreamchaser/depository_manage/utils/LinkInterfaceUtil.java

@ -52,6 +52,40 @@ public class LinkInterfaceUtil {
return result; return result;
} }
/**
* 获取恒信集团下的所有公司
* @param userByPort
* @return
*/
public static List<AdministrationP> findAllCompany(UserByPort userByPort) {
String url = PortConfig.external_url + "/org/govlist";
Map<String, Object> map = new HashMap<>();
map.put("superior", "313");
map.put("level", 3);
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<AdministrationP> 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查询对应用户 * 根据用户id查询对应用户
* *

Loading…
Cancel
Save