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

供应商及 物料/产品主数据修改

parent 7310ec54
......@@ -111,7 +111,7 @@ function loadGrid() {
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
// }
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
//let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -159,7 +159,7 @@ function loadGrid() {
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height: "90%",//coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -22,7 +22,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -112,7 +112,7 @@ function loadGrid() {
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
//let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -155,12 +155,13 @@ function loadGrid() {
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
//parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
parms: {dept: $("#businessUsage").val(),deptId: $("#applyDeptId").val(),id:$("#id").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height:"90%",// coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -21,7 +21,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -25,6 +25,7 @@
<%-- <x:hidden name="billCode"/>--%>
<%-- <x:hidden name="fillinDate" type="datetime"/>--%>
<x:hidden name="sourceId"/>
<x:hidden name="kind"/>
<x:hidden name="applyType"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
......
......@@ -116,7 +116,7 @@ function loadGrid() {
UICtrl.disable($("#materialUsage"));
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -159,12 +159,13 @@ function loadGrid() {
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
//parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
parms: {dept: $("#businessUsage").val(),deptId: $("#applyDeptId").val(),id:$("#id").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height: "90%",//coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -21,7 +21,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -191,7 +191,7 @@ function modifyHandler(id,matnr) {
UICtrl.addTabItem({
tabid: 'nonProdApplyChange'+id,
text: "非产品/非本成品类物料主数据变更申请",
url: web_app.name + '/sapNonProdApply/forwardNonProdApplyDetail.job?bizId='+id
url: web_app.name + '/sapNonProdApply/forwardNonProdApplyDetail.job?bizId='+id+"&modify=1"
});
}
//扩展
......
......@@ -113,7 +113,7 @@ function loadGrid() {
UICtrl.disable($("#businessUsage"));
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -156,12 +156,13 @@ function loadGrid() {
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
// parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
parms: {dept: $("#businessUsage").val(),deptId: $("#applyDeptId").val(),id:$("#id").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height: "90%",//coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -22,7 +22,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -111,7 +111,7 @@ function loadGrid() {
UICtrl.disable($("#materialUsage"));
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
//let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -154,12 +154,12 @@ function loadGrid() {
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
parms: {dept: $("#businessUsage").val(),deptId: $("#applyDeptId").val(),id:$("#id").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height: "90%",//coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -22,7 +22,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -23,20 +23,24 @@ function initializate() {
UICtrl.enable($("#matklName"));
switch ($("#active").val()) {
case '0'://已分发未完成
$("#businessUsageDiv").hide();
$("#businessUsageDiv").hide(); // alert($("#deptCode").val())
if ($("#deptCode").val() === "system") {
$("#auditForm").show();
} else {
$("#buttonBox").show();
$("#showChart").remove();
// $("#showChart").remove(); //去掉 lxh
}
break;
case '1'://已分发
// $("#auditForm").show();
$("#buttonBox").remove();
UICtrl.setDisable("#basicInfoDiv")
break;
case '2'://保存未分发
$("#buttonBox").show();
case '2'://已分发 从首页进入填写基本数据
$("#buttonBox").show(); //alert();
$("#showChart").remove();
UICtrl.setEnable("#basicInfoDiv")
break;
case '3'://被驳回
showRejectCauseBox();
......@@ -115,14 +119,16 @@ function loadGrid() {
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
//}
// let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// alert($("#busiLens").val());
let coRowNum=$("#busiLens").val();
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
gridManager = UICtrl.grid("#businessPersonnelListGrid", {
columns: [
{display: "部门", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left"},
{ display: "部门人员", name: "userName", width: 280, minWidth: 60, type: "string", align: "left",
{display: "部门人员", name: "userName", width: 280,disable: true, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
......@@ -154,9 +160,15 @@ function loadGrid() {
usePager: false,
enabledEdit: true,
width: "100%",
// height: coRowNum * 37.5,
height:coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
onBeforeEdit: function (editParm) {
var cols = editParm.column, data = editParm.record;
if ($("#active").val()==1){
return false;
}
},
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(gridManager);
......@@ -167,9 +179,9 @@ function loadGrid() {
* 表单提交
* @returns {boolean}
*/
function saveForm() {
function saveForm(status) {
// alert($("#businessCode").val());
$("#status").val(0)
$("#active").val(status)
let extendedData = getExtendedData();
if (!extendedData) return false;
var _self = this;
......@@ -179,6 +191,9 @@ function saveForm() {
success: function (data) {
$("#applyDeptId").val(data.applyDeptId);
Public.successTip("保存成功!");
if (status==1) {
$("#buttonBox").remove();
}
_self.close();
UICtrl.reloadTabById('homepage');
}
......@@ -235,6 +250,7 @@ function distributeForm() {
param: extendedData,
success: function (data) {
Public.successTip("分发成功!");
$("#buttonBox").remove();
control.isDistribute = true;
_self.close();
}
......@@ -358,7 +374,7 @@ function getExtendedData() {
isAllData: true,
onCheck: function (data) {
if (typeof data.userCode === 'undefined') {
msg += `${data.deptName}`;
msg += `${data.deptName}`;
isUndefined = true;
}
return true;
......
......@@ -2,6 +2,7 @@
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date"/>
<x:script src='/biz/topsun/sap/nonProdApply/nonProdApplyNext.js'/>
......@@ -25,10 +26,17 @@
<x:hidden name="active" value=""/> <!--状态-->
<x:hidden name="meId" value=""/> <!--状态-->
<x:hidden name="status" /> <!--状态-->
<x:hidden name="busiLens" />
<div style="float: right; margin-right: 10px;display: none;" class="btn-group" id="buttonBox">
<button id="save" title="" type="button" onclick="saveForm()" class="btn btn-gray"><i
<button id="save" title="" type="button" onclick="saveForm(0)" class="btn btn-gray"><i
class="fa fa-save"></i>保存
</button>
<c:if test="${active==2}">
<button id="submit" hidden="true" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-check-circle-o"></i>提交
</button>
</c:if>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
</button>
......@@ -80,7 +88,7 @@
</div>
</div>
<x:title title="维护基本信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-cols" id="basicInfoDiv">
<div class="hg-form-row">
<x:inputC name="matnr" label="物品编码" readonly="true" labelCol="1" fieldCol="2"/>
<x:selectC name="mtart" label="物品类型" required="true" labelCol="1" fieldCol="2" dictionary="suppliesType"/>
......@@ -140,13 +148,13 @@
fieldCol="11"/>
</div>
</c:if>
<c:if test="${applyType==1}">
<c:if test="${applyType==1||active==1||active==2}">
<div class="hg-form-row">
<x:checkboxListC name="businessUsage" label="业务用途" dictionary="serviceusage" labelCol="1"
fieldCol="11" disabled="true"/>
</div>
</c:if>
<c:if test="${applyType==0}">
<c:if test="${applyType==0&&active!=1}">
<div class="hg-form-row">
<x:checkboxListC name="businessUsage" label="业务用途" dictionary="serviceusage" labelCol="1"
fieldCol="11"/>
......
......@@ -111,7 +111,7 @@ function loadGrid() {
UICtrl.disable($("#materialUsage"));
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
//let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -159,7 +159,7 @@ function loadGrid() {
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height:"90%",// coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -22,7 +22,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -161,7 +161,7 @@ function loadGrid() {
usePager: false,
enabledEdit: true,
width: "100%",
height: "80%",//coRowNum * 37.5,
height: "90%",//coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -22,7 +22,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -114,13 +114,13 @@ function loadGrid() {
$("#specifications").attr("disabled",true);
$("#materialUsage").attr("disabled",true);
// UICtrl.disable($("#vkorg"));
UICtrl.disable($("#vtweg"));
UICtrl.disable($("#businessUsage"));
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -163,12 +163,12 @@ function loadGrid() {
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
parms: {dept: $("#businessUsage").val(),deptId: $("#applyDeptId").val(),id:$("#id").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height: "90%",//coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -22,7 +22,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......@@ -80,7 +80,7 @@
<div class="hg-form-row">
<x:hidden name="vkorg"/>
<x:inputC name="vkorgName" required="true" label="销售组织" labelCol="1" wrapper="select" fieldCol="2"/>
<x:hidden name="vkorg"/>
<x:inputC name="vtwegName" required="true" label="分销渠道" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="vtweg"/>
<x:selectC name="vrkme" label="销售计量单位" labelCol="1" fieldCol="2" dictionary="measuringUnit"/>
......
......@@ -113,7 +113,7 @@ function loadGrid() {
UICtrl.disable($("#materialUsage"));
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -156,12 +156,12 @@ function loadGrid() {
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
parms: {dept: $("#businessUsage").val(),deptId: $("#applyDeptId").val(),id:$("#id").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height: "90%",//coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -22,7 +22,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -117,7 +117,7 @@ function loadGrid() {
UICtrl.disable($("#baseUnit"));
UICtrl.disable($("#itemAttributes"));
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
//let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
......@@ -160,12 +160,12 @@ function loadGrid() {
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
parms: {dept: $("#businessUsage").val(),deptId: $("#applyDeptId").val(),id:$("#id").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
height:"90%",// coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
......
......@@ -22,7 +22,7 @@
class="fa fa-save"></i>保存
</button>
<button id="submit" title="" type="button" onclick="saveForm(1)" class="btn btn-gray"><i
class="fa fa-save"></i>提交
class="fa fa-check-circle-o"></i>提交
</button>
<button id="back" title="" type="button" onclick="clearForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
......
......@@ -33,12 +33,15 @@ function initialize(){
function setId(bizId) {
$("#id").val(bizId);
var _grid = UICtrl.getGridManager('#sapSuppliersPayGrid');
_grid.options.parms.id = bizId;
var _grid = UICtrl.getGridManager('#sapSuppliersBuyerGrid');
_grid.options.parms.id = bizId;
var _grid = UICtrl.getGridManager('#sapSuppliersBankGrid');
_grid.options.parms.id = bizId;
_grid.options.parms.sId = bizId;
var _grid2 = UICtrl.getGridManager('#sapSuppliersBuyerGrid');
_grid2.options.parms.sId = bizId;
var _grid3 = UICtrl.getGridManager('#sapSuppliersBankGrid');
_grid3.options.parms.sId = bizId;
$("#sId").val(bizId);
sapSuppliersPayGridManager.loadData();
sapSuppliersBuyerGridManager.loadData();
sapSuppliersBankGridManager.loadData();
}
/**
......@@ -52,7 +55,7 @@ function getId() {
function getsId() {
var sid=$("#id").val() || ""; //alert(applyType); alert($("#sId").val());
if (applyType!="0"){
if (applyType!="0"){ // alert("sID=00===="+$("#sId").val())
sid=$("#sId").val();
}
return sid;
......@@ -151,7 +154,7 @@ function loadSuppliersPayListGrid() {
data: {name: 'zwels'},
textField: 'zwelsTextView',
valueField: 'zwels',
checkbox:true,
// checkbox:true,
required: true,
render: function (item) {
return item.zwelsTextView;
......@@ -479,6 +482,14 @@ function getExtendedData(processAction) {
}
var _grid = UICtrl.getGridManager('#sapSuppliersBuyerGrid');
if (_grid) {
var rows = _grid.getData();
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
if (row.Inco1 != ""&&row.Inco2L=="") {
Public.errorTip('请输入国际贸易条款位置1!');
return false;
}
}
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: isAllData
......@@ -589,6 +600,8 @@ function bindEvent(){
}
function reloadGrid() {
alert(sid);
sid=$("#id").val(); alert(sid);
sapSuppliersPayGridManager.loadData();
sapSuppliersBuyerGridManager.loadData();
sapSuppliersBankGridManager.loadData();
......
......@@ -166,7 +166,7 @@ function doView(id,applyType) {
UICtrl.addTabItem({
tabid: 'suppliersData'+id,
text: title,
url: web_app.name + '/sapSuppliersData/showSuppliersData.job?bizId='+id+"&isDetailPage=true"
url: web_app.name + '/sapSuppliersData/showSuppliersData.job?isReadOnly=true&bizId='+id+"&isDetailPage=true"
});
}
function initShowDialog() {
......
......@@ -60,6 +60,9 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
List<BsnMessageExecute> executes = this.getExecutesByMsId(sponsor.getId());
for (BsnMessageExecute execute :executes) {
execute.setActive(ActiveStatus.UNFINISHED.getValue());
if ("INIT_DPT".equals(execute.getBusinessCode())){ //是产品的 把待办的去掉
execute.setActive(ActiveStatus.FINISHED.getValue());
}
}
this.saveBsnMessageExecute(executes);
}
......
......@@ -128,9 +128,10 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
// newSapNonProdApplyDept.setWerksName(sapNonProdApplyDept.getWerksName());
}
newSapNonProdApplyDept.setId("");
newSapNonProdApplyDept.setApplyDeptId("");
newSapNonProdApplyDept.setBaseInfoId(nonProdApplyBaseInfo.getId());
nonProdApplyDeptApplication.save(newSapNonProdApplyDept);
}
}
return nonProdApplyBaseInfo.getId();
}
......@@ -415,6 +416,9 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
}
nonProdApplyDeptApplication.save(applyDept);
} else {
//更改分发状态
prodApplyBaseInfo.setDistribute(0);
nonProdApplyBaseInfoRepository.save(prodApplyBaseInfo);
throw new RuntimeException("数据传输失败,请稍后手动重试!" + backMap.get("MESSAGE"));
}
} catch (Exception e) {
......@@ -507,7 +511,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
BsnMessageSponsor bsnMessageSponsor = new BsnMessageSponsor();
bsnMessageSponsor.setTaskSponsor(operator.getLoginUser().getId());
bsnMessageSponsor.setTitle(nonProdApplyBaseInfo.getGenericName());//通用品名
bsnMessageSponsor.setExecutorUrl("sapNonProdApplyNext/forwardNonProdApplyNext.do?prod=1");
bsnMessageSponsor.setExecutorUrl("sapNonProdApplyNext/forwardNonProdApplyNext.do?prod=1&isReadOnly=false");
bsnMessageSponsor.setBusinessId(sapNonProdApplyDept.getApplyDeptId());
bsnMessageSponsor.setCreateDate(new Date());
bsnMessageSponsor.setStatus(0);
......
......@@ -21,6 +21,7 @@ import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.persistence.Column;
import java.util.*;
@Service
......@@ -42,12 +43,24 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
Integer active=sdo.getInteger("active");
String meId=sdo.getString("meId");
NonProdApplyBaseInfo nonProdApplyBaseInfo=nonProdApplyBaseInfoRepository.findOne(sdo.getString("id"));
nonProdApplyBaseInfo.setBusinessUsage(sdo.getString("businessUsage"));
if (StringUtil.isNotBlank(sdo.getString("distribute"))){ //是否已分发
nonProdApplyBaseInfo.setDistribute(1);
}
if ("K".equals(businessCode)){ //首页进入的基本信息维护
nonProdApplyBaseInfo.setGenericName(sdo.getString("genericName"));
nonProdApplyBaseInfo.setApplicableStandard(sdo.getString("applicableStandard"));
nonProdApplyBaseInfo.setBaseUnit(sdo.getString("baseUnit"));
nonProdApplyBaseInfo.setSpecifications(sdo.getString("specifications"));
nonProdApplyBaseInfo.setMaterial(sdo.getString("material"));
nonProdApplyBaseInfo.setDesign(sdo.getString("design"));
nonProdApplyBaseInfo.setSize(sdo.getString("size"));
// nonProdApplyBaseInfo.setGenericName(sdo.getString("brand"));
nonProdApplyBaseInfo.setBrand(sdo.getString("brand"));
nonProdApplyBaseInfo.setMaterialUsage(sdo.getString("materialUsage"));
nonProdApplyBaseInfo.setItemAttributes(sdo.getString("itemAttributes"));
}
nonProdApplyBaseInfoRepository.save(nonProdApplyBaseInfo);
NonProdApplyDeptVo deptVo=null;
......
......@@ -121,10 +121,10 @@ public class NonProdApplyController extends CommonController {
this.putAttribute("bizId", "");
this.putAttribute("sourceId", bizId);
this.putAttribute("id", "");
} else { //变更
} else if (StringUtil.isNotBlank(sdo.getString("modify"))){ //变更
if (StringUtil.isNotBlank(bizId)) {
nonProdApplyBaseInfo = nonProdApplyApplication.loadNonProdApplyBaseInfoById(bizId);
this.putAttribute("processDefinitionKey", NonProdApplyApplication.PROCESS_DEFINITION_KEY_MOD);
this.putAttribute("applyType", "1");
nonProdApplyBaseInfo.setMaintenanceType("modify");
......
......@@ -112,6 +112,11 @@ public class NonProdApplyNextController extends CommonController {
// this.putAttribute("businessUsageSeledList",mapTmp);
// this.putAttribute("businessUsageUnSeledList",unMapTmp);
}
int slen=1;
if (StringUtil.isNotBlank(nonProdApplyBaseInfo.getBusinessUsage())){
slen=nonProdApplyBaseInfo.getBusinessUsage().split(",").length+1;
}
this.putAttribute("busiLens",slen);
if (nonProdApplyDept != null) {
getBaseInfoAttrs(nonProdApplyBaseInfo, nonProdApplyDept);
if (nonProdApplyBaseInfo.getDistribute()!=null&&nonProdApplyBaseInfo.getDistribute()==1){
......@@ -222,6 +227,7 @@ public class NonProdApplyNextController extends CommonController {
String businessCode=circulate.get("deptCode").toString();
switch (businessCode) {
case "K":
this.putAttribute("active",2); //已经分发的 填写基本数据
return forward("nonProdApplyNext", nonProdApplyDept);
case "C":
return forward("nonProdApplyClass", nonProdApplyDept);
......
......@@ -9,6 +9,8 @@ import com.huigou.topsun.sap.suppliers.domain.query.SuppliersBankQueryRequest;
import com.huigou.topsun.sap.suppliers.domain.query.SuppliersBuyerQueryRequest;
import com.huigou.topsun.sap.suppliers.domain.query.SuppliersDataQueryRequest;
import com.huigou.topsun.sap.suppliers.domain.query.SuppliersPayQueryRequest;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.SDO;
import org.springframework.data.domain.Sort;
import java.util.List;
......@@ -35,9 +37,9 @@ public interface SuppliersDataApplication {
void deleteSuppliersDataByIds( List<String> ids);
List<SuppliersInfo> findDeletedSuppliersDataById(String id);
List<Map<String, Object>> findDeletedSuppliersDataById(SDO params);
void deleteSuppliersPaysByIds( List<String> ids);
void deleteSuppliersPaysByIds( List<String> ids);
void deleteSuppliersBuyerByIds( List<String> ids);
......
......@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.JsonObject;
import com.huigou.cache.DictUtil;
import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.query.model.QueryDescriptor;
......@@ -31,9 +32,7 @@ import com.huigou.topsun.sap.suppliers.repository.SuppliersPayRepository;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.ApprovalParameter;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.ClassHelper;
import com.huigou.util.DateUtil;
import com.huigou.util.StringUtil;
import com.huigou.util.*;
import lombok.SneakyThrows;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
......@@ -137,6 +136,9 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
}
for (SuppliersBuyer buyer : suppliersBuyerList) {
if (StringUtil.isNotBlank(buyer.getInco1())&&StringUtil.isBlank(buyer.getInco2L())){
throw new RuntimeException("请输入国际贸易条款位置1!");
}
if (StringUtil.isBlank(buyer.getSId())) {
buyer.setSId(suppliersInfo.getId());
this.suppliersBuyerRepository.save(buyer);
......@@ -348,7 +350,7 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
ObjectMapper objectMapper = new ObjectMapper();
String url = "CUD_SUPPLY/SUPPLY_DATA";
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("businessType", "suppliersInfo");
resultMap.put("businessType", "供应商主数据");
resultMap.put("businessId", suppliersInfo.getId());
resultMap.put("parameter", JSON.toJSONString(suppliersInfoVo));
List<SuppliersInfoVo> suppliersInfoVos = new ArrayList<>();
......@@ -356,13 +358,17 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
try {
String result = defaultHttpClient.execute(suppliersInfoVos, url);
List<SapResult> sapResultList = JSONObject.parseArray(result, SapResult.class);
if (sapResultList.size()<1){
throw new RuntimeException("数据传输失败,没有收到返回结果:" + sapResultList);
}
SapResult sapResult = sapResultList.get(0);
resultMap.put("sequence", resultMap.get("row"));
if ("S".equals(sapResult.getTYPE())) {
if ("S".equals(sapResult.getTYPE())&&"0".equals(suppliersInfo.getApplyType())) {
suppliersInfo.setPartner(sapResult.getMESSAGE_V1());
resultMap.put("type", sapResult.getTYPE());
resultMap.put("message", sapResult.getMESSAGE());
suppliersInfoRepository.save(suppliersInfo);
} else {
throw new RuntimeException("数据传输失败,请稍后手动重试!" + sapResult.getMESSAGE());
}
......@@ -471,9 +477,20 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
}
@Override
public List<SuppliersInfo> findDeletedSuppliersDataById(String id) {
public List<Map<String, Object>> findDeletedSuppliersDataById(SDO params) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "findDeletedByPartner");
QueryModel queryModel = new QueryModel();
queryModel.setSql(queryDescriptor.getSql());
queryModel.setPageIndex(1);
queryModel.setPageSize(10);
// queryModel.setSortFieldName("updateDate");
// queryModel.setSortOrder("desc");
queryModel.putParam("partner", params.getString("partner"));
Map<String, Object> map=this.sqlExecutorDao.executeSlicedQuery(queryModel);
List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("Rows");
List<SuppliersInfo> list = suppliersInfoRepository.findDeletedById(id);
return list;
}
......
......@@ -88,7 +88,10 @@ public class SuppliersDataController extends CommonController {
} else {
if (StringUtil.isNotBlank(bizId)) {
suppliersInfo = suppliersDataApplication.loadSuppliersDataById(bizId);
List deletedList=suppliersDataApplication.findDeletedSuppliersDataById(bizId);
sdo.putProperty("partner",suppliersInfo.getPartner());
List deletedList=suppliersDataApplication.findDeletedSuppliersDataById(sdo);
if (deletedList.size()>0){
throw new RuntimeException("该供应商已经执行删除,不能再次修改了!");
}
......
......@@ -273,6 +273,7 @@ public class SuppliersInfo extends FlowBillAbstractEntity {
@JsonProperty("UPDKZ")
private String updkz;
//申请类型 -1 删除 0 申请 1 修改
@Column(name = "apply_type")
private String applyType;
......
......@@ -2,6 +2,7 @@ package com.huigou.topsun.sap.suppliers.repository;
import com.huigou.topsun.sap.suppliers.domain.SuppliersInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
......@@ -13,5 +14,7 @@ import java.util.List;
public interface SuppliersInfoRepository extends JpaRepository<SuppliersInfo,String> {
// SapPurchaseOrder findAllByEbeln(String ebeln);
List<SuppliersInfo> findDeletedById(String id);
// @Query(" select t.* from sap_suppliers_info t where 1=1 and apply_type='-1' and status in (1,3) and id= #{id}")
// List<SuppliersInfo> findDeletedById(String id);
}
......@@ -12,7 +12,8 @@
LEFT JOIN bsn_message_sponsor t2 ON t2.id = t.message_sponsor_id
LEFT JOIN sap_non_prod_apply_dept ad ON ad.apply_dept_id = t2.business_id
left join sap_non_prod_apply_base_info bs on bs.id=ad.base_info_id
WHERE t.active IN (0, 3) and bs.distribute=1 and task_execute = :taskExecute
WHERE t.active IN (0, 3) and (bs.distribute=1 or (t.business_code='INIT_DPT' and bs.kind='product'))
and task_execute = :taskExecute
</sql-query>
</query>
......
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query name="sapDull" label="呆滞物料" table="sap_dull">
<sql-query>
select
t.*
from sap_dull t where 1=1
</sql-query>
<condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/>
</query>
</query-mappings>
\ No newline at end of file
......@@ -7,10 +7,10 @@
</sql-query>
<!-- <condition column="stats_indicators_id" name="statsIndicatorsId" type="java.lang.String" symbol="=" alias="t"/>-->
</query>
<query name="findDeletedById" label="查询是否存在删除的数据" table="sap_suppliers_info">
<query name="findDeletedByPartner" label="查询是否存在删除的数据" table="sap_suppliers_info">
<sql-query>
select t.* from sap_suppliers_info t
where 1=1 and apply_type='-1' and status in (1,3) and id= #{id}
where 1=1 and apply_type='-1' and status in (1,3) and partner=:partner
</sql-query>
</query>
......
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