This commit is contained in:
parent
d08a78681e
commit
b20511cb60
|
@ -151,7 +151,37 @@ public class PickmToBuyingreqAction implements ICommonAction {
|
||||||
head.setCtrantypeid(ctrantypeid);
|
head.setCtrantypeid(ctrantypeid);
|
||||||
// head.setCwarehouseid("");
|
// head.setCwarehouseid("");
|
||||||
}
|
}
|
||||||
return inVOS;
|
|
||||||
|
|
||||||
|
List<PraybillVO> resultList = new ArrayList<>();
|
||||||
|
Map<Object, List<PraybillVO>> groupMap = new HashMap<>();
|
||||||
|
|
||||||
|
for (PraybillVO vo : inVOS) {
|
||||||
|
Object pk_org = vo.getHVO().getPk_org();
|
||||||
|
groupMap.computeIfAbsent(pk_org, k -> new ArrayList<>()).add(vo);
|
||||||
|
}
|
||||||
|
for (Map.Entry<Object, List<PraybillVO>> entry : groupMap.entrySet()) {
|
||||||
|
List<PraybillVO> group = entry.getValue();
|
||||||
|
|
||||||
|
// 修改1:使用ISuperVO列表收集子对象
|
||||||
|
List<PraybillItemVO> mergedChildren = new ArrayList<PraybillItemVO>();
|
||||||
|
for (PraybillVO vo : group) {
|
||||||
|
for (PraybillItemVO child : vo.getBVO()) {
|
||||||
|
mergedChildren.add(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mergedChildren.isEmpty()){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
PraybillVO newVO = new PraybillVO();
|
||||||
|
newVO.setParent(group.get(0).getHVO());
|
||||||
|
// 修改2:转换为ISuperVO数组
|
||||||
|
newVO.setChildren(PickmItemVO.class, mergedChildren.toArray(new PraybillItemVO[0]));
|
||||||
|
|
||||||
|
resultList.add(newVO);
|
||||||
|
}
|
||||||
|
return resultList.toArray(new PraybillVO[0]);
|
||||||
|
// return inVOS;
|
||||||
}
|
}
|
||||||
private String getValueByCondtion(String tablename, String fieldname, String contion) throws BusinessException {
|
private String getValueByCondtion(String tablename, String fieldname, String contion) throws BusinessException {
|
||||||
BaseDAO dao = new BaseDAO();
|
BaseDAO dao = new BaseDAO();
|
||||||
|
@ -190,21 +220,21 @@ public class PickmToBuyingreqAction implements ICommonAction {
|
||||||
|
|
||||||
|
|
||||||
public AggPickmVO[] processAggVOs(AggPickmVO[] aggVOs) throws DAOException {
|
public AggPickmVO[] processAggVOs(AggPickmVO[] aggVOs) throws DAOException {
|
||||||
Map<Object, List<AggPickmVO>> groupMap = new HashMap<>();
|
// Map<Object, List<AggPickmVO>> groupMap = new HashMap<>();
|
||||||
|
//
|
||||||
for (AggPickmVO vo : aggVOs) {
|
// for (AggPickmVO vo : aggVOs) {
|
||||||
Object pk_org = vo.getParentVO().getPk_org();
|
// Object pk_org = vo.getParentVO().getPk_org();
|
||||||
groupMap.computeIfAbsent(pk_org, k -> new ArrayList<>()).add(vo);
|
// groupMap.computeIfAbsent(pk_org, k -> new ArrayList<>()).add(vo);
|
||||||
}
|
// }
|
||||||
|
|
||||||
List<AggPickmVO> resultList = new ArrayList<>();
|
List<AggPickmVO> resultList = new ArrayList<>();
|
||||||
|
|
||||||
for (Map.Entry<Object, List<AggPickmVO>> entry : groupMap.entrySet()) {
|
// for (Map.Entry<Object, List<AggPickmVO>> entry : groupMap.entrySet()) {
|
||||||
List<AggPickmVO> group = entry.getValue();
|
// List<AggPickmVO> group = entry.getValue();
|
||||||
|
|
||||||
// 修改1:使用ISuperVO列表收集子对象
|
// 修改1:使用ISuperVO列表收集子对象
|
||||||
List<PickmItemVO> mergedChildren = new ArrayList<PickmItemVO>();
|
List<PickmItemVO> mergedChildren = new ArrayList<PickmItemVO>();
|
||||||
for (AggPickmVO vo : group) {
|
for (AggPickmVO vo : aggVOs) {
|
||||||
PickmItemVO[] items = (PickmItemVO[]) vo.getChildren(PickmItemVO.class);
|
PickmItemVO[] items = (PickmItemVO[]) vo.getChildren(PickmItemVO.class);
|
||||||
if (items != null) {
|
if (items != null) {
|
||||||
for (PickmItemVO child : items) {
|
for (PickmItemVO child : items) {
|
||||||
|
@ -297,23 +327,30 @@ public class PickmToBuyingreqAction implements ICommonAction {
|
||||||
}
|
}
|
||||||
//只合并项目专用料数据
|
//只合并项目专用料数据
|
||||||
if(child.getBprojectmaterial().booleanValue()){
|
if(child.getBprojectmaterial().booleanValue()){
|
||||||
mergedChildren.add(child);
|
// mergedChildren.add(child);
|
||||||
|
List<PickmItemVO> pickmItemVOList = new ArrayList<PickmItemVO>();
|
||||||
|
pickmItemVOList.add(child);
|
||||||
|
AggPickmVO newVO = new AggPickmVO();
|
||||||
|
newVO.setParent(vo.getParent());
|
||||||
|
// 修改2:转换为ISuperVO数组
|
||||||
|
newVO.setChildren(PickmItemVO.class, pickmItemVOList.toArray(new PickmItemVO[0]));
|
||||||
|
resultList.add(newVO);
|
||||||
}
|
}
|
||||||
// CircularlyAccessibleValueObject 实现了 ISuperVO
|
// CircularlyAccessibleValueObject 实现了 ISuperVO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(mergedChildren.size() == 0){
|
// if(mergedChildren.size() == 0){
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
AggPickmVO newVO = new AggPickmVO();
|
// AggPickmVO newVO = new AggPickmVO();
|
||||||
newVO.setParent(group.get(0).getParentVO());
|
// newVO.setParent(group.get(0).getParentVO());
|
||||||
// ÐÞ¸Ä2£º×ª»»ÎªISuperVOÊý×é
|
// // 修改2:转换为ISuperVO数组
|
||||||
newVO.setChildren(PickmItemVO.class, mergedChildren.toArray(new PickmItemVO[0]));
|
// newVO.setChildren(PickmItemVO.class, mergedChildren.toArray(new PickmItemVO[0]));
|
||||||
|
//
|
||||||
resultList.add(newVO);
|
// resultList.add(newVO);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return resultList.toArray(new AggPickmVO[0]);
|
return resultList.toArray(new AggPickmVO[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,6 +158,7 @@ public class PickmToPmo implements ICommonAction {
|
||||||
if (MMValueCheck.isEmpty(inVOS)) {
|
if (MMValueCheck.isEmpty(inVOS)) {
|
||||||
ExceptionUtils.wrapBusinessException("备料计划转换流程生产订单失败");
|
ExceptionUtils.wrapBusinessException("备料计划转换流程生产订单失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (PMOAggVO inVO : inVOS) {
|
for (PMOAggVO inVO : inVOS) {
|
||||||
// 其它入库单的仓库、交易类型取自【业务参数设置】的默认值
|
// 其它入库单的仓库、交易类型取自【业务参数设置】的默认值
|
||||||
PMOHeadVO head = inVO.getParentVO();
|
PMOHeadVO head = inVO.getParentVO();
|
||||||
|
@ -196,7 +197,34 @@ public class PickmToPmo implements ICommonAction {
|
||||||
}
|
}
|
||||||
// head.setCwarehouseid("");
|
// head.setCwarehouseid("");
|
||||||
}
|
}
|
||||||
return inVOS;
|
List<PMOAggVO> resultList = new ArrayList<>();
|
||||||
|
Map<Object, List<PMOAggVO>> groupMap = new HashMap<>();
|
||||||
|
|
||||||
|
for (PMOAggVO vo : inVOS) {
|
||||||
|
Object pk_org = vo.getParentVO().getPk_org();
|
||||||
|
groupMap.computeIfAbsent(pk_org, k -> new ArrayList<>()).add(vo);
|
||||||
|
}
|
||||||
|
for (Map.Entry<Object, List<PMOAggVO>> entry : groupMap.entrySet()) {
|
||||||
|
List<PMOAggVO> group = entry.getValue();
|
||||||
|
|
||||||
|
// 修改1:使用ISuperVO列表收集子对象
|
||||||
|
List<PMOItemVO> mergedChildren = new ArrayList<PMOItemVO>();
|
||||||
|
for (PMOAggVO vo : group) {
|
||||||
|
for (PMOItemVO child : vo.getChildrenVO()) {
|
||||||
|
mergedChildren.add(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mergedChildren.isEmpty()){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
PMOAggVO newVO = new PMOAggVO();
|
||||||
|
newVO.setParent(group.get(0).getParentVO());
|
||||||
|
// 修改2:转换为ISuperVO数组
|
||||||
|
newVO.setChildren(PickmItemVO.class, mergedChildren.toArray(new PMOItemVO[0]));
|
||||||
|
|
||||||
|
resultList.add(newVO);
|
||||||
|
}
|
||||||
|
return resultList.toArray(new PMOAggVO[0]);
|
||||||
}
|
}
|
||||||
private UFDateTime getnextmonth(UFDateTime date) {
|
private UFDateTime getnextmonth(UFDateTime date) {
|
||||||
if (date == null) {
|
if (date == null) {
|
||||||
|
@ -231,21 +259,21 @@ public class PickmToPmo implements ICommonAction {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
public AggPickmVO[] processAggVOs(AggPickmVO[] aggVOs) throws DAOException {
|
public AggPickmVO[] processAggVOs(AggPickmVO[] aggVOs) throws DAOException {
|
||||||
Map<Object, List<AggPickmVO>> groupMap = new HashMap<>();
|
// Map<Object, List<AggPickmVO>> groupMap = new HashMap<>();
|
||||||
|
//
|
||||||
for (AggPickmVO vo : aggVOs) {
|
// for (AggPickmVO vo : aggVOs) {
|
||||||
Object pk_org = vo.getParentVO().getPk_org();
|
// Object pk_org = vo.getParentVO().getPk_org();
|
||||||
groupMap.computeIfAbsent(pk_org, k -> new ArrayList<>()).add(vo);
|
// groupMap.computeIfAbsent(pk_org, k -> new ArrayList<>()).add(vo);
|
||||||
}
|
// }
|
||||||
|
|
||||||
List<AggPickmVO> resultList = new ArrayList<>();
|
List<AggPickmVO> resultList = new ArrayList<>();
|
||||||
|
|
||||||
for (Map.Entry<Object, List<AggPickmVO>> entry : groupMap.entrySet()) {
|
// for (Map.Entry<Object, List<AggPickmVO>> entry : groupMap.entrySet()) {
|
||||||
List<AggPickmVO> group = entry.getValue();
|
// List<AggPickmVO> group = entry.getValue();
|
||||||
|
|
||||||
// 修改1:使用ISuperVO列表收集子对象
|
// 修改1:使用ISuperVO列表收集子对象
|
||||||
List<PickmItemVO> mergedChildren = new ArrayList<PickmItemVO>();
|
List<PickmItemVO> mergedChildren = new ArrayList<PickmItemVO>();
|
||||||
for (AggPickmVO vo : group) {
|
for (AggPickmVO vo : aggVOs) {
|
||||||
PickmItemVO[] items = (PickmItemVO[]) vo.getChildren(PickmItemVO.class);
|
PickmItemVO[] items = (PickmItemVO[]) vo.getChildren(PickmItemVO.class);
|
||||||
if (items != null) {
|
if (items != null) {
|
||||||
for (PickmItemVO child : items) {
|
for (PickmItemVO child : items) {
|
||||||
|
@ -329,23 +357,29 @@ public class PickmToPmo implements ICommonAction {
|
||||||
}
|
}
|
||||||
//只合并项目专用料数据
|
//只合并项目专用料数据
|
||||||
if(child.getBprojectmaterial().booleanValue()){
|
if(child.getBprojectmaterial().booleanValue()){
|
||||||
mergedChildren.add(child);
|
List<PickmItemVO> pickmItemVOList = new ArrayList<PickmItemVO>();
|
||||||
|
pickmItemVOList.add(child);
|
||||||
|
AggPickmVO newVO = new AggPickmVO();
|
||||||
|
newVO.setParent(vo.getParent());
|
||||||
|
// 修改2:转换为ISuperVO数组
|
||||||
|
newVO.setChildren(PickmItemVO.class, pickmItemVOList.toArray(new PickmItemVO[0]));
|
||||||
|
resultList.add(newVO);
|
||||||
}
|
}
|
||||||
// CircularlyAccessibleValueObject 实现了 ISuperVO
|
// CircularlyAccessibleValueObject 实现了 ISuperVO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(mergedChildren.size() == 0){
|
// if(resultList.size() == 0){
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
AggPickmVO newVO = new AggPickmVO();
|
// AggPickmVO newVO = new AggPickmVO();
|
||||||
newVO.setParent(group.get(0).getParentVO());
|
// newVO.setParent(group.get(0).getParentVO());
|
||||||
// ÐÞ¸Ä2£º×ª»»ÎªISuperVOÊý×é
|
// // 修改2:转换为ISuperVO数组
|
||||||
newVO.setChildren(PickmItemVO.class, mergedChildren.toArray(new PickmItemVO[0]));
|
// newVO.setChildren(PickmItemVO.class, mergedChildren.toArray(new PickmItemVO[0]));
|
||||||
|
//
|
||||||
resultList.add(newVO);
|
// resultList.add(newVO);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return resultList.toArray(new AggPickmVO[0]);
|
return resultList.toArray(new AggPickmVO[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue