This commit is contained in:
parent
c985a1deb3
commit
c28339a91c
|
@ -41,6 +41,7 @@ import javax.ws.rs.Consumes;
|
|||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -75,6 +76,16 @@ public class CloseSoResource extends AbstractNCCRestResource {
|
|||
ISaleOrderQueryAPI iSaleOrderQueryAPI= NCLocator.getInstance()
|
||||
.lookup(ISaleOrderQueryAPI.class);
|
||||
SaleOrderVO[] billvos = iSaleOrderQueryAPI.queryVOByIDs(ids);
|
||||
billvos = Arrays.stream(billvos)
|
||||
.filter(vo -> vo.getParentVO().getFstatusflag() != 4)
|
||||
.toArray(SaleOrderVO[]::new);
|
||||
if(billvos.length == 0){
|
||||
errojson.put("status", "1");
|
||||
errojson.put("message", "单据已经被关闭");
|
||||
errojson.put("codeList", "");
|
||||
return ResultMessageUtil.toJSON(errojson);
|
||||
|
||||
}
|
||||
// ISCMBatchOprContext context = new SCMBatchOprContext();
|
||||
// context.setInterfaceName("nc.itf.so.m30.closemanage.ISaleOrderCloseManageMaintain");
|
||||
// context.setMethodName("closeSaleOrder");
|
||||
|
@ -87,10 +98,10 @@ public class CloseSoResource extends AbstractNCCRestResource {
|
|||
.lookup(ISaleOrderCloseManageMaintain.class);
|
||||
SaleOrderVO[] saleOrderVOS= iSaleOrderCloseManageMaintain.closeSaleOrder(billvos);
|
||||
if(saleOrderVOS.length == 0){
|
||||
errojson.put("status", "0");
|
||||
errojson.put("message", "¹Ø±Õʧ°Ü");
|
||||
errojson.put("codeList", "");
|
||||
return ResultMessageUtil.toJSON(errojson);
|
||||
errojson.put("status", "0");
|
||||
errojson.put("message", "关闭失败");
|
||||
errojson.put("codeList", "");
|
||||
return ResultMessageUtil.toJSON(errojson);
|
||||
|
||||
}
|
||||
errojson.put("status", "1");
|
||||
|
@ -130,7 +141,22 @@ public class CloseSoResource extends AbstractNCCRestResource {
|
|||
// 直接获取每个元素的字符串形式
|
||||
stringArray[i] = array.getString(i);
|
||||
}
|
||||
SaleOrderViewVO[] result = this.buttonClick(stringArray, "billOpen");
|
||||
|
||||
SaleOrderViewVO[] vos = queryViewByBIDs(stringArray, "");
|
||||
CombineViewToAggUtil<SaleOrderVO> combineViewToAggUtil = new CombineViewToAggUtil(SaleOrderVO.class, SaleOrderHVO.class, SaleOrderBVO.class);
|
||||
SaleOrderVO[] bills = (SaleOrderVO[])combineViewToAggUtil.combineViewToAgg(vos, "csaleorderid");
|
||||
|
||||
bills = Arrays.stream(bills)
|
||||
.filter(vo -> vo.getParentVO().getFstatusflag() == 4)
|
||||
.toArray(SaleOrderVO[]::new);
|
||||
if(bills.length == 0){
|
||||
errojson.put("status", "1");
|
||||
errojson.put("message", "打开成功");
|
||||
errojson.put("codeList", "");
|
||||
// 返回表示操作成功的JSON字符串
|
||||
return ResultMessageUtil.toJSON(errojson);
|
||||
}
|
||||
SaleOrderViewVO[] result = this.buttonClick(bills, "billOpen");
|
||||
if (result.length == 0 ){
|
||||
errojson.put("status", "0");
|
||||
errojson.put("message", "打开失败");
|
||||
|
@ -172,10 +198,7 @@ public class CloseSoResource extends AbstractNCCRestResource {
|
|||
|
||||
|
||||
|
||||
public static SaleOrderViewVO[] buttonClick(String [] bids, String buttonType) throws BusinessException {
|
||||
SaleOrderViewVO[] vos = queryViewByBIDs(bids, "");
|
||||
CombineViewToAggUtil<SaleOrderVO> combineViewToAggUtil = new CombineViewToAggUtil(SaleOrderVO.class, SaleOrderHVO.class, SaleOrderBVO.class);
|
||||
SaleOrderVO[] bills = (SaleOrderVO[])combineViewToAggUtil.combineViewToAgg(vos, "csaleorderid");
|
||||
public static SaleOrderViewVO[] buttonClick(SaleOrderVO[] bills, String buttonType) throws BusinessException {
|
||||
ISaleOrderCloseMaintainService service=NCLocator.getInstance()
|
||||
.lookup(ISaleOrderCloseMaintainService.class);
|
||||
SaleOrderViewVO[] saleOrderViewVOS= service.billOpen(bills,false);
|
||||
|
|
Loading…
Reference in New Issue