Commit e38678f2 authored by 刘学辉's avatar 刘学辉

物料主数据、异常报告单调整

parent 65b00418
......@@ -135,7 +135,7 @@ columns = [
type: 'system',
name: "sapCustomerProduceNo",
getParam: function (item) {
return {werks:$("#werks").val(),kunnr: $("#customerNo").val(),vbeln:$("#customerOrderNo").val()}
return {werks:$("#werks").val(),kunnr: $("#customerNo").val(),vbeln:$("#customerOrderNo").val()}
},
back: {
AUFNR: "produceNo",
......@@ -149,29 +149,29 @@ columns = [
}
}
},
{display: "产品编码", name: "productCode", width: "160", align: "left", type: "string",
editor: {type: 'text'}
{display: "产品编码", name: "productCode", width: "160", align: "left", type: "string"
//,editor: {type: 'text'}
},
{display: "产品名称", name: "productName", width: "200", align: "left", type: "string",
editor: {type: 'text'}
{display: "产品名称", name: "productName", width: "200", align: "left", type: "string"
//,editor: {type: 'text'}
},
{display: "数量", name: "number", width: "100", align: "left", type: "string",
editor: {type: "text",mask: '9999999.999'}
{display: "数量", name: "number", width: "100", align: "left", type: "string"
//,editor: {type: "text",mask: '9999999.999'}
},
{display: "单位", name: "unitName", width: "80", align: "left", type: "string",
editor: {type: "text"}
{display: "单位", name: "unitName", width: "80", align: "left", type: "string"
//editor: {type: "text"}
},
{display: "币别", name: "currencyName", width: "100", align: "left", type: "string",
editor: {type: "text"}
{display: "币别", name: "currencyName", width: "100", align: "left", type: "string"
//editor: {type: "text"}
},
{display: "金额", name: "money", width: "100", align: "left", type: "string",
editor: {type: "text",mask: '9999999.999'}
{display: "金额", name: "money", width: "100", align: "left", type: "string"
//editor: {type: "text",mask: '9999999.999'}
},
{display: "折算人民币金额", name: "rmbMoney", width: "100", align: "left", type: "string",
editor: {type: "text",mask: '9999999.999'}
},
{display: "出货日期", name: "sendDate", width: "140", align: "left", type: "date",
editor: {type: "date"}
{display: "出货日期", name: "sendDate", width: "140", align: "left", type: "date"
//editor: {type: "date"}
}
]
return columns;
......
......@@ -258,37 +258,41 @@
<x:selectC name="beskz" label="获取类型" labelCol="1" fieldCol="2" dictionary="beskz" required="false"/>
<x:selectC name="sobsl" label="特殊获取方式" labelCol="1" fieldCol="2" dictionary="sobsl" required="false"/>
<x:inputC name="lgproName" label="默认生产库存地" labelCol="2" fieldCol="2" wrapper="select"/>
<x:hidden name="lgpro"/>
<x:inputC name="lgfsbName" label="默认采购收货库存地" labelCol="2" fieldCol="3" wrapper="select"/>
<x:hidden name="lgfsb"/>
<x:selectC name="rgekz" label="倒冲标志" labelCol="1" fieldCol="2" dictionary="rgekz"/>
<x:inputC name="webaz" label="收货处理天数" labelCol="1" fieldCol="2"/>
<x:inputC name="dzeit" label="自制时间" labelCol="1" fieldCol="2"/>
<x:inputC name="fhori" label="排程边际码" labelCol="1" fieldCol="1" required="false"/>
<x:inputC name="plifz" label="外部采购交货时间" labelCol="2" fieldCol="2"/>
<x:inputC name="fhori" label="排程边际码" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="eisbe" label="安全库存" labelCol="1" fieldCol="1" required="false"/>
<x:inputC name="eislo" label="最小安全库存" labelCol="1" fieldCol="1"/>
<x:inputC name="eisbe" label="安全库存" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="eislo" label="最小安全库存" labelCol="1" fieldCol="2"/>
<x:selectC name="strgr" label="策略组" labelCol="1" fieldCol="2" dictionary="strgr"/>
<x:inputC name="wzeit" label="补货提前天数" labelCol="1" fieldCol="1" mask="999"/>
<x:selectC name="sbdkz" label="独立/集中" labelCol="1" fieldCol="1" dictionary="sbdkz"/>
<x:selectC name="diskz" label="库存地MRP标识" labelCol="2" fieldCol="2" dictionary="diskz"/>
<x:inputC name="wzeit" label="补货提前天数" labelCol="1" fieldCol="2" mask="999"/>
<x:selectC name="sbdkz" label="独立/集中" labelCol="1" fieldCol="2" dictionary="sbdkz"/>
<x:selectC name="vrmod" label="消耗模式" labelCol="1" fieldCol="2" dictionary="vrmod"/>
<x:inputC name="vint1" label="逆推消耗期间" labelCol="1" fieldCol="2" mask="99999"/>
<x:inputC name="vint2" label="顺推消耗期间" labelCol="1" fieldCol="2" mask="99999"/>
<x:selectC name="miskz" label="综合MRP" labelCol="1" fieldCol="2" dictionary="MISKZ"/>
<x:selectC name="vrmod" label="消耗模式" labelCol="1" fieldCol="2" dictionary="vrmod"/>
<x:inputC name="vint1" label="逆推消耗期间" labelCol="1" fieldCol="2" mask="99999"/>
<x:inputC name="vint2" label="顺推消耗期间" labelCol="1" fieldCol="2" mask="99999"/>
<x:selectC name="miskz" label="综合MRP" labelCol="1" fieldCol="2" dictionary="MISKZ"/>
<x:selectC name="perkz" label="期间标识" labelCol="1" fieldCol="2" dictionary="perkz"/>
<x:inputC name="plifz" label="外采交货时间" labelCol="1" fieldCol="2"/>
<x:selectC name="perkz" label="期间标识" labelCol="1" fieldCol="2" dictionary="perkz"/>
</div>
</div>
<div class="hg-form-row">
<x:selectC name="diskz" label="库存地MRP标识" labelCol="2" fieldCol="2" dictionary="diskz"/>
<x:inputC name="lgproName" label="默认生产库存地" labelCol="2" fieldCol="2" wrapper="select"/>
<x:hidden name="lgpro"/>
<x:inputC name="lgfsbName" label="默认采购收货库存地" labelCol="2" fieldCol="2" wrapper="select"/>
<x:hidden name="lgfsb"/>
</div>
</div>
<div class="hg-form-cols" id="produceDiv">
<x:title title="生产" name="group"/>
......@@ -296,8 +300,11 @@
<x:inputC name="ausme" label="投料计量单位" labelCol="1" fieldCol="2"/>
<x:inputC name="umrenProd" label="转换分母(生产)" labelCol="2" fieldCol="2"/>
<x:inputC name="umrezProd" label="转换分子(生产)" labelCol="2" fieldCol="2"/>
<x:selectC name="sfcpf" label="生产计划参数文件" labelCol="2" fieldCol="2" dictionary="sfcpf"/>
</div>
<div class="hg-form-row">
<x:inputC name="fevor" label="生产主管" labelCol="1" fieldCol="2"/>
<x:selectC name="sfcpf" label="生产计划参数文件" labelCol="2" fieldCol="2" dictionary="sfcpf"/>
</div>
</div>
......@@ -336,14 +343,14 @@
<x:inputC name="lety1" label="仓库设施1类型" labelCol="1" fieldCol="1" required="false" readonly="true"/>
<x:inputC name="lhmg1" label="仓库设施1存储数量" labelCol="2" fieldCol="1" required="false" mask="99999999"/>
<x:inputC name="lhme1Name" label="仓库设施1存储单位" labelCol="2" fieldCol="1" required="false" wrapper="select"/>
<x:hidden name="lhme1"/>
<x:inputC name="ltkzeName" label="存货上架存储类型" labelCol="2" fieldCol="2" required="false" wrapper="select"/>
<x:hidden name="ltkze"/>
<%-- <x:inputC name="lgbkzName" label="存储分区标识" labelCol="1" fieldCol="2" required="true" wrapper="select"/>--%>
<x:hidden name="lgbkz" value="001"/>
<x:inputC name="lhme1Name" label="仓库设施1存储单位" labelCol="2" fieldCol="2" required="false" wrapper="select"/>
<x:hidden name="lhme1"/>
</div>
</div>
......@@ -352,21 +359,20 @@
<div class="hg-form-row">
<!--x:selectC name="bklas" label="评估分类" labelCol="1" fieldCol="2" dictionary="bklas"/-->
<x:inputC name="bklas" label="评估分类" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="bklas" label="评估分类" labelCol="2" fieldCol="1" readonly="true"/>
<!--x:inputC name="mlast" label="价格确定" labelCol="1" fieldCol="2" required="false"/-->
<x:selectC name="vprsv" label="价格控制" labelCol="1" fieldCol="2" dictionary="vprsv" />
<x:selectC name="mlast" label="价格确定" labelCol="1" fieldCol="2" dictionary="mlast"/>
<x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/>
<x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/>
<x:selectC name="ncost" label="不参与成本核算" labelCol="2" fieldCol="1" dictionary="xchpf"/>
<x:selectC name="hkmat" label="物料来源" labelCol="1" fieldCol="2" dictionary="xchpf"/>
<x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/>
<x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:selectC name="ekalr" label="根据数量结构进行成本核算" labelCol="2" fieldCol="1" dictionary="xchpf"/>
<x:inputC name="awsls" label="差异码" labelCol="1" fieldCol="2"/>
<x:inputC name="eklas" label="销售评估类" labelCol="1" fieldCol="2"/>
</div>
......
......@@ -172,6 +172,7 @@ function bindEvent(){
UICtrl.disable($("#matnr"));
$("#sortl").val("");
UICtrl.disable($("#sortl"));
UICtrl.setElRequiredFlag("#sortl",false);
}
}
});
......
......@@ -544,10 +544,10 @@ function doSaveDefine() {
Public.tip("物料描述必须填写!");
return false;
}
if ($("#matnr").val()==""&&$("#sortl").val()==""){
Public.tip("排序字段必须填写!");
return false;
}
// if ($("#matnr").val()==""&&$("#sortl").val()==""){
// Public.tip("排序字段必须填写!");
// return false;
// }
if (MathUtil.compare($("#norbm").val(),$("#minbm").val())<0){
Public.tip("标准采购订单数量必须大于最小采购订单量!");
return false;
......
......@@ -222,24 +222,14 @@ public class ResourceSearchController {
@EasySearch(queryName = "sapCustomerOrderSelect")
public Map<String, Object> sapCustomerOrderSelect(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String werks = sdo.getString("werks");
String kunnr = sdo.getString("kunnr");
SapDialogOrderQuery queryRequest = sdo.toObject(SapDialogOrderQuery.class);
//queryRequest.setWerks(filterValue);
queryRequest.setKunnr(kunnr);
queryRequest.setWerks(werks);
SapDialogOrderQuery queryRequest = sdo.toObject(SapDialogOrderQuery.class);
List <Map<String,String>>mapList = sapMaterialApplication.getSapCustomerOrder(queryRequest);
// List<SapOrderVo> orderList=new ArrayList<>();
// for (int x=0;x<mapList.size();x++){
// orderList.add((SapOrderVo)mapList.get(x));
// }
if (CollectionUtil.isNotEmpty(mapList)){
if (StringUtil.isNotBlank(kunnr)){//固定条件过滤,比如选了工厂后,只能读取改工厂下的物料组
if (StringUtil.isNotBlank(param)){//固定条件过滤,
mapList = mapList
.stream()
.filter(map -> !map.containsValue(kunnr))
.filter(map -> map.values().stream().anyMatch(value->value.contains(param)))
.collect(Collectors.toList());
}
}
......@@ -264,28 +254,9 @@ public class ResourceSearchController {
@EasySearch(queryName = "sapCustomerProduceNo")
public Map<String, Object> sapCustomerProduceNo(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String filterValue = sdo.getString("filterValue");
String kunnr = sdo.getString("kunnr");
String werks = sdo.getString("werks");
String vbeln = sdo.getString("vbeln");
SapDialogOrderQuery queryRequest = sdo.toObject(SapDialogOrderQuery.class);
queryRequest.setWerks(werks);
queryRequest.setKunnr(kunnr);
queryRequest.setVbeln(vbeln);
List <Map<String,String>>mapList = sapMaterialApplication.getSapCustomerOrder(queryRequest);
if (CollectionUtil.isNotEmpty(mapList)){
if (StringUtil.isNotBlank(kunnr)){//固定条件过滤,比如选了工厂后,只能读取改工厂下的物料组
mapList = mapList
.stream()
.filter(map -> !map.containsValue(kunnr))
.collect(Collectors.toList());
}
}
// List <Map<String,String>> list=(List <Map<String,String>>)mapList.get(0).get("ITEM");
Integer intPage = sdo.getInteger("intPage", 1);
Integer pageSize = sdo.getInteger("pageSize",10);
PageRequest pageRequest = new PageRequest(intPage - 1, pageSize);
......@@ -301,10 +272,7 @@ public class ResourceSearchController {
new QuerySchemeField("币别", "KOEIN", "string", 100L),
new QuerySchemeField("金额", "KWERT", "string", 200L),
new QuerySchemeField("出货日期", "EDATU", "string", 100L)
// new QuerySchemeField("基本计量单位名称", "MSEHL", "string", 100L),
// new QuerySchemeField("采购组", "EKGRP", "string", 100L),
// new QuerySchemeField("采购组名称", "EKNAM", "string", 200L),
// new QuerySchemeField("价格基数", "PEINH", "string", 100L)
);
easySearchParse.setFields(fields);
easySearchParse.setWidth(500L);
......
......@@ -21,6 +21,8 @@ public interface SapPurchaseInfoRecordItemApplication {
List<SapPurchaseInfoRecordItem> findBySapPurchaseInfoRecordId(String sapPurchaseInfoRecordId);
List <SapPurchaseInfoRecordItem> querySapPurchaseInfoRecordItemByMaytkl(SapPurchaseInfoRecordQueryRequest query);
void save(SapPurchaseInfoRecordItem sapPurchaseInfoRecordItem);
Map<String, Object> querySapPurchaseInfoRecordItemByIds(SapPurchaseInfoRecordQueryRequest request);
......
......@@ -74,7 +74,6 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
sapPurchaseInfoRecord = sapPurchaseInfoRecordRepository.save(sapPurchaseInfoRecord);
List<SapPurchaseInfoRecordItem> sapPurchaseInfoRecordItems = getBizEntities(SapPurchaseInfoRecordItem.class, "sapPurchaseInfoRecordItems");
sapPurchaseInfoRecordItemApplication.saveSapPurchaseInfoRecordItem(sapPurchaseInfoRecord.getId(),sapPurchaseInfoRecordItems);
return sapPurchaseInfoRecord.getId();
}
......@@ -151,8 +150,13 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
//物料编码为空 排序字段 传SAP FYL+7位流水号
if (StringUtils.isBlank(sapPurchaseInfoRecordItemVo.getMatnr())
&&StringUtils.isBlank(sapPurchaseInfoRecordItemVo.getSortl())) {
synchronized(this) {
//根据供应商和物料组来查询是否推送成功过,如果成功过 则设置序号 并累加1
SapPurchaseInfoRecordQueryRequest query=new SapPurchaseInfoRecordQueryRequest();
query.setLifnr(sapPurchaseInfoRecordItem.getLifnr());
query.setMatkl(sapPurchaseInfoRecordItem.getMatkl());
List list=sapPurchaseInfoRecordItemApplication.querySapPurchaseInfoRecordItemByMaytkl(query);
if (list.size()>0){
synchronized(this) {
String sql = "select t.* from code_rule t where t.RULE_KIND = ? for update";
CodeRule codeRule = this.sqlExecutorDao.queryToObject(sql, CodeRule.class, "sortl");
Integer currentValue = codeRule.getCurrentValue();
......@@ -166,10 +170,10 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
String sortNo = codeRule.getPrefix() + formatSerialNumber(currentValue, 7);
sapPurchaseInfoRecordItemVo.setSortl(sortNo);
}
sapPurchaseInfoRecordItem.setSortl(sapPurchaseInfoRecordItemVo.getSortl());
}
sapPurchaseInfoRecordItem.setSortl(sapPurchaseInfoRecordItemVo.getSortl());
}
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
if (sapPurchaseInfoRecordItem.getDatab() !=null){
String datab = dateFormat.format(sapPurchaseInfoRecordItem.getDatab());
......@@ -255,6 +259,7 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
queryModel.putDictionary("urzla", DictUtil.getDictionary("country"));
queryModel.putDictionary("loekz", DictUtil.getDictionary("loekz"));
queryModel.addCriteria(" order by fillin_date desc ");
return this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
......
......@@ -13,10 +13,7 @@ import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Auther: xin.lu
......@@ -60,7 +57,18 @@ public class SapPurchaseInfoRecordItemApplicationImpl extends BaseApplication im
Map<String, Object> map = this.sqlExecutorDao.executeSlicedQuery(queryModel);
return map;
}
@Override
public List<SapPurchaseInfoRecordItem> querySapPurchaseInfoRecordItemByMaytkl(SapPurchaseInfoRecordQueryRequest query) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "querySapPurchaseInfoRecordItemByMaytkl");
QueryModel model = this.sqlExecutorDao.getQueryModel(queryDescriptor, query);
model.setPageIndex(1);
model.setPageSize(10);
Map<String, Object> map = this.sqlExecutorDao.executeSlicedQuery(model);
List<SapPurchaseInfoRecordItem> list=new ArrayList<>();
list=(List<SapPurchaseInfoRecordItem>)map.get("Rows");
return list;
}
@Override
public void deleteByIds(List<String> ids) {
ids.forEach(id->{
......
......@@ -18,4 +18,5 @@ public class SapPurchaseInfoRecordQueryRequest extends QueryAbstractRequest {
private String lifnr;
private String matnr;
private String esokz;
private String matkl;
}
......@@ -13,4 +13,7 @@ import java.util.List;
public interface SapPurchaseInfoRecordItemRepository extends JpaRepository<SapPurchaseInfoRecordItem,String> {
List<SapPurchaseInfoRecordItem> findBySapPurchaseInfoRecordId(String sapPurchaseInfoRecordId);
}
package com.huigou.topsun.sap.sapApplication.application.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
......@@ -10,10 +9,12 @@ import com.huigou.topsun.sap.common.domain.SapResult;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogOrderQuery;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery;
import com.huigou.topsun.sap.sapApplication.application.SapMaterialApplication;
import com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo;
import com.huigou.topsun.sap.sapApplication.domain.vo.OrderQueryVo;
import com.huigou.topsun.sap.sapApplication.domain.vo.SignVo;
import com.huigou.topsun.util.SAPUtils;
import com.huigou.util.JSONUtil;
import com.huigou.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
......@@ -60,19 +61,38 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
public List<Map<String, String>> getSapCustomerOrder(SapDialogOrderQuery queryRequest) throws IOException {
List<Map<String,String>> sapOrderVoList= new ArrayList<>();
//String jsonParams="KUNNR:[{\"SIGN\": \"\",\"OPTION\": \"\",\"LOW\":"+queryRequest.getKunnr()+",\"HIGH\": \"\"}]";
StringBuffer sb = new StringBuffer("{");
if (StringUtils.isNotBlank(queryRequest.getWerks())) { //客户订单号
sb.append("'WERKS':[{'SIGN':'I','OPTION':'EQ','LOW':'").append(queryRequest.getWerks()).append("','HIGH':''}]");
OrderQueryVo orderQueryVo=new OrderQueryVo();
SignVo signVo=null;
if (StringUtils.isNotBlank(queryRequest.getWerks())) { //工厂
signVo=new SignVo();
signVo.setLow(queryRequest.getWerks());
List <SignVo> werksList=new ArrayList<>();
werksList.add(signVo);
orderQueryVo.setWERKS(werksList);
}
if (StringUtils.isNotBlank(queryRequest.getKunnr())) {
sb.append(",'KUNNR':[{'SIGN':'I','OPTION':'EQ','LOW':'").append(queryRequest.getKunnr()).append("','HIGH':''}]");
if (StringUtils.isNotBlank(queryRequest.getKunnr())) { //客户
signVo=new SignVo();
signVo.setLow(queryRequest.getKunnr());
List <SignVo> kunnrList=new ArrayList<>();
kunnrList.add(signVo);
orderQueryVo.setKUNNR(kunnrList);
if (StringUtils.isNotBlank(queryRequest.getParamValue())) { //过滤参数
signVo=new SignVo();
signVo.setLow("*"+queryRequest.getParamValue()+"*");
signVo.setOption("CP");
List <SignVo> vbelnList=new ArrayList<>();
vbelnList.add(signVo);
orderQueryVo.setVBELN(vbelnList);
}
}
if (StringUtils.isNotBlank(queryRequest.getVbeln())) { //客户销售订单号
sb.append(",'VBELN':[{'SIGN':'I','OPTION':'EQ','LOW':'").append(queryRequest.getVbeln()).append("','HIGH':''}]");
signVo=new SignVo();
signVo.setLow(queryRequest.getVbeln());
List <SignVo> vbelnList=new ArrayList<>();
vbelnList.add(signVo);
orderQueryVo.setVBELN(vbelnList);
}
sb.append("}");
Object obj = JSONArray.parse(sb.toString());
Object obj = JSONObject.toJSON(orderQueryVo);
try {
String json = httpClient.execute(obj, "SALES_ORDERS/SALES");
List<Map<String, Object>> mapList = JSONUtil.toListMap(json);
......@@ -80,22 +100,30 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
for (Map map : mapList) {
Map newMap = new HashMap();
List<Map<String, Object>> mapList2=(List<Map<String, Object>>)map.get("ITEM");
newMap.put("MATNR", mapList2.get(0).get("MATNR"));
newMap.put("MAKTX", mapList2.get(0).get("MAKTX"));
newMap.put("AUFNR", mapList2.get(0).get("AUFNR"));
newMap.put("PSMNG", mapList2.get(0).get("PSMNG")); //生产数量
newMap.put("EDATU", mapList2.get(0).get("EDATU")); //出货日期
// KPEIN //定价单位
newMap.put("KWERT", mapList2.get(0).get("KWERT")); // //折前总金额
newMap.put("KOEIN", mapList2.get(0).get("KOEIN")); // 币别
sapOrderVoList.add(newMap);
for (Map mapItem:mapList2) {
newMap.put("MATNR", mapItem.get("MATNR")); //物料编号
newMap.put("MAKTX", mapItem.get("MAKTX")); //物料名称
newMap.put("AUFNR", mapItem.get("AUFNR")); //生产单号
newMap.put("PSMNG", mapItem.get("PSMNG")); //生产数量
newMap.put("EDATU", mapItem.get("EDATU")); //出货日期
// KPEIN //定价单位
newMap.put("KWERT", mapItem.get("KWERT")); // //折前总金额
newMap.put("KOEIN", mapItem.get("KOEIN")); // 币别
if (StringUtils.isNotBlank(queryRequest.getParamValue())){ //过滤参数
if (mapItem.get("MATNR").toString().contains(queryRequest.getParamValue())
||mapItem.get("MAKTX").toString().contains(queryRequest.getParamValue())
||mapItem.get("AUFNR").toString().contains(queryRequest.getParamValue())
){
sapOrderVoList.add(newMap);
}
} else {
sapOrderVoList.add(newMap);
}
}
}
} else if (StringUtils.isNotBlank(queryRequest.getKunnr())) { //查询订单号
for (Map map : mapList) {
Map newMap = new HashMap();
newMap.put("BSTNK", map.get("BSTNK"));
newMap.put("VBELN", map.get("VBELN"));
newMap.put("KUNNR", map.get("KUNNR"));
newMap.put("NAME1", map.get("NAME1"));
......@@ -113,11 +141,6 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
// sapOrderVoList = objectMapper.readValue(JSONUtil.toString(json), new TypeReference<List<Map<String, String>>>() {
// });
// if (StringUtils.isNotBlank(queryRequest.getVbeln())) { //客户订单号
// sapOrderVoList = objectMapper.readValue(JSONUtil.toString(mapList.get(0).get("ITEM")), new TypeReference<List<Map<String, String>>>() {
// });
// }
} catch (Exception ex){
throw new RuntimeException("查询客户订单失败:"+ex.getMessage());
//ex.printStackTrace();
......
......@@ -16,6 +16,6 @@ public class SapDialogOrderQuery {
private String werks; //工厂
private String mtart;
private String paramValue;
}
package com.huigou.topsun.sap.sapApplication.domain.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.List;
@Data
public class OrderQueryVo {
@JSONField(name="KUNNR")
private List<SignVo> KUNNR;
@JSONField(name="WERKS")
private List<SignVo> WERKS;
@JSONField(name="VBELN")
private List<SignVo> VBELN;
}
package com.huigou.topsun.sap.sapApplication.domain.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import static javax.swing.text.html.HTML.Tag.OPTION;
@Data
public class SignVo {
public SignVo(){
this.high="";
this.sign="I";
this.option="EQ";
}
@JSONField(name="SIGN")
private String sign;
@JSONField(name="OPTION")
private String option;
@JSONField(name="HIGH")
private String high;
@JSONField(name="LOW")
private String low;
}
......@@ -68,4 +68,11 @@
<condition column="id" name="ids" symbol="in" alias="t"/>
</query>
<query name="querySapPurchaseInfoRecordItemByMaytkl" label="根据物料组和供应商查询" table="sap_purchase_info_record_item">
<sql-query>
select * from sap_purchase_info_record_item t where t.type='S'
</sql-query>
<condition column="lifnr" name="lifnr" symbol="=" alias="t"/>
<condition column="matkl" name="matkl" symbol="=" alias="t"/>
</query>
</query-mappings>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment