|
|
|
@ -1255,7 +1255,7 @@ public class PageController { |
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { |
|
|
|
// 获取子订单信息
|
|
|
|
// 获取出库物料信息
|
|
|
|
Inventory materialById = materialService.findInventoryById(applicationOutRecordMin.getMid()); |
|
|
|
Inventory inventoryById = materialService.findInventoryById(applicationOutRecordMin.getMid()); |
|
|
|
// 获取出库物料仓库信息
|
|
|
|
Depository depository = depositoryService.findDepositoryById(applicationOutRecordMin.getDepositoryId()); |
|
|
|
// 获取出库库位
|
|
|
|
@ -1263,16 +1263,26 @@ public class PageController { |
|
|
|
if (placeById != null) { |
|
|
|
placeCode.append(placeById.getCode()).append(","); |
|
|
|
} |
|
|
|
mname.append(materialById.getMname()).append(","); |
|
|
|
mcode.append(materialById.getCode()).append(","); |
|
|
|
mname.append(inventoryById.getMname()).append(","); |
|
|
|
mcode.append(inventoryById.getCode()).append(","); |
|
|
|
depositoryName.append(depository.getDname()).append(","); |
|
|
|
sumQuantity += applicationOutRecordMin.getQuantity(); |
|
|
|
sumPrice += (materialById.getPrice()); |
|
|
|
|
|
|
|
String unit = applicationOutRecordMin.getUnit(); |
|
|
|
if ("-1".equals(unit)) { |
|
|
|
sumUnit.append(materialById.getUnit() + ","); |
|
|
|
sumPrice += (inventoryById.getPrice() * applicationOutRecordMin.getQuantity()); |
|
|
|
sumUnit.append(inventoryById.getUnit()).append(","); |
|
|
|
} else { |
|
|
|
sumUnit.append(unit + ","); |
|
|
|
// 用于获取当前拆单记录
|
|
|
|
Map<String,Object> paramForSplitInfo = new HashMap<>(); |
|
|
|
paramForSplitInfo.put("newUnit",unit); |
|
|
|
paramForSplitInfo.put("mid",inventoryById.getMid()); |
|
|
|
// 获取拆单记录
|
|
|
|
SplitInfo splitInfo = splitUnitService.findSplitInfoByMidAndUnit(paramForSplitInfo); |
|
|
|
// 获取当前拆单与基础单位的进制
|
|
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|
sumUnit.append(unit).append(","); |
|
|
|
sumPrice+= (inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 申请人
|
|
|
|
@ -1281,8 +1291,8 @@ public class PageController { |
|
|
|
String departmentheads = recordP.getDepartmenthead(); |
|
|
|
String[] split = departmentheads.split(","); |
|
|
|
StringBuilder departmentHeadName = new StringBuilder(); |
|
|
|
for (int i = 0; i < split.length; i++) { |
|
|
|
UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(split[i]), userToken); |
|
|
|
for (String value : split) { |
|
|
|
UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(value), userToken); |
|
|
|
departmentHeadName.append(departmenthead.getName()).append(","); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1327,7 +1337,6 @@ public class PageController { |
|
|
|
applicationInRecordPById.setApplicantName(userByPort.getName()); |
|
|
|
applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime()))); |
|
|
|
applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100); |
|
|
|
|
|
|
|
mv.addObject("record", applicationInRecordPById); |
|
|
|
} else { |
|
|
|
throw new MyException("缺少必要参数!"); |
|
|
|
@ -1343,9 +1352,10 @@ public class PageController { |
|
|
|
if (id != null) { |
|
|
|
// 获取当前子订单
|
|
|
|
ApplicationOutRecordMin recordMin = depositoryRecordService.findApplicationOutMinById(id); |
|
|
|
|
|
|
|
ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(recordMin); |
|
|
|
// 获取出库物料信息
|
|
|
|
Inventory materialById = materialService.findInventoryById(recordMin.getMid()); |
|
|
|
Inventory inventoryById = materialService.findInventoryById(recordMin.getMid()); |
|
|
|
// 获取出库物料仓库信息
|
|
|
|
Depository depository = depositoryService.findDepositoryById(recordMin.getDepositoryId()); |
|
|
|
// 获取出库库位
|
|
|
|
@ -1355,13 +1365,30 @@ public class PageController { |
|
|
|
// 设置处理人姓名
|
|
|
|
recordMinP.setCheckerName(userByPort.getName()); |
|
|
|
recordMinP.setDepositoryName(depository.getDname()); |
|
|
|
recordMinP.setMname(materialById.getMname()); |
|
|
|
recordMinP.setMcode(materialById.getCode()); |
|
|
|
recordMinP.setMname(inventoryById.getMname()); |
|
|
|
recordMinP.setMcode(inventoryById.getCode()); |
|
|
|
recordMinP.setPlaceCode(placeById.getCode()); |
|
|
|
Double price = (materialById.getPrice()) * recordMinP.getQuantity(); |
|
|
|
BigDecimal bg = new BigDecimal(price); |
|
|
|
price = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
recordMinP.setPrice(price); |
|
|
|
String unit = recordMinP.getUnit(); |
|
|
|
if("-1".equals(unit)){ |
|
|
|
recordMinP.setUnit(inventoryById.getUnit()); |
|
|
|
double price = (inventoryById.getPrice()) * recordMinP.getQuantity(); |
|
|
|
BigDecimal bg = new BigDecimal(price); |
|
|
|
price = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
recordMinP.setPrice(price); |
|
|
|
}else{ |
|
|
|
// 用于获取拆单记录
|
|
|
|
Map<String,Object> paramForSplitInfo = new HashMap<>(); |
|
|
|
paramForSplitInfo.put("newUnit",unit); |
|
|
|
paramForSplitInfo.put("mid",inventoryById.getMid()); |
|
|
|
// 获取拆单记录
|
|
|
|
SplitInfo splitInfo = splitUnitService.findSplitInfoByMidAndUnit(paramForSplitInfo); |
|
|
|
// 获取当前拆单与基础单位的进制
|
|
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|
double price = (inventoryById.getPrice()) / scale * recordMinP.getQuantity(); |
|
|
|
BigDecimal bg = new BigDecimal(price); |
|
|
|
price = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
recordMinP.setPrice(price); |
|
|
|
} |
|
|
|
mv.addObject("recordMinP", recordMinP); |
|
|
|
} else { |
|
|
|
throw new MyException("缺少必要参数!"); |
|
|
|
@ -1399,14 +1426,13 @@ public class PageController { |
|
|
|
List<ApplicationOutRecordMinP> recordMinPList = new ArrayList<>(); |
|
|
|
// 当前总额
|
|
|
|
Double sumPrice = 0.0; |
|
|
|
for (int i = 0; i < applicationOutRecordMinByParent.size(); i++) { |
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { |
|
|
|
// 获取子订单信息
|
|
|
|
ApplicationOutRecordMin applicationOutRecordMin = applicationOutRecordMinByParent.get(i); |
|
|
|
// 获取输出子订单信息
|
|
|
|
ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(applicationOutRecordMin); |
|
|
|
|
|
|
|
// 获取出库物料信息
|
|
|
|
Inventory materialById = materialService.findInventoryById(applicationOutRecordMin.getMid()); |
|
|
|
Inventory inventoryById = materialService.findInventoryById(applicationOutRecordMin.getMid()); |
|
|
|
// 获取出库物料仓库信息
|
|
|
|
Depository depository = depositoryService.findDepositoryById(applicationOutRecordMin.getDepositoryId()); |
|
|
|
// 获取出库库位
|
|
|
|
@ -1414,7 +1440,7 @@ public class PageController { |
|
|
|
if (placeById != null) { |
|
|
|
placeCode.append(placeById.getCode()).append(","); |
|
|
|
} |
|
|
|
recordMinP.setMname(materialById.getMname()); |
|
|
|
recordMinP.setMname(inventoryById.getMname()); |
|
|
|
recordMinP.setDepositoryName(depository.getDname()); |
|
|
|
recordMinP.setPlaceCode(placeById.getCode()); |
|
|
|
Integer checkId = applicationOutRecordMin.getCheckId(); |
|
|
|
@ -1428,12 +1454,30 @@ public class PageController { |
|
|
|
outDisposer.append("暂未处理,"); |
|
|
|
recordMinP.setCheckerName("暂未处理"); |
|
|
|
} |
|
|
|
mname.append(materialById.getMname()).append(","); |
|
|
|
mcode.append(materialById.getCode()).append(","); |
|
|
|
|
|
|
|
mname.append(inventoryById.getMname()).append(","); |
|
|
|
mcode.append(inventoryById.getCode()).append(","); |
|
|
|
depositoryName.append(depository.getDname()).append(","); |
|
|
|
quantityByMaterial.append(applicationOutRecordMin.getQuantity() + ","); |
|
|
|
quantityByMaterial.append(applicationOutRecordMin.getQuantity()).append(","); |
|
|
|
sumQuantity += applicationOutRecordMin.getQuantity(); |
|
|
|
sumPrice += (materialById.getPrice() * applicationOutRecordMin.getQuantity()); |
|
|
|
// 获取当前计量单位
|
|
|
|
String unit = recordMinP.getUnit(); |
|
|
|
if("-1".equals(unit)){ |
|
|
|
// 如果是基础单位
|
|
|
|
sumPrice += (inventoryById.getPrice() * applicationOutRecordMin.getQuantity()); |
|
|
|
}else{ |
|
|
|
// 如果是拆单
|
|
|
|
|
|
|
|
// 用于获取拆单记录
|
|
|
|
Map<String,Object> paramForSplitInfo = new HashMap<>(); |
|
|
|
paramForSplitInfo.put("newUnit",unit); |
|
|
|
paramForSplitInfo.put("mid",inventoryById.getMid()); |
|
|
|
// 查询拆单记录
|
|
|
|
SplitInfo splitInfo = splitUnitService.findSplitInfoByMidAndUnit(paramForSplitInfo); |
|
|
|
// 获取当前拆单记录与基础单位的进制
|
|
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|
sumPrice += (inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity()); |
|
|
|
} |
|
|
|
recordMinPList.add(recordMinP); |
|
|
|
} |
|
|
|
// 申请人
|
|
|
|
@ -1457,16 +1501,16 @@ public class PageController { |
|
|
|
depositoryManagerId = manager.split(","); |
|
|
|
} |
|
|
|
List<UserByPort> depositoryManager = new ArrayList<>(); |
|
|
|
String depositoryManagerNames = ""; |
|
|
|
StringBuilder depositoryManagerNames = new StringBuilder(); |
|
|
|
for (int i = 0; i < depositoryManagerId.length; i++) { |
|
|
|
Integer managerid = ObjectFormatUtil.toInteger(depositoryManagerId[i]); |
|
|
|
UserByPort user = LinkInterfaceUtil.FindUserById(managerid, userToken); |
|
|
|
depositoryManager.add(user); |
|
|
|
depositoryManagerNames += user.getName(); |
|
|
|
depositoryManagerNames.append(user.getName()); |
|
|
|
} |
|
|
|
applicationOutRecordPById.setApplicantName(userByPort.getName()); |
|
|
|
applicationOutRecordPById.setDepartmentheadName(departmentHeadName.toString()); |
|
|
|
applicationOutRecordPById.setDepositoryManagerName(depositoryManagerNames); |
|
|
|
applicationOutRecordPById.setDepositoryManagerName(depositoryManagerNames.toString()); |
|
|
|
applicationOutRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getApplicantTime()))); |
|
|
|
applicationOutRecordPById.setDepartmentheadTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getDepartmentheadTime()))); |
|
|
|
applicationOutRecordPById.setDepositoryManagerTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getDepositoryManagerTime()))); |
|
|
|
|