Commit 8ddb1e20 authored by 鲁鑫's avatar 鲁鑫

采购申请优化;质量信息记录优化

parent b33f1ed6
...@@ -1576,6 +1576,9 @@ ...@@ -1576,6 +1576,9 @@
opts.onChange.call(this,values,{}); opts.onChange.call(this,values,{});
} }
} }
if($.isFunction(opts.beforeChange)){//原始数据作为参数回调
opts.beforeChange.call(this,values)
}
if(opts.checkbox&&this.selectDataMap){ if(opts.checkbox&&this.selectDataMap){
this.selectDataMap.clear(); this.selectDataMap.clear();
} }
......
var itemGridManager = null,pstyp=" ",fillinDate="",ZEBKN_NUM=0; var itemGridManager = null, pstyp = " ", fillinDate = "", bsart = "";
$(function () { $(function () {
initItemGrid(); initItemGrid();
bindEvent(); bindEvent();
bsart = $("#bsart").val();
}); });
function bindEvent() { function bindEvent() {
$("#bsart").combox({onChange:function(data){ $("#bsart").combox({
if ("ZFW" == data.value){ onChange: function (data) {
if ("ZFW" == data.value) {
pstyp = "D"; pstyp = "D";
}else { } else {
pstyp = ""; pstyp = "";
} }
bsart = data.value;
} }
}) })
...@@ -20,10 +23,15 @@ function bindEvent() { ...@@ -20,10 +23,15 @@ function bindEvent() {
function initItemGrid() { function initItemGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({ var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function(){ addHandler: function () {
UICtrl.addGridRow(itemGridManager,{ bnfpo: (itemGridManager.getData().length + 1)*10 ,pstyp:pstyp,badat:fillinDate,erdat:fillinDate}); UICtrl.addGridRow(itemGridManager, {
bnfpo: (itemGridManager.getData().length + 1) * 10,
pstyp: pstyp,
badat: fillinDate,
erdat: fillinDate
});
}, },
deleteHandler: function (){ deleteHandler: function () {
var _grid = UICtrl.getGridManager('#maingrid'); var _grid = UICtrl.getGridManager('#maingrid');
DataUtil.delSelectedRows({ DataUtil.delSelectedRows({
action: 'sapPurchaseItem/deleteSapPurchaseItem.ajax', action: 'sapPurchaseItem/deleteSapPurchaseItem.ajax',
...@@ -36,11 +44,11 @@ function initItemGrid() { ...@@ -36,11 +44,11 @@ function initItemGrid() {
}); });
}, },
}); });
itemGridManager = UICtrl.grid('#maingrid', { itemGridManager = UICtrl.grid('#maingrid', {
columns: getGridColumns(), columns: getGridColumns(),
dataAction: 'server', dataAction: 'server',
url: web_app.name + '/sapPurchaseItem/querySapPurchaseItems.ajax', url: web_app.name + '/sapPurchaseItem/querySapPurchaseItems.ajax',
parms:{sapPurchaseId:getId()}, parms: {sapPurchaseId: getId()},
height: '95%', height: '95%',
heightDiff: -4, heightDiff: -4,
sortName: 'id', sortName: 'id',
...@@ -51,24 +59,40 @@ function initItemGrid() { ...@@ -51,24 +59,40 @@ function initItemGrid() {
enabledEdit: true, enabledEdit: true,
fixedCellHeight: true, fixedCellHeight: true,
selectRowButtonOnly: true, selectRowButtonOnly: true,
autoApplyNextEditor:false, autoApplyNextEditor: false,
toolbar: toolbarOptions, toolbar: toolbarOptions,
onBeforeEdit: function (editParm) { onBeforeEdit: function (editParm) {
var c = editParm.column, data = editParm.record; var c = editParm.column, data = editParm.record;
//仅适用于KNTTP=K时 //非资产类消耗性采购申请类型当“科目分配类型”选择K后“物料编号”字段调整为非必须输入项;“成本中心”、“总账科目”字段调整为必须输入项。订单号不可编辑。
if (data.knttp !== "K" && c.name === 'kostl') { if ("ZNE2" == bsart && (data.knttp == "K"|| data.knttp == "F" ) && c.name === 'kostl') {
return true;
}else {
return false; return false;
} }
//仅适用于KNTTP=F时 //仅适用于KNTTP=F时
if (data.knttp !== "F" && c.name === 'aufnr') { if (("ZFW" == bsart || "ZNE2" == bsart) && data.knttp == "F" && c.name === 'aufnr') {
return true;
}else {
return false; return false;
} }
//仅适用于KNTTP=A时 //仅适用于KNTTP=A时
// 仅适用于KNTTP=A时 if (data.knttp == 'A' && c.name === 'anln1') {
if (data.knttp !== 'A' && (c.name === 'anln1' || c.name === 'anln2')){ return true;
}else {
return false; return false;
} }
}, },
onAfterEdit: function (editParm) {
if (editParm.record.knttp === "K") {
var colums = itemGridManager.columns;
colums.forEach(colum => {
if (colum.name == "matnr") {
colum.editor.required = false;
itemGridManager.columns = colums
}
})
}
}
} }
); );
UICtrl.setSearchAreaToggle(itemGridManager); UICtrl.setSearchAreaToggle(itemGridManager);
...@@ -77,13 +101,15 @@ function initItemGrid() { ...@@ -77,13 +101,15 @@ function initItemGrid() {
function getGridColumns() { function getGridColumns() {
var columns = []; var columns = [];
columns = [ columns = [
{display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string", {
editor: { type: 'spinner', min: 10, max: 200, mask: 'nnn'} display: "申购项次号", name: "bnfpo", width: "80", align: "left", type: "string",
editor: {type: 'spinner', min: 10, max: 200, mask: 'nnn'}
}, },
{display: "项次类别", name: "pstyp", width: "100", align: "left", type: "string"}, {display: "项次类别", name: "pstyp", width: "100", align: "left", type: "string", hide: true},
{display: "科目分配类别", name: "knttp", width: "100", align: "left", type: "string", {
display: "科目分配类别", name: "knttp", width: "100", align: "left", type: "string",
editor: { editor: {
required: false, type: "select", required: true, type: "select",
data: { data: {
type: 'system', type: 'system',
name: "knttp", name: "knttp",
...@@ -94,10 +120,10 @@ function getGridColumns() { ...@@ -94,10 +120,10 @@ function getGridColumns() {
knttp: "knttp" knttp: "knttp"
} }
}, },
onChange() {}
} }
}, },
{display: "工厂", name: "werks", width: "100", align: "left", type: "string", {
display: "工厂", name: "werks", width: "100", align: "left", type: "string",
editor: { editor: {
required: true, type: "select", required: true, type: "select",
data: { data: {
...@@ -109,22 +135,25 @@ function getGridColumns() { ...@@ -109,22 +135,25 @@ function getGridColumns() {
back: { back: {
WERKS: "werks", WERKS: "werks",
NAME1: "name1" NAME1: "name1"
} },
}, },
} }
}, },
{display: "工厂名称", name: "name1", width: "200", align: "left", type: "string", {
display: "工厂名称", name: "name1", width: "200", align: "left", type: "string",
editor: {required: false, type: "text"} editor: {required: false, type: "text"}
}, },
{display: "物料编号", name: "matnr", width: "300", align: "left", type: "string", {
display: "物料编号", name: "matnr", width: "300", align: "left", type: "string",
editor: { editor: {
required: true, type: "select", required: false, type: "select",
data: { data: {
type: 'system', type: 'system',
name: "sapMaterialSelect", name: "sapMaterialSelect",
getParam: function (item) { getParam: function (item) {
return { return {
filterValue:item.werks filterValue: item.werks
} }
}, },
back: { back: {
...@@ -143,7 +172,8 @@ function getGridColumns() { ...@@ -143,7 +172,8 @@ function getGridColumns() {
}, },
} }
}, },
{display: "库存地点", name: "lgort", width: "100", align: "left", type: "string", {
display: "库存地点", name: "lgort", width: "100", align: "left", type: "string",
editor: { editor: {
required: false, type: "select", required: false, type: "select",
data: { data: {
...@@ -159,13 +189,16 @@ function getGridColumns() { ...@@ -159,13 +189,16 @@ function getGridColumns() {
}, },
} }
}, },
{display: "库存地点名称", name: "lgobe", width: "200", align: "left", type: "string", {
display: "库存地点名称", name: "lgobe", width: "200", align: "left", type: "string",
//editor: {required: false, type: "text"} //editor: {required: false, type: "text"}
}, },
{display: "短文本", name: "txz01", width: "200", align: "left", type: "string", {
display: "短文本", name: "txz01", width: "200", align: "left", type: "string",
editor: {required: true, type: "text"} editor: {required: true, type: "text"}
}, },
{display: "物料组", name: "matkl", width: "100", align: "left", type: "string", {
display: "物料组", name: "matkl", width: "100", align: "left", type: "string",
editor: { editor: {
required: true, type: "select", required: true, type: "select",
data: { data: {
...@@ -180,10 +213,12 @@ function getGridColumns() { ...@@ -180,10 +213,12 @@ function getGridColumns() {
}, },
} }
}, },
{display: "申购数量", name: "menge", width: 150, minWidth: 60, type: "string", align: "center", {
editor: {required: true, type: "text",mask: '9999999.999'} display: "申购数量", name: "menge", width: 150, minWidth: 60, type: "string", align: "center",
editor: {required: true, type: "text", mask: '9999999.999'}
}, },
{display: "申购数量单位", name: "meins", width: 150, minWidth: 60, type: "string", align: "center", {
display: "申购数量单位", name: "meins", width: 150, minWidth: 60, type: "string", align: "center",
/*editor: { /*editor: {
required: false, type: "select", required: false, type: "select",
data: { data: {
...@@ -199,7 +234,8 @@ function getGridColumns() { ...@@ -199,7 +234,8 @@ function getGridColumns() {
}*/ }*/
editor: {required: true, type: "text"} editor: {required: true, type: "text"}
}, },
{display: "采购组", name: "ekgrp", width: 150, minWidth: 60, type: "string", align: "center", {
display: "采购组", name: "ekgrp", width: 150, minWidth: 60, type: "string", align: "center",
editor: { editor: {
required: true, type: "select", required: true, type: "select",
data: { data: {
...@@ -214,59 +250,62 @@ function getGridColumns() { ...@@ -214,59 +250,62 @@ function getGridColumns() {
}, },
} }
}, },
{display: "申请日期", name: "badat", width: "100", align: "left", type: "string", {
editor: {required: false, type: "date"} display: "批准日期", name: "frgdt", width: "100", align: "left", type: "string",
},
{display: "创建日期", name: "erdat", width: "100", align: "left", type: "string",
//editor: {required: false, type: "date"} //editor: {required: false, type: "date"}
}, },
{display: "批准日期", name: "frgdt", width: "80", align: "left", type: "string", {
editor: {required: false, type: "date"} display: "要求交货日期", name: "lfdat", width: "100", align: "left", type: "string",
},
{display: "要求交货日期", name: "lfdat", width: "100", align: "left", type: "string",
editor: {required: true, type: "date"} editor: {required: true, type: "date"}
}, },
{display: "服务主数据编号", name: "srvpos", width: "80", align: "left", type: "string", // {display: "服务主数据编号", name: "srvpos", width: "80", align: "left", type: "string",
editor: {type: 'text', required: false}, // editor: {type: 'text', required: false},
}, // },
{display: "服务短文本", name: "ktext1", width: "100", align: "left", type: "string"}, // {display: "服务短文本", name: "ktext1", width: "100", align: "left", type: "string"},
{display: "服务条目数量", name: "esllMenge", width: "80", align: "left", type: "string", // {display: "服务条目数量", name: "esllMenge", width: "80", align: "left", type: "string",
//editor: {type: 'text', mask: '9999999.999'}, // //editor: {type: 'text', mask: '9999999.999'},
render:function(item){ // render:function(item){
return item.esllMenge=item.menge; // return item.esllMenge=item.menge;
} // }
}, // },
{display: "服务计量单位", name: "esllMeins", width: "100", align: "left", type: "string", // {display: "服务计量单位", name: "esllMeins", width: "100", align: "left", type: "string",
editor: {type: "text", required: false,} // editor: {type: "text", required: false,}
}, // },
{display: '定价基数', name: "peinh", width: "100", align: "left", type: "string", // {display: '定价基数', name: "peinh", width: "100", align: "left", type: "string",
//editor: {required: true, type: "select"} // //editor: {required: true, type: "select"}
render:function(item){ // render:function(item){
return item.peinh=item.preis; // return item.peinh=item.preis;
} // }
}, // },
{display: "服务预估单价", name: "brtwr", width: "100", align: "left", type: "string", // {display: "服务预估单价", name: "brtwr", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'} // editor: {type: 'text', mask: '9999999.99'}
}, // },
{display: "服务预估金额", name: "netwr", width: "100", align: "left", type: "string", // {display: "服务预估金额", name: "netwr", width: "100", align: "left", type: "string",
render:function(item){ // render:function(item){
if (item.brtwr == '' || item.brtwr == null || item.peinh == '' || item.peinh == null){ // if (item.brtwr == '' || item.brtwr == null || item.peinh == '' || item.peinh == null){
return item.netwr=0; // return item.netwr=0;
} // }
return item.netwr=(item.brtwr*item.esllMenge/item.peinh).toFixed(2); // return item.netwr=(item.brtwr*item.esllMenge/item.peinh).toFixed(2);
} // }
}, // },
{display: "创建者", name: "ernam", width: "200", align: "left", type: "string"}, {display: "创建者", name: "ernam", width: "200", align: "left", type: "string"},
{display: "申请人", name: "afnam", width: "90", align: "left", type: "string", {
display: "申请人", name: "afnam", width: "90", align: "left", type: "string",
editor: {type: 'text', required: false}, editor: {type: 'text', required: false},
}, },
{display: "评估价格", name: "preis", width: "100", align: "left", type: "string", {
editor: {type: 'text', mask: '9999999.99',required: true} display: "预估单价", name: "preis", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99', required: true}
}, },
{display: "价格基数", name: "ebanPeinh", width: "100", align: "left", type: "string", {
editor: {type: 'text', mask: '9999999',required: false} display: "价格基数", name: "ebanPeinh", width: "100", align: "left", type: "string",
//editor: {type: 'text', mask: '9999999',required: false}
render: function (item) {
return item.ebanPeinh = 1;
}
}, },
{display: "币种", name: "waers", width: "100", align: "left", type: "string", {
display: "币种", name: "waers", width: "100", align: "left", type: "string",
editor: { editor: {
required: false, type: "text", required: false, type: "text",
/*data: { /*data: {
...@@ -281,49 +320,54 @@ function getGridColumns() { ...@@ -281,49 +320,54 @@ function getGridColumns() {
},*/ },*/
} }
}, },
{display: "评估金额", name: "ebanNetwr", width: "100", align: "left", type: "string", {
render:function(item){ display: "评估金额", name: "ebanNetwr", width: "100", align: "left", type: "string",
if (item.ebanPeinh == ''){ render: function (item) {
return item.ebanNetwr=null; if (item.ebanPeinh == '') {
return item.ebanNetwr = null;
} }
return item.ebanNetwr=(item.preis*item.menge/item.ebanPeinh).toFixed(2); return item.ebanNetwr = (item.preis * item.menge / item.ebanPeinh).toFixed(2);
} }
//editor: {type: 'text'} //editor: {type: 'text'}
}, },
{display: "会计分配序号", name: "zebkn", width: "100", align: "left", type: "string", {
display: "会计分配序号", name: "zebkn", width: "100", align: "left", type: "string",
editor: {type: 'text'}, editor: {type: 'text'},
render:function (item){ render: function (item) {
//申购项次为消耗性采购时,从1开始步长为1自动编号,最大99 //申购项次为消耗性采购时,从1开始步长为1自动编号,最大99
// if (item.knttp != ''){ // if (item.knttp != ''){
// ZEBKN_NUM = ZEBKN_NUM + 1; // ZEBKN_NUM = ZEBKN_NUM + 1;
// } // }
return item.zebkn = item.menge; return item.zebkn = item.menge;
} }
}, },
{display: "多重科目分配", name: "vrtkz", width: "100", align: "left", type: "string", {
display: "多重科目分配", name: "vrtkz", width: "100", align: "left", type: "string",
//editor: {type: 'text'}, //editor: {type: 'text'},
render : function (item) { render: function (item) {
//资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1 //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
if (item.knttp == "A" && item.menge > 1){ if (item.knttp == "A" && item.menge > 1) {
return item.vrtkz = 1; return item.vrtkz = 1;
} }
} }
}, },
{display: "部分发票", name: "twrkz", width: "100", align: "left", type: "string", {
display: "部分发票", name: "twrkz", width: "100", align: "left", type: "string",
editor: {type: 'text'}, editor: {type: 'text'},
render : function (item) { render: function (item) {
//资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1 //资产消耗性申购,若申请数量大于1,此处不能为空,必须选择1
if (item.knttp == "A" && item.menge > 1){ if (item.knttp == "A" && item.menge > 1) {
return item.twrkz = 1; return item.twrkz = 1;
} }
} }
}, },
{display: "PR分解数量", name: "ekbnMenge", width: "100", align: "left", type: "string", {
display: "PR分解数量", name: "ekbnMenge", width: "100", align: "left", type: "string",
editor: {type: 'text'} editor: {type: 'text'}
}, },
{ {
display: "总账科目", name: "sakto", width: "100", align: "left", type: "string", display: "总账科目", name: "sakto", width: "100", align: "left", type: "string",
editor: {type: 'text',required: true} editor: {type: 'text', required: true}
}, },
{ {
display: "成本中心", name: "kostl", width: "200", align: "left", type: "string", display: "成本中心", name: "kostl", width: "200", align: "left", type: "string",
...@@ -362,7 +406,7 @@ function getGridColumns() { ...@@ -362,7 +406,7 @@ function getGridColumns() {
} }
}, },
{ {
display: "主资产号", name: "anln1", width: "200", align: "left", type: "string", display: "资产编号", name: "anln1", width: "200", align: "left", type: "string",
editor: { editor: {
required: false, type: "select", required: false, type: "select",
data: { data: {
...@@ -380,13 +424,21 @@ function getGridColumns() { ...@@ -380,13 +424,21 @@ function getGridColumns() {
}, },
} }
}, },
// {
// display: "子资产号", name: "anln2", width: "100", align: "left", type: "string",
// editor: {type: 'text'}
// },
{ {
display: "子资产号", name: "anln2", width: "100", align: "left", type: "string", display: "审批处理状态", name: "banpr", width: "100", align: "left", type: "string",
editor: {type: 'text'} editor: {type: 'text'}
}, },
{ {
display: "审批处理状态", name: "banpr", width: "100", align: "left", type: "string", display: "申请日期", name: "badat", width: "100", align: "left", type: "string",
editor: {type: 'text'} editor: {required: false, type: "date"}
},
{
display: "创建日期", name: "erdat", width: "100", align: "left", type: "string",
//editor: {required: false, type: "date"}
}, },
] ]
return columns; return columns;
...@@ -399,7 +451,7 @@ function getExtendedData(processAction) { ...@@ -399,7 +451,7 @@ function getExtendedData(processAction) {
|| processAction == ProcessAction.REPLENISH || processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) { || processAction == ProcessAction.TRANSMIT) {
//不验证 //不验证
$('#submitForm').attr('check', false); $('#submitForm').attr('check', true);
} }
var extendedData = {}; var extendedData = {};
var _grid = UICtrl.getGridManager('#maingrid'); var _grid = UICtrl.getGridManager('#maingrid');
...@@ -411,12 +463,66 @@ function getExtendedData(processAction) { ...@@ -411,12 +463,66 @@ function getExtendedData(processAction) {
if (!datas) { if (!datas) {
return false; return false;
} }
datas.forEach(data =>{ var checked1 = false;
if (data.pstyp === "D" && Public.isBlank(data.srvpos)){ var checked2 = false;
var checked3 = false;
var checked4 = false;
var checked5 = false;
var checked6 = false;
datas.forEach(data => {
if (data.pstyp === "D" && Public.isBlank(data.srvpos)) {
Public.tip("项次类别等于D时,服务主数据编号必须输入") Public.tip("项次类别等于D时,服务主数据编号必须输入")
return false; return false;
} }
//选择固定资产采购申请类型时,“科目分配类别”、“申请人”、“币种”、“资产编号” 调整为必须输入项
if ("ZNE1" === bsart) {
if (Public.isBlank(data.afnam)) {
checked1 = true;
}
if (Public.isBlank(data.waers)) {
checked2 = true;
}
if (Public.isBlank(data.anln1)) {
checked3 = true;
}
}
if (("ZFW" == bsart || "ZNE2" == bsart) ){
if (Public.isBlank(data.sakto)){
checked4 = true;
}
if (Public.isBlank(data.kostl)){
checked5 = true;
}
if ("F" == data.knttp && Public.isBlank(data.aufnr)){
checked6 = true;
}
}
}) })
if (checked1) {
Public.tip("申请人不能为空")
return false;
}
if (checked2) {
Public.tip("币种不能为空")
return false;
}
if (checked3) {
Public.tip("资产编号不能为空")
return false;
}
if (checked4) {
Public.tip("总账科目不能为空")
return false;
}
if (checked5) {
Public.tip("成本中心不能为空")
return false;
}
if (checked6) {
Public.tip("订单号不能为空")
return false;
}
extendedData.sapPurchaseItems = Public.encodeJSONURI(datas); extendedData.sapPurchaseItems = Public.encodeJSONURI(datas);
} }
return extendedData; return extendedData;
...@@ -428,7 +534,7 @@ function getId() { ...@@ -428,7 +534,7 @@ function getId() {
function setId(value) { function setId(value) {
$("#id").val(value); $("#id").val(value);
var _grid=UICtrl.getGridManager('#maingrid'); var _grid = UICtrl.getGridManager('#maingrid');
_grid.options.parms.sapPurchaseId = value; _grid.options.parms.sapPurchaseId = value;
} }
...@@ -436,7 +542,7 @@ function reloadGrid() { ...@@ -436,7 +542,7 @@ function reloadGrid() {
itemGridManager.loadData(); itemGridManager.loadData();
} }
function getGridData(){ function getGridData() {
var _grid = UICtrl.getGridManager('#maingrid'); var _grid = UICtrl.getGridManager('#maingrid');
var datas = DataUtil.getGridData({ var datas = DataUtil.getGridData({
gridManager: _grid, gridManager: _grid,
...@@ -445,9 +551,9 @@ function getGridData(){ ...@@ -445,9 +551,9 @@ function getGridData(){
return datas; return datas;
} }
function getBsartNum(){ function getBsartNum() {
var datas = this.getGridData(); var datas = this.getGridData();
datas.forEach(data=>{ datas.forEach(data => {
}) })
} }
......
...@@ -48,12 +48,14 @@ public class SapPurchaseApprovalController extends CommonController { ...@@ -48,12 +48,14 @@ public class SapPurchaseApprovalController extends CommonController {
HashMap<String, Object> messageMap = new HashMap<>(); HashMap<String, Object> messageMap = new HashMap<>();
messageMap.put("Message_Status","S"); messageMap.put("Message_Status","S");
messageMap.put("Message_Text","成功"); messageMap.put("Message_Text","成功");
messageMap.put("NUMBER",sapPurchaseApprovalDto.getLsDeader().getBanfn());
LOG.info("SAP采购申请审批数据=={}",sapPurchaseApprovalDto); LOG.info("SAP采购申请审批数据=={}",sapPurchaseApprovalDto);
try { try {
this.sapPurchaseApprovalApplication.saveSapPurchaseApprovalVo(sapPurchaseApprovalDto); this.sapPurchaseApprovalApplication.saveSapPurchaseApprovalVo(sapPurchaseApprovalDto);
}catch (RuntimeException e){ }catch (RuntimeException e){
messageMap.put("Message_Status","E"); messageMap.put("Message_Status","E");
messageMap.put("Message_Text",e); messageMap.put("Message_Text",e);
messageMap.put("NUMBER",sapPurchaseApprovalDto.getLsDeader().getBanfn());
} }
return messageMap; return messageMap;
} }
......
...@@ -154,9 +154,15 @@ public class SapQualityInfoRecordApplicationImpl extends FlowBroker implements S ...@@ -154,9 +154,15 @@ public class SapQualityInfoRecordApplicationImpl extends FlowBroker implements S
purchaseInfoRecordItemList.forEach(sapQualityInfoRecordItem -> { purchaseInfoRecordItemList.forEach(sapQualityInfoRecordItem -> {
SapQualityInfoRecordItemVo sapQualityInfoRecordItemVo = new SapQualityInfoRecordItemVo(); SapQualityInfoRecordItemVo sapQualityInfoRecordItemVo = new SapQualityInfoRecordItemVo();
BeanUtil.copyProperties(sapQualityInfoRecordItem, sapQualityInfoRecordItemVo); BeanUtil.copyProperties(sapQualityInfoRecordItem, sapQualityInfoRecordItemVo);
sapQualityInfoRecordItem.setZqavfn3("M1"); // sapQualityInfoRecordItem.setZqavfn3("M1");
sapQualityInfoRecordItem.setZvfnc3("A"); // sapQualityInfoRecordItem.setZvfnc3("A");
sapQualityInfoRecordItem.setZqafst("11"); // sapQualityInfoRecordItem.setZqafst("11");
if ("0".equals(sapQualityInfoRecordItemVo.getGrsrq())){
sapQualityInfoRecordItemVo.setGrsrq("");
}
if ("0".equals(sapQualityInfoRecordItemVo.getFscrq())){
sapQualityInfoRecordItemVo.setFscrq("");
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
if (sapQualityInfoRecordItem.getGrscertdatai() !=null){ if (sapQualityInfoRecordItem.getGrscertdatai() !=null){
String datab = dateFormat.format(sapQualityInfoRecordItem.getGrscertdatai()); String datab = dateFormat.format(sapQualityInfoRecordItem.getGrscertdatai());
......
...@@ -11,6 +11,7 @@ import com.huigou.data.query.model.QueryDescriptor; ...@@ -11,6 +11,7 @@ import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel; import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.sap.common.DefaultHttpClient; import com.huigou.topsun.sap.common.DefaultHttpClient;
import com.huigou.topsun.sap.common.application.SapMutualEpLogApplication; import com.huigou.topsun.sap.common.application.SapMutualEpLogApplication;
import com.huigou.topsun.sap.common.domain.SapResult;
import com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement; import com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement;
import com.huigou.topsun.sap.suppliers.application.SuppliersDataApplication; import com.huigou.topsun.sap.suppliers.application.SuppliersDataApplication;
import com.huigou.topsun.sap.suppliers.domain.*; import com.huigou.topsun.sap.suppliers.domain.*;
...@@ -353,16 +354,16 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -353,16 +354,16 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
suppliersInfoVos.add(suppliersInfoVo); suppliersInfoVos.add(suppliersInfoVo);
try { try {
String result = defaultHttpClient.execute(suppliersInfoVos, url); String result = defaultHttpClient.execute(suppliersInfoVos, url);
List<Map<String, Object>> resultList = objectMapper.readValue(result, new TypeReference<List<Map<String, Object>>>() { List<SapResult> sapResultList = objectMapper.readValue(result, new TypeReference<List<SapResult>>() {
}); });
resultMap = resultList.get(0); SapResult sapResult = sapResultList.get(0);
resultMap.put("sequence", resultMap.get("row")); resultMap.put("sequence", resultMap.get("row"));
sapMutualEpLogApplication.saveSapMutualEpLog(resultMap); sapMutualEpLogApplication.saveSapMutualEpLog(resultMap);
if ("S".equals(resultMap.get("TYPE"))) { if ("S".equals(sapResult.getTYPE())) {
suppliersInfo.setPartner((String) resultMap.get("MESSAGE_V1")); suppliersInfo.setPartner(sapResult.getMESSAGE_V1());
suppliersInfoRepository.save(suppliersInfo); suppliersInfoRepository.save(suppliersInfo);
} else { } else {
throw new RuntimeException("数据传输失败,请稍后手动重试!" + resultMap.get("MESSAGE")); throw new RuntimeException("数据传输失败,请稍后手动重试!" + sapResult.getMESSAGE());
} }
} catch (Exception e) { } catch (Exception e) {
resultMap.put("type", "E"); resultMap.put("type", "E");
......
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