Commit f31360da authored by 鲁鑫's avatar 鲁鑫

财务客户功能

parent 950db84a
var gridManager = null;
var sapFinaCustomerPayGridManager = null;
var sapFinaCustomerBankGridManager = null;
var canEdit=true;
$(document).ready(function () {
initialize();
loadFinaCustomerPayListGrid();
loadFinaCustomerBankListGrid();
bindEvent();
});
function initialize(){
UICtrl.layout("#layout", {leftWidth: 3});
if (applyType=="-1"){
// $("form[id='submitForm']:text").attr("disabled","disabled");
// disableForm("submitForm","disabled");
UICtrl.setDisable($("#submitForm"));
canEdit=false;
}
if (applyType=="1"){
UICtrl.disable("#zbz01");
}
$('#supplierList').fileList({
bizId : $("#id").val()
});
}
/**
* 流程引擎回调设置打样的id
* @param value 打样申请的id
*/
function setId(bizId) {
$("#id").val(bizId);
var _grid = UICtrl.getGridManager('#sapFinaCustomerPayGrid');
_grid.options.parms.sId = bizId;
var _grid3 = UICtrl.getGridManager('#sapFinaCustomerBankGrid');
_grid3.options.parms.sId = bizId;
$("#sId").val(bizId);
sapFinaCustomerPayGridManager.loadData();
sapFinaCustomerBankGridManager.loadData();
$('#supplierList').fileList({
bizId : bizId
});
}
/**
* 流程引擎获取打样申请id的回掉方法。
* @return 打样申请的id
*/
function getId() {
var id=$("#id").val() || "";
return id;
}
function getsId() {
var sid=$("#id").val() || ""; //alert(applyType); alert($("#sId").val());
if (applyType!="0"){ // alert("sID=00===="+$("#sId").val())
sid=$("#sId").val();
}
return sid;
}
// 加载付款信息表格
function loadFinaCustomerPayListGrid() {
var toolbarOptions = null;
if (applyType == 0){
toolbarOptions = UICtrl.getDefaultToolbarOptions({
// 添加一行表格
addHandler: function () {
UICtrl.addGridRow(sapFinaCustomerPayGridManager,
{
// 行号加一
sequence: (sapFinaCustomerPayGridManager.getData().length + 1)*10,
//( "0000000000000000" + num ).substr( -length )
zuawa: "000" + (sapFinaCustomerPayGridManager.getData().length + 1)
}
);
},
// 删除选中的尺码信息
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#sapFinaCustomerPayGrid');
DataUtil.delSelectedRows({
action: 'finaCustomer/deleteFinaCustomerPays.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
sapFinaCustomerPayGridManager.loadData();
}
});
}
});
}
// 表格
sapFinaCustomerPayGridManager = UICtrl.grid("#sapFinaCustomerPayGrid", {
//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"}
},
back: {
BUKRS: "bukrs",
}
},
}
},
{
display: "统驭科目", name: "akontCustomerTextView", width: 140, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'akontCustomer'},
textField: 'akontCustomerTextView',
valueField: 'akontCustomer',
required: true,
render: function (item) {
return item.akontCustomerTextView;
}
},
},
{
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: false,
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: false,
render: function (item) {
return item.zwelsTextView;
}
},
},
{
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 + '/finaCustomer/slicedFinaCustomerPayData.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(sapFinaCustomerPayGridManager);
}
// 加载银行信息表格
function loadFinaCustomerBankListGrid() {
var toolbarOptions = null;
if (applyType == 0){
toolbarOptions = UICtrl.getDefaultToolbarOptions({
// 添加一行表格
addHandler: function () {
UICtrl.addGridRow(sapFinaCustomerBankGridManager,
{
// 行号加一
sequence: (sapFinaCustomerBankGridManager.getData().length + 1)*10
}
);
},
// 删除选中的尺码信息
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#sapFinaCustomerBankGrid');
DataUtil.delSelectedRows({
action: 'finaCustomer/deleteFinaCustomerBanks.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
sapFinaCustomerBankGridManager.loadData();
}
});
}
});
}
// 表格
sapFinaCustomerBankGridManager = UICtrl.grid("#sapFinaCustomerBankGrid", {
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: {
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}
},
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: "accname", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},
],
dataAction: "server",
url: web_app.name + '/finaCustomer/slicedFinaCustomerBankData.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(sapFinaCustomerBankGridManager);
}
//获取数据保存的参数
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('#sapFinaCustomerPayGrid');
if (_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: isAllData
});
if (!datas) {
return false;
}
extendedData.finaCustomerPayList = Public.encodeJSONURI(datas);
}
var bank_grid = UICtrl.getGridManager('#sapFinaCustomerBankGrid');
if (bank_grid) {
var datas = DataUtil.getGridData({
gridManager: bank_grid,
isAllData: isAllData
});
if (!datas) {
return false;
}
extendedData.finaCustomerBankList = Public.encodeJSONURI(datas);
}
return extendedData;
}
function checkConstraints(){
//银行信息
var bank_grid = UICtrl.getGridManager('#sapFinaCustomerBankGrid');
if (bank_grid) {
var datas = DataUtil.getGridData({
gridManager: bank_grid,
isAllData: true
});
if (!datas) {
return false;
}
if (isApproveProcUnit() && datas.length == 0 && "2" != getHandleResult()){
Public.tip("财务客户银行信息必填");
return false;
}
}
//付款信息
var pay_grid = UICtrl.getGridManager('#sapFinaCustomerPayGrid');
if (pay_grid) {
var datas = DataUtil.getGridData({
gridManager: pay_grid,
isAllData: true
});
if (!datas) {
return false;
}
if (isApproveProcUnit() && datas.length == 0 && "2" != getHandleResult()){
Public.tip("财务客户付款信息必填");
return false;
}
}
return true;
}
function bindEvent(){
$('#countryName').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {
fieldName: "LAND1",
}
},
onChange: function (value, data) {
$('#country').val(data.LAND1);
$('#countryName').val(data.LANDX);
}
});
$('#regionName').searchbox({
type: "system", name: "getArea",
getParam: function (item) {
if (Public.isBlank($('#country').val())){
Public.tip("请先选择国家")
return false;
}
return {
LAND1: $('#country').val(),
}
},
onChange: function (value, data) {
$('#region').val(data.BLAND);
$('#regionName').val(data.BEZEI);
}
});
// $('#lifnr').searchbox({
// type: "suppliers", name: "selectSuppliers",
// getParam: function (item) {
// },
// onChange: function (value, data) {
// $('#lifnr').val(data.partner);
// $('#name1').val(data.nameOrg1);
// }
// });
}
function reloadGrid() {
sid=$("#id").val();
sapFinaCustomerPayGridManager.loadData();
sapFinaCustomerBankGridManager.loadData();
}
\ 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/finaCustomer/finaCustomerDetail.js'/>
</head>
<body>
<c:if test="${applyType==0}">
<x:billTitle title="财务客户主数据维护申请表" needStatus="false" needPerson="true"/>
</c:if>
<c:if test="${applyType==1}">
<x:billTitle title="财务客户主数据修改申请表" needStatus="false" needPerson="true"/>
</c:if>
<c:if test="${applyType==-1}">
<x:billTitle title="财务客户主数据删除申请表" needStatus="false" needPerson="true"/>
</c:if>
<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="dateTime" labelCol="1" fieldCol="2"/>
</div>
</div>
<x:title title="财务客户主基本数据" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="buPartner" label="业务伙伴编码" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="partnerRole" label="业务伙伴角色" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:inputC name="creationGroup" label="业务伙伴分组" labelCol="1" fieldCol="2" readonly="true"/>
<x:selectC name="titleMedi" label="称谓代码" labelCol="1" fieldCol="2" dictionary="title"/>
</div>
<div class="hg-form-row">
<x:inputC name="nameOrg1" label="财务客户名称1" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="buSort1Txt" label="搜索词1" labelCol="1" fieldCol="2" required="true"/>
<x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu"/>
</div>
<div class="hg-form-row">
<x:inputC name="countryName" label="国家" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:hidden name="country"/>
<x:inputC name="regionName" label="地区" labelCol="1" fieldCol="2" required="false" wrapper="select"/>
<x:hidden name="region"/>
<x:inputC name="street" label="街道" labelCol="1" fieldCol="2" maxLength="35"/>
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="false" maxLength="6"/>
</div>
<div class="hg-form-row">
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2"/>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2"/>
<x:inputC name="faxNumber" label="传真" labelCol="1" fieldCol="2" maxLength="30"/>
</div>
<div class="hg-form-row">
<x:inputC name="lifnr" label="供应商" labelCol="1" fieldCol="2" maxLength="30"/>
<x:inputC name="stenr" label="税号" labelCol="1" fieldCol="2" maxLength="30"/>
<x:selectC name="sperr" label="中心记帐冻结" labelCol="1" fieldCol="2" dictionary="sperr"/>
</div>
<div class="hg-form-row">
<x:textareaC name="zbz01" label="备注" labelCol="1" fieldCol="11" rows="3"/>
</div>
</div>
<div style="padding-top: 15px;">
<x:fileList bizCode="supplier" bizId="attbizId" id="supplierList" title="营业执照/开票资料" />
</div>
<div class="blank_div clearfix"></div>
<x:title title="财务客户公司信息" name="group"/>
<div id="sapFinaCustomerPayGrid" style="margin: 2px;"></div>
<div class="blank_div clearfix"></div>
<x:title title="财务客户银行信息" name="group"/>
<div id="sapFinaCustomerBankGrid" style="margin: 2px;"></div>
</form>
</body>
</html>
var gridManager = null;
var sapFinaCustomerPayGridManager = null;
var sapFinaCustomerBuyerGridManager = null;
var sapFinaCustomerBankGridManager = null;
var canEdit=true,cashierGridCanEdit = false;
var nowBankl,nowBukrs = null;
$(document).ready(function () {
initialize();
loadFinaCustomerPayListGrid();
loadFinaCustomerBankListGrid();
bindEvent();
initNowData();
});
function initialize(){
UICtrl.layout("#layout", {leftWidth: 3});
$('#supplierList').fileList({
bizId : $("#id").val()
});
}
/**
* 流程引擎回调设置打样的id
* @param value 打样申请的id
*/
function setId(bizId) {
$("#id").val(bizId);
var _grid = UICtrl.getGridManager('#sapFinaCustomerPayGrid');
_grid.options.parms.sId = bizId;
var _grid3 = UICtrl.getGridManager('#sapFinaCustomerBankGrid');
_grid3.options.parms.sId = bizId;
$("#sId").val(bizId);
sapFinaCustomerPayGridManager.loadData();
sapFinaCustomerBankGridManager.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 loadFinaCustomerPayListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
// 添加一行表格
addHandler: function () {
UICtrl.addGridRow(sapFinaCustomerPayGridManager,
{
// 行号加一
sequence: (sapFinaCustomerPayGridManager.getData().length + 1)*10
}
);
},
// 删除选中的尺码信息
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#sapFinaCustomerPayGrid');
DataUtil.delSelectedRows({
action: 'finaCustomer/deleteFinaCustomerPays.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
sapFinaCustomerPayGridManager.loadData();
}
});
}
});
// 表格
sapFinaCustomerPayGridManager = UICtrl.grid("#sapFinaCustomerPayGrid", {
//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: "akontCustomerTextView", width: 140, minWidth: 60, type: "String", align: "left",
editor: {
type: 'dictionary',
data: {name: 'akontCustomer'},
textField: 'akontCustomerTextView',
valueField: 'akontCustomer',
required: true,
render: function (item) {
return item.akontCustomerTextView;
}
},
},
{
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: false,
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: false,
render: function (item) {
return item.zwelsTextView;
}
},
},
{
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 + '/finaCustomer/slicedFinaCustomerPayData.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(sapFinaCustomerPayGridManager);
}
// 加载银行信息表格
function loadFinaCustomerBankListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
// 添加一行表格
addHandler: function () {
UICtrl.addGridRow(sapFinaCustomerBankGridManager,
{
// 行号加一
sequence: (sapFinaCustomerBankGridManager.getData().length + 1)*10
}
);
},
// 删除选中的尺码信息
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#sapFinaCustomerBankGrid');
DataUtil.delSelectedRows({
action: 'finaCustomer/deleteFinaCustomerBanks.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
sapFinaCustomerBankGridManager.loadData();
}
});
}
});
// 表格
sapFinaCustomerBankGridManager = UICtrl.grid("#sapFinaCustomerBankGrid", {
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: {
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: "accname", width: 140, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
}
],
dataAction: "server",
url: web_app.name + '/finaCustomer/slicedFinaCustomerBankData.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(sapFinaCustomerBankGridManager);
}
//获取数据保存的参数
function getExtendedData(processAction) {
//回退、打回、转交时,不需要验证必填项是否已经填写;
if (processAction == ProcessAction.BACK
|| processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) {
//不验证
$('#submitForm').attr('check', false);
}
const isAllData = $('#oldId') || !getId();
var extendedData = {};
var pay_grid = UICtrl.getGridManager('#sapFinaCustomerPayGrid');
if (pay_grid) {
var datas = DataUtil.getGridData({
gridManager: pay_grid,
isAllData: isAllData
});
if (!datas) {
return false;
}
extendedData.finaCustomerPayList = Public.encodeJSONURI(datas);
}
var bank_grid = UICtrl.getGridManager('#sapFinaCustomerBankGrid');
if (bank_grid) {
var datas = DataUtil.getGridData({
gridManager: bank_grid,
isAllData: isAllData
});
if (!datas) {
return false;
}
extendedData.finaCustomerBankList = Public.encodeJSONURI(datas);
}
return extendedData;
}
function bindEvent(){
$('#countryName').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {
fieldName: "LAND1",
}
},
onChange: function (value, data) {
$('#country').val(data.LAND1);
$('#countryName').val(data.LANDX);
}
});
$('#regionName').searchbox({
type: "system", name: "getArea",
getParam: function (item) {
if (Public.isBlank($('#country').val())){
Public.tip("请先选择国家")
return false;
}
return {
LAND1: $('#country').val(),
}
},
onChange: function (value, data) {
$('#region').val(data.BLAND);
$('#regionName').val(data.BEZEI);
}
});
}
function reloadGrid() {
sid=$("#id").val();
sapFinaCustomerPayGridManager.loadData();
sapFinaCustomerBankGridManager.loadData();
}
function initNowData(){
var buPartner = $("#buPartner").val();
Public.ajax(web_app.name+"/finaCustomer/getFinaCustomerNowItemList.ajax",{buPartner:buPartner},function (data){
nowBankl = data.nowBankl;
nowBukrs = data.nowBukrs
})
}
\ 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/finaCustomer/finaCustomerExtendDetail.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-cols">
<div class="hg-form-row">
<x:inputC name="buPartner" label="业务伙伴编码" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="creationGroup" label="业务伙伴分组" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="partnerRole" label="业务伙伴角色" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:selectC name="titleMedi" label="称谓代码" labelCol="1" fieldCol="2" dictionary="title" disabled="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="nameOrg1" label="财务客户名称1" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="buSort1Txt" label="搜索词1" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu" disabled="true"/>
<x:selectC name="sperr" label="中心记帐冻结" labelCol="1" fieldCol="2" dictionary="sperr" disabled="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="countryName" label="国家" labelCol="1" fieldCol="2" required="true" wrapper="select" disabled="true"/>
<x:hidden name="country"/>
<x:inputC name="regionName" label="地区" labelCol="1" fieldCol="2" required="false" wrapper="select" disabled="true"/>
<x:hidden name="region"/>
<x:inputC name="street" label="街道" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="false" maxLength="6" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="faxNumber" label="传真" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="lifnr" label="供应商" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<x:inputC name="stenr" label="税号" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
</div>
<div class="hg-form-row">
<x:textareaC name="zbz01" label="备注" labelCol="1" fieldCol="11" rows="3" readonly="true"/>
</div>
</div>
</div>
<div style="padding-top: 15px;">
<x:fileList bizCode="supplier" bizId="attbizId" id="supplierList" title="营业执照/开票资料" />
</div>
<div class="blank_div clearfix"></div>
<x:title title="财务客户公司信息" name="group"/>
<div id="sapFinaCustomerPayGrid" style="margin: 2px;"></div>
<div class="blank_div clearfix"></div>
<x:title title="财务客户银行信息" name="group"/>
<div id="sapFinaCustomerBankGrid" style="margin: 2px;"></div>
</form>
</body>
</html>
var gridManager = null;
var refreshFlag = false;
$(document).ready(function () {
initializateUI()
loadSuppliersDataListGrid();
})
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
function loadSuppliersDataListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function (){
addHandler()
},
updateHandler: showUpdateDialog,
// extendHandler: {id: 'extendHandler', text: '扩展', img: 'fa-music', className: 'btn-gray',click: function () {
// extendHandler();
// }}
});
gridManager = UICtrl.grid("#finaCustomerDataListGrid", {
columns: [
{display: "申请单编号", name: "billCode", width: 120, 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: "applyTypeTextView", width: 80, minWidth: 60, type: "string", align: "left"},
{display: "业务伙伴分组", name: "creationGroup", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "业务伙伴编号", name: "buPartner", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "业务伙伴角色", name: "partnerRole", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "称谓代码", name: "titleMedi", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "组织名称1", name: "nameOrg1", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "搜索词1", name: "buSort1Txt", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "国家", name: "countryName", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "地区", name: "regionName", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "街道", name: "street", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "邮编", name: "postCode1", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "电话号码", name: "telNumber", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "移动电话号码", name: "mobNumber", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "传真号", name: "faxNumber", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "电子邮件地址", name: "smtpAddr", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "申请人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "left"},
],
dataAction: "server",
url: web_app.name + '/finaCustomer/slicedFinaCustomerList.ajax',
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
height: "100%",
heightDiff: -8,
checkbox: true,
async: false,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) {
doView(data.id,data.applyType);
},
onAfterShowData: function (data){
console.log(data)
}
});
UICtrl.setSearchAreaToggle(gridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
//删除按钮
function deleteHandler(id) {
// var rows = UICtrl.checkSelectedRows(gridManager);
/* var rows = gridManager.getSelectedRows();
var statusFlag="1";
for (var i=0;i<rows.length;i++){
if (rows[i].status!="0"){
statusFlag="0";
break;
}
}
if (statusFlag=="0"){
UICtrl.alert("申请状态下的数据,才能删除!");
return false;
} else {
DataUtil.del({
action: 'sapSuppliersData/deleteSuppliersData.ajax',
gridManager: gridManager, idFieldName: 'id',
onSuccess: function () {
reloadGrid();
}
});
} */
let result=DataUtil.getUpdateRow(gridManager);
if (result.applyType=="-1"){
Public.tip("已经删除的不能再次操作!")
return false;
}
if(result.status!==3){
Public.tip("请选择一条审核完成后的数据!")
return false;
}
UICtrl.addTabItem({
tabid: 'suppliersDataDele'+id,
text: "供应商主数据删除",
url: web_app.name + '/sapSuppliersData/forwardSuppliersDataApply.job?bizId='+result.id+"&isDel=1"
});
}
function addHandler() {
UICtrl.addTabItem({
tabid: 'finaCustomerApply',
text: "财务客户主数据申请",
url: web_app.name + '/finaCustomer/forwardFinaCustomerApply.job'
});
}
function doView(id,applyType) {
var title="财务客户主数据申请详情";
if (applyType=="-1"){
title="财务客户主数据删除详情";
}
if (applyType=="1"){
title="财务客户主数据修改详情";
}
UICtrl.addTabItem({
tabid: 'finaCustomer'+id,
text: title,
url: web_app.name + '/finaCustomer/showFinaCustomer.job?isReadOnly=true&bizId='+id+"&isDetailPage=true"
});
}
function initShowDialog() {
var mainFileTable = $('#compensateLibraryList').fileList();
mainFileTable.find('table').css({
borderTopWidth: 0
});
}
// 进行修改操作
function showUpdateDialog(id) {
/* UICtrl.showAjaxDialog({
title: "修改供应商主数据申请",
url: web_app.name + '/sapSuppliersData/showSuppliersData.load',
param: {
id: id
},
width: 800,
init: initShowDialog,
ok: doSaveDefine,
start: false,
stop: false,
close: onDialogCloseHandler
}); */
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'+id,
text: "财务可数主数据修改详情",
url: web_app.name + '/finaCustomer/forwardFinaCustomerApply.job?bizId='+result.id+ '&flag='+'update'
});
}
// function next(){
// UICtrl.addTabItem({
// tabid: 'showNonProdApplyNext',
// text: "非产品/非半成品类物料主数据维护申请详情",
// url: web_app.name + '/sapNonProdApply/forwardNonProdApplyNext.do?isDetailPage=true'
// });
// }
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 + '/finaCustomer/forwardFinaCustomerApply.job?bizId='+result.id + '&flag='+'extend'
});
}
// 关闭对话框
function onDialogCloseHandler() {
if (refreshFlag) {
reloadGrid();
refreshFlag = false;
}
}
\ No newline at end of file
<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ 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"/>
<x:script src='/biz/topsun/sap/finaCustomer/finaCustomerList.js'/>
</head>
<body>
<div class="container-fluid">
<%-- <x:button value="next" onclick="next()" icon="fa-save"/>--%>
<div class="ui-hide">
<x:select name="processType" dictionary="processType"/>
<x:select name="yesorno" dictionary="yesorno"/>
</div>
<div id="layout">
<div position="center" title="供应商主数据查询">
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/>
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:inputC name="billCode" required="false" label="申请单号" labelCol="1"/>
<x:inputC name="partner" required="false" label="业务伙伴编号" labelCol="1"/>
<x:inputC name="nameOrg1" required="false" label="组织名称1" labelCol="1"/>
<x:selectC name="applyType" label="操作类型" labelCol="1" fieldCol="2" dictionary="applyType"/>
<x:selectC name="status" label="审批状态" labelCol="1" fieldCol="2" dictionary="bizBillStatus"/>
<x:searchButtons/>
</form>
<div class="blank_div clearfix"></div>
<div id="finaCustomerDataListGrid" style="margin: 2px;"></div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
package com.huigou.topsun.sap.finaCustomer.application;
import com.huigou.topsun.sap.finaCustomer.domain.FinaCustomerInfo;
import com.huigou.topsun.sap.finaCustomer.domain.query.FinaCustomerQueryRequest;
import com.huigou.util.SDO;
import java.util.List;
import java.util.Map;
public interface FinaCustomerApplication {
String PROCESS_DEFINITION_KEY = "finaCustomerProc";
String PROCESS_DEFINITION_KEY2 = "finaCustomerModiProc";
String PROCESS_DEFINITION_KEY3 = "finaCustomerDeleProc";
String PROCESS_DEFINITION_KEY4 = "finaCustomerExteProc";
String QUERY_XML_FILE_PATH= "config/topsun/sap/finaCustomer/finaCustomer.xml";
Map<String, Object> slicedFinaCustomerQuery(FinaCustomerQueryRequest query);
FinaCustomerInfo loadFinaCustomerById(String id);
Map<String, Object> loadFinaCustomerPayDatas(FinaCustomerQueryRequest queryRequest);
Map<String, Object> loadFinaCustomerBankDatas(FinaCustomerQueryRequest queryRequest);
List<Map<String, Object>> findDeletedFinaCustomerById(SDO params);
void deleteFinaCustomerPaysByIds( List<String> ids);
void deleteFinaCustomerBankByIds( List<String> ids);
List<Map<String, String>> selectFinaCustomers(String types);
String checkApprovalStatus(String partner);
Map<String, String> getFinaCustomerNowItemList(String buPartner);
}
package com.huigou.topsun.sap.finaCustomer.application.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.cache.DictUtil;
import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.sap.common.DefaultHttpClient;
import com.huigou.topsun.sap.common.application.SapMutualEpLogApplication;
import com.huigou.topsun.sap.common.domain.SapResult;
import com.huigou.topsun.sap.finaCustomer.application.FinaCustomerApplication;
import com.huigou.topsun.sap.finaCustomer.domain.FinaCustomerBank;
import com.huigou.topsun.sap.finaCustomer.domain.FinaCustomerInfo;
import com.huigou.topsun.sap.finaCustomer.domain.FinaCustomerPay;
import com.huigou.topsun.sap.finaCustomer.domain.query.FinaCustomerQueryRequest;
import com.huigou.topsun.sap.finaCustomer.repository.FinaCustomerBankRepository;
import com.huigou.topsun.sap.finaCustomer.repository.FinaCustomerInfoRepository;
import com.huigou.topsun.sap.finaCustomer.repository.FinaCustomerPayRepository;
import com.huigou.topsun.syncOrg.vo.SapPersonVo.BankVo;
import com.huigou.topsun.syncOrg.vo.SapPersonVo.CompanyCodeVo;
import com.huigou.topsun.syncOrg.vo.SapPersonVo.MdClientSapVo;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.fn.CodeGenerator;
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.SDO;
import com.huigou.util.StringUtil;
import lombok.SneakyThrows;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service("finaCustomerApplication")
public class FinaCustomerApplicationImpl extends FlowBroker implements FinaCustomerApplication {
@Autowired
FinaCustomerInfoRepository finaCustomerRepository;
@Autowired
FinaCustomerPayRepository finaCustomerPayRepository;
@Autowired
FinaCustomerBankRepository finaCustomerBankRepository;
@Autowired
DefaultHttpClient defaultHttpClient;
@Autowired
SapMutualEpLogApplication sapMutualEpLogApplication;
@Autowired
private CodeGenerator codeGenerator;
//finaCustomerNum
@Override
public Map<String, Object> slicedFinaCustomerQuery(FinaCustomerQueryRequest query) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedFinaCustomerQuery");
QueryModel model = this.sqlExecutorDao.getQueryModel(queryDescriptor, query);
model.putDictionary("maintenanceType", DictUtil.getDictionary("maintainType"));
model.putDictionary("baseUnit", DictUtil.getDictionary("measuringUnit"));
model.putDictionary("itemAttributes", DictUtil.getDictionary("suppliesType"));
model.putDictionary("businessUsage", DictUtil.getDictionary("serviceusage"));
model.putDictionary("status", DictUtil.getDictionary("bizBillStatus"));
model.addCriteria(" order by bill_code desc ");
return this.sqlExecutorDao.executeSlicedQuery(model);
}
@SneakyThrows
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Override
protected String saveBizAndApprovalData() {
super.saveBizAndApprovalData();
FinaCustomerInfo finaCustomer = getBizEntity(FinaCustomerInfo.class);
List<FinaCustomerPay> finaCustomerPayList = getBizEntities(FinaCustomerPay.class, "finaCustomerPayList");
List<FinaCustomerBank> finaCustomerBankList = getBizEntities(FinaCustomerBank.class, "finaCustomerBankList");
if (finaCustomer.isNew()) {
finaCustomer.setStatusId(BizBillStatus.APPLYING.getId());
} else {
finaCustomer = (FinaCustomerInfo) commonDomainService.loadAndFillinProperties(finaCustomer);
}
finaCustomer = finaCustomerRepository.save(finaCustomer);
for (FinaCustomerPay pay : finaCustomerPayList) {
if (StringUtil.isBlank(pay.getSId())) {
pay.setSId(finaCustomer.getId());
this.finaCustomerPayRepository.save(pay);
} else if (!(finaCustomer.getId().equals(pay.getSId()))) { //从新增带过来的
FinaCustomerPay modifyPay = new FinaCustomerPay();
ClassHelper.copyProperties(pay, modifyPay);
modifyPay.setId(UUID.randomUUID().toString());
modifyPay.setSId(finaCustomer.getId());
this.finaCustomerPayRepository.save(modifyPay);
} else {
pay.setSId(finaCustomer.getId());
if (StringUtil.isBlank(pay.getId())) {
this.finaCustomerPayRepository.save(pay);
} else {
FinaCustomerPay finaCustomerPay=finaCustomerPayRepository.findOne(pay.getId());
ClassHelper.copyProperties(pay, finaCustomerPay);
this.finaCustomerPayRepository.saveAndFlush(finaCustomerPay);
}
}
}
for (FinaCustomerBank bank : finaCustomerBankList) {
if (StringUtil.isBlank(bank.getSId())) {
bank.setSId(finaCustomer.getId());
this.finaCustomerBankRepository.save(bank);
} else if (!(finaCustomer.getId().equals(bank.getSId()))) { //从新增带过来的
FinaCustomerBank modifyBank = new FinaCustomerBank();
ClassHelper.copyProperties(bank, modifyBank);
modifyBank.setId(UUID.randomUUID().toString());
modifyBank.setSId(finaCustomer.getId());
this.finaCustomerBankRepository.save(modifyBank);
} else {
// bank.setSId(finaCustomer.getId());
// this.finaCustomerBankRepository.save(bank);
bank.setSId(finaCustomer.getId());
if (StringUtil.isBlank(bank.getId())) {
this.finaCustomerBankRepository.save(bank);
} else {
FinaCustomerBank finaCustomerBank=finaCustomerBankRepository.findOne(bank.getId());
ClassHelper.copyProperties(bank, finaCustomerBank);
this.finaCustomerBankRepository.saveAndFlush(finaCustomerBank);
}
}
}
return finaCustomer.getId();
}
@Override
protected Map<String, Object> getProcessBizParams(String bizId) {
// 返回业务数据给流程实例,
return ClassHelper.toMap(finaCustomerRepository.getOne(bizId));
}
@Override
protected void onBeforeComplete(DelegateTask delegateTask) {
super.onBeforeComplete(delegateTask);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
if (this.isApplyProcUnit(delegateTask) && this.getApprovalParameter().isAdvanceProcessAction()) {
FinaCustomerInfo finaCustomer = finaCustomerRepository.findOne(bizId);
finaCustomer.setStatusId(BizBillStatus.APPROVING.getId());
finaCustomerRepository.save(finaCustomer);
}
}
//流程已办
@Override
public void onAfterComplete(DelegateTask delegateTask) {
super.onAfterComplete(delegateTask);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
// FinaCustomerInfo finaCustomer = finaCustomerRepository.findOne(bizId);
}
@Override
public void onComplete(DelegateTask delegateTask) {
super.onComplete(delegateTask);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
FinaCustomerInfo finaCustomer = finaCustomerRepository.findOne(bizId);
//审批不通过
ApprovalParameter parameter = getApprovalParameter();
// if (ObjectUtils.equals(parameter.getHandleResult(), HandleResult.DISAGREE.id)) { //审批不通过 或者退回
// }
if (this.isApplyProcUnit(delegateTask)) { //申请后直接提交
}
}
/**
* 流程撤销事件
**/
@Override
protected void onRecallProcessInstance(DelegateExecution delegateExecution) {
String bizId = delegateExecution.getProcessBusinessKey();
// 修改单据状态为申请
updateStatus(bizId, BizBillStatus.APPLYING);
}
/**
* 回收事件
**/
@Override
protected void onWithdraw(DelegateTask delegateTask, String destActivityId) {
super.onWithdraw(delegateTask, destActivityId);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
if (destActivityId.equalsIgnoreCase("apply")) {
updateStatus(bizId, BizBillStatus.APPLYING);
}
}
@Transactional
protected void updateStatus(String bizId, BizBillStatus status) {
Assert.hasText(bizId, CommonDomainConstants.ID_NOT_BLANK);
this.commonDomainService.updateStatus(FinaCustomerInfo.class, bizId, status.getId());
}
/**
* 流程实例结束
*
* @param delegateExecution
*/
@Override
protected void onEnd(DelegateExecution delegateExecution) {
super.onEnd(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
FinaCustomerInfo finaCustomer = finaCustomerRepository.findOne(bizId);
List<FinaCustomerPay> payList = this.finaCustomerPayRepository.findAllBySId(finaCustomer.getId());
List<FinaCustomerBank> bankList = this.finaCustomerBankRepository.findAllBySId(finaCustomer.getId());
this.sendSapClientData(finaCustomer, payList, bankList);
BizBillStatus status = approvePassed() ? BizBillStatus.COMPLETED : BizBillStatus.ABORTED;
finaCustomer.setStatusId(status.getId());
finaCustomerRepository.save(finaCustomer);
}
@Override
protected void onAbortProcessInstance(DelegateExecution delegateExecution) {
super.onAbortProcessInstance(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
FinaCustomerInfo finaCustomer = finaCustomerRepository.findOne(bizId);
finaCustomer.setStatusId(BizBillStatus.ABORTED.getId());
finaCustomerRepository.save(finaCustomer);
}
/**
* @param delegateTask
* @param destActivityId 回退到的目标节点id
*/
@Override
protected void onBack(DelegateTask delegateTask, String destActivityId) {
super.onBack(delegateTask, destActivityId);
if ("Apply".equalsIgnoreCase(destActivityId)) {
String bizId = delegateTask.getExecution().getProcessBusinessKey();
FinaCustomerInfo finaCustomer = finaCustomerRepository.findOne(bizId);
finaCustomer.setStatusId(BizBillStatus.APPLYING.getId());
finaCustomerRepository.save(finaCustomer);
}
}
/**
* 远程调用sap接口,传递数据
*/
// public void sendSapData(FinaCustomerInfo finaCustomer, List<FinaCustomerPay> payList, List<FinaCustomerBank> bankList) {
// FinaCustomerInfoVo finaCustomerVo = new FinaCustomerInfoVo();
// BeanUtil.copyProperties(finaCustomer, finaCustomerVo);
// finaCustomerVo.setKtokk(finaCustomerVo.getPartnerRole());
// finaCustomerVo.setUpdkz("I");
// if (finaCustomer.getApplyType().equals("1")) { //更新
// finaCustomerVo.setUpdkz("U");
// }
// if (finaCustomer.getApplyType().equals("-1")) { //删除
// finaCustomerVo.setUpdkz("D");
// }
// if (finaCustomer.getApplyType().equals("2")) { //扩展
// finaCustomerVo.setUpdkz("U");
// List<FinaCustomerPay> otherPayList = this.getOtherPayList(finaCustomer.getBuPartner());
// payList.addAll(otherPayList);
// List<FinaCustomerBank> otherBankList = this.getOtherBankList(finaCustomer.getBuPartner());
// bankList.addAll(otherBankList);
// }
// if ("0".equals(finaCustomerVo.getSperr())){
// finaCustomerVo.setSperr("");
// }
// if ("0".equals(finaCustomerVo.getSperm())){
// finaCustomerVo.setSperm("");
// }
// List<FinaCustomerPayVo> payVoList = new ArrayList<>();
// for (FinaCustomerPay finaCustomerPay : payList) {
// FinaCustomerPayVo payVo = new FinaCustomerPayVo();
// ClassHelper.copyProperties(finaCustomerPay, payVo);
// if ("0".equals(payVo.getSperrB())){
// payVo.setSperrB("");
// }
// payVoList.add(payVo);
// }
// finaCustomerVo.setFinaCustomerPayVoList(payVoList);
// List<FinaCustomerBankVo> bankVoList = new ArrayList<>();
// for (FinaCustomerBank finaCustomerBank : bankList) {
// FinaCustomerBankVo bankVo = new FinaCustomerBankVo();
// ClassHelper.copyProperties(finaCustomerBank, bankVo);
// //银行账户,BPM不处理,SAP处理
//// if (bankVo.getBankn().length() > 18){
//// String bankn = bankVo.getBankn();
//// bankVo.setBankn(bankn.substring(0,18));
//// //账户明细放18位后的值
//// bankVo.setBkref(bankn.substring(18,bankn.length()));
//// }
// //财务机构名称赋值组织名称1
// bankVo.setBanka(finaCustomerVo.getNameOrg1());
// bankVoList.add(bankVo);
// }
// finaCustomerVo.setFinaCustomerBankVoList(bankVoList);
// ObjectMapper objectMapper = new ObjectMapper();
// String url = "CUD_SUPPLY/SUPPLY_DATA";
// Map<String, Object> resultMap = new HashMap<>();
// resultMap.put("businessType", "财务客户主数据");
// resultMap.put("businessId", finaCustomer.getId());
// List<FinaCustomerInfoVo> finaCustomerVos = new ArrayList<>();
// finaCustomerVos.add(finaCustomerVo);
// try {
// String parameter=JSON.toJSONString(finaCustomerVo);
// parameter=parameter.replaceAll("finaCustomerPayList","LFB1");
// parameter=parameter.replaceAll("finaCustomerBankList","BANK");
// // parameter=com.huigou.topsun.util.CommonUtil.camelToUnderline(parameter);
// resultMap.put("parameter", parameter);
// String result = defaultHttpClient.execute(finaCustomerVos, 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 ("0".equals(finaCustomer.getApplyType())){
// finaCustomer.setBuPartner(sapResult.getMESSAGE_V1().substring(4));
// resultMap.put("MESSAGE", sapResult.getMESSAGE()+sapResult.getMESSAGE_V1().substring(4));
// } else {
// resultMap.put("MESSAGE", sapResult.getMESSAGE());
// }
// resultMap.put("TYPE", sapResult.getTYPE());
// finaCustomerRepository.save(finaCustomer);
//
// } else {
// throw new RuntimeException("数据传输失败,请稍后手动重试!" + sapResult.getMESSAGE());
// }
// } catch (Exception e) {
// resultMap.put("TYPE", "E");
// resultMap.put("MESSAGE", e.getMessage());
// throw new RuntimeException("数据传输失败请检查数据后重试!" + e.getMessage());
// } finally {
// sapMutualEpLogApplication.saveSapMutualEpLog(resultMap);
// }
//
//
// }
@Transactional
public void sendSapClientData(FinaCustomerInfo finaCustomer, List<FinaCustomerPay> payList, List<FinaCustomerBank> bankList) {
List<MdClientSapVo> mdClientSapVoList = new ArrayList<>();
MdClientSapVo mdClientSapVo = new MdClientSapVo();
BeanUtil.copyProperties(finaCustomer, mdClientSapVo);
mdClientSapVo.setRltyp(finaCustomer.getPartnerRole());//BP角色,财务客户
mdClientSapVo.setBuGroup(finaCustomer.getCreationGroup());//业务伙伴分类,员工客户
mdClientSapVo.setKunnr(finaCustomer.getBuPartner());//员工编码
mdClientSapVo.setLand1(finaCustomer.getCountry());//国家
mdClientSapVo.setTitle(finaCustomer.getTitleMedi());
mdClientSapVo.setBuSort1(finaCustomer.getBuSort1Txt());//搜索词
mdClientSapVo.setStras(finaCustomer.getStreet());//街道
mdClientSapVo.setTaxnumxl(finaCustomer.getStenr());//税号
mdClientSapVo.setUpdkz("I");
mdClientSapVo.setTaxtype("CN5");//税类别
if (finaCustomer.getApplyType().equals("1")) { //更新
mdClientSapVo.setUpdkz("U");
}
if (finaCustomer.getApplyType().equals("-1")) { //删除
mdClientSapVo.setUpdkz("D");
}
if (finaCustomer.getApplyType().equals("2")) { //扩展
mdClientSapVo.setUpdkz("U");
List<FinaCustomerPay> otherPayList = this.getOtherPayList(finaCustomer.getBuPartner());
payList.addAll(otherPayList);
List<FinaCustomerBank> otherBankList = this.getOtherBankList(finaCustomer.getBuPartner());
bankList.addAll(otherBankList);
}
if ("0".equals(finaCustomer.getSperr())){
mdClientSapVo.setSperr("");
}
//公司代码视图
List<CompanyCodeVo> payVoList = new ArrayList<>();
for (int i = 0; i < payList.size(); i++) {
FinaCustomerPay finaCustomerPay = payList.get(i);
CompanyCodeVo companyCodeVo = new CompanyCodeVo();
ClassHelper.copyProperties(finaCustomerPay, companyCodeVo);
companyCodeVo.setAkont(finaCustomerPay.getAkontCustomer());
//前置补零
// DecimalFormat g1=new DecimalFormat("000");
// String startZeroStr = g1.format(Integer.valueOf(i+1));
// companyCodeVo.setZuawa(startZeroStr);
if ("0".equals(companyCodeVo.getSperrB())){
companyCodeVo.setSperrB("");
}
payVoList.add(companyCodeVo);
}
mdClientSapVo.setKnb1(payVoList);
//银行视图
List<BankVo> bankVoList = new ArrayList<>();
for (FinaCustomerBank finaCustomerBank : bankList) {
BankVo bankVo = new BankVo();
ClassHelper.copyProperties(finaCustomerBank, bankVo);
//银行账户,BPM不处理,SAP处理
// if (bankVo.getBankn().length() > 18){
// String bankn = bankVo.getBankn();
// bankVo.setBankn(bankn.substring(0,18));
// //账户明细放18位后的值
// bankVo.setBkref(bankn.substring(18,bankn.length()));
// }
//财务机构名称赋值组织名称1
bankVoList.add(bankVo);
}
mdClientSapVo.setBank(bankVoList);
String url = "cud_custom/customer";
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("businessType", "财务客户主数据");
resultMap.put("businessId", finaCustomer.getId());
try {
if (StringUtil.isBlank(finaCustomer.getBuPartner())){
String buPartner = this.getBuPartner();
finaCustomer.setBuPartner(buPartner);//赋值客户编码
mdClientSapVo.setKunnr(buPartner);
}
mdClientSapVoList.add(mdClientSapVo);
String parameter=JSON.toJSONString(mdClientSapVoList);
parameter=parameter.replaceAll("finaCustomerPayList","LFB1");
parameter=parameter.replaceAll("finaCustomerBankList","BANK");
// parameter=com.huigou.topsun.util.CommonUtil.camelToUnderline(parameter);
resultMap.put("parameter", parameter);
String result = defaultHttpClient.execute(mdClientSapVoList, 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 ("0".equals(finaCustomer.getApplyType())){
finaCustomer.setBuPartner(sapResult.getMESSAGE_V1().substring(4));
resultMap.put("MESSAGE", sapResult.getMESSAGE()+sapResult.getMESSAGE_V1().substring(4));
} else {
resultMap.put("MESSAGE", sapResult.getMESSAGE());
}
resultMap.put("TYPE", sapResult.getTYPE());
finaCustomerRepository.save(finaCustomer);
} else {
throw new RuntimeException("数据传输失败,请稍后手动重试!" + sapResult.getMESSAGE());
}
} catch (Exception e) {
resultMap.put("TYPE", "E");
resultMap.put("MESSAGE", e.getMessage());
throw new RuntimeException("数据传输失败请检查数据后重试!" + e.getMessage());
} finally {
sapMutualEpLogApplication.saveSapMutualEpLog(resultMap);
}
}
/**
* 从数据库统计客户编码,加锁
* @return
*/
public synchronized String getBuPartner(){
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "countBuPartner");
int buPartner = this.sqlExecutorDao.queryToInt(queryDescriptor.getSql());
return String.valueOf(buPartner+1);
}
/**
* 设置任务名称
*/
@Override
protected void setTaskDescription(DelegateTask delegateTask) {
String bizId = delegateTask.getExecution().getProcessBusinessKey();
delegateTask.setDescription(this.getApprovalSubjectName(bizId));
}
/**
* 获取任务标题
*
* @param bizId
* @return
*/
private String getApprovalSubjectName(String bizId) {
FinaCustomerInfo finaCustomer = this.finaCustomerRepository.findOne(bizId);
//查询 单据日期
String fillinDateStr = DateUtil.getDateFormat("yyyy-MM-dd HH:mm:ss", finaCustomer.getFillinDate());
//设置标题
// String wantGoodsNameText = DictUtil.getDictionaryDetailText("A0051", wantGoods.getCustomerName());
if (finaCustomer.getApplyType().equals("1")) {
return String.format("%s-%s(%s)", "财务客户主数据修改", finaCustomer.getBillCode(), fillinDateStr);
} else if (finaCustomer.getApplyType().equals("-1")) {
return String.format("%s-%s(%s)", "财务客户主数据删除", finaCustomer.getBillCode(), fillinDateStr);
}else if (finaCustomer.getApplyType().equals("2")) {
return String.format("%s-%s(%s)", "财务客户主数据扩展", finaCustomer.getBillCode(), fillinDateStr);
} else {
return String.format("%s-%s(%s)", "财务客户主数据申请", finaCustomer.getBillCode(), fillinDateStr);
}
}
@Override
public FinaCustomerInfo loadFinaCustomerById(String id) {
return finaCustomerRepository.findOne(id);
}
@Override
public Map<String, Object> loadFinaCustomerPayDatas(FinaCustomerQueryRequest queryRequest) {
//FinaCustomerInfo finaCustomer=finaCustomerRepository.findOne(queryRequest.getSId());
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedFinaCustomerPayList");
// FinaCustomerPayQueryRequest queryRequest=new FinaCustomerPayQueryRequest();
// queryRequest.setSId(sId);
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
// queryModel.putDictionary("konwa", DictUtil.getDictionary("currency"));
queryModel.addCriteria(" and t.s_id =:sId");
queryModel.putParam("sId", queryRequest.getSId());
return this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
@Override
public Map<String, Object> loadFinaCustomerBankDatas(FinaCustomerQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedFinaCustomerBankList");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
queryModel.putDictionary("banks",DictUtil.getDictionary("country"));
queryModel.addCriteria(" and t.s_id =:sId");
queryModel.putParam("sId", queryRequest.getSId());
return this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
@Override
public List<Map<String, Object>> findDeletedFinaCustomerById(SDO params) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "findDeletedByBuPartner");
QueryModel queryModel = new QueryModel();
queryModel.setSql(queryDescriptor.getSql());
queryModel.setPageIndex(1);
queryModel.setPageSize(10);
queryModel.putParam("buPartner", params.getString("buPartner"));
Map<String, Object> map=this.sqlExecutorDao.executeSlicedQuery(queryModel);
List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("Rows");
return list;
}
@Override
public void deleteFinaCustomerPaysByIds( List<String> ids){
for (String id:ids){
FinaCustomerPay finaCustomerPay=finaCustomerPayRepository.findOne(id);
finaCustomerPayRepository.delete(finaCustomerPay);
}
}
@Override
public void deleteFinaCustomerBankByIds( List<String> ids){
for (String id:ids){
FinaCustomerBank finaCustomerBank =finaCustomerBankRepository.findOne(id);
finaCustomerBankRepository.delete(finaCustomerBank);
}
}
public List<Map<String, String>> selectFinaCustomers(String types) {
FinaCustomerQueryRequest queryRequest=new FinaCustomerQueryRequest();
List<Map<String, String>> list =new ArrayList<>();
try {
String sql="select t.bu_partner,t.name_org1 from sap_fina_customer_info t where t.bu_partner!='' and t.status=3 ";
List<Map<String, Object>> list2=this.sqlExecutorDao.queryToListMap(sql);
for (Map map:list2){
list.add(map);
}
// QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "sap_finaCustomer_info");
// QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
// queryModel.putDictionary("banks", DictUtil.getDictionary("country"));
// queryModel.addCriteria(" and t.status =3");
// queryModel.putParam("sId", queryRequest.getSId());
// Map<String, Object> map = this.sqlExecutorDao.executeSlicedQuery(queryModel);
// list = (List<Map<String, String>>) map.get("Rows");
}catch (Exception ex){
ex.printStackTrace();
}
return list;
}
@Override
public String checkApprovalStatus(String partner) {
List<FinaCustomerInfo> finaCustomerList = finaCustomerRepository.findByBuPartner(partner);
//如果有单据在审批或者申请中,也不能做任何操作
for (FinaCustomerInfo finaCustomer : finaCustomerList) {
//先判断是否已删除,如果删除不能做任何操作
if ("-1".equals(finaCustomer.getApplyType())){
return "已删除";
}
}
return null;
}
/**
* 获取财务客户编码下有效的银行、公司代码
* @param buPartner
* @return
*/
@Override
public Map<String, String> getFinaCustomerNowItemList(String buPartner){
List<FinaCustomerBank> bankList = this.getOtherBankList(buPartner);
List<FinaCustomerPay> payList = this.getOtherPayList(buPartner);
//已维护的银行组织
Set<String> banklSet = bankList
.stream()
.map(FinaCustomerBank::getBankl)
.collect(Collectors.toSet());
String bankl = StringUtils.join(banklSet, ",");
//已维护的公司代码
Set<String> bukrsSet = payList
.stream()
.map(FinaCustomerPay::getBukrs)
.collect(Collectors.toSet());
String bukrs = StringUtils.join(bukrsSet, ",");
Map<String,String> map = new HashMap<>();
map.put("nowBankl",bankl);
map.put("nowBukrs",bukrs);
return map;
}
public Map<String,String> getIdGroup(String partner){
List<FinaCustomerInfo> finaCustomerList = finaCustomerRepository.findByBuPartner(partner);
finaCustomerList = finaCustomerList
.stream()
.filter(finaCustomer->BizBillStatus.COMPLETED.getId() == finaCustomer.getStatusId())
.sorted(Comparator.comparing(FinaCustomerInfo::getFillinDate))
.collect(Collectors.toList());
String id = "";
String extendId = "";
for (FinaCustomerInfo finaCustomer : finaCustomerList) {
//如果是新增的,那么根据新增的id查询明细
if ("0".equals(finaCustomer.getApplyType())){
id = finaCustomer.getId();
}
//如果有修改的,排序后,取时间最大的财务客户id查询明细
if ("1".equals(finaCustomer.getApplyType())){
id = finaCustomer.getId();
}
//如果是扩展的,排序后,取时间最大的财务客户id查询明细
if ("2".equals(finaCustomer.getApplyType())){
extendId = finaCustomer.getId();
}
}
Map<String,String> map = new HashMap<>();
map.put("id",id);
map.put("extendId",extendId);
return map;
}
public List<FinaCustomerBank> getOtherBankList(String partner){
Map<String, String> idGroup = this.getIdGroup(partner);
//银行信息
List<FinaCustomerBank> bankList = finaCustomerBankRepository.findAllBySId(idGroup.get("id"));
List<FinaCustomerBank> extendBankList = finaCustomerBankRepository.findAllBySId(idGroup.get("extendId"));
bankList.addAll(extendBankList);
return bankList;
}
public List<FinaCustomerPay> getOtherPayList(String partner){
Map<String, String> idGroup = this.getIdGroup(partner);
//付款信息
List<FinaCustomerPay> payList = finaCustomerPayRepository.findAllBySId(idGroup.get("id"));
List<FinaCustomerPay> extendPayList = finaCustomerPayRepository.findAllBySId(idGroup.get("extendId"));
payList.addAll(extendPayList);
return payList;
}
}
package com.huigou.topsun.sap.finaCustomer.controller;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.topsun.sap.finaCustomer.application.FinaCustomerApplication;
import com.huigou.topsun.sap.finaCustomer.domain.FinaCustomerInfo;
import com.huigou.topsun.sap.finaCustomer.domain.query.FinaCustomerQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Auther: LXH
*
* @Date: 2024/03/01
* @Description:
*/
@Controller
@ControllerMapping("/finaCustomer")
public class FinaCustomerController extends CommonController {
protected String getPagePath() {
return "/biz/topsun/sap/finaCustomer/";
}
@Autowired
FinaCustomerApplication finaCustomerApplication;
public String forwardFinaCustomerList() {
return forward("finaCustomerList");
}
public String slicedFinaCustomerList() {
SDO sdo = this.getSDO();
FinaCustomerQueryRequest queryRequest = sdo.toQueryRequest(FinaCustomerQueryRequest.class);
Map<String, Object> map = finaCustomerApplication.slicedFinaCustomerQuery(queryRequest);
return toResult(map);
}
public String forwardFinaCustomerApply() {
this.putAttribute("processDefinitionKey",FinaCustomerApplication.PROCESS_DEFINITION_KEY);
this.putAttribute("procUnitId","Apply");//定义流程环节的id
this.putAttribute("applyType","0");
SDO sdo = this.getSDO();
String bizId=sdo.getString("bizId");
String flag=sdo.getString("flag");
FinaCustomerInfo finaCustomerInfo = new FinaCustomerInfo();
finaCustomerInfo.setCreationGroup("C006");//分组: 默认【C006】,不可更改
finaCustomerInfo.setPartnerRole("FLCU00");//业务伙伴角色 默认【FLCU00】,不可更改
finaCustomerInfo.setApplyType("0");
String isDel=sdo.getString("isDel");
String page = "finaCustomerDetail";
if (StringUtil.isNotBlank(isDel)){ //删除流程
finaCustomerInfo = finaCustomerApplication.loadFinaCustomerById(bizId);
this.putAttribute("processDefinitionKey", FinaCustomerApplication.PROCESS_DEFINITION_KEY3);
this.putAttribute("applyType", "-1");
finaCustomerInfo.setApplyType("-1");
finaCustomerInfo.setBillCode("");
finaCustomerInfo.setId("");
// finaCustomerInfo.setSId(bizId);
Map<String, Object> map = new HashMap();
map.put("bizId", "");
sdo.setProperties(map);
finaCustomerInfo.setFullId("");
this.putAttribute("bizId", "");
this.putAttribute("sId", bizId);
this.putAttribute("id", "");
} else {
if (StringUtil.isNotBlank(bizId)) {
finaCustomerInfo = finaCustomerApplication.loadFinaCustomerById(bizId);
sdo.putProperty("buPartner",finaCustomerInfo.getBuPartner());
List deletedList=finaCustomerApplication.findDeletedFinaCustomerById(sdo);
if (deletedList.size()>0){
throw new RuntimeException("该财务客户已经执行删除,不能再次修改了!");
}
if ("update".equals(flag)){
this.putAttribute("processDefinitionKey", FinaCustomerApplication.PROCESS_DEFINITION_KEY2);
this.putAttribute("applyType", "1");
finaCustomerInfo.setApplyType("1");
} else if ("extend".equals(flag)) {
this.putAttribute("processDefinitionKey", FinaCustomerApplication.PROCESS_DEFINITION_KEY4);
this.putAttribute("applyType", "2");//扩展
finaCustomerInfo.setApplyType("2");
page = "finaCustomerExtendDetail";
}
finaCustomerInfo.setBillCode("");
finaCustomerInfo.setId("");
// finaCustomerInfo.setSId(bizId);
Map<String, Object> map = new HashMap();
map.put("bizId", "");
sdo.setProperties(map);
finaCustomerInfo.setFullId("");
this.putAttribute("bizId", "");
this.putAttribute("sId", bizId);
this.putAttribute("id", "");
}
}
finaCustomerInfo.setStatusId(BizBillStatus.APPLYING.getId());
Operator operator = getOperator();//获取当前操作员的详情信息
finaCustomerInfo.setDefaultValues(new OrgUnit(operator.getFullId(),operator.getFullName()));
return forward(page,finaCustomerInfo);
}
public String showFinaCustomer() {
SDO sdo = this.getSDO();
String id = sdo.getBizId();
String isDetailPage = sdo.getString("isDetailPage");
this.putAttribute("applyType","0");
if("true".equals(isDetailPage)) this.putAttribute("isDetailPage","true");
FinaCustomerInfo finaCustomerInfo = finaCustomerApplication.loadFinaCustomerById(id);
if (!(finaCustomerInfo.getApplyType().equals("0"))){
this.putAttribute("sId", id);
this.putAttribute("applyType",finaCustomerInfo.getApplyType());
if ("2".equals(finaCustomerInfo.getApplyType())){
return forward("finaCustomerExtendDetail", finaCustomerInfo);
}
}
return forward("finaCustomerDetail", finaCustomerInfo);
}
public String slicedFinaCustomerPayData(){
SDO sdo = this.getSDO();
FinaCustomerQueryRequest queryRequest=sdo.toQueryRequest(FinaCustomerQueryRequest.class);
queryRequest.setSId(sdo.getString("sId"));
Map<String, Object> map = finaCustomerApplication.loadFinaCustomerPayDatas(queryRequest);
return toResult(map);
}
public String slicedFinaCustomerBankData(){
SDO sdo = this.getSDO();
FinaCustomerQueryRequest queryRequest=sdo.toQueryRequest(FinaCustomerQueryRequest.class);
queryRequest.setSId(sdo.getString("sId"));
Map<String, Object> map = finaCustomerApplication.loadFinaCustomerBankDatas(queryRequest);
return toResult(map);
}
public String deleteFinaCustomerPays() {
SDO sdo = this.getSDO();
List<String> ids = sdo.getIds();
finaCustomerApplication.deleteFinaCustomerPaysByIds(ids);
return success();
}
public String deleteFinaCustomerBanks() {
SDO sdo = this.getSDO();
List<String> ids = sdo.getIds();
finaCustomerApplication.deleteFinaCustomerBankByIds(ids);
return success();
}
public String checkApprovalStatus(){
SDO sdo = this.getSDO();
String partner = sdo.getString("partner");
finaCustomerApplication.checkApprovalStatus(partner);
return success();
}
public String getFinaCustomerNowItemList(){
SDO sdo = this.getSDO();
String buPartner = sdo.getString("buPartner");
Map<String, String> map = finaCustomerApplication.getFinaCustomerNowItemList(buPartner);
return toResult(map);
}
}
package com.huigou.topsun.sap.finaCustomer.domain;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
/**
*
* @TableName sap_fina_customer_bank
*/
@Table(name="sap_fina_customer_bank")
@Data
@Entity
public class FinaCustomerBank implements Serializable {
@Id
@GeneratedValue(
generator = "system-uuid"
)
@GenericGenerator(
name = "system-uuid",
strategy = "guid"
)
private String id;
/**
* 主表id
*/
@Column(name = "s_id")
private String sId;
/**
* 银行所属国家/地区代码
*/
@Column(name = "banks")
private String banks;
/**
* 银行代码
*/
@Column(name = "bankl")
private String bankl;
/**
* 银行帐户号码
*/
@Column(name = "bankn")
private String bankn;
/**
* 财务机构名称
*/
@Column(name = "banka")
private String banka;
/**
* 银行细目的参考明细
*/
@Column(name = "bkref")
private String bkref;
/**
* 账户持有人姓名
*/
@Column(name = "koinh")
private String koinh;
/**
* 账户名称
*/
@Column(name = "accname")
private String accname;
@Column(name = "sequence")
private int sequence;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.huigou.topsun.sap.finaCustomer.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huigou.data.domain.model.FlowBillAbstractEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
* 财务客户主数据
*/
@Table(name="sap_fina_customer_info")
@Data
@Entity
public class FinaCustomerInfo extends FlowBillAbstractEntity {
/**
* 业务伙伴编码
*/
@Column(name = "bu_partner")
@JsonProperty("BU_PARTNER")
private String buPartner;
/**
* 业务伙伴分组
*/
@Column(name = "creation_group")
@JsonProperty("CREATION_GROUP")
private String creationGroup;
/**
* 业务伙伴角色
*/
@Column(name = "partner_role")
@JsonProperty("PARTNER_ROLE")
private String partnerRole;
/**
* 称谓代码
* 非必填,设下拉菜单,选项为【0001女士】、【0002先生】、【0003公司】
*/
@Column(name = "title_medi")
@JsonProperty("TITLE_MEDI")
private String titleMedi;
/**
* 组织名称 1
*/
@Column(name = "name_org1")
@JsonProperty("NAME_ORG1")
private String nameOrg1;
/**
* 搜索词1
*/
@Column(name = "bu_sort1_txt")
@JsonProperty("BU_SORT1_TXT")
private String buSort1Txt;
/**
* 备注
*/
@Column(name = "zbz01")
@JsonProperty("zbz01")
private String zbz01;
/**
* 国家/地区代码
*/
@Column(name = "country")
@JsonProperty("COUNTRY")
private String country;
/**
* 国家/地区代码
*/
@Column(name = "country_name")
private String countryName;
/**
* 地区代码
*/
@Column(name = "region")
@JsonProperty("REGION")
private String region;
/**
* 地区代码
*/
@Column(name = "region_name")
private String regionName;
/**
* 街道
*/
@Column(name = "street")
@JsonProperty("STREET")
private String street;
/**
* 城市邮政编码
*/
@Column(name = "post_code1")
@JsonProperty("POST_CODE1")
private String postCode1;
/**
* 语言关键字
*/
@Column(name = "langu")
@JsonProperty("LANGU")
private String langu;
/**
* 电话号码
*/
@Column(name = "tel_number")
@JsonProperty("TEL_NUMBER")
private String telNumber;
/**
* 移动电话号码
*/
@Column(name = "mob_number")
@JsonProperty("MOB_NUMBER")
private String mobNumber;
/**
* 传真号
*/
@Column(name = "fax_number")
@JsonProperty("FAX_NUMBER")
private String faxNumber;
/**
* 电子邮件地址
*/
@Column(name = "smtp_addr")
@JsonProperty("SMTP_ADDR")
private String smtpAddr;
/**
* 税号
*/
@JsonProperty("STENR")
@Column(name = "stenr")
private String stenr;
/**
* 中心记帐冻结
*/
@JsonProperty("SPERR")
@Column(name = "sperr")
private String sperr;
/**
* 更新标识 I、U、D
*/
@Column(name = "updkz")
@JsonProperty("UPDKZ")
private String updkz;
//申请类型 -1 删除 0 申请 1 修改
@Column(name = "apply_type")
private String applyType;
/**
* 供应商编号
*/
@Column(name = "lifnr")
private String lifnr;
@Override
protected String getCodeRuleId() {
return "finaCustomerInfo";
}
}
\ No newline at end of file
package com.huigou.topsun.sap.finaCustomer.domain;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
/**
*
* @TableName sap_fina_customer_pay
*/
@Table(name="sap_fina_customer_pay")
@Data
@Entity
public class FinaCustomerPay implements Serializable {
@Id
@GeneratedValue(
generator = "system-uuid"
)
@GenericGenerator(
name = "system-uuid",
strategy = "guid"
)
private String id;
/**
* 主表id
*/
@Column(name = "s_id")
private String sId;
/**
* 公司代码
*/
@Column(name = "bukrs")
private String bukrs;
/**
* 总帐中的统驭科目
*/
@Column(name = "akont_customer")
private String akontCustomer;
/**
* 根据分配号排序代码
*/
@Column(name = "zuawa")
private String zuawa;
/**
* 付款条件代码
*/
@Column(name = "zterm")
private String zterm;
/**
* 对公司代码过帐冻结
*/
@Column(name = "sperr_b")
private String sperrB;
/**
* 考虑的付款方式清单
*/
@Column(name = "zwels")
private String zwels;
@Column(name = "sequence")
private int sequence;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.huigou.topsun.sap.finaCustomer.domain.query;
import com.huigou.data.domain.query.FlowBillSuperQueryRequest;
import lombok.Data;
@Data
public class FinaCustomerQueryRequest extends FlowBillSuperQueryRequest {
/**
* 业务伙伴编号
*/
private String partner;
/**
* 单据编号
*/
private String billCode;
/**
* 称谓代码
*/
private String title;
/**
* 组织名称1
*/
private String nameOrg1;
private String applyType;
private String sId;
}
package com.huigou.topsun.sap.finaCustomer.repository;
import com.huigou.topsun.sap.finaCustomer.domain.FinaCustomerBank;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @Auther: lxh
* @Date: 2024/03/01
* @Description:
*/
public interface FinaCustomerBankRepository extends JpaRepository<FinaCustomerBank,String> {
List<FinaCustomerBank> findAllBySId(String sId);
List<FinaCustomerBank> findByBankn(String bankn);
}
package com.huigou.topsun.sap.finaCustomer.repository;
import com.huigou.topsun.sap.finaCustomer.domain.FinaCustomerInfo;
import com.huigou.topsun.sap.suppliers.domain.SuppliersInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @Auther: lxh
* @Date: 2024/03/01
* @Description:
*/
public interface FinaCustomerInfoRepository extends JpaRepository<FinaCustomerInfo,String> {
List<FinaCustomerInfo> findByBuPartner(String buPartner);
}
package com.huigou.topsun.sap.finaCustomer.repository;
import com.huigou.topsun.sap.finaCustomer.domain.FinaCustomerPay;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @Auther: lxh
* @Date: 2024/03/01
* @Description:
*/
public interface FinaCustomerPayRepository extends JpaRepository<FinaCustomerPay,String> {
// SuppliersPay findBysId(String sId);
List<FinaCustomerPay> findAllBySId(String sId);
}
<?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="finaCustomerModiProc" name="财务客户主数据" isExecutable="true">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="#{finaCustomerApplication}"></activiti:executionListener>
<activiti:executionListener event="end" delegateExpression="#{finaCustomerApplication}"></activiti:executionListener>
</extensionElements>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="Apply" name="财务客户主数据修改申请" activiti:formKey="finaCustomer/showFinaCustomer.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{finaCustomerApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{finaCustomerApplication}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="Approve" name="财务客户主数据修改审批" activiti:assignee="${assignee} " activiti:formKey="finaCustomer/showFinaCustomer.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{finaCustomerApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{finaCustomerApplication}"></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_finaCustomerModiProc">
<bpmndi:BPMNPlane bpmnElement="finaCustomerModiProc" id="BPMNPlane_finaCustomerModiProc">
<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
<?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="finaCustomerProc" name="财务客户主数据" isExecutable="true">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="#{finaCustomerApplication}"></activiti:executionListener>
<activiti:executionListener event="end" delegateExpression="#{finaCustomerApplication}"></activiti:executionListener>
</extensionElements>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="Apply" name="财务客户主数据申请" activiti:formKey="finaCustomer/showFinaCustomer.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{finaCustomerApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{finaCustomerApplication}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="Approve" name="财务客户主数据审批" activiti:assignee="${assignee} " activiti:formKey="finaCustomer/showFinaCustomer.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{finaCustomerApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{finaCustomerApplication}"></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_finaCustomerProc">
<bpmndi:BPMNPlane bpmnElement="finaCustomerProc" id="BPMNPlane_finaCustomerProc">
<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
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query name="slicedFinaCustomerQuery" table="sap_fina_customer_info">
<sql-query>
select t.* from sap_fina_customer_info t
where 1=1
</sql-query>
<!-- <condition column="stats_indicators_id" name="statsIndicatorsId" type="java.lang.String" symbol="=" alias="t"/>-->
</query>
<query name="findDeletedByBuPartner" label="查询是否存在删除的数据" table="sap_fina_customer_info">
<sql-query>
select t.* from sap_fina_customer_info t
where 1=1 and apply_type='-1' and status in (1,3) and bu_partner=:buPartner
</sql-query>
</query>
<query name="slicedFinaCustomerPayList" label="付款明细数据" table="sap_fina_customer_pay">
<sql-query>
select t.*
from sap_fina_customer_pay t
</sql-query>
<condition column="s_id" name="sId" type="java.lang.String" symbol="=" alias="t"/>
</query>
<query name="slicedFinaCustomerBankList" label="银行明细" table="sap_fina_customer_bank">
<sql-query>
select t.*
from sap_fina_customer_bank t
</sql-query>
<condition column="s_id" name="sId" type="java.lang.String" symbol="=" alias="t"/>
</query>
<query name="countBuPartner" table="sap_fina_customer_info">
<sql-query>
select DISTINCT t.bu_partner from sap_fina_customer_info t ORDER BY t.bu_partner desc limit 1
</sql-query>
</query>
</query-mappings>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment