|
|
|
@ -710,7 +710,17 @@ public class DepositoryRecordController { |
|
|
|
public RestResponse findApplicationOutRecordByCondition(@RequestParam Map<String, Object> map, HttpServletRequest request) { |
|
|
|
UserByPort userByPort = (UserByPort) request.getAttribute("userToken"); |
|
|
|
// 获取对应主订单
|
|
|
|
List<ApplicationOutRecordP> list = depositoryRecordService.findApplicationOutRecordPByUser(userByPort, map); |
|
|
|
List<ApplicationOutRecordP> list = new ArrayList<>(); |
|
|
|
Integer countBy = 0; |
|
|
|
if(Integer.compare(userByPort.getMaindeparment(),361)==0){ |
|
|
|
list = depositoryRecordService.findApplicationOutRecordPByCondition(map,userByPort); |
|
|
|
countBy = depositoryRecordService.findApplicationOutRecordPCountByCondition(map); |
|
|
|
}else{ |
|
|
|
|
|
|
|
list = depositoryRecordService.findApplicationOutRecordPByUser(userByPort, map); |
|
|
|
countBy = depositoryRecordService.findApplicationOutRecordPCountByUser(userByPort, map); |
|
|
|
} |
|
|
|
|
|
|
|
for (ApplicationOutRecordP outRecordP : list) { |
|
|
|
// 根据主订单获取所有子订单
|
|
|
|
List<ApplicationOutRecordMin> applicationOutMinByParentId = depositoryRecordService.findApplicationOutMinByParentId(outRecordP.getId()); |
|
|
|
@ -718,10 +728,9 @@ public class DepositoryRecordController { |
|
|
|
StringBuilder mcode = new StringBuilder(); |
|
|
|
StringBuilder depositoryName = new StringBuilder(); |
|
|
|
Integer sumQuantity = 0; |
|
|
|
Double sumPrice = 0.0; |
|
|
|
for (int j = 0; j < applicationOutMinByParentId.size(); j++) { |
|
|
|
double sumPrice = 0.0; |
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutMinByParentId) { |
|
|
|
// 获取子订单信息
|
|
|
|
ApplicationOutRecordMin applicationOutRecordMin = applicationOutMinByParentId.get(j); |
|
|
|
// 获取出库物料信息
|
|
|
|
Inventory inventory = materialService.findInventoryById(applicationOutRecordMin.getMid()); |
|
|
|
// 获取出库物料仓库信息
|
|
|
|
@ -738,7 +747,7 @@ public class DepositoryRecordController { |
|
|
|
outRecordP.setQuantity(sumQuantity); |
|
|
|
outRecordP.setPrice(sumPrice); |
|
|
|
} |
|
|
|
return new RestResponse(list, depositoryRecordService.findApplicationOutRecordPCountByUser(userByPort, map), 200); |
|
|
|
return new RestResponse(list, countBy, 200); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|