Commit 80149aa5 by lixinyi

cips手工拟报组报调整,反显调整

parent 1fd7a8b5
......@@ -100,5 +100,12 @@ export default{
data:data
})
},
cips2Json(data){
return new link({
url:`/cips/cips2Json`,
method:"post",
data:data
})
},
}
......@@ -2,8 +2,8 @@
import axios from 'axios'
const service = axios.create({
// baseURL: '/swift-editor-1.0.0', //代理
baseURL: '/swift-editor', //本地用这个
baseURL: '/swift-editor-1.0.0', //代理
// baseURL: '/swift-editor', //本地用这个
timeout: 50000 // request timeout
})
......
<template>
<span>
<span :class="{'warning-border': iswarning}">
<el-select
v-model="orgData.Ccy"
:disabled="dataModel.disabled"
filterable
placeholder="select currency"
clearable
size="small"
@change="changeOption"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<el-input
:disabled="dataModel.disabled"
v-model="orgData.amount"
type="number"
:show-word-limit="true"
style="width: 60%"
@blur="amountHandle"
@input="checkData"
:placeholder="`Please enter ${dataModel.name}`"
>
</el-input>
</span>
<p v-if="iswarning" class="warning-text">{{ warningText }}</p>
</span>
</template>
<script>
import MsgCodes from '../script/MsgCode'
import MsgJsonMap from '../script/MsgJson'
import Decimal from 'decimal.js'
export default {
props: ['dataModel', 'sca1'],
data() {
return {
scale: 2,
orgData: {},
options: [],
scaleMap: {},
iswarning: false,
warningText:''
}
},
mounted() {
this.orgData = this.dataModel.value
? this.dataModel.value
: MsgJsonMap('Amount')
this.dataModel.value = this.orgData
this.options = MsgCodes['Ccy']
for (let opt of this.options) {
this.scaleMap[opt.value] = opt.scale
}
this.changeOption(this.orgData.amount)
},
methods: {
changeOption(value) {
if (value === '') {
this.orgData.amount = ''
this.iswarning = false;
} else {
if(this.dataModel.comparePath){
this.compare(this.dataModel.comparePath)
}
this.scale = this.scaleMap[value]
this.amountHandle()
}
},
//与关联路径对应的Amount的币种进行比较,如果不一致则给出提示信息
compare(path) {
let pathMap = path.split('.')
let treeNodeArry = this.$root.$children[0].$children[0].$data.treeModel.treeNodeArry;
let exp = `treeNodeArry[${pathMap[0]}]`;
for (let index = 1; index < pathMap.length; index++) {
const child = pathMap[index];
exp += `.children[${child}]`
}
let targetCcy = eval(exp + '.value.Ccy')
let targetName = eval(exp + '.name')
if(targetCcy != undefined && targetCcy !='' && this.dataModel.value.Ccy !== targetCcy){
this.iswarning = true;
this.warningText = `${this.dataModel.name} And ${targetName} have different Currency`
}else{
this.iswarning = false;
}
},
checkData() {
if (
this.orgData.Ccy === undefined ||
this.orgData.Ccy === null ||
this.orgData.Ccy.trim() === ''
) {
this.orgData.Ccy = this.options[0].value
this.scale = this.options[0].scale
}
},
amountHandle() {
this.$root.$children[0].$children[0].$refs.form.validateField(
this.$parent._props.prop,
(errMsg) => {
if (errMsg === '') {
if (this.orgData.amount !== '' && this.orgData.amount !== undefined) {
const Ccy = this.orgData.Ccy
const inputValue = Decimal(this.orgData.amount)
var maxValue = Decimal('999999999999.99')
const minValue = Decimal('0')
var tip = '999,999,999,999.99'
let value = inputValue.toFixed(this.scale, Decimal.ROUND_HALF_UP)
if (Ccy !== '' && Ccy !== undefined) {
if (Ccy == 'RAND' || Ccy == 'IDR' || Ccy == 'VND') {
maxValue = Decimal('9999999999999999.99')
tip = '9,999,999,999,999,999.99'
}
}
if (inputValue.comparedTo(maxValue) === 1) {
this.$message({
message: 'The amount maxVlue is ' + tip,
type: 'error',
})
value = maxValue.toFixed(this.scale, Decimal.ROUND_HALF_UP)
//} else if(inputValue.comparedTo(minValue)===-1||inputValue.comparedTo(minValue)===0) {
// this.$message({
// message: "The amount must be greater than zero",
// type: "error",
// });
// value = null;
// }
} else if (inputValue.comparedTo(minValue) === -1) {
this.$message({
message: 'The amount must be greater than or equal to zero',
type: 'error',
})
value = null
}
this.orgData.amount = value
}
}
}
)
},
},
watch: {
orgData: function (newValue, oldValue) {
//监听异步改变的orgData的值,并实时绑定到dataModel.value上
this.dataModel.value = newValue
},
},
}
</script>
<style scoped>
.warning-border >>> .el-input--small .el-input__inner{
border-color: orange;
}
.warning-text{
font-size: 12px;
color: orange;
padding: 0;
margin: 0;
}
</style>
\ No newline at end of file
......@@ -195,6 +195,9 @@ export default {
) {
this.active = true;
this.showSpan = true;
} else if("1" === this.dataModel.iscips){
this.$set(this.dataModel, 'value', "C"+this.$moment(new Date()).format("YYYYMMDDHHmmssSSS"));
console.log("MsgId:"+this.dataModel.value);
}
if (this.dataModel.defaultValue !== undefined) {
this.$set(this.dataModel, "value", this.dataModel.defaultValue);
......
<template>
<!-- <el-menu class="el-menu-demo" mode="horizontal">
<el-submenu index="1">
<template slot="title">CBPR+ Manual mirroring packet</template>
<div v-for="(item, i) in messageTypeCodes">
<el-menu-item><router-link :to="'/iso/'+item.value">{{item.label}}</router-link></el-menu-item>
</div>
</el-submenu>
<el-submenu index="2">
<template slot="title">RTGS Manual mirroring packet</template>
<div v-for="(item, i) in messageTypeCodesRtgs">
<el-menu-item><router-link :to="'/rtgs/'+item.value">{{item.label}}</router-link></el-menu-item>
</div>
</el-submenu> -->
<!-- <el-submenu index="3">
<template slot="title">SWIFT报文中央格转器</template>
<el-menu-item index="3-1"><router-link to="/mx2mt">MX转MT</router-link></el-menu-item>
<el-menu-item index="3-2"><router-link to="/mt2mx">MT转MX</router-link></el-menu-item>
</el-submenu> -->
<!-- </el-menu> -->
<el-row>
<!-- <el-col :span="3"></el-col> -->
<el-col :span="18" :offset="3">
<el-tabs v-model="activeName" type="card">
<!--
<el-tab-pane label="RTGS Manual mirroring packet" name="first">
<el-input v-model="inputRtgs" placeholder="Input message type for quick screening" @input="searchRtgsMessageByType"></el-input>
<el-table
:data="messageTypeCodesRtgs.filter((v) => v.isShow == true)"
:show-header="false"
style="width: 100%">
<el-table-column>
<template slot-scope="scope">
<router-link :to="'/rtgs/'+scope.row.value+`/${loginUser}`">{{"Create " + scope.row.value + " " + scope.row.label}}</router-link>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
-->
<el-tab-pane label="CIPS Manual mirroring packet" name="second">
<el-input v-model="inputCbprPlus" placeholder="Input message type for quick screening" @input="searchCIPSPlusMessageByType"></el-input>
<el-table
:data="CIPSmessageTypeCodes.filter((v) => v.isShow == true)"
:show-header="false"
style="width: 100%">
<el-table-column>
<template slot-scope="scope">
<router-link :to="'/cips/'+scope.row.value+`/${loginUser}`">{{"Create " + scope.row.value + " " + scope.row.label}}</router-link>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-col>
<!-- <el-col :span="3"></el-col> -->
</el-row>
</template>
<script>
import MsgCodes from './script/MsgCode';
export default {
data() {
return {
CIPSmessageTypeCodes : MsgCodes['CIPSmessageTypeCode'],
activeName: 'second',
inputCbprPlus: '',
inputRtgs: '',
loginUser: this.$route.query.loginUser,
}
},
methods:{
searchCIPSPlusMessageByType(){
let icp = this.inputCbprPlus;
console.log(this.CIPSmessageTypeCodes);
console.log("icp:"+icp);
for(let mess of this.CIPSmessageTypeCodes){
if(icp != null || icp != undefined){
console.log(mess.value.indexOf(icp));
console.log(mess.value);
if(mess.value.indexOf(icp) != -1)
mess.isShow = true;
else
mess.isShow = false;
}else
mess.isShow = true;
}
},
},
mounted(){
//点击goBack,返回刷新页面
this.searchCIPSPlusMessageByType();
},
created(){
console.log(this.loginUser);
}
}
</script>
<style scoped>
a{text-decoration: none}
</style>
\ No newline at end of file
<template>
<div class="container">
<!-- <el-page-header @back="goBack" content="Detail Page" title="Return"> -->
<!-- </el-page-header> -->
<h3 class="page_title" :title="msg">{{ title }}</h3>
<div class="iso_tools">
<el-button
v-if="onShow"
@click="validateMessage"
size="small"
type="primary"
>检核</el-button
>
<el-button v-else ref="openBtn" @click="open" size="small" type="primary"
>展开</el-button
>
<br /><br /><br />
<el-button v-if="onShow" @click="genMessage" size="small" type="primary"
>发送</el-button
>
<el-button
v-else
ref="closeBtn"
@click="close"
size="small"
type="primary"
>收起</el-button
>
<br /><br /><br />
<!-- <el-button v-if="thShow" @click="mx2mt" size="small" type="primary">转换</el-button> -->
<!-- <el-button v-if="!onShow" type="primary" @click="showTemplate(mty)" size="small">模板</el-button> -->
</div>
<el-tabs
type="card"
tab-position="top"
style="height: 200px"
activeName="messageTab"
:before-leave="beforeTabLeave"
>
<el-tab-pane label="报文信息" name="messageTab">
<el-form :model="treeModel" size="small" inline-message ref="form">
<el-tree
ref="tree"
:data="treeModel.treeNodeArry"
node-key="path"
icon-class="el-icon-folder"
>
<span class="tree_node" slot-scope="{ node, data }">
<el-col :span="8">
<span class="msg_title" :class="{ node_nonleaf: !node.isLeaf }">
<input
type="radio"
:name="parentNodeData(node).path"
:checked="data.checked"
v-if="
'Choice' === parentNodeData(node).type &&
!parentNodeData(node).disabled
"
@click.stop
@change="radioChange(node)"
/>
<span
style="margin-right: 5px"
v-if="node.data.type != 'HiddenInput'"
>
{{ node.data.name }}</span
>
<!--添加 报文模板保存功能 -->
<template-infos
:mty="mty"
:obj="templateData"
:loginUser="loginUser"
ref="templateInfos"
>
</template-infos>
<el-button
v-if="
data.array &&
(data._children === undefined ||
data._children === null) &&
!(siblSameTagNodeNum(node) >= data.maxLength)
"
type="text"
icon="el-icon-circle-plus-outline"
size="mini"
circle
@click.stop="addNodeArryElem(node)"
></el-button>
<el-button
v-if="
data.array &&
siblNodeData(node, -1).array &&
siblNodeData(node, -1).tag == data.tag
"
type="text"
icon="el-icon-remove-outline"
size="mini"
circle
@click.stop="removeNodeArryElem(node)"
>
</el-button>
</span>
</el-col>
<el-col :span="16">
<span>
<el-form-item
label=" "
:prop="`treeNodeArry${nodePath(data.path)}.value`"
:rules="genRules(data, node)"
>
<component
:is="msgComRender(node).is"
:dataModel="data"
v-bind="msgComRender(node).props"
>
</component>
</el-form-item>
</span>
</el-col>
</span>
</el-tree>
</el-form>
</el-tab-pane>
<el-tab-pane label="预览" name="previewTab">
<div>
<div class="left">
<h3 class="title1">MX Message</h3>
<textarea class="textleft" readonly v-model="message"></textarea>
</div>
<!-- <div v-if="flag" class="right">
<h3 class="title2">mt报文</h3>
<textarea class="textright" readonly v-model="mtmessage"></textarea>
</div> -->
</div>
</el-tab-pane>
</el-tabs>
<el-dialog title="mtType" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="mtType:">
<el-select v-model="form.mtType" placeholder="Please select mtType">
<el-option label="MT202" value="202"></el-option>
<el-option label="MT205" value="205"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">Cancellation</el-button>
<el-button type="primary" @click="sure">Confirm</el-button>
</div>
</el-dialog>
<el-backtop style="right: 18px" />
</div>
</template>
<script>
import MsgCodes from "../script/MsgCode";
import MsgJsonMap from "../script/MsgJson";
import msgComRender from "../script/MsgComRender";
import {
appendTreeChild,
deleteEmptyProperty,
hasMandatoryChildNode,
clearMsgValue,
deepClone,
} from "../script/MsgJson/MsgHander";
import ISOComs from "../components";
import send from "../Service/post";
import { validatorRule } from "../script/Rule/CipsRule";
export default {
props: ["mty"],
components: {
...ISOComs,
},
data() {
return {
isCheck: false,
title: "CIPS Manual reporting",
message: "",
treeModel: { treeNodeArry: [] },
jsonMsg: "",
flag: false,
mtmessage: "",
msg: "",
onShow: false,
thShow: false,
form: {
mtType: "",
},
dialogFormVisible: false,
data: {},
map: "",
smhinr: this.$route.query.smhinr,
mxminr: this.$route.query.mxminr,
loginUser: this.$route.params.loginUser,
count: 1,
templateData:"",
};
},
methods: {
goBack() {
this.$router.push({
path: "/cips",
query: {
loginUser: this.loginUser,
},
});
},
msgComRender,
buildMsgStruct() {
this.title = this.mty;
let messageTypeCodes = MsgCodes["CIPSmessageTypeCode"];
for (let messageTypeCode of messageTypeCodes) {
if (messageTypeCode.value == this.mty) {
this.title = messageTypeCode.label2;
this.msg = messageTypeCode.value;
}
}
const jsonArry = MsgJsonMap(this.mty);
if (jsonArry !== null) {
this.commonNodeReplace(jsonArry, null);
this.resetValueAndStatus(jsonArry);
// 报文回退编辑
let smhinr = this.smhinr;
let mxminr = this.mxminr;
console.log(smhinr);
console.log(mxminr);
console.log(jsonArry);
if (smhinr != undefined && smhinr != null) {
this.setJSonValue(jsonArry);
} else if(mxminr != undefined && mxminr != null) {
//模板查询报文编辑
this.getTemplate(jsonArry);
} else {
this.treeModel.treeNodeArry = jsonArry;
}
}
},
getTemplate(jsonArry) {
const data = { mty: this.mty, type: "cbpr", mxminr: this.mxminr };
send.getTemplate(data).then((res) => {
this.map = res.data;
this.setValue2JsonArry(jsonArry, this.map, true);
this.treeModel.treeNodeArry = jsonArry;
this.changeTreeNodeStatus(this.treeModel.treeNodeArry);
});
},
showTemplate(mty){
let dataArray = deepClone(this.treeModel.treeNodeArry);
dataArray = appendTreeChild(dataArray);
this.templateData = JSON.stringify(dataArray);
this.$refs.templateInfos.showDialog();
console.log("-----json-----")
console.log(this.templateData);
},
changeTreeNodeStatus(jsonArry){
for(let job of jsonArry){
let type = job.type;
let children = job.children;
let children2 = job._children;
//得到最外层的Choice节点
if(type == "Choice"){
if(children != undefined && children != null){
let count = 0;
for(let i = 0 ; i< children.length;i++){
//判断节点是否为空
if(this.judgeArrayNone(children[i]) != null){
//当前节点不为空
//修改当前节点的checked状态
this.changeChildsStatus(children[i],false,true,true);
this.UpdateChoiceNode(children[i]);
}else{
count++;
//当前节点值为空置灰
this.changeChildsStatus(children[i],true,false,true);
}
}
//若只有一层Choice节点,默认设置checked为第一项
if(count == children.length){
this.changeChildsStatus(children[0],false,true,true);
}
}
if(children2 != undefined && children2 != null){
let count = 0;
for(let i = 0 ; i< children2.length;i++){
if(this.judgeArrayNone(children2[i]) != null){
this.changeChildsStatus(children2[i],false,true,true);
this.UpdateChoiceNode(children2[i]);
}else{
count++;
this.changeChildsStatus(children2[i],true,false,true);
}
}
//若只有一层Choice节点,默认设置checked为第一项
if(count == children2.length){
this.changeChildsStatus(children2[0],false,true,true);
}
}
continue;
}
if(children != undefined && children != null){
this.changeTreeNodeStatus(children);
}
if(children2 != undefined && children2 != null){
this.changeTreeNodeStatus(children2);
}
}
},
//判断是Choice的子节点是值是否为空
judgeArrayNone(jsonarray){
if(jsonarray.value !=undefined && jsonarray.value != ""){
return jsonarray;
}
if(jsonarray.children != undefined && jsonarray.children != null){
for(let data of jsonarray.children){
const res = this.judgeArrayNone(data);
if(res) return res;
}
}
if(jsonarray._children != undefined && jsonarray._children != null){
for(let data of jsonarray._children){
const res = this.judgeArrayNone(data);
if(res) return res;
}
}
return null;
},
////判断是否含有Choice节点
judgeChoiceNode(jsonarray){
if(jsonarray.type == "Choice"){
return jsonarray;
}
if(jsonarray.children != undefined && jsonarray.children != null){
for(let data of jsonarray.children){
const res = this.judgeChoiceNode(data);
if(res) return res;
}
}
if(jsonarray._children != undefined && jsonarray._children != null){
for(let data of jsonarray._children){
const res = this.judgeChoiceNode(data);
if(res) return res;
}
}
return null;
},
//修改子节点含有Choice的checked状态
UpdateChoiceNode(jsonarray){
if(jsonarray.children != undefined && jsonarray.children != null){
for(let data of jsonarray.children){
if(this.judgeChoiceNode(data) != null){
data = this.judgeChoiceNode(data);
if(data.children != undefined || data._children != undefined){
//如果是数组则继续递归修改状态
this.UpdateChoiceNode(data);
}else{
this.changeChildsStatus(data,false,true,true);
}
}else{
//当前节点没有子节点
if(data.children == undefined && data._children == undefined){
if(data.value != ''){
this.changeChildsStatus(data,false,true,true);
}else{
this.changeChildsStatus(data,true,false,true);
}
}
}
}
}
if(jsonarray._children != undefined && jsonarray._children != null){
for(let data of jsonarray._children){
if(this.judgeChoiceNode(data) != null){
data = this.judgeChoiceNode(data);
console.log(data);
if(data.children != undefined || data._children != undefined){
this.UpdateChoiceNode(data);
}else{
this.changeChildsStatus(data,false,true,true);
}
}else{
if(data.children == undefined && data._children == undefined){
if(data.value != ''){
this.changeChildsStatus(data,false,true,true);
}else{
this.changeChildsStatus(data,true,false,true);
}
}
}
}
}
},
/**
* 修改节点disable、checked状态;
*
* @param {tree node对应的数据对象} nodeData
* @param {*disable值} sta
* @param {*checked值} checked
* @param {*当前节点的父节点是否为“Choice”} parentIsChoice
*/
changeChildsStatus(nodeData, sta, checked, parentIsChoice){
//父节点是“Choice”,并且要将disable置为false(表现在web页面上为可以输入)
if(parentIsChoice && !sta){
if(nodeData.checked === undefined)
this.$set(nodeData, "checked", checked);
else
nodeData.checked = checked;
//当前节点及其后代节点disable的值要继承
//若当前节checked === true,disable的值要固定为false(可用)
//若当前节checked === false,disable的值要固定为true(不可用)
if(checked)
sta = false;
else
sta = true;
}
if(nodeData.disabled === undefined){
this.$set(nodeData, "disabled", sta);
}else{
nodeData.disabled = sta;
}
if(nodeData.children !== null && nodeData.children !== undefined){
for(let i = 0; i < nodeData.children.length; i++){
//父节点是“Choice”的节点,默认(子节点都没有值)第一个子节点checked值为true
this.changeChildsStatus(nodeData.children[i], sta, i === 0, nodeData.type === "Choice");
}
}else if(nodeData._children !== null && nodeData._children !== undefined){
for(let i = 0; i < nodeData._children.length; i++){
this.changeChildsStatus(nodeData._children[i], sta, i === 0, nodeData.type === "Choice");
}
}
},
genRules(data, node) {
const rules = [];
rules.push({
required:
"M" === data.status &&
node.isLeaf &&
data.unable !== true &&
data.disabled !== true,
message: node.data.name + " Cannot be null",
});
let validator = msgComRender(node).contextValidator;
if (validator !== undefined) {
if (Array.isArray(validator)) {
for (let v of validator) {
rules.push(v);
}
} else {
rules.push(validator);
}
}
return rules;
},
commonNodeReplace(jsonArry, pathSufix) {
for (let job of jsonArry) {
if (pathSufix !== null) {
job.path = pathSufix + "." + job.path;
}
let id = jsonArry[jsonArry.length - 1].defaultValue;
if ("bizSvc" === job.tag && "pacs.008.001.08" === id) {
job.type = "Select#pacs008";
}
if (job.children === undefined || job.children === null) {
let child = MsgJsonMap(job.type);
// debugger
if (child != null && child.length === 12) {
let id = jsonArry[jsonArry.length - 2].defaultValue;
if ("cips.111.001.02" === id) {
child[5].defaultValue = "swift.cbprplus.02";
child[5].unable = true;
} else if ("cips.112.001.02" === id) {
child[5].defaultValue = "swift.cbprplus.02";
child[5].unable = true;
}
id = id.substring(0, 15);
child[4].defaultValue = id;
}
if (child !== null && Array.isArray(child)) {
this.commonNodeReplace(child, job.path);
job.children = child;
}
} else {
this.commonNodeReplace(job.children, pathSufix);
}
if (job.status !== "M" && hasMandatoryChildNode(job.children)) {
job._children = job.children;
job.children = null;
}
}
},
setValue2JsonArry(jsonArry, map, flag) {
console.log("---------start setValue2JsonArry----------");
let j = 0;
for (let job of jsonArry) {
let children = job.children;
let children2 = job._children;
let tag = job.tag;
let label = job.label;
let value = "";
let type = job.type;
console.log("-----type-----:"+type);
console.log("-----tag-----:"+tag);
console.log("-----label-----:"+label);
if (map[tag] === null || map[tag] === undefined) {
console.log("map[tag] === null");
continue;
}
if (type != undefined && type.includes("List")) {
value = [];
console.log("---list---");
for (let i = 0; i < map[tag].length; i++) {
console.log("map[tag][i]:"+map[tag][i]);
value.push({ name: map[tag][i] });
}
job.value = value;
console.log("---List done---");
continue;
}
if (tag === "ntry" && this.count === 1) {
flag = true;
j = 0;
this.count++;
}
if (map[tag] instanceof Array) {
if (map[tag].length > 1 && flag) {
for (let i = 0; i < map[tag].length - 1; i++) {
this.addNode(jsonArry, job);
}
flag = false;
console.log("---map[tag]=Array---");
this.setValue2JsonArry(jsonArry, map, flag);
}
console.log("---array---");
console.log("map[tag][j]:"+map[tag][j]);
value = map[tag][j];
j++;
} else {
console.log("value=map[tag]:"+map[tag]);
value = map[tag];
}
if (value === undefined || value === null) {
console.log("---value === undefined---");
continue;
}
if (children === undefined || children === null) {
if (children2 === undefined || children2 === null) {
console.log("no child!!!job.value = "+value);
job.value = value;
} else {
console.log("child2");
this.setValue2JsonArry(children2, value, flag);
}
} else {
console.log("child1");
this.setValue2JsonArry(children, value, flag);
}
}
},
setJSonValue(jsonArry) {
const data = { mty: this.mty, type: "cbpr", smhinr: this.smhinr };
console.log(data);
send.cips2Json(data).then((res) => {
this.map = res.data;
this.setValue2JsonArry(jsonArry, this.map, true);
this.treeModel.treeNodeArry = jsonArry;
//解决选择checked的但依旧置灰的错误
this.changeTreeNodeStatus(this.treeModel.treeNodeArry);
});
console.log("cips2Json done");
},
parentNodeData(node) {
return node.parent.data;
},
siblNodeData(node, num) {
const parent = this.getParentTreeModel(node.data.path);
const split = node.data.path.split(".");
const index = Number(split[split.length - 1]) + num;
const ret = parent[index];
return ret ? ret : {};
},
siblSameTagNodeNum(node) {
let cnt = 0;
const targetTag = node.data.tag;
for (let n of node.parent.childNodes) {
if (n.data.tag === targetTag) {
++cnt;
}
}
return cnt;
},
nodePath(path) {
if (path !== undefined) {
const split = path.split(".");
let nodePath = `[${split[0]}]`;
if (split.length > 1) {
for (let j = 1; j < split.length; j++) {
nodePath += `.children[${split[j]}]`;
}
}
return nodePath;
}
},
beforeTabLeave(to, from) {
if (to === "previewTab") {
this.isCheck = false;
return this.$refs.form
.validate()
.then((success) => {
let dataArray = deepClone(this.treeModel.treeNodeArry);
let obj = appendTreeChild(dataArray);
let flag = validatorRule(this.mty, obj);
if (!flag) {
this.onShow = false;
this.thShow = true;
return Promise.reject();
}
this.onShow = true;
if (
this.mty !== "pain.001.001.09" &&
this.mty !== "pain.002.001.10"
) {
this.thShow = true;
}
const json = appendTreeChild(dataArray);
console.log(json);
deleteEmptyProperty(json);
console.log(json);
this.jsonMsg = JSON.stringify(json);
let smhinr = this.smhinr;
let data = { json: this.jsonMsg };
if (smhinr != undefined && smhinr != null) {
this.$set(data, "opeType", "2");
}
send
.sendCipsMes(data)
.then((res) => {
this.message = res.data;
})
.catch((err) => {
this.$message({
message: "Network exception(" + err.message + ")",
type: "error",
});
});
})
.catch((errMsg) => {
console.log("com to catch");
console.log(errMsg);
for (let err of Object.keys(errMsg)) {
if (err.indexOf("children") !== -1) {
const firstErrorPath = eval(
"this.treeModel." + err.slice(0, -5) + "path"
);
this.updateTreeNodeParentExpand(firstErrorPath, true);
break;
}
}
setTimeout(() => {
const isError = document.getElementsByClassName("is-error");
if (
isError[0] === null ||
isError[0] === "" ||
isError[0] === undefined
)
return;
isError[0].scrollIntoView({
block: "center",
behavior: "smooth",
});
}, 100);
throw new Error(errMsg);
});
} else {
this.onShow = false;
this.thShow = false;
}
},
radioChange(node) {
this.updateTreeNodeStatus(node, true);
const curId = node.id;
for (let collNode of node.parent.childNodes) {
if (collNode.id !== curId) {
this.updateTreeNodeStatus(collNode, false);
}
}
},
updateTreeNodeStatus(node, bFlag, checked) {
let disable;
if (bFlag) {
if (checked) {
node.data.checked = true;
}
disable = checked === false;
} else {
clearMsgValue(node.data);
this.$refs.form.clearValidate(
`treeNodeArry${this.nodePath(node.data.path)}.value`
);
disable = true;
}
if (node.data.disabled === undefined) {
this.$set(node.data, "disabled", disable);
} else {
node.data.disabled = disable;
}
if (
(node.childNodes && node.childNodes.length > 0) ||
node.data.children ||
node.data._children
) {
const relChildren =
node.childNodes && node.childNodes.length > 0
? node.childNodes
: node.data.children
? node.data.children
: node.data._children;
for (let i = 0; i < relChildren.length; i++) {
if (node.data.type === "Choice") {
checked = i === 0;
}
let child = relChildren[i].data
? relChildren[i]
: { data: relChildren[i] };
this.updateTreeNodeStatus(child, bFlag, checked);
}
}
if (node.expanded !== undefined && !node.isLeaf) {
node.expanded = bFlag;
}
},
getParentTreeModel(childPath) {
const path = this.nodePath(childPath);
let index = path.lastIndexOf(".");
let parent;
if (index != -1) {
parent = eval(
"this.treeModel.treeNodeArry" + path.substring(0, index) + ".children"
);
} else {
parent = this.treeModel.treeNodeArry;
}
return parent;
},
addNode(jsonArry, job) {
const newNode = this.copyNewNode(job);
const split = job.path.split(".");
this.updateNodePath(newNode, split.length, 1);
let index = split[split.length - 1];
index = Number(index) + 1;
for (let i = index; i < jsonArry.length; i++) {
this.updateNodePath(jsonArry[i], split.length, 1);
}
jsonArry.splice(index, 0, newNode);
},
addNodeArryElem(node) {
// debugger;
const parent = this.getParentTreeModel(node.data.path);
const newNode = this.copyNewNode(node.data);
this.updateNodePath(newNode, node.level, 1);
const split = node.data.path.split(".");
let index = split[split.length - 1];
index = Number(index) + 1;
for (let i = index; i < parent.length; i++) {
this.updateNodePath(parent[i], node.level, 1);
}
parent.splice(index, 0, newNode);
},
removeNodeArryElem(node) {
const parent = this.getParentTreeModel(node.data.path);
const split = node.data.path.split(".");
let index = split[split.length - 1];
index = Number(index);
parent.splice(index, 1);
for (let i = index; i < parent.length; i++) {
this.updateNodePath(parent[i], node.level, -1);
}
},
resetValueAndStatus(data, checked) {
if (Array.isArray(data)) {
for (let node of data) {
checked = this.resetValueAndStatus(node, checked);
}
} else {
let nextChecked = checked;
clearMsgValue(data);
if (checked === undefined) {
Reflect.deleteProperty(data, "disable");
Reflect.deleteProperty(data, "checked");
} else if (checked === true) {
data.checked = true;
Reflect.deleteProperty(data, "disable");
nextChecked = false;
checked = undefined;
} else if (checked === false) {
data.disabled = true;
Reflect.deleteProperty(data, "checked");
}
if (data.children || data._children) {
if (data.type === "Choice" && checked !== false) {
checked = true;
}
const relChildren = data.children ? data.children : data._children;
this.resetValueAndStatus(relChildren, checked);
}
return nextChecked;
}
},
copyNewNode(json) {
const data = JSON.parse(JSON.stringify(json));
this.resetValueAndStatus(data);
return data;
},
updateNodePath(json, level, num) {
const split = json.path.split(".");
split[level - 1] = Number(split[level - 1]) + num;
json.path = split.join(".");
if (json.children || json._children) {
const realChild = json.children ? json.children : json._children;
for (let child of realChild) {
this.updateNodePath(child, level, num);
}
}
},
genMessage() {
if (!this.isCheck) {
this.$message({
message: "save requires successful check",
type: "error",
});
return;
}
let data = { json: this.jsonMsg };
let smhinr = this.smhinr;
if (smhinr != undefined && smhinr != null) {
this.$set(data, "opeType", "2");
}
let loginUser = this.loginUser;
if (loginUser != undefined && loginUser != null) {
this.$set(data, "loginUser", loginUser);
}
send
.saveCipsMes(data)
.then((res) => {
if ("1" === res.data.substring(0, 1)) {
this.$message({
message: res.data.substring(1),
type: "success",
});
this.$router.push({
path: "/successCips",
query: {
loginUser: this.loginUser,
}
});
} else {
this.$message({
message: "发送失败!"+res.data,
type: "error",
});
}
})
.catch((err) => {
this.$message({
message: "Network exception(" + err.message + ")",
type: "error",
});
});
},
validateMessage() {
let data = { xml: this.message, mty: this.mty };
send
.validateCipsMes(data)
.then((res) => {
if ("1" == res.data) {
this.$message({
message: "检核成功!",
type: "success",
});
this.isCheck = true;
} else {
this.$message({
message: res.data,
type: "error",
});
this.isCheck = false;
}
})
.catch((err) => {
this.$message({
message: "Network exception(" + err.message + ")",
type: "error",
});
this.isCheck = false;
});
},
updateTreeNodeParentExpand(path, expanded) {
const split = path.split(".");
if (split.length < 2) {
return;
}
for (let i = split.length - 1; i > 0; i--) {
path = split.slice(0, i).join(".");
this.updateTreeNodeExpand(path, expanded);
}
},
updateTreeNodeExpand(path, expanded) {
this.$refs.tree.store.nodesMap[path].expanded = expanded;
},
// 展开按钮
open() {
// 控制按钮点击之后失焦
this.$refs.openBtn.$el.blur();
for (let key in this.$refs.tree.store.nodesMap) {
this.$refs.tree.store.nodesMap[key].expanded = true;
}
},
// 收起按钮
close() {
// 控制按钮点击之后失焦
this.$refs.closeBtn.$el.blur();
for (let key in this.$refs.tree.store.nodesMap) {
this.$refs.tree.store.nodesMap[key].expanded = false;
}
},
mx2mt() {
this.data = { xml: this.message };
if (this.mty == "pacs.009.001.08") {
this.dialogFormVisible = true;
} else {
send
.mx2mt(this.data)
.then((res) => {
this.mtmessage = res.data;
})
.catch((err) => {
this.$message({
message: "Network exception" + err.message + ")",
type: "error",
});
});
}
this.flag = true;
},
sure() {
this.dialogFormVisible = false;
this.data = { xml: this.message, mtType: this.form.mtType };
send
.mx2mt(this.data)
.then((res) => {
this.mtmessage = res.data;
//console.log(this.mtmessage)
})
.catch((err) => {
this.$message({
message: "Network exception(" + err.message + ")",
type: "error",
});
});
},
},
mounted() {
this.buildMsgStruct();
// 在nextTick回调函数中执行渲染完毕后的函数
this.$nextTick(()=>{
console.log("-----初始化展开-----")
this.open();
});
},
created(){
window.sessionStorage.clear()
}
};
</script>
<style scoped>
.page_title {
text-align: center;
}
.node_nonleaf {
color: #169bff;
border-bottom: 1px dotted #169bff;
}
.msg_title input {
vertical-align: top;
margin-right: 0px;
}
.el-form-item {
margin-bottom: 0px;
}
:deep(.el-form-item__content) {
padding-left: 23px;
}
:deep(.el-tree-node__content) {
height: auto;
}
.el-button + .el-button {
margin-left: 0px;
}
.el-button--mini.is-circle {
padding: 1px;
}
.tree_node {
flex: 1;
display: flex;
align-items: center;
font-size: 14px;
}
.iso_tools {
position: fixed;
top: 150px;
right: 10px;
z-index: 9;
}
.left {
width: 90%;
height: 100%;
background: #ffffff;
float: left;
}
.right {
float: left;
width: 50%;
height: 100%;
background: #fff;
}
.title1 {
background: red;
text-align: center;
}
.title2 {
background: green;
text-align: center;
}
.textleft {
width: 100%;
height: 600px;
}
.textright {
width: 100%;
height: 600px;
}
/*/deep/ .el-form-item.is-error .el-input__inner {
background-color: red;
}
/deep/ .el-form-item.is-error .el-input__count-inner {
background-color: red;
}*/
</style>
\ No newline at end of file
<template>
<div class="main"><span>success</span></div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {
loginUser: this.$route.query.loginUser,
};
},
watch: {},
computed: {},
methods: {
toHome() {
this.$router.push({
path: "/cips",
query: {
loginUser: this.loginUser,
},
});
},
},
created() {
console.log(this.loginUser);
},
mounted() {}
};
</script>
<style scoped>
.main {
height: 100%;
margin-top: 10%;
}
.main span {
margin: auto;
font-size: 40px;
width: 200px;
height: 200px;
border-radius: 100px;
text-align: center;
line-height: 200px;
display: block;
color: blueviolet;
background-color: rgb(240, 210, 155);
}
.btn {
display: block;
margin: auto;
margin-top: 20px;
}
</style>
\ No newline at end of file
......@@ -113,6 +113,12 @@ const MsgCodes = {
// scale: 2
// },
],
Ccy: [{
value: "CNY",
label: "CNY",
scale: 2
},
],
externalAccountIdCode: [{
value: "AIIN",
label: "Issuer Identification Number"
......
export default [
{
path:"0",
name:"报文内容",
label:"Message root",
tag:"FIToFICstmrCdtTrf",
status:"M",
children: [
{
path:"0.0",
name:"报文头",
label:"GroupHeader",
tag:"GrpHdr",
status:"M",
children: [
{
path:"0.0.0",
name:"报文标识号",
label:"MessageIdentification",
tag:"MsgId",
type:"TextInput",
status:"M",
maxLength:"20",
//iscips 标识是否属于cips,若属于cips有特定的初始化规则
iscips:"1",
},
{
path:"0.0.1",
name:"报文发送时间",
label:"CreationDateTime",
tag:"CreDtTm",
type:"DateTime",
status:"M",
},
{
path:"0.0.2",
name:"明细业务总笔数",
label:"NumberOfTransactions",
tag:"NbOfTxs",
type:"TextInput",
status:"M",
maxLength:"15",
defaultValue:"1",
},
{
path:"0.0.3",
name:"结算信息",
label:"SettlementInformation",
tag:"SttlmInf",
status:"M",
children: [
{
path:"0.0.3.0",
name:"结算方式",
label:"SettlementMethod",
tag:"SttlmMtd",
type:"TextInput",
status:"M",
maxLength:"4",
defaultValue:"CLRG",
},
],
},
],
},
{
path:"0.1",
name:"报文体",
label:"CreditTransferTransactionInformation",
tag:"CdtTrfTxInf",
status:"M",
children: [
{
path:"0.1.0",
name:"付款标识",
label:"PaymentIdentification",
tag:"PmtId",
status:"M",
children: [
{
path:"0.1.0.0",
name:"端到端标识号",
label:"EndToEndIdentification",
tag:"EndToEndId",
type:"TextInput",
status:"M",
maxLength:"35",
//iscips 标识是否属于cips,若属于cips有特定的初始化规则
iscips:"1",
},
{
path:"0.1.0.1",
name:"交易标识号",
label:"TransactionIdentification",
tag:"TxId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.1",
name:"付款类型信息",
label:"PaymentTypeInformation",
tag:"PmtTpInf",
status:"O",
children: [
{
path:"0.1.1.0",
name:"业务种类",
label:"CategoryPurpose",
tag:"CtgyPurp",
status:"O",
children: [
{
path:"0.1.1.0.0",
name:"业务种类编码",
label:"Proprietary",
tag:"Prtry",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.2",
name:"货币符号、金额",
label:"InterbankSettlementAmount",
tag:"IntrBkSttlmAmt",
type:"AmountCIPS#18,5",
status:"M",
},
{
path:"0.1.3",
name:"起息日",
label:"InterbankSettlementDate",
tag:"IntrBkSttlmDt",
type:"Date",
status:"M",
},
{
path:"0.1.4",
name:"业务优先级",
label:"SettlementPriority",
tag:"SttlmPrty",
type:"Select#priority3Code",
status:"M",
},
{
path:"0.1.5",
name:"结算信息",
label:"SettlementTimeIndication",
tag:"SttlmTmIndctn",
status:"O",
children: [
{
path:"0.1.5.0",
name:"结算时间",
label:"DebitDateTime",
tag:"DbtDtTm",
type:"DateTime",
status:"O",
},
],
},
{
path:"0.1.6",
name:"原始货币符号、金额",
label:"InstructedAmount",
tag:"InstdAmt",
type:"AmountCIPS#18,5",
status:"O",
},
{
path:"0.1.7",
name:"汇率",
label:"ExchangeRate",
tag:"XchgRate",
type:"Decimal#11,10",
status:"O",
},
{
path:"0.1.8",
name:"费用承担方",
label:"ChargeBearer",
tag:"ChrgBr",
type:"Select#ChargeBearerType1Code",
status:"M",
maxLength:"4",
},
{
path:"0.1.9",
name:"费用信息",
label:"ChargesInformation",
tag:"ChrgsInf",
status:"O",
array:true,
children: [
{
path:"0.1.9.0",
name:"费用",
label:"Amount",
tag:"Amt",
type:"AmountCIPS#18,5",
status:"M",
},
{
path:"0.1.9.1",
name:"代理",
label:"Agent",
tag:"Agt",
status:"M",
children: [
{
path:"0.1.9.1.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.9.1.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"M",
children: [
{
path:"0.1.9.1.0.0.0",
name:"付费行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
],
},
],
},
{
path:"0.1.10",
name:"付款代理",
label:"InstructingAgent",
tag:"InstgAgt",
status:"M",
children: [
{
path:"0.1.10.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.10.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"M",
children: [
{
path:"0.1.10.0.0.0",
name:"付款直接参与者行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.10.1",
name:"分行标识",
label:"BranchIdentification",
tag:"BrnchId",
status:"O",
children: [
{
path:"0.1.10.1.0",
name:"付款间接参与者行号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"O",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.11",
name:"收款代理",
label:"InstructedAgent",
tag:"InstdAgt",
status:"M",
children: [
{
path:"0.1.11.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.11.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"M",
children: [
{
path:"0.1.11.0.0.0",
name:"收款直接参与者行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
],
},
{
path:"0.1.12",
name:"中介机构1信息",
label:"IntermediaryAgent1",
tag:"IntrmyAgt1",
status:"O",
children: [
{
path:"0.1.12.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.12.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"O",
children: [
{
path:"0.1.12.0.0.0",
name:"中介机构1行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.12.0.1",
name:"中介机构1名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
],
},
],
},
{
path:"0.1.13",
name:"中介机构2信息",
label:"IntermediaryAgent2",
tag:"IntrmyAgt2",
status:"O",
children: [
{
path:"0.1.13.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.13.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"O",
children: [
{
path:"0.1.13.0.0.0",
name:"中介机构2行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.13.0.1",
name:"中介机构2名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
],
},
],
},
{
path:"0.1.14",
name:"付款人",
label:"Debtor",
tag:"Dbtr",
status:"M",
children: [
{
path:"0.1.14.0",
name:"付款人名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
{
path:"0.1.14.1",
name:"通信地址",
label:"PostalAddress",
tag:"PstlAdr",
status:"O",
children: [
{
path:"0.1.14.1.0",
name:"付款人地址",
label:"AddressLine",
tag:"AdrLine",
type:"TextInput",
status:"O",
maxLength:"70",
array:true,
},
],
},
{
path:"0.1.14.2",
name:"标识",
label:"Identification",
tag:"Id",
type:"Choice",
status:"M",
children: [
{
path:"0.1.14.2.0",
name:"组织标识",
label:"OrganisationIdentification",
tag:"OrgId",
status:"M",
children: [
{
path:"0.1.14.2.0.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"O",
children: [
{
path:"0.1.14.2.0.0.0",
name:"付款人组织机构代码",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.14.2.1",
name:"证件标识",
label:"PrivateIdentification",
tag:"PrvtId",
status:"M",
children: [
{
path:"0.1.14.2.1.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"O",
children: [
{
path:"0.1.14.2.1.0.0",
name:"付款人证件号码",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"35",
},
{
path:"0.1.14.2.1.0.1",
name:"证件体系名称",
label:"SchemeName",
tag:"SchmeNm",
status:"O",
children: [
{
path:"0.1.14.2.1.0.1.0",
name:"付款人证件类型",
label:"Proprietary",
tag:"Prtry",
type:"Select#IDTypeCode",
status:"M",
},
],
},
],
},
],
},
],
},
{
path:"0.1.14.3",
name:"付款人常驻国家(地区)代码",
label:"CountryOfResidence",
tag:"CtryOfRes",
type:"TextInput#[A-Z]{2,2}",
status:"O",
maxLength:"2",
},
],
},
{
path:"0.1.15",
name:"付款人账目",
label:"DebtorAccount",
tag:"DbtrAcct",
status:"O",
children: [
{
path:"0.1.15.0",
name:"标识",
label:"Identification",
tag:"Id",
status:"M",
children: [
{
path:"0.1.15.0.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"M",
children: [
{
path:"0.1.15.0.0.0",
name:"付款人账号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"34",
},
],
},
],
},
],
},
{
path:"0.1.16",
name:"付款人代理",
label:"DebtorAgent",
tag:"DbtrAgt",
status:"M",
children: [
{
path:"0.1.16.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.16.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"O",
children: [
{
path:"0.1.16.0.0.0",
name:"付款人开户行行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.16.0.1",
name:"付款人开户行名称或付款非银行支付机构名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
{
path:"0.1.16.0.2",
name:"通信地址",
label:"PostalAddress",
tag:"PstlAdr",
status:"O",
children: [
{
path:"0.1.16.0.2.0",
name:"付款非银行支付机构地址",
label:"AddressLine",
tag:"AdrLine",
type:"TextInput",
status:"O",
maxLength:"70",
array:true,
},
],
},
],
},
],
},
{
path:"0.1.17",
name:"付款人代理账目",
label:"DebtorAgentAccount",
tag:"DbtrAgtAcct",
status:"O",
children: [
{
path:"0.1.17.0",
name:"标识",
label:"Identification",
tag:"Id",
status:"M",
children: [
{
path:"0.1.17.0.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"M",
children: [
{
path:"0.1.17.0.0.0",
name:"付款非银行支付机构账号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"34",
},
],
},
],
},
],
},
{
path:"0.1.18",
name:"收款人代理",
label:"CreditorAgent",
tag:"CdtrAgt",
status:"M",
children: [
{
path:"0.1.18.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.18.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"O",
children: [
{
path:"0.1.18.0.0.0",
name:"收款人开户行行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
{
path:"0.1.18.0.0.1",
name:"收款非银行支付机构地址",
label:"AddressLine",
tag:"AdrLine",
type:"TextInput",
status:"O",
maxLength:"70",
array:true,
},
],
},
{
path:"0.1.18.0.1",
name:"收款人开户行名称或收款非银行支付机构名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
{
path:"0.1.18.0.2",
name:"通信地址",
label:"PostalAddress",
tag:"PstlAdr",
status:"O",
},
],
},
],
},
{
path:"0.1.19",
name:"收款人代理账目",
label:"CreditorAgentAccount",
tag:"CdtrAgtAcct",
status:"O",
children: [
{
path:"0.1.19.0",
name:"标识",
label:"Identification",
tag:"Id",
status:"M",
children: [
{
path:"0.1.19.0.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"M",
children: [
{
path:"0.1.19.0.0.0",
name:"收款非银行支付机构账号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"34",
},
],
},
],
},
],
},
{
path:"0.1.20",
name:"收款人",
label:"Creditor",
tag:"Cdtr",
status:"M",
children: [
{
path:"0.1.20.0",
name:"收款人名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
{
path:"0.1.20.1",
name:"通信地址",
label:"PostalAddress",
tag:"PstlAdr",
status:"O",
children: [
{
path:"0.1.20.1.0",
name:"收款人地址",
label:"AddressLine",
tag:"AdrLine",
type:"TextInput",
status:"O",
maxLength:"70",
array:true,
},
],
},
{
path:"0.1.20.2",
name:"标识",
label:"Identification",
tag:"Id",
type:"Choice",
status:"M",
children: [
{
path:"0.1.20.2.0",
name:"组织标识",
label:"OrganisationIdentification",
tag:"OrgId",
status:"M",
children: [
{
path:"0.1.20.2.0.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"O",
children: [
{
path:"0.1.20.2.0.0.0",
name:"收款人组织机构代码",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.20.2.1",
name:"证件标识",
label:"PrivateIdentification",
tag:"PrvtId",
status:"M",
children: [
{
path:"0.1.20.2.1.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"O",
children: [
{
path:"0.1.20.2.1.0.0",
name:"收款人证件号码",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"35",
},
{
path:"0.1.20.2.1.0.1",
name:"证件体系名称",
label:"SchemeName",
tag:"SchmeNm",
status:"O",
children: [
{
path:"0.1.20.2.1.0.1.0",
name:"收款人证件类型",
label:"Proprietary",
tag:"Prtry",
type:"Select#IDTypeCode",
status:"M",
},
],
},
],
},
],
},
],
},
{
path:"0.1.20.3",
name:"收款人常驻国家(地区)代码",
label:"CountryOfResidence",
tag:"CtryOfRes",
type:"TextInput#[A-Z]{2,2}",
status:"O",
maxLength:"2",
},
],
},
{
path:"0.1.21",
name:"收款人账目",
label:"CreditorAccount",
tag:"CdtrAcct",
status:"O",
children: [
{
path:"0.1.21.0",
name:"标识",
label:"Identification",
tag:"Id",
status:"M",
children: [
{
path:"0.1.21.0.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"M",
children: [
{
path:"0.1.21.0.0.0",
name:"收款人账号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"34",
},
],
},
],
},
],
},
{
path:"0.1.22",
name:"致收款人银行",
label:"InstructionForCreditorAgent",
tag:"InstrForCdtrAgt",
status:"O",
array:true,
children: [
{
path:"0.1.22.0",
name:"致收款人银行附言",
label:"InstructionInformation",
tag:"InstrInf",
type:"TextInput",
status:"O",
maxLength:"140",
},
],
},
{
path:"0.1.23",
name:"监管报告",
label:"RegulatoryReporting",
tag:"RgltryRptg",
status:"O",
children: [
{
path:"0.1.23.0",
name:"详细信息",
label:"Details",
tag:"Dtls",
status:"O",
children: [
{
path:"0.1.23.0.0",
name:"订单编号",
label:"Type",
tag:"Tp",
type:"TextInput",
status:"O",
maxLength:"35",
},
{
path:"0.1.23.0.1",
name:"订单描述",
label:"Information",
tag:"Inf",
type:"TextInput",
status:"O",
maxLength:"35",
array:true,
},
],
},
],
},
{
path:"0.1.24",
name:"汇款信息",
label:"RemittanceInformation",
tag:"RmtInf",
status:"O",
children: [
{
path:"0.1.24.0",
name:"附言",
label:"Unstructured",
tag:"Ustrd",
type:"TextInput",
status:"O",
maxLength:"140",
array:true,
},
],
},
{
path:"0.1.25",
name:"补充数据",
label:"SupplementaryData",
tag:"SplmtryData",
status:"M",
children: [
{
path:"0.1.25.0",
name:"名称及地址",
label:"PlaceAndName",
tag:"PlcAndNm",
type:"TextInput",
status:"M",
maxLength:"350",
defaultValue:"/Document/FIToFICstmrCdtTrf/CdtTrfTxInf",
},
{
path:"0.1.25.1",
name:"信封",
label:"Envelope",
tag:"Envlp",
status:"M",
children: [
{
path:"0.1.25.1.0",
name:"内容",
label:"Contents",
tag:"Cnts",
status:"M",
children: [
{
path:"0.1.25.1.0.0",
name:"期望结算日期",
label:"ExpectedSettlementDate",
tag:"XpctdSttlmDt",
type:"Date",
status:"M",
},
{
path:"0.1.25.1.0.1",
name:"付款人EID",
label:"DebtorEID",
tag:"DEId",
type:"TextInput",
status:"O",
maxLength:"60",
},
{
path:"0.1.25.1.0.2",
name:"收款人EID",
label:"CreditorEID",
tag:"CEId",
type:"TextInput",
status:"O",
maxLength:"60",
},
{
path:"0.1.25.1.0.3",
name:"日间夜间标志",
label:"BusinessPhase",
tag:"BizPhs",
type:"Select#BizPhaseTypeCode",
status:"O",
},
],
},
],
},
],
},
],
},
],
},
{
path:"1",
name:"MesgType",
tag:"MesgType",
type:"HiddenInput",
status:"O",
defaultValue:"cips.111.001.02",
},
{
path:"2",
name:"MesgPriority",
tag:"MesgPriority",
type:"HiddenInput",
status:"O",
defaultValue:"3",
},
{
path:"3",
name:"OrigReceiver",
tag:"OrigReceiver",
type:"HiddenInput",
status:"O",
},
{
path:"4",
name:"OrigSendDate",
tag:"OrigSendDate",
type:"HiddenInput",
status:"O",
},
{
path:"5",
name:"MesgDirection",
tag:"MesgDirection",
type:"HiddenInput",
status:"O",
defaultValue:"D",
},
{
path:"6",
name:"MesgRefID",
tag:"MesgRefID",
type:"HiddenInput",
status:"O",
},
{
path:"7",
name:"MesgID",
tag:"MesgID",
type:"HiddenInput",
status:"O",
},
{
path:"8",
name:"cipsMsgId",
tag:"cipsMsgId",
type:"HiddenInput",
status:"O",
},
{
path:"9",
name:"OrigSendTime",
tag:"OrigSendTime",
type:"HiddenInput",
status:"O",
},
]
\ No newline at end of file
export default [
{
path:"0",
name:"报文内容",
label:"Message root",
tag:"FICdtTrf",
status:"M",
children: [
{
path:"0.0",
name:"报文头",
label:"GroupHeader",
tag:"GrpHdr",
status:"M",
children: [
{
path:"0.0.0",
name:"报文标识号",
label:"MessageIdentification",
tag:"MsgId",
type:"TextInput",
status:"M",
maxLength:"35",
//iscips 标识是否属于cips,若属于cips有特定的初始化规则
iscips:"1",
},
{
path:"0.0.1",
name:"报文发送时间",
label:"CreationDateTime",
tag:"CreDtTm",
type:"DateTime",
status:"M",
},
{
path:"0.0.2",
name:"明细业务总笔数",
label:"NumberOfTransactions",
tag:"NbOfTxs",
type:"TextInput",
status:"M",
maxLength:"15",
defaultValue:"1",
},
{
path:"0.0.3",
name:"结算信息",
label:"SettlementInformation",
tag:"SttlmInf",
status:"M",
children: [
{
path:"0.0.3.0",
name:"结算方式",
label:"SettlementMethod",
tag:"SttlmMtd",
type:"TextInput",
status:"M",
maxLength:"4",
defaultValue:"CLRG",
},
],
},
],
},
{
path:"0.1",
name:"报文体",
label:"CreditTransferTransactionInformation",
tag:"CdtTrfTxInf",
status:"M",
children: [
{
path:"0.1.0",
name:"付款标识",
label:"PaymentIdentification",
tag:"PmtId",
status:"M",
children: [
{
path:"0.1.0.0",
name:"原交易参考号",
label:"InstructionIdentification",
tag:"InstrId",
type:"TextInput",
status:"O",
maxLength:"35",
},
{
path:"0.1.0.1",
name:"端到端标识号",
label:"EndToEndIdentification",
tag:"EndToEndId",
type:"TextInput",
status:"M",
maxLength:"35",
//iscips 标识是否属于cips,若属于cips有特定的初始化规则
iscips:"1",
},
{
path:"0.1.0.2",
name:"交易标识号",
label:"TransactionIdentification",
tag:"TxId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.1",
name:"付款类型信息",
label:"PaymentTypeInformation",
tag:"PmtTpInf",
status:"O",
children: [
{
path:"0.1.1.0",
name:"业务种类",
label:"CategoryPurpose",
tag:"CtgyPurp",
status:"O",
children: [
{
path:"0.1.1.0.0",
name:"业务种类编码",
label:"Proprietary",
tag:"Prtry",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.2",
name:"货币符号、金额",
label:"InterbankSettlementAmount",
tag:"IntrBkSttlmAmt",
type:"AmountCIPS#18,5",
status:"M",
},
{
path:"0.1.3",
name:"起息日",
label:"InterbankSettlementDate",
tag:"IntrBkSttlmDt",
type:"Date",
status:"M",
},
{
path:"0.1.4",
name:"业务优先级",
label:"SettlementPriority",
tag:"SttlmPrty",
type:"Select#priority3Code",
status:"M",
},
{
path:"0.1.5",
name:"结算信息",
label:"SettlementTimeIndication",
tag:"SttlmTmIndctn",
status:"O",
children: [
{
path:"0.1.5.0",
name:"结算时间",
label:"DebitDateTime",
tag:"DbtDtTm",
type:"DateTime",
status:"O",
},
],
},
{
path:"0.1.6",
name:"付款代理",
label:"InstructingAgent",
tag:"InstgAgt",
status:"M",
children: [
{
path:"0.1.6.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.6.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"M",
children: [
{
path:"0.1.6.0.0.0",
name:"付款直接参与者行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.6.1",
name:"分行标识",
label:"BranchIdentification",
tag:"BrnchId",
status:"O",
children: [
{
path:"0.1.6.1.0",
name:"付款间接参与者行号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"O",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.7",
name:"收款代理",
label:"InstructedAgent",
tag:"InstdAgt",
status:"M",
children: [
{
path:"0.1.7.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.7.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"M",
children: [
{
path:"0.1.7.0.0.0",
name:"收款直接参与者行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.7.1",
name:"分行标识",
label:"BranchIdentification",
tag:"BrnchId",
status:"O",
children: [
{
path:"0.1.7.1.0",
name:"收款间接参与者行号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"O",
maxLength:"35",
},
],
},
],
},
{
path:"0.1.8",
name:"中介机构1信息",
label:"IntermediaryAgent1",
tag:"IntrmyAgt1",
status:"O",
children: [
{
path:"0.1.8.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.8.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"M",
children: [
{
path:"0.1.8.0.0.0",
name:"中介机构1行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.8.0.1",
name:"中介机构1名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
],
},
],
},
{
path:"0.1.9",
name:"中介机构2信息",
label:"IntermediaryAgent2",
tag:"IntrmyAgt2",
status:"O",
children: [
{
path:"0.1.9.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.9.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"M",
children: [
{
path:"0.1.9.0.0.0",
name:"中介机构2行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
],
},
],
},
{
path:"0.1.10",
name:"付款人",
label:"Debtor",
tag:"Dbtr",
status:"M",
children: [
{
path:"0.1.10.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.10.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"O",
children: [
{
path:"0.1.10.0.0.0",
name:"付款行行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.10.0.1",
name:"付款行名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
{
path:"0.1.10.0.2",
name:"通信地址",
label:"PostalAddress",
tag:"PstlAdr",
status:"O",
children: [
{
path:"0.1.10.0.2.0",
name:"付款行地址",
label:"AddressLine",
tag:"AdrLine",
type:"TextInput",
status:"O",
maxLength:"70",
array:true,
},
],
},
],
},
],
},
{
path:"0.1.11",
name:"付款人账目",
label:"DebtorAccount",
tag:"DbtrAcct",
status:"O",
children: [
{
path:"0.1.11.0",
name:"标识",
label:"Identification",
tag:"Id",
status:"M",
children: [
{
path:"0.1.11.0.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"M",
children: [
{
path:"0.1.11.0.0.0",
name:"付款行账号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"34",
},
],
},
],
},
],
},
{
path:"0.1.12",
name:"付款人代理",
label:"DebtorAgent",
tag:"DbtrAgt",
status:"M",
children: [
{
path:"0.1.12.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.12.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"O",
children: [
{
path:"0.1.12.0.0.0",
name:"付款行开户行行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.12.0.1",
name:"付款行开户行名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
],
},
],
},
{
path:"0.1.13",
name:"收款人代理",
label:"CreditorAgent",
tag:"CdtrAgt",
status:"M",
children: [
{
path:"0.1.13.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.13.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"O",
children: [
{
path:"0.1.13.0.0.0",
name:"收款行开户行行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.13.0.1",
name:"收款行开户行名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
],
},
],
},
{
path:"0.1.14",
name:"收款人",
label:"Creditor",
tag:"Cdtr",
status:"M",
children: [
{
path:"0.1.14.0",
name:"金融机构标识",
label:"FinancialInstitutionIdentification",
tag:"FinInstnId",
status:"M",
children: [
{
path:"0.1.14.0.0",
name:"结算系统成员标识",
label:"ClearingSystemMemberIdentification",
tag:"ClrSysMmbId",
status:"O",
children: [
{
path:"0.1.14.0.0.0",
name:"收款行行号",
label:"MemberIdentification",
tag:"MmbId",
type:"TextInput",
status:"M",
maxLength:"35",
},
],
},
{
path:"0.1.14.0.1",
name:"收款行名称",
label:"Name",
tag:"Nm",
type:"TextInput",
status:"O",
maxLength:"140",
},
{
path:"0.1.14.0.2",
name:"通信地址",
label:"PostalAddress",
tag:"PstlAdr",
status:"O",
children: [
{
path:"0.1.14.0.2.0",
name:"收款行地址",
label:"AddressLine",
tag:"AdrLine",
type:"TextInput",
status:"O",
maxLength:"70",
array:true,
},
],
},
],
},
],
},
{
path:"0.1.15",
name:"收款人账目",
label:"CreditorAccount",
tag:"CdtrAcct",
status:"O",
children: [
{
path:"0.1.15.0",
name:"标识",
label:"Identification",
tag:"Id",
status:"M",
children: [
{
path:"0.1.15.0.0",
name:"其他",
label:"Other",
tag:"Othr",
status:"M",
children: [
{
path:"0.1.15.0.0.0",
name:"收款行账号",
label:"Identification",
tag:"Id",
type:"TextInput",
status:"M",
maxLength:"34",
},
],
},
],
},
],
},
{
path:"0.1.16",
name:"致收款人银行",
label:"InstructionForCreditorAgent",
tag:"InstrForCdtrAgt",
status:"O",
array:true,
children: [
{
path:"0.1.16.0",
name:"致收款人银行附言",
label:"InstructionInformation",
tag:"InstrInf",
type:"TextInput",
status:"O",
maxLength:"140",
},
],
},
{
path:"0.1.17",
name:"汇款信息",
label:"RemittanceInformation",
tag:"RmtInf",
status:"O",
children: [
{
path:"0.1.17.0",
name:"附言",
label:"Unstructured",
tag:"Ustrd",
type:"TextInput",
status:"O",
maxLength:"140",
array:true,
},
],
},
{
path:"0.1.18",
name:"补充数据",
label:"SupplementaryData",
tag:"SplmtryData",
status:"M",
children: [
{
path:"0.1.18.0",
name:"名称及地址",
label:"PlaceAndName",
tag:"PlcAndNm",
type:"TextInput",
status:"M",
maxLength:"350",
defaultValue:"/Document/FIToFICstmrCdtTrf/CdtTrfTxInf",
},
{
path:"0.1.18.1",
name:"信封",
label:"Envelope",
tag:"Envlp",
status:"M",
children: [
{
path:"0.1.18.1.0",
name:"内容",
label:"Contents",
tag:"Cnts",
status:"M",
children: [
{
path:"0.1.18.1.0.0",
name:"期望结算日期",
label:"ExpectedSettlementDate",
tag:"XpctdSttlmDt",
type:"Date",
status:"M",
},
{
path:"0.1.18.1.0.1",
name:"订单编号",
label:"OrderNumber",
tag:"OrdNum",
type:"TextInput",
status:"O",
maxLength:"35",
},
{
path:"0.1.18.1.0.2",
name:"订单描述",
label:"OrderInformation",
tag:"OrdInf",
type:"TextInput",
status:"O",
maxLength:"500",
},
{
path:"0.1.18.1.0.3",
name:"日间夜间标志",
label:"BusinessPhase",
tag:"BizPhs",
type:"Select#BizPhaseTypeCode",
status:"O",
},
],
},
],
},
],
},
],
},
],
},
{
path:"1",
name:"MesgType",
tag:"MesgType",
type:"HiddenInput",
status:"O",
defaultValue:"cips.112.001.02",
},
{
path:"2",
name:"MesgPriority",
tag:"MesgPriority",
type:"HiddenInput",
status:"O",
defaultValue:"3",
},
{
path:"3",
name:"OrigReceiver",
tag:"OrigReceiver",
type:"HiddenInput",
status:"O",
},
{
path:"4",
name:"OrigSendDate",
tag:"OrigSendDate",
type:"HiddenInput",
status:"O",
},
{
path:"5",
name:"MesgDirection",
tag:"MesgDirection",
type:"HiddenInput",
status:"O",
defaultValue:"D",
},
{
path:"6",
name:"MesgRefID",
tag:"MesgRefID",
type:"HiddenInput",
status:"O",
},
{
path:"7",
name:"MesgID",
tag:"MesgID",
type:"HiddenInput",
status:"O",
},
{
path:"8",
name:"cipsMsgId",
tag:"cipsMsgId",
type:"HiddenInput",
status:"O",
},
{
path:"9",
name:"OrigSendTime",
tag:"OrigSendTime",
type:"HiddenInput",
status:"O",
},
]
\ No newline at end of file
import message from '../Message.js'
import {isEmpty,isNotEmpty} from '../BeanUtil.js'
import Decimal from 'decimal.js';
export default function validator(obj) {
console.log("com to cips111 rule....");
console.log(obj);
if(!CIPS_Creditor(obj.FIToFICstmrCdtTrf.CdtTrfTxInf.Cdtr,'Message root/CreditTransferTransactionInformation/Creditor')){
return false;
}
if(!CIPS_Dbtr(obj.FIToFICstmrCdtTrf.CdtTrfTxInf.Dbtr,'Message root/CreditTransferTransactionInformation/Debtor')){
return false;
}
if(!CIPS_CdtrAgt(obj.FIToFICstmrCdtTrf.CdtTrfTxInf.CdtrAgt,'Message root/CreditTransferTransactionInformation/CreditorAgent')){
return false;
}
if(!CIPS_DbtrAgt(obj.FIToFICstmrCdtTrf.CdtTrfTxInf.DbtrAgt,'Message root/CreditTransferTransactionInformation/DebtorAgent')){
return false;
}
return true;
}
//收款人名称、收款人地址必须有一个存在
function CIPS_Creditor(cdtr,position) {
const msg = "* 收款人名称、收款人地址必须有一个存在";
let nm = cdtr.Nm;
let adrLine = cdtr.AdrLine;
if(isEmpty(nm) && isEmpty(adrLine)){
message(position,msg);
return false;
}
return true;
}
//汇款人名称、汇款人地址必须有一个存在
function CIPS_Dbtr(cdtr,position) {
const msg = "* 汇款人名称、汇款人地址必须有一个存在";
let nm = cdtr.Nm;
let adrLine = cdtr.AdrLine;
if(isEmpty(nm) && isEmpty(adrLine)){
message(position,msg);
return false;
}
return true;
}
//收款人开户行行号、名称必须有一个存在
function CIPS_CdtrAgt(cdtr,position) {
const msg = "* 收款人开户行行号、名称必须有一个存在";
let mmbId = cdtr.FinInstnId.ClrSysMmbId.MmbId;
let nm = cdtr.FinInstnId.Nm;
if(isEmpty(nm) && isEmpty(mmbId)){
message(position,msg);
return false;
}
return true;
}
//汇款人开户行行号、名称必须有一个存在
function CIPS_DbtrAgt(cdtr,position) {
const msg = "* 汇款人开户行行号、名称必须有一个存在";
let mmbId = cdtr.FinInstnId.ClrSysMmbId.MmbId;
let nm = cdtr.FinInstnId.Nm;
if(isEmpty(nm) && isEmpty(mmbId)){
message(position,msg);
return false;
}
return true;
}
import cips111 from './CIPS/Cips111.js'
export function validatorRule(mty,obj) {
console.log("COMON TO validatorRule");
console.log(mty,obj);
switch (mty) {
case 'cips.111.001.02':
return cips111(obj);
}
return true;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import ISO2 from "../iso/pages/indexrtgs.vue";
import index from "../iso/index.vue";
import indexcips from "../iso/indexcips.vue";
import success from "../iso/pages/success.vue";
import successCips from "../iso/pages/successCips.vue";
import MX2MT from "../iso/pages/mx2mt.vue";
import MT2MX from "../iso/pages/mt2mx.vue";
import CIPS from "../iso/pages/indexcips.vue"
......@@ -38,6 +39,10 @@ export default new VueRouter({
path: "/success",
component: success,
},
{
path: "/successCips",
component: successCips,
},
// {
// path: "/mx2mt",
// component: MX2MT,
......
......@@ -27,14 +27,23 @@ public class CipsTransfer {
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat dateFormat2 = new SimpleDateFormat("HHmmss");
//改造map层级,使能转换成xml报文
//删除最外层FIToFICstmrCdtTrf
//删除最外层FIToFICstmrCdtTrf(cips111)
if (gsonMaps.get("FIToFICstmrCdtTrf") != null) {
JSONObject jsonObject = (JSONObject) gsonMaps.get("FIToFICstmrCdtTrf");
for (String key : jsonObject.keySet()) {
gsonMaps.put(key, jsonObject.get(key));
}
gsonMaps.remove("FIToFICstmrCdtTrf");
}
gsonMaps.remove("FIToFICstmrCdtTrf");
//删除最外层FICdtTrf(cips112)
if (gsonMaps.get("FICdtTrf") != null) {
JSONObject jsonObject = (JSONObject) gsonMaps.get("FICdtTrf");
for (String key : jsonObject.keySet()) {
gsonMaps.put(key, jsonObject.get(key));
}
gsonMaps.remove("FICdtTrf");
}
//新增OrigSendDate
String currentDate = dateFormat1.format(date);
gsonMaps.put("OrigSendDate",currentDate);
......@@ -75,8 +84,13 @@ public class CipsTransfer {
if (res.get(s) != null)
res = (Map) res.get(s);
}
if (res.get("MsgId") != null)
gsonMaps.put("MesgRefID",res.get("MsgId"));
if("cips.112.001.02".equals(gsonMaps.get("MesgType"))) {
if (res.get("MsgId") != null)
gsonMaps.put("MesgRefID", res.get("MsgId"));
}else if ("cips.111.001.02".equals(gsonMaps.get("MesgType"))){
if (res.get("EndToEndId") != null)
gsonMaps.put("MesgRefID", res.get("EndToEndId"));
}
//新增MesgID、cipsMsgId、OrigSenderSID、OrigReceiverSID
gsonMaps.put("MesgID",gsonMaps.get("MesgRefID"));
gsonMaps.put("cipsMsgId",gsonMaps.get("MesgRefID"));
......
......@@ -77,10 +77,14 @@ public class CipsEditorController {
map.put("opeType", StringUtil.isNotEmpty(opeType) ? opeType : "1");
Map res = (Map) CommonSend.send(map);
String retcod = (String) res.get("retcode");
String retmsg = (String) res.get("retmsg");
logger.info(res.toString());
if (retcod != null && retcod.endsWith("0000000")) {
return "1" + identifier + ".xml is saved successfully";
} else {
return "save return:" + retcod;
} else if((retcod != null && retcod.endsWith("OBS0000111"))){
return "原因:" + retmsg;
}else {
return "请联系管理员";
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
......@@ -117,34 +121,6 @@ public class CipsEditorController {
}
return null;
}
@RequestMapping(value = "/mx2mt", method = RequestMethod.POST)
@ResponseBody
public String mx2Mt(@RequestBody SwiftVo swiftVo){
Map<String, Object> maps = new HashMap<String, Object>();
try {
if("MT202".equals(swiftVo.getMtType())||"MT205".equals(swiftVo.getMtType())){
maps.put("MtType",swiftVo.getMtType());
}
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(swiftVo.getXml(), null, maps);
String mstr = str.getMessage();
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (StringUtil.isEmpty(mstr)) {
return null;
}
String errorDsp = "Translation Result : " + str.getTranslationResult();
if (errorInfos != null && errorInfos.size() > 0) {
for (int i = 0; i < errorInfos.size(); i++) {
SwiftTranslationErrorInfo errorInfo = errorInfos.get(i);
errorDsp += Mx2MtConstants.NEW_LINE + errorInfo.toString();
}
}
return errorDsp +Mx2MtConstants.NEW_LINE+ mstr;
} catch (com.brilliance.swift.exception.SwiftException e){
return e.getMessage();
} catch (Exception e){
return "报文格式有问题,请重新输入!!!";
}
}
@RequestMapping(value = "/mt2mx", method = RequestMethod.POST)
@ResponseBody
......@@ -176,19 +152,19 @@ public class CipsEditorController {
}
}
@RequestMapping(value = "/mx2Json", method = RequestMethod.POST)
@RequestMapping(value = "/cips2Json", method = RequestMethod.POST)
@ResponseBody
public JSONObject mx2Json(@RequestBody SwiftVo swiftVo) {
logger.info("---->swiftVo.getMty():" + swiftVo.getMty());
if (swiftVo.getMty() != null) {
String messageType = swiftVo.getMty().replaceAll("\\.", "");
public JSONObject mx2Json(@RequestBody CipsVo cipsVo) {
logger.info("---->swiftVo.getMty():" + cipsVo.getMty());
if (cipsVo.getMty() != null) {
String messageType = cipsVo.getMty().replaceAll("\\.", "");
// 根据smhinr获取报文内容
String smhinr = swiftVo.getSmhinr();
String smhinr = cipsVo.getSmhinr();
logger.info("---->messageType:" + messageType);
logger.info("---->smhinr:" + smhinr);
Map<String, Object> map = new HashMap();
// 接口
map.put("interface", "bdTaskFive");
map.put("interface", "cipsEdit");
// 交易
map.put("transaction", "getMsg");
// 根据报文id获取报文内容
......@@ -207,10 +183,20 @@ public class CipsEditorController {
// } catch (IOException e) {
// }
// }
if (swiftVo.getType() != null) {
AbstractMX abstractMX = AbstractMX.parse(xmlStr);
String s = abstractMX.toJson();
Map<String, Object> maps = MxTransfer.transfer2(s, messageType, swiftVo.getType());
if (cipsVo.getType() != null) {
Map<String, Object> xmlMaps = MsgUtil.cips2Map(xmlStr);
Map<String, Object> maps = new HashMap<>();
Map<String, Object> fIToFICstmrCdtTrf = new HashMap<>();
fIToFICstmrCdtTrf.put("GrpHdr",xmlMaps.get("GrpHdr"));
fIToFICstmrCdtTrf.put("CdtTrfTxInf",xmlMaps.get("CdtTrfTxInf"));
if("cips11100102".equals(messageType))
maps.put("FIToFICstmrCdtTrf",fIToFICstmrCdtTrf);
else if ("cips11200102".equals(messageType)) {
maps.put("FICdtTrf",fIToFICstmrCdtTrf);
}
// AbstractMX abstractMX = AbstractMX.parse(xmlStr);
// String s = abstractMX.toJson();
// Map<String, Object> maps = MxTransfer.transfer2(s, messageType, cipsVo.getType());
JSONObject json = new JSONObject(maps);
return json;
}
......
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"/><title>ISO手工拟报</title><script defer="defer" src="js/chunk-vendors.e88189ab.js"></script><script defer="defer" src="js/app.4f0b7632.js"></script><link href="css/chunk-vendors.7c88cb4c.css" rel="stylesheet"><link href="css/app.24dcf439.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but swiftiso-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"/><title>ISO手工拟报</title><script defer="defer" src="js/chunk-vendors.e88189ab.js"></script><script defer="defer" src="js/app.364b900e.js"></script><link href="css/chunk-vendors.7c88cb4c.css" rel="stylesheet"><link href="css/app.8d1e3241.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but swiftiso-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ 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