|
|
|
@ -21,6 +21,7 @@ import org.springframework.web.servlet.ModelAndView; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
@ -485,6 +486,8 @@ public class PageController { |
|
|
|
@GetMapping("/selectPlaceByDepository") |
|
|
|
// 库位树形菜单
|
|
|
|
public ModelAndView selectPlaceByDepository(Integer depositoryId, Integer mid, String placeCode, String unit) { |
|
|
|
|
|
|
|
|
|
|
|
ModelAndView mv = new ModelAndView(); |
|
|
|
|
|
|
|
|
|
|
|
@ -507,18 +510,24 @@ public class PageController { |
|
|
|
placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(place.getId(), mid); |
|
|
|
mv.addObject("placeId", place.getId()); |
|
|
|
} |
|
|
|
if ("-1".equals(unit)) { |
|
|
|
Inventory inventoryById = materialService.findInventoryById(mid); |
|
|
|
if (unit.equals(inventoryById.getUnit())) { |
|
|
|
// 如果转移的基础单位
|
|
|
|
mv.addObject("quantity", placeAndMaterialByMidAndPid.getQuantity()); |
|
|
|
} else { |
|
|
|
// 获取当前的拆单记录
|
|
|
|
Map<String, Object> paramForSplitInfo = new HashMap<>(); |
|
|
|
Inventory inventoryById = materialService.findInventoryById(mid); |
|
|
|
|
|
|
|
paramForSplitInfo.put("mid", inventoryById.getMid()); |
|
|
|
paramForSplitInfo.put("newUnit", unit); |
|
|
|
SplitInfo splitInfo = splitUnitService.findSplitInfoByMidAndUnit(paramForSplitInfo); |
|
|
|
SplitInventory splitInventory = splitUnitService.findSplitInventoryByIidAndSid(placeAndMaterialByMidAndPid.getId(), splitInfo.getId()); |
|
|
|
mv.addObject("quantity", splitInventory.getSaveQuantity()); |
|
|
|
if (splitInventory != null) { |
|
|
|
mv.addObject("quantity", splitInventory.getSaveQuantity()); |
|
|
|
}else{ |
|
|
|
int Scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|
mv.addObject("quantity",inventoryById.getQuantity() * Scale); |
|
|
|
} |
|
|
|
} |
|
|
|
mv.addObject("depositoryId", depositoryId); |
|
|
|
mv.addObject("mid", mid); |
|
|
|
@ -2428,9 +2437,9 @@ public class PageController { |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
mv.setViewName("pages/notice/notice-edit"); |
|
|
|
String[] split = noticeById.getViewRangeId().split(","); |
|
|
|
for (String s:split |
|
|
|
) { |
|
|
|
if(!"".equals(s)){ |
|
|
|
for (String s : split |
|
|
|
) { |
|
|
|
if (!"".equals(s)) { |
|
|
|
// 获取对应的部门名称
|
|
|
|
qywxDepartment qyWxDepartment = QyWxConfig.getQyWxDepartment(crypt, ObjectFormatUtil.toInteger(s)); |
|
|
|
sb.append(qyWxDepartment.getName()).append(","); |
|
|
|
@ -2449,17 +2458,17 @@ public class PageController { |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/noticeAll") |
|
|
|
public ModelAndView noticeAll(HttpServletRequest request){ |
|
|
|
public ModelAndView noticeAll(HttpServletRequest request) { |
|
|
|
ModelAndView mv = new ModelAndView(); |
|
|
|
mv.setViewName("pages/notice/notice-out_user"); |
|
|
|
UserByPort userToken = (UserByPort) request.getAttribute("userToken"); |
|
|
|
mv.addObject("userId",userToken.getId()); |
|
|
|
mv.addObject("userId", userToken.getId()); |
|
|
|
Integer role = userToken.getIsadmin(); |
|
|
|
if (role == null) { |
|
|
|
role = 1; |
|
|
|
} |
|
|
|
if (role == 4) { |
|
|
|
mv.setViewName("pages/notice/notice-out"); |
|
|
|
mv.setViewName("pages/notice/notice-out"); |
|
|
|
} |
|
|
|
return mv; |
|
|
|
} |
|
|
|
|