|
@@ -1345,6 +1345,89 @@ public class YongyouServiceImpl implements YongyouService {
|
|
|
return myVOPage;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AbstractPageResultBean<SpareStoreVO> selectPageList4(SpareStoreDTO record, int pageNum, int pageSize) {
|
|
|
+ // 已生成情况,直接推送
|
|
|
+ GetCurrentStockHandler2 handler = new GetCurrentStockHandler2();
|
|
|
+ GetCurrentStockRequest req = new GetCurrentStockRequest();
|
|
|
+ req.setToken(geToken(record.getTokenType()));
|
|
|
+ req.setConn(getConn2(record.getTokenType()));
|
|
|
+ boolean isDev = BeanUtils.isDev();
|
|
|
+ if(!isDev){
|
|
|
+ if (record.getTokenType()==1){
|
|
|
+ req.setCAcc_ID("005");
|
|
|
+ }else if (record.getTokenType()==2){
|
|
|
+ req.setCAcc_ID("004");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ req.setCAcc_ID("993");
|
|
|
+ }
|
|
|
+ req.setPageNum(pageNum);
|
|
|
+ req.setPageSize(pageSize);
|
|
|
+ StringBuffer whereStr = new StringBuffer(" 1=1 ");
|
|
|
+ // 仓库编码搜索
|
|
|
+ if (StringUtils.isNotBlank(record.getStoreNo())) {
|
|
|
+ whereStr.append(" and cWhCode like '%" + record.getStoreNo() + "%' ");
|
|
|
+ }
|
|
|
+ // 仓库名称搜索
|
|
|
+ if (StringUtils.isNotBlank(record.getStoreName())) {
|
|
|
+ whereStr.append(" and cWhName like '%" + record.getStoreName() + "%' ");
|
|
|
+ }
|
|
|
+ // 存货编码搜索
|
|
|
+ if (StringUtils.isNotBlank(record.getSpareNo())) {
|
|
|
+ whereStr.append(" and cInvCode like '%" + record.getSpareNo() + "%' ");
|
|
|
+ }
|
|
|
+ // 存货名称搜索
|
|
|
+ if (StringUtils.isNotBlank(record.getSpareName())) {
|
|
|
+ whereStr.append(" and cInvName like '%" + record.getSpareName() + "%' ");
|
|
|
+ }
|
|
|
+ // 规格型号搜索
|
|
|
+ if (StringUtils.isNotBlank(record.getGgxh())) {
|
|
|
+ whereStr.append(" and cInvStd like '%" + record.getGgxh() + "%' ");
|
|
|
+ }
|
|
|
+ if(record.getPurchaseFlag() == null || record.getPurchaseFlag() == 2){
|
|
|
+ // 非采购请求数据
|
|
|
+ whereStr.append(" and iQuantity > 0 ");
|
|
|
+ }
|
|
|
+ req.setStrWhere(whereStr.toString());
|
|
|
+ handler.setRequest(req);
|
|
|
+ String responseStr = handler.handler();
|
|
|
+ GetCurrentStockResponse response = JSONObject.parseObject(responseStr, GetCurrentStockResponse.class);
|
|
|
+ if (!response.getResult()) {
|
|
|
+ throw new BusinessException(response.getMsg());
|
|
|
+ }
|
|
|
+ GetCurrentStockResponseData data = response.getData();
|
|
|
+ List<GetCurrentStock> stocks = data.getStock();
|
|
|
+ List<SpareStoreVO> partInfoVOS = new ArrayList<>();
|
|
|
+ for (GetCurrentStock stockResponse : stocks) {
|
|
|
+ SpareStoreVO partInfoVO = new SpareStoreVO();
|
|
|
+ partInfoVO.setId(stockResponse.getAutoId() + "");
|
|
|
+ partInfoVO.setNo(stockResponse.getCInvCode());
|
|
|
+ partInfoVO.setSpareId(stockResponse.getPartId() + "");
|
|
|
+ partInfoVO.setSpareName(stockResponse.getCInvName());
|
|
|
+ partInfoVO.setGgxh(stockResponse.getCInvStd());
|
|
|
+ partInfoVO.setNum(stockResponse.getIQuantity());
|
|
|
+ partInfoVO.setStoreName(stockResponse.getCWhName());
|
|
|
+ partInfoVO.setStoreId(stockResponse.getCWhCode());
|
|
|
+ partInfoVO.setUnit(stockResponse.getCComUnitName());
|
|
|
+ partInfoVO.setCBatch(stockResponse.getCBatch());
|
|
|
+ partInfoVO.setAutoId(stockResponse.getAutoId());
|
|
|
+ partInfoVO.setStorePosition(stockResponse.getCInvDefine1());
|
|
|
+ partInfoVOS.add(partInfoVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ //PageHelper.startPage(pageNum, pageSize);
|
|
|
+ MyVOPage<SpareStoreVO> myVOPage = new MyVOPage<>();
|
|
|
+ myVOPage.setPageNum(pageNum);
|
|
|
+ myVOPage.setPageSize(pageSize);
|
|
|
+ Page page = new Page(pageNum, pageSize);
|
|
|
+ page.setTotal(data.getTotal());
|
|
|
+ myVOPage.setPages(data.getPages().intValue());
|
|
|
+ myVOPage.setTotal(page.getTotal());
|
|
|
+ myVOPage.setRows(partInfoVOS);
|
|
|
+ return myVOPage;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 提交出库单到用友
|
|
|
*
|