Commit 1a9def1b authored by 鲁鑫's avatar 鲁鑫

供应商扩展功能

parent 17992933
...@@ -86,14 +86,14 @@ ...@@ -86,14 +86,14 @@
<!--x:selectC name="ktokk" label="供应商帐户组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup"/--> <!--x:selectC name="ktokk" label="供应商帐户组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup"/-->
<x:inputC name="kunnr" label="客户编号" labelCol="1" fieldCol="2"/> <x:inputC name="kunnr" label="客户编号" labelCol="1" fieldCol="2"/>
<%--<x:inputC name="vbund" label="贸易伙伴" labelCol="1" fieldCol="2"/>--%> <%--<x:inputC name="vbund" label="贸易伙伴" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="stenr" label="责任税务部门的税收编号" labelCol="2" fieldCol="2" required="true"/> <x:inputC name="stenr" label="税号" labelCol="1" fieldCol="2" required="true" maxLength="18"/>
<x:selectC name="sperr" label="中心记帐冻结" labelCol="1" fieldCol="1" dictionary="sperr"/> <x:selectC name="sperr" label="中心记帐冻结" labelCol="1" fieldCol="2" dictionary="sperr"/>
<x:selectC name="sperm" label="集中设置的采购冻结" labelCol="2" fieldCol="1" dictionary="sperrB"/> <x:selectC name="sperm" label="集中设置的采购冻结" labelCol="2" fieldCol="1" dictionary="sperrB"/>
</div> </div>
</div> </div>
<div style="padding-top: 15px;"> <div style="padding-top: 15px;">
<x:fileList bizCode="supplier" bizId="attbizId" id="supplierList" title="供应商资料" /> <x:fileList bizCode="supplier" bizId="attbizId" id="supplierList" title="营业执照/开票资料" />
</div> </div>
<div class="blank_div clearfix"></div> <div class="blank_div clearfix"></div>
<div id="sapSuppliersBuyerGrid" style="margin: 2px;"></div> <div id="sapSuppliersBuyerGrid" style="margin: 2px;"></div>
......
...@@ -15,7 +15,9 @@ function loadSuppliersDataListGrid() { ...@@ -15,7 +15,9 @@ function loadSuppliersDataListGrid() {
addHandler() addHandler()
}, },
updateHandler: showUpdateDialog, updateHandler: showUpdateDialog,
deleteHandler: deleteHandler extendHandler: {id: 'extendHandler', text: '扩展', img: 'fa-music', className: 'btn-gray',click: function () {
extendHandler();
}}
/* testHandler: {id: 'basicInfoMaintenance', text: '基本信息维护', img: 'fa-music', className: 'btn-gray', /* testHandler: {id: 'basicInfoMaintenance', text: '基本信息维护', img: 'fa-music', className: 'btn-gray',
click: function () { click: function () {
...@@ -38,16 +40,16 @@ function loadSuppliersDataListGrid() { ...@@ -38,16 +40,16 @@ function loadSuppliersDataListGrid() {
{display: "申请单编号", name: "billCode", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "申请单编号", name: "billCode", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请状态", name: "statusTextView", width: 60, minWidth: 60, type: "string", align: "left"}, {display: "申请状态", name: "statusTextView", width: 60, minWidth: 60, type: "string", align: "left"},
{display: "申请日期", name: "fillinDate", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "申请日期", name: "fillinDate", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "操作类型", name: "applyType", width: 80, minWidth: 60, type: "string", align: "left" {display: "操作类型", name: "applyTypeTextView", width: 80, minWidth: 60, type: "string", align: "left"
,render : function (record, rowindex, value, column) { // ,render : function (record, rowindex, value, column) {
if (value!=null&&value=="0") { // if (value!=null&&value=="0") {
return "新增"; // return "新增";
}else if (value!=null&&value=="1"){ // }else if (value!=null&&value=="1"){
return "修改"; // return "修改";
} else { // } else if (){
return "删除"; // return "删除";
} // }
} // }
}, },
{display: "业务伙伴分组", name: "buGroup", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "业务伙伴分组", name: "buGroup", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "业务伙伴编号", name: "partner", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "业务伙伴编号", name: "partner", width: 120, minWidth: 60, type: "string", align: "left"},
...@@ -202,7 +204,7 @@ function showUpdateDialog(id) { ...@@ -202,7 +204,7 @@ function showUpdateDialog(id) {
UICtrl.addTabItem({ UICtrl.addTabItem({
tabid: 'suppliersDataModi'+id, tabid: 'suppliersDataModi'+id,
text: "供应商主数据修改详情", text: "供应商主数据修改详情",
url: web_app.name + '/sapSuppliersData/forwardSuppliersDataApply.job?bizId='+result.id url: web_app.name + '/sapSuppliersData/forwardSuppliersDataApply.job?bizId='+result.id+ '&flag='+'update'
}); });
} }
...@@ -215,6 +217,24 @@ function showUpdateDialog(id) { ...@@ -215,6 +217,24 @@ function showUpdateDialog(id) {
// }); // });
// } // }
function extendHandler(){
let result=DataUtil.getUpdateRow(gridManager);
if (result.applyType=="-1"){
Public.tip("已经删除的不能再扩展!")
return false;
}
if(result.status!==3){
Public.tip("请选择一条审核完成后数据!")
return false;
}
UICtrl.addTabItem({
tabid: 'suppliersDataModi'+result.id,
text: "供应商主数据扩展详情",
url: web_app.name + '/sapSuppliersData/forwardSuppliersDataApply.job?bizId='+result.id + '&flag='+'extend'
});
}
// 关闭对话框 // 关闭对话框
function onDialogCloseHandler() { function onDialogCloseHandler() {
if (refreshFlag) { if (refreshFlag) {
......
var gridManager = null;
var sapSuppliersPayGridManager = null;
var sapSuppliersBuyerGridManager = null;
var sapSuppliersBankGridManager = null;
var canEdit=true,cashierGridCanEdit = false;
var nowEkorg,nowBankl,nowBukrs = null;
$(document).ready(function () {
initialize();
loadSuppliersPayListGrid();
loadSuppliersBuyerListGrid();
loadSuppliersBankListGrid();
bindEvent();
controlCashierGrid();
initNowData();
});
function initialize(){
UICtrl.layout("#layout", {leftWidth: 3});
$("#rltgr").val("Z00001X");
$('#supplierList').fileList({
bizId : $("#id").val()
});
}
/**
* 流程引擎回调设置打样的id
* @param value 打样申请的id
*/
function setId(bizId) {
$("#id").val(bizId);
var _grid = UICtrl.getGridManager('#sapSuppliersPayGrid');
_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();
$('#supplierList').fileList({
bizId : bizId
});
}
/**
* 流程引擎获取打样申请id的回掉方法。
* @return 打样申请的id
*/
function getId() {
var id=$("#id").val() || "";
return id;
}
function getsId() {
var sid=$("#id").val() || "";
// if (applyType!="0"){
// sid=$("#sId").val();
// }
return sid;
}
// 加载采购组织信息表格
function loadSuppliersBuyerListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
// 添加一行表格
addHandler: function () {
UICtrl.addGridRow(sapSuppliersBuyerGridManager,
{
// 行号加一
sequence: (sapSuppliersBuyerGridManager.getData().length + 1)*10,
webre:"X",
kalsk:"Z1"
}
);
},
// 删除
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#sapSuppliersBuyerGrid');
DataUtil.delSelectedRows({
action: 'sapSuppliersData/deleteSuppliersBuyers.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
sapSuppliersBuyerGridManager.loadData();
}
});
}
});
// 表格
sapSuppliersBuyerGridManager = UICtrl.grid("#sapSuppliersBuyerGrid", {
gridManager: null,
columns: getBuyColumns(),
dataAction: "server",
url: web_app.name + '/sapSuppliersData/slicedSuppliersBuyerData.ajax',
parms: {sId: getsId},
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
enabledEdit: canEdit,
width: "98%",
height: "300px",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(sapSuppliersBuyerGridManager);
}
function getBuyColumns(){
var columns = [];
columns.push({
display: "行号", name: "sequence", width: 80, minWidth: 60, type: "String", align: "left",
//editor: {type: 'spinner', min: 1, max: 100, mask: 'nnn'}
},)
columns.push({
display: "采购组织", name: "ekorgTextView", width: 200, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'ekorg'},
textField: 'ekorgTextView',
valueField: 'ekorg',
required: true,
render: function (item) {
if (nowEkorg.indexOf(item.ekorg) >= 0){
Public.tip("已维护采购组织"+item.ekorg);
return false;
}
return item.ekorgTextView;
}
},
},)
columns.push({
display: "货币码", name: "waersTextView", width: 140, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'waers'},
textField: 'waersTextView',
valueField: 'waers',
required: true,
render: function (item) {
return item.waersTextView;
}
},
},)
columns.push({
display: "付款条件", name: "payConditionTextView", width: 150, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'payCondition'},
textField: 'payConditionTextView',
valueField: 'payCondition',
required: true,
render: function (item) {
return item.payConditionTextView;
}
},
},)
columns.push({
display: "国际贸易条款", name: "inco1TextView", width: 200, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'inco1'},
textField: 'inco1TextView',
valueField: 'inco1',
required: false,
render: function (item) {
return item.inco1TextView;
}
},
},)
columns.push({
display: "国际贸易条款位置1", name: "inco2L", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},)
columns.push( {
display: "国际贸易条款位置2", name: "inco3L", width: 160, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},)
columns.push({
display: "收货的发票验证", name: "webre", width: 100, minWidth: 60, type: "String", align: "left",
//editor: {type: 'text', required: true}
},)
columns.push({
display: "供应商方案组", name: "kalsk", width: 140, minWidth: 60, type: "String", align: "left",
//editor: {type: 'text', required: true}
},)
columns.push({
display: "供应商销售人员", name: "verkf", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},)
columns.push({
display: "供应商电话号码", name: "telf1", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},)
columns.push({
display: "服务的发票校验标识", name: "lebre", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},)
columns.push( {
display: "采购冻结", name: "sperm", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},)
return columns;
}
// 加载付款信息表格
function loadSuppliersPayListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
// 添加一行表格
addHandler: function () {
UICtrl.addGridRow(sapSuppliersPayGridManager,
{
// 行号加一
sequence: (sapSuppliersPayGridManager.getData().length + 1)*10,reprf:"X"
}
);
},
// 删除选中的尺码信息
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#sapSuppliersPayGrid');
DataUtil.delSelectedRows({
action: 'sapSuppliersData/deleteSuppliersPays.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
sapSuppliersPayGridManager.loadData();
}
});
}
});
// 表格
sapSuppliersPayGridManager = UICtrl.grid("#sapSuppliersPayGrid", {
//gridManager: null,
columns: [
{
display: "行号", name: "sequence", width: 80, minWidth: 60, type: "String", align: "left",
//editor: {type: 'spinner', min: 1, max: 100, mask: 'nnn'}
},
{
display: "公司代码", name: "bukrs", width: 100, minWidth: 60, type: "String", align: "left",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "BUKRS",noContain:nowBukrs}
},
back: {
BUKRS: "bukrs",
}
},
}
},
{
display: "统驭科目", name: "akontTextView", width: 140, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'akont'},
textField: 'akontTextView',
valueField: 'akont',
required: true,
render: function (item) {
return item.akontTextView;
}
},
},
{
display: "根据分配号排序代码", name: "zuawa", width: 150, minWidth: 60, type: "String", align: "left",
render:function (item){
return item.sequence;
}
},
{
display: "付款条件", name: "ztermTextView", width: 100, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'zterm'},
textField: 'ztermTextView',
valueField: 'zterm',
required: true,
render: function (item) {
return item.ztermTextView;
}
},
},
{
display: "考虑的付款方式清单", name: "zwelsTextView", width: 140, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'zwels'},
textField: 'zwelsTextView',
valueField: 'zwels',
// checkbox:true,
required: true,
render: function (item) {
return item.zwelsTextView;
}
},
},
{
display: "检查双重发票", name: "reprf", width: 160, minWidth: 60, type: "String", align: "left",
//editor: {type: 'text', required: true}
},
{
display: "中心记帐冻结", name: "sperrTextView", width: 100, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'sperr'},
textField: 'sperrTextView',
valueField: 'sperr',
required: false,
render: function (item) {
return item.sperrTextView;
}
}
},
{
display: "对公司代码过帐冻结", name: "sperrBTextView", width: 140, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'sperrB'},
textField: 'sperrBTextView',
valueField: 'sperrB',
required: false,
render: function (item) {
return item.sperrBTextView;
}
}
},
],
dataAction: "server",
url: web_app.name + '/sapSuppliersData/slicedSuppliersPayData.ajax',
parms: {sId: getsId},
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
enabledEdit: canEdit,
width: "98%",
height: "300px",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
// onAfterEdit:function (item) {
// if(item.column.name == "bukrs"){
// var bukrs = item.record.bukrs;
// if (nowBukrs.indexOf(bukrs) >= 0 && Public.isNotBlank(bukrs)){
// item.record.bukrs = "";
// Public.tip("已维护公司代码"+bukrs);
// return false;
// }
// }
// }
});
UICtrl.setSearchAreaToggle(sapSuppliersPayGridManager);
}
// 加载银行信息表格
function loadSuppliersBankListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
// 添加一行表格
addHandler: function () {
UICtrl.addGridRow(sapSuppliersBankGridManager,
{
// 行号加一
sequence: (sapSuppliersBankGridManager.getData().length + 1)*10
}
);
},
// 删除选中的尺码信息
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#sapSuppliersBankGrid');
DataUtil.delSelectedRows({
action: 'sapSuppliersData/deleteSuppliersBanks.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
sapSuppliersBankGridManager.loadData();
}
});
}
});
// 表格
sapSuppliersBankGridManager = UICtrl.grid("#sapSuppliersBankGrid", {
gridManager: null,
columns: [
{
display: "行号", name: "sequence", width: 80, minWidth: 60, type: "String", align: "left",
//editor: {type: 'spinner', min: 1, max: 100, mask: 'nnn'}
},
{
display: "银行所属国家", name: "banksTextView", width: 150, minWidth: 60, type: "String", align: "left",
/* editor: {
type: 'dictionary',
data: {name: 'country'},
emptyOption:true,
textField: 'banksTextView',
valueField: 'banks',
required: true,
render: function (item) {
return item.banksTextView;
}
},*/
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "dictionarySelect",
getParam: function (item) {
return {fieldName: "country",displayNames:"国家",displayLens:"180"}
},
// checkbox:true,
// checkboxIndex:'value',
back: {
value: "banks",
name:"banksTextView"
}
// valueIndex:'value'
},
}
},
{
display: "银行代码", name: "bankl", width: 200, minWidth: 60, type: "String", align: "left",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "getBankInfo",
getParam: function (item) {
return {
BANKS: item.banks,
noContain:nowBankl
}
},
back: {
BANKL: "bankl",
BANKA: "banka"
}
},
}
},
{
display: "银行名称", name: "banka", width: 300, minWidth: 60, type: "String", align: "left",
//editor: {type: 'text', required: false}
},
{
display: "银行帐户号码", name: "bankn", width: 200, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: true, maxLength :18 }
},
{
display: "银行细目的参考明细", name: "bkref", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},
{
display: "账户持有人姓名", name: "koinh", width: 120, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},
{
display: "银行控制代码", name: "bkont", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},
{
display: "对方开户行类型", name: "bvtyp", width: 160, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},
{
display: "分行", name: "brnch", width: 200, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
}
],
dataAction: "server",
url: web_app.name + '/sapSuppliersData/slicedSuppliersBankData.ajax',
parms: {sId: getsId},
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
enabledEdit: canEdit,
width: "98%",
height: "300px",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(sapSuppliersBankGridManager);
}
//获取数据保存的参数
function getExtendedData(processAction) {
//回退、打回、转交时,不需要验证必填项是否已经填写;
if (processAction == ProcessAction.BACK
|| processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) {
//不验证
$('#submitForm').attr('check', false);
}
const isAllData = $('#oldId') || !getId();
var extendedData = {};
var _grid = UICtrl.getGridManager('#sapSuppliersPayGrid');
if (_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: isAllData
});
if (!datas) {
return false;
}
extendedData.suppliersPayList = Public.encodeJSONURI(datas);
}
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
});
if (!datas) {
return false;
}
extendedData.suppliersBuyerList = Public.encodeJSONURI(datas);
}
var _grid = UICtrl.getGridManager('#sapSuppliersBankGrid');
if (_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: isAllData
});
if (!datas) {
return false;
}
extendedData.suppliersBankList = Public.encodeJSONURI(datas);
}
return extendedData;
}
function bindEvent(){
$('#land1Name').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {
fieldName: "LAND1",
}
},
onChange: function (value, data) {
$('#land1').val(data.LAND1);
$('#land1Name').val(data.LANDX);
}
});
$('#regionName').searchbox({
type: "system", name: "getArea",
getParam: function (item) {
if (Public.isBlank($('#land1').val())){
Public.tip("请先选择国家")
return false;
}
return {
LAND1: $('#land1').val(),
}
},
onChange: function (value, data) {
$('#region').val(data.BLAND);
$('#regionName').val(data.BEZEI);
}
});
$('#city1Name').searchbox({
type: "system", name: "getArea",
getParam: function (item) {
if (Public.isBlank($('#land1').val())){
Public.tip("请先选择国家")
return false;
}
return {
LAND1: $('#land1').val(),
}
},
onChange: function (value, data) {
$('#city1').val(data.BLAND);
$('#city1Name').val(data.BEZEI);
}
});
}
function reloadGrid() {
sid=$("#id").val();
sapSuppliersPayGridManager.loadData();
sapSuppliersBuyerGridManager.loadData();
sapSuppliersBankGridManager.loadData();
}
function controlCashierGrid(){
var status = $("#statusId").val();
if (status == 0 || status == 1){
$("#cashierGrid").hide();
}
let subProcUnitId = getSubProcUnitId();
if ("cashier" == subProcUnitId){
$("#cashierGrid").show();
}
if ("finance" == subProcUnitId){
$("#cashierGrid").show();
}
}
function initNowData(){
var partner = $("#partner").val();
Public.ajax(web_app.name+"/sapSuppliersData/getSupplierNowItemList.ajax",{partner:partner},function (data){
nowBankl = data.nowBankl;
nowEkorg = data.nowEkorg;
nowBukrs = data.nowBukrs
})
}
//UICtrl中校验是否允许编辑
// function businessJudgmentUnit() {
// var isApply = isApplyProcUnit();
// if (isApply) {
// return true;
// }else {
// UICtrl.setDisable($("#submitForm"));
// }
// //资金岗
// if ("cashier" === getSubProcUnitId()){
// cashierGridCanEdit = true;
// canEdit = false;
// }
// return true;
// }
\ No newline at end of file
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<script type="text/javascript">
var applyType ="${applyType}";
</script>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date,attachment"/>
<x:script src='/biz/topsun/sap/suppliers/suppliersExtendDataDetail.js'/>
</head>
<body>
<x:billTitle title="供应商主数据扩展申请表" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<x:hidden name="sId"/>
<x:hidden name="applyType"/>
<%-- <x:hidden name="billCode"/>--%>
<%-- <x:hidden name="fillinDate" type="datetime"/>--%>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<%-- <x:hidden name="deptName"/>--%>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="statusId"/>
<%-- <x:hidden name="personMemberName"/>--%>
<x:title title="申请人填写区域" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="billCode" label="申请单编号" labelCol="1" readonly="true" fieldCol="2"/>
<x:inputC name="personMemberName" label="申请人" readonly="true" labelCol="1" fieldCol="2"/>
<x:inputC name="deptName" label="申请部门" readonly="true" labelCol="1" fieldCol="2"/>
<x:inputC name="fillinDate" label="申请日期" readonly="true" wrapper="date" labelCol="1" fieldCol="2"/>
</div>
</div>
<x:title title="供应商主数据" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="rltgr" label="业务伙伴角色" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:selectC name="buGroup" label="业务伙伴分组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup" disabled="true"/>
<x:inputC name="partner" label="供应商编码" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:selectC name="title" label="称谓代码" labelCol="1" fieldCol="2" dictionary="title" disabled="true"/>
<x:inputC name="nameOrg1" label="供应商名称1" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="nameOrg2" label="供应商名称2" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="nameOrg3" label="组织名称3" labelCol="1" fieldCol="2"/>
<x:inputC name="nameOrg4" label="组织名称4" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="buSort1" label="搜索词1" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="buSort2" label="搜索词2" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="strSuppl1" label="街道2" labelCol="1" fieldCol="2"/>
<x:inputC name="strSuppl2" label="街道3" labelCol="1" fieldCol="2"/>
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="land1Name" label="国家" labelCol="1" fieldCol="2" required="true" wrapper="select" readonly="true"/>
<x:hidden name="land1"/>
<x:inputC name="regionName" label="地区" labelCol="1" fieldCol="2" required="true" wrapper="select" readonly="true"/>
<x:hidden name="region"/>
<x:inputC name="city1" label="城市" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="street" label="街道地址" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="strSuppl1" label="街道2" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="strSuppl2" label="街道3" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="strSuppl4" label="街道5" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu" disabled="true"/>
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6" readonly="true"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="telExtens" label="第一个电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="faxNumber" label="传真" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<%--<x:inputC name="faxExtens" label="第一个传真号分机号" labelCol="1" fieldCol="2"/>--%>
<!--x:selectC name="ktokk" label="供应商帐户组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup"/-->
<x:inputC name="kunnr" label="客户编号" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="vbund" label="贸易伙伴" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="stenr" label="税号" labelCol="1" fieldCol="2" required="true" maxLength="18" readonly="true"/>
<x:selectC name="sperr" label="中心记帐冻结" labelCol="1" fieldCol="2" dictionary="sperr" disabled="true"/>
<x:selectC name="sperm" label="集中设置的采购冻结" labelCol="2" fieldCol="1" dictionary="sperrB" disabled="true"/>
</div>
</div>
<div style="padding-top: 15px;">
<x:fileList bizCode="supplier" bizId="attbizId" id="supplierList" title="营业执照/开票资料" />
</div>
<div class="blank_div clearfix"></div>
<div id="sapSuppliersBuyerGrid" style="margin: 2px;"></div>
<div id="cashierGrid">
<div class="blank_div clearfix"></div>
<div id="sapSuppliersPayGrid" style="margin: 2px;"></div>
<div class="blank_div clearfix"></div>
<div id="sapSuppliersBankGrid" style="margin: 2px;"></div>
</div>
</form>
</body>
</html>
...@@ -21,6 +21,7 @@ public interface SuppliersDataApplication { ...@@ -21,6 +21,7 @@ public interface SuppliersDataApplication {
String PROCESS_DEFINITION_KEY = "sapSuppliersDataProc"; String PROCESS_DEFINITION_KEY = "sapSuppliersDataProc";
String PROCESS_DEFINITION_KEY2 = "sapSuppliersDataModiProc"; String PROCESS_DEFINITION_KEY2 = "sapSuppliersDataModiProc";
String PROCESS_DEFINITION_KEY3 = "sapSuppliersDataDeleProc"; String PROCESS_DEFINITION_KEY3 = "sapSuppliersDataDeleProc";
String PROCESS_DEFINITION_KEY4 = "sapSuppliersDataExteProc";
String QUERY_XML_FILE_PATH= "config/topsun/sap/sapSuppliersData/suppliersData.xml"; String QUERY_XML_FILE_PATH= "config/topsun/sap/sapSuppliersData/suppliersData.xml";
...@@ -46,4 +47,8 @@ public interface SuppliersDataApplication { ...@@ -46,4 +47,8 @@ public interface SuppliersDataApplication {
void deleteSuppliersBankByIds( List<String> ids); void deleteSuppliersBankByIds( List<String> ids);
List<Map<String, String>> selectSuppliersDatas(String types); List<Map<String, String>> selectSuppliersDatas(String types);
String checkApprovalStatus(String partner);
Map<String, String> getSupplierNowItemList(String partner);
} }
...@@ -3,10 +3,8 @@ package com.huigou.topsun.sap.suppliers.application.impl; ...@@ -3,10 +3,8 @@ package com.huigou.topsun.sap.suppliers.application.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.JsonObject;
import com.huigou.cache.DictUtil; import com.huigou.cache.DictUtil;
import com.huigou.data.domain.model.CommonDomainConstants; import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.query.model.QueryDescriptor; import com.huigou.data.query.model.QueryDescriptor;
...@@ -14,7 +12,6 @@ import com.huigou.data.query.model.QueryModel; ...@@ -14,7 +12,6 @@ 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.common.domain.SapResult;
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.*;
import com.huigou.topsun.sap.suppliers.domain.query.SuppliersBankQueryRequest; import com.huigou.topsun.sap.suppliers.domain.query.SuppliersBankQueryRequest;
...@@ -36,14 +33,15 @@ import com.huigou.util.*; ...@@ -36,14 +33,15 @@ import com.huigou.util.*;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask; import org.activiti.engine.delegate.DelegateTask;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Service("suppliersDataApplication") @Service("suppliersDataApplication")
public class SuppliersDataApplicationImpl extends FlowBroker implements SuppliersDataApplication { public class SuppliersDataApplicationImpl extends FlowBroker implements SuppliersDataApplication {
...@@ -266,11 +264,7 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -266,11 +264,7 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
protected void onEnd(DelegateExecution delegateExecution) { protected void onEnd(DelegateExecution delegateExecution) {
super.onEnd(delegateExecution); super.onEnd(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey(); String bizId = delegateExecution.getProcessBusinessKey();
BizBillStatus status = approvePassed() ? BizBillStatus.COMPLETED : BizBillStatus.ABORTED;
SuppliersInfo suppliersInfo = suppliersInfoRepository.findOne(bizId); SuppliersInfo suppliersInfo = suppliersInfoRepository.findOne(bizId);
suppliersInfo.setStatusId(status.getId());
suppliersInfoRepository.save(suppliersInfo);
List<SuppliersPay> payList = this.suppliersPayRepository.findAllBySId(suppliersInfo.getId()); List<SuppliersPay> payList = this.suppliersPayRepository.findAllBySId(suppliersInfo.getId());
List<SuppliersBuyer> buyerList = this.suppliersBuyerRepository.findAllBySId(suppliersInfo.getId()); List<SuppliersBuyer> buyerList = this.suppliersBuyerRepository.findAllBySId(suppliersInfo.getId());
...@@ -278,6 +272,9 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -278,6 +272,9 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
List<SuppliersBank> bankList = this.suppliersBankRepository.findAllBySId(suppliersInfo.getId()); List<SuppliersBank> bankList = this.suppliersBankRepository.findAllBySId(suppliersInfo.getId());
sendSapData(suppliersInfo, payList, buyerList, bankList); sendSapData(suppliersInfo, payList, buyerList, bankList);
BizBillStatus status = approvePassed() ? BizBillStatus.COMPLETED : BizBillStatus.ABORTED;
suppliersInfo.setStatusId(status.getId());
suppliersInfoRepository.save(suppliersInfo);
} }
...@@ -320,6 +317,15 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -320,6 +317,15 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
if (suppliersInfo.getApplyType().equals("-1")) { //删除 if (suppliersInfo.getApplyType().equals("-1")) { //删除
suppliersInfoVo.setUpdkz("D"); suppliersInfoVo.setUpdkz("D");
} }
if (suppliersInfo.getApplyType().equals("2")) { //扩展
suppliersInfoVo.setUpdkz("U");
List<SuppliersPay> otherPayList = this.getOtherPayList(suppliersInfo.getPartner());
payList.addAll(otherPayList);
List<SuppliersBank> otherBankList = this.getOtherBankList(suppliersInfo.getPartner());
bankList.addAll(otherBankList);
List<SuppliersBuyer> otherBuyerList = this.getOtherBuyerList(suppliersInfo.getPartner());
buyerList.addAll(otherBuyerList);
}
if ("0".equals(suppliersInfoVo.getSperr())){ if ("0".equals(suppliersInfoVo.getSperr())){
suppliersInfoVo.setSperr(""); suppliersInfoVo.setSperr("");
} }
...@@ -350,13 +356,13 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -350,13 +356,13 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
for (SuppliersBank suppliersBank : bankList) { for (SuppliersBank suppliersBank : bankList) {
SuppliersBankVo bankVo = new SuppliersBankVo(); SuppliersBankVo bankVo = new SuppliersBankVo();
ClassHelper.copyProperties(suppliersBank, bankVo); ClassHelper.copyProperties(suppliersBank, bankVo);
//银行账户 //银行账户,BPM不处理,SAP处理
if (bankVo.getBankn().length() > 18){ // if (bankVo.getBankn().length() > 18){
String bankn = bankVo.getBankn(); // String bankn = bankVo.getBankn();
bankVo.setBankn(bankn.substring(0,18)); // bankVo.setBankn(bankn.substring(0,18));
//账户明细放18位后的值 // //账户明细放18位后的值
bankVo.setBkref(bankn.substring(18,bankn.length())); // bankVo.setBkref(bankn.substring(18,bankn.length()));
} // }
//财务机构名称赋值组织名称1 //财务机构名称赋值组织名称1
bankVo.setBanka(suppliersInfoVo.getNameOrg1()); bankVo.setBanka(suppliersInfoVo.getNameOrg1());
bankVoList.add(bankVo); bankVoList.add(bankVo);
...@@ -430,6 +436,8 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -430,6 +436,8 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
return String.format("%s-%s(%s)", "供应商主数据修改", "", fillinDateStr); return String.format("%s-%s(%s)", "供应商主数据修改", "", fillinDateStr);
} else if (suppliersInfo.getApplyType().equals("-1")) { } else if (suppliersInfo.getApplyType().equals("-1")) {
return String.format("%s-%s(%s)", "供应商主数据删除", "", fillinDateStr); return String.format("%s-%s(%s)", "供应商主数据删除", "", fillinDateStr);
}else if (suppliersInfo.getApplyType().equals("2")) {
return String.format("%s-%s(%s)", "供应商主数据扩展", "", fillinDateStr);
} else { } else {
return String.format("%s-%s(%s)", "供应商主数据申请", "", fillinDateStr); return String.format("%s-%s(%s)", "供应商主数据申请", "", fillinDateStr);
} }
...@@ -564,4 +572,120 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier ...@@ -564,4 +572,120 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
} }
return list; return list;
} }
@Override
public String checkApprovalStatus(String partner) {
List<SuppliersInfo> suppliersInfoList = suppliersInfoRepository.findByPartner(partner);
//如果有单据在审批或者申请中,也不能做任何操作
for (SuppliersInfo suppliersInfo : suppliersInfoList) {
//先判断是否已删除,如果删除不能做任何操作
if ("-1".equals(suppliersInfo.getApplyType())){
return "已删除";
}
}
return null;
}
/**
* 获取供应商编码下有效的采购组织、银行、公司代码
* @param partner
* @return
*/
@Override
public Map<String, String> getSupplierNowItemList(String partner){
List<SuppliersBuyer> buyerList = this.getOtherBuyerList(partner);
List<SuppliersBank> bankList = this.getOtherBankList(partner);
List<SuppliersPay> payList = this.getOtherPayList(partner);
//已维护的采购组织
Set<String> ekorgSet = buyerList
.stream()
.map(SuppliersBuyer::getEkorg)
.collect(Collectors.toSet());
String ekorg = StringUtils.join(ekorgSet, ",");
//已维护的银行组织
Set<String> banklSet = bankList
.stream()
.map(SuppliersBank::getBankl)
.collect(Collectors.toSet());
String bankl = StringUtils.join(banklSet, ",");
//已维护的公司代码
Set<String> bukrsSet = payList
.stream()
.map(SuppliersPay::getBukrs)
.collect(Collectors.toSet());
String bukrs = StringUtils.join(bukrsSet, ",");
Map<String,String> map = new HashMap<>();
map.put("nowEkorg",ekorg);
map.put("nowBankl",bankl);
map.put("nowBukrs",bukrs);
return map;
}
public Map<String,String> getIdGroup(String partner){
List<SuppliersInfo> suppliersInfoList = suppliersInfoRepository.findByPartner(partner);
suppliersInfoList = suppliersInfoList
.stream()
.filter(suppliersInfo->BizBillStatus.COMPLETED.getId() == suppliersInfo.getStatusId())
.sorted(Comparator.comparing(SuppliersInfo::getFillinDate))
.collect(Collectors.toList());
String id = "";
String extendId = "";
for (SuppliersInfo suppliersInfo : suppliersInfoList) {
//如果是新增的,那么根据新增的id查询明细
if ("0".equals(suppliersInfo.getApplyType())){
id = suppliersInfo.getId();
}
//如果有修改的,排序后,取时间最大的供应商id查询明细
if ("1".equals(suppliersInfo.getApplyType())){
id = suppliersInfo.getId();
}
//如果是扩展的,排序后,取时间最大的供应商id查询明细
if ("2".equals(suppliersInfo.getApplyType())){
extendId = suppliersInfo.getId();
}
}
Map<String,String> map = new HashMap<>();
map.put("id",id);
map.put("extendId",extendId);
return map;
}
public List<SuppliersBuyer> getOtherBuyerList(String partner){
Map<String, String> idGroup = this.getIdGroup(partner);
//采购组织
List<SuppliersBuyer> buyerList = suppliersBuyerRepository.findAllBySId(idGroup.get("id"));
List<SuppliersBuyer> extendBuyerList = suppliersBuyerRepository.findAllBySId(idGroup.get("extendId"));
buyerList.addAll(extendBuyerList);
return buyerList;
}
public List<SuppliersBank> getOtherBankList(String partner){
Map<String, String> idGroup = this.getIdGroup(partner);
//银行信息
List<SuppliersBank> bankList = suppliersBankRepository.findAllBySId(idGroup.get("id"));
List<SuppliersBank> extendBankList = suppliersBankRepository.findAllBySId(idGroup.get("extendId"));
bankList.addAll(extendBankList);
return bankList;
}
public List<SuppliersPay> getOtherPayList(String partner){
Map<String, String> idGroup = this.getIdGroup(partner);
//付款信息
List<SuppliersPay> payList = suppliersPayRepository.findAllBySId(idGroup.get("id"));
List<SuppliersPay> extendPayList = suppliersPayRepository.findAllBySId(idGroup.get("extendId"));
payList.addAll(extendPayList);
return payList;
}
} }
...@@ -70,9 +70,11 @@ public class SuppliersDataController extends CommonController { ...@@ -70,9 +70,11 @@ public class SuppliersDataController extends CommonController {
this.putAttribute("applyType","0"); this.putAttribute("applyType","0");
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
String bizId=sdo.getString("bizId"); String bizId=sdo.getString("bizId");
String flag=sdo.getString("flag");
SuppliersInfo suppliersInfo = new SuppliersInfo(); SuppliersInfo suppliersInfo = new SuppliersInfo();
suppliersInfo.setApplyType("0"); suppliersInfo.setApplyType("0");
String isDel=sdo.getString("isDel"); String isDel=sdo.getString("isDel");
String page = "suppliersDataDetail";
if (StringUtil.isNotBlank(isDel)){ //删除流程 if (StringUtil.isNotBlank(isDel)){ //删除流程
suppliersInfo = suppliersDataApplication.loadSuppliersDataById(bizId); suppliersInfo = suppliersDataApplication.loadSuppliersDataById(bizId);
this.putAttribute("processDefinitionKey", SuppliersDataApplication.PROCESS_DEFINITION_KEY3); this.putAttribute("processDefinitionKey", SuppliersDataApplication.PROCESS_DEFINITION_KEY3);
...@@ -98,9 +100,17 @@ public class SuppliersDataController extends CommonController { ...@@ -98,9 +100,17 @@ public class SuppliersDataController extends CommonController {
if (deletedList.size()>0){ if (deletedList.size()>0){
throw new RuntimeException("该供应商已经执行删除,不能再次修改了!"); throw new RuntimeException("该供应商已经执行删除,不能再次修改了!");
} }
if ("update".equals(flag)){
this.putAttribute("processDefinitionKey", SuppliersDataApplication.PROCESS_DEFINITION_KEY2); this.putAttribute("processDefinitionKey", SuppliersDataApplication.PROCESS_DEFINITION_KEY2);
this.putAttribute("applyType", "1"); this.putAttribute("applyType", "1");
suppliersInfo.setApplyType("1"); suppliersInfo.setApplyType("1");
} else if ("extend".equals(flag)) {
this.putAttribute("processDefinitionKey", SuppliersDataApplication.PROCESS_DEFINITION_KEY4);
this.putAttribute("applyType", "2");//扩展
suppliersInfo.setApplyType("2");
page = "suppliersExtendDataDetail";
}
suppliersInfo.setBillCode(""); suppliersInfo.setBillCode("");
suppliersInfo.setId(""); suppliersInfo.setId("");
// suppliersInfo.setSId(bizId); // suppliersInfo.setSId(bizId);
...@@ -117,7 +127,7 @@ public class SuppliersDataController extends CommonController { ...@@ -117,7 +127,7 @@ public class SuppliersDataController extends CommonController {
Operator operator = getOperator();//获取当前操作员的详情信息 Operator operator = getOperator();//获取当前操作员的详情信息
suppliersInfo.setDefaultValues(new OrgUnit(operator.getFullId(),operator.getFullName())); suppliersInfo.setDefaultValues(new OrgUnit(operator.getFullId(),operator.getFullName()));
return forward("suppliersDataDetail",suppliersInfo); return forward(page,suppliersInfo);
} }
public String showSuppliersData() { public String showSuppliersData() {
...@@ -130,6 +140,9 @@ public class SuppliersDataController extends CommonController { ...@@ -130,6 +140,9 @@ public class SuppliersDataController extends CommonController {
if (!(suppliersInfo.getApplyType().equals("0"))){ if (!(suppliersInfo.getApplyType().equals("0"))){
this.putAttribute("sId", id); this.putAttribute("sId", id);
this.putAttribute("applyType",suppliersInfo.getApplyType()); this.putAttribute("applyType",suppliersInfo.getApplyType());
if ("2".equals(suppliersInfo.getApplyType())){
return forward("suppliersExtendDataDetail", suppliersInfo);
}
} }
return forward("suppliersDataDetail", suppliersInfo); return forward("suppliersDataDetail", suppliersInfo);
} }
...@@ -190,4 +203,18 @@ public class SuppliersDataController extends CommonController { ...@@ -190,4 +203,18 @@ public class SuppliersDataController extends CommonController {
impDataFromXLS.readFile(); impDataFromXLS.readFile();
return success(); return success();
} }
public String checkApprovalStatus(){
SDO sdo = this.getSDO();
String partner = sdo.getString("partner");
suppliersDataApplication.checkApprovalStatus(partner);
return success();
}
public String getSupplierNowItemList(){
SDO sdo = this.getSDO();
String partner = sdo.getString("partner");
Map<String, String> map = suppliersDataApplication.getSupplierNowItemList(partner);
return toResult(map);
}
} }
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="sapSuppliersDataExteProc" name="供应商主数据扩展" isExecutable="true">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="#{suppliersDataApplication}"></activiti:executionListener>
<activiti:executionListener event="end" delegateExpression="#{suppliersDataApplication}"></activiti:executionListener>
</extensionElements>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="Apply" name="供应商主数据扩展申请" activiti:formKey="sapSuppliersData/showSuppliersData.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{suppliersDataApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{suppliersDataApplication}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="Approve" name="供应商主数据扩展审批" activiti:assignee="${assignee} " activiti:formKey="sapSuppliersData/showSuppliersData.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{suppliersDataApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{suppliersDataApplication}"></activiti:taskListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="handlerList" activiti:elementVariable="assignee">
<completionCondition>${chiefApprovePassed}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="Apply"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="Apply" targetRef="Approve"></sequenceFlow>
<exclusiveGateway id="ApproveFinished" name="审批结束"></exclusiveGateway>
<sequenceFlow id="flow3" name="审批通过" sourceRef="ApprovePassed" targetRef="ApproveFinished">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approvePassed}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow4" name="审批结束" sourceRef="ApproveFinished" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approveFinished}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow5" name="审批未结束" sourceRef="ApproveFinished" targetRef="Approve">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approveFinished}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="ApprovePassed" name="审批通过"></exclusiveGateway>
<sequenceFlow id="flow6" sourceRef="Approve" targetRef="ApprovePassed"></sequenceFlow>
<sequenceFlow id="flow9" name="审批未通过" sourceRef="ApprovePassed" targetRef="Apply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approvePassed}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_sapSuppliersDataProc">
<bpmndi:BPMNPlane bpmnElement="sapSuppliersDataProc" id="BPMNPlane_sapSuppliersDataProc">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="50.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="550.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Apply" id="BPMNShape_Apply">
<omgdc:Bounds height="55.0" width="161.0" x="292.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Approve" id="BPMNShape_Approve">
<omgdc:Bounds height="55.0" width="161.0" x="292.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ApproveFinished" id="BPMNShape_ApproveFinished">
<omgdc:Bounds height="40.0" width="40.0" x="352.0" y="440.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ApprovePassed" id="BPMNShape_ApprovePassed">
<omgdc:Bounds height="40.0" width="40.0" x="352.0" y="349.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="372.0" y="85.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="140.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="372.0" y="195.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="240.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="372.0" y="389.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="440.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="320.0" y="396.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="372.0" y="480.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="550.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="382.0" y="489.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="392.0" y="460.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="459.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="317.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="267.0"></omgdi:waypoint>
<omgdi:waypoint x="489.0" y="267.0"></omgdi:waypoint>
<omgdi:waypoint x="453.0" y="267.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="60.0" x="459.0" y="411.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="372.0" y="295.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="349.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="352.0" y="369.0"></omgdi:waypoint>
<omgdi:waypoint x="231.0" y="369.0"></omgdi:waypoint>
<omgdi:waypoint x="231.0" y="167.0"></omgdi:waypoint>
<omgdi:waypoint x="292.0" y="167.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="60.0" x="257.0" y="376.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ 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