|
|
|
@ -51,7 +51,6 @@ public class PageController { |
|
|
|
private MaterialService materialService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CompanyService companyService; |
|
|
|
|
|
|
|
@ -169,8 +168,6 @@ public class PageController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/register") |
|
|
|
public String register() { |
|
|
|
return "pages/user/register"; |
|
|
|
@ -213,23 +210,10 @@ public class PageController { |
|
|
|
map.put("userAgent", Md5.crypt(header)); |
|
|
|
mv.addObject("notices", noticeService.findNoticeByCondition(map, userToken)); |
|
|
|
} |
|
|
|
// 查询当前用户所在部门
|
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
// 查询当前用户管理的仓库
|
|
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userToken.getId()); |
|
|
|
// 查询当前用户部门拥有的仓库
|
|
|
|
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); |
|
|
|
// 定义仓库编号列表
|
|
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (Depository depository : depositoryByAdminorg |
|
|
|
) { |
|
|
|
depositoryIdList.add(depository.getId()); |
|
|
|
} |
|
|
|
for (RoleAndDepository rad : depositoryAndRole |
|
|
|
) { |
|
|
|
if (!depositoryIdList.contains(rad.getDepositoryId())) { |
|
|
|
depositoryIdList.add(rad.getDepositoryId()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<Integer> depositoryIdList = roleService.findDepositoryIdForUserHas(userToken); |
|
|
|
mv.addObject("depositoryCount", depositoryIdList.size()); |
|
|
|
Integer inventoryCountByDepository = materialService.findInventoryCountByDepository(depositoryIdList); |
|
|
|
if (inventoryCountByDepository == null) { |
|
|
|
@ -244,11 +228,8 @@ public class PageController { |
|
|
|
Integer applicationIn = depositoryRecordService.findApplicationInRecordPCountByCondition(param); |
|
|
|
warehouseRecord = applicationIn + applicationOut; |
|
|
|
mv.addObject("warehouseRecord", warehouseRecord); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
if (role == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
|
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -258,7 +239,6 @@ public class PageController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/message") |
|
|
|
public ModelAndView userMessage(HttpServletRequest request) { |
|
|
|
ModelAndView mv = new ModelAndView(); |
|
|
|
@ -359,11 +339,8 @@ public class PageController { |
|
|
|
ModelAndView mv = new ModelAndView(); |
|
|
|
mv.setViewName("pages/split/split-out"); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
if (role == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -386,15 +363,12 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
// 获取当天时间戳
|
|
|
|
String currentDate = DateUtil.getCurrentDate(); |
|
|
|
Long aLong = DateUtil.DateTimeByDayToTimeStamp(currentDate); |
|
|
|
mv.addObject("nowDay", aLong); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -603,11 +577,8 @@ public class PageController { |
|
|
|
map.put("mcode", material.getCode()); |
|
|
|
map.put("codeFlag", 1); |
|
|
|
// 获取物料与条形码的对应关系
|
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
if (role == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -642,12 +613,9 @@ public class PageController { |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
List<MaterialType> materialTypeAll = materialTypeService.findMaterialTypeByCondition(map); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
mv.addObject("materialTypes", materialTypeAll); |
|
|
|
if (role == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -725,10 +693,6 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
// 获取当前用户是否存在可见仓库
|
|
|
|
List<Integer> union = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userToken); |
|
|
|
if (union.size() > 0) { |
|
|
|
@ -737,7 +701,8 @@ public class PageController { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
} |
|
|
|
mv.setViewName("pages/application/application-out"); |
|
|
|
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(4, role) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.setViewName("pages/applicationForStorageCenter/application-out"); |
|
|
|
} |
|
|
|
return mv; |
|
|
|
@ -752,10 +717,6 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
// 获取当前用户是否存在可见仓库
|
|
|
|
List<Integer> union = roleService.findDepositoryIdForWareHouseVisiblePermissionByUser(userToken); |
|
|
|
if (union.size() > 0) { |
|
|
|
@ -763,7 +724,8 @@ public class PageController { |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
} |
|
|
|
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(4, role) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.setViewName("pages/applicationForStorageCenter/application-out_back"); |
|
|
|
} |
|
|
|
InventoryP inventoryP = new InventoryP(); |
|
|
|
@ -803,11 +765,8 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -830,11 +789,8 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -879,11 +835,8 @@ public class PageController { |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
ModelAndView mv = new ModelAndView(); |
|
|
|
mv.setViewName("pages/depository/table-stock"); |
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "table-cell"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -943,11 +896,8 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -1000,11 +950,8 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -1039,11 +986,8 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -1066,11 +1010,8 @@ public class PageController { |
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -1104,11 +1045,8 @@ public class PageController { |
|
|
|
} |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
|
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -1172,11 +1110,8 @@ public class PageController { |
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
|
|
|
|
|
|
|
|
Integer isadmin = userToken.getIsadmin(); |
|
|
|
if (isadmin == null) { |
|
|
|
isadmin = 1; |
|
|
|
} |
|
|
|
if (isadmin == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "block"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -1731,11 +1666,8 @@ public class PageController { |
|
|
|
recordP.setUnit(sumUnit.toString()); |
|
|
|
mv.addObject("record", recordP); |
|
|
|
mv.addObject("recordMinList", applicationOutRecordMinByParent); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(role, 4) == 0 ) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "table-row"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -1959,17 +1891,14 @@ public class PageController { |
|
|
|
// 获取当前主单
|
|
|
|
ApplicationOutRecordP recordP = depositoryRecordService.findApplicationOutRecordPById(recordMinP.getParentId()); |
|
|
|
boolean b = DateUtil.IsMonthStartAndEnd(recordP.getApplicantTime()); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(role, 4) == 0 && b) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment) && b) { |
|
|
|
mv.addObject("edisplay", "inline-block"); |
|
|
|
} else { |
|
|
|
mv.addObject("edisplay", "none"); |
|
|
|
|
|
|
|
} |
|
|
|
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(role, 4) == 0) { |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("pdisplay", "table-row"); |
|
|
|
} else { |
|
|
|
mv.addObject("pdisplay", "none"); |
|
|
|
@ -1977,7 +1906,6 @@ public class PageController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mv.addObject("recordMinP", recordMinP); |
|
|
|
} else { |
|
|
|
throw new MyException("缺少必要参数!"); |
|
|
|
@ -2146,12 +2074,8 @@ public class PageController { |
|
|
|
mv.addObject("cdisplay", "none"); |
|
|
|
} |
|
|
|
|
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
|
|
|
|
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(role, 4) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.addObject("display", "table-row"); |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
@ -2194,13 +2118,10 @@ public class PageController { |
|
|
|
gidList.add(gid); |
|
|
|
} else if ("more".equals(type)) { |
|
|
|
} |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
mv.addObject("gidList", gidList); |
|
|
|
mv.setViewName("pages/group/applicationOutForGroup"); |
|
|
|
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(role, 4) == 0) { |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.setViewName("pages/applicationForStorageCenter/applicationOutForGroup"); |
|
|
|
} |
|
|
|
return mv; |
|
|
|
@ -2804,22 +2725,15 @@ public class PageController { |
|
|
|
} else { |
|
|
|
mv.addObject("display", "none"); |
|
|
|
} |
|
|
|
Integer maindeparment = userToken.getMaindeparment(); |
|
|
|
if (range != null && range.size() > 0) { |
|
|
|
mv.setViewName("pages/application/application-out_temporaryValue"); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
if (role == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.setViewName("pages/applicationForStorageCenter/application-out_temporaryValue"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
mv.setViewName("pages/application/application-out"); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
if (role == 4 || Integer.compare(userToken.getMaindeparment(), 361) == 0) { |
|
|
|
if (PortConfig.roleAdminorgList.contains(maindeparment)) { |
|
|
|
mv.setViewName("pages/applicationForStorageCenter/application-out"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -3167,8 +3081,6 @@ public class PageController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 用于跳转到库存盘点时编辑页面
|
|
|
|
@GetMapping("/stockTakingInfoForInventory") |
|
|
|
public ModelAndView stockTakingInfoForInventory(@RequestParam Map<String, String> param, HttpServletRequest request) { |
|
|
|
@ -3212,6 +3124,7 @@ public class PageController { |
|
|
|
|
|
|
|
/** |
|
|
|
* 用于获取当前用户的任务列表 |
|
|
|
* |
|
|
|
* @param userToken 当前用户 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@ -3269,6 +3182,7 @@ public class PageController { |
|
|
|
|
|
|
|
/** |
|
|
|
* 用于获取当前用户的部分申请列表 |
|
|
|
* |
|
|
|
* @param userToken 当前用户 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@ -3305,10 +3219,9 @@ public class PageController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 跳转到移动端功能页面 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/userAuthorityMenus") |
|
|
|
|