ecology-dev代码提交
parent
be949e910e
commit
9f1e8c0cd0
|
@ -20,6 +20,7 @@ log
|
|||
|
||||
/src/main/resources/**/*.properties
|
||||
!/src/main/resources/**/*.xml
|
||||
/src/main/jitu-src/
|
||||
/target
|
||||
.idea/
|
||||
src/main/java/.gitignore
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
</webroots>
|
||||
<sourceRoots>
|
||||
<root url="file://$MODULE_DIR$/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/src/main/jitu-src" />
|
||||
<root url="file://$MODULE_DIR$/src/main/resources" />
|
||||
<root url="file://$MODULE_DIR$/src/main/xuanran_pcn_src" />
|
||||
<root url="file://$MODULE_DIR$/target/generated-sources/annotations" />
|
||||
</sourceRoots>
|
||||
</configuration>
|
||||
|
@ -22,12 +24,17 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/annotations" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/jitu-src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/xuanran_pcn_src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/log" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="jdk" jdkName="jdk1.8" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="classbean" level="project" />
|
||||
<orderEntry type="library" name="classbean" level="project" />
|
||||
<orderEntry type="library" name="classbeanLib" level="project" />
|
||||
<orderEntry type="library" name="weaverLib" level="project" />
|
||||
<orderEntry type="library" name="jitu-lib" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct-jdk8:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.4.2.Final" level="project" />
|
||||
|
@ -36,17 +43,5 @@
|
|||
<orderEntry type="library" name="Maven: com.adobe.xmp:xmpcore:6.1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-excelant:3.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.ant:ant:1.8.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.ant:ant-launcher:1.8.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-scratchpad:3.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -74,7 +74,7 @@ class CopyMultipleFile {
|
|||
* @param listenerField 浏览框字段
|
||||
*/
|
||||
bindBrowseBoxChangeEvent() {
|
||||
WfForm.bindFieldChangeEvent(this.convertField2Id(this.configuration.browseBox),async (elem, id, value) => {
|
||||
WfForm.bindFieldChangeEvent(this.convertField2Id(this.configuration.browseBox), async (elem, id, value) => {
|
||||
await this.copyFile(value)
|
||||
})
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ class CopyMultipleFile {
|
|||
* @param value 浏览框的值
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async copyFile(value){
|
||||
async copyFile(value) {
|
||||
//为空,清除其他模板字段数据,TODO 删除文件
|
||||
if ((value ?? '') === '') {
|
||||
let deleteArr = []
|
||||
|
@ -193,3 +193,5 @@ $(() => {
|
|||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,263 @@
|
|||
//<editor-fold desc="新建订单计算扣减金额和计算冻结金额 --- aiYouHog dev">
|
||||
//#region 新建订单计算扣减金额和计算冻结金额 --- aiYouHog dev
|
||||
|
||||
let config = {
|
||||
query: {
|
||||
channelField: "qdbh"
|
||||
},
|
||||
condition: {
|
||||
//条件字段
|
||||
fieldName: "fkzt",
|
||||
//满足条件值
|
||||
value: "0"
|
||||
},
|
||||
bindFields: {
|
||||
//渠道字段
|
||||
channelField: "qdbh",
|
||||
},
|
||||
|
||||
calculate: {
|
||||
// 合同金额字段
|
||||
contractAmount: "htje",
|
||||
//信用金额字段
|
||||
creditAmount: "dqxyed",
|
||||
//扣减后金额字段
|
||||
contractBalance: "kjhje",
|
||||
//扣减后信用金额字段
|
||||
creditBalance: "kchxyed",
|
||||
//订单金额字段
|
||||
orderAmount: "ddje",
|
||||
//冻结渠道金额字段
|
||||
frozenContractAmount: "djzje",
|
||||
// 冻结信用额度字段
|
||||
frozenCreditAmount: "xyeddjzje"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 请求方法
|
||||
* @param url 请求地址
|
||||
* @param type 请求类心
|
||||
* @param data 请求参数
|
||||
* @param isAsync 是否异步请求
|
||||
* @param success 成功回调参数
|
||||
* @param error 失败回调方法
|
||||
* @param complete 完成回调方法
|
||||
* @param contentType 请求参数类型
|
||||
* @param beforeSend 发送前回调
|
||||
* @returns {*}
|
||||
*/
|
||||
const request = (url, type = "GET", data, isAsync = true,
|
||||
success = () => {
|
||||
}, error = () => {
|
||||
}, complete = () => {
|
||||
},
|
||||
contentType = 'application/json',
|
||||
beforeSend = () => {
|
||||
}) => {
|
||||
let options = {
|
||||
url,
|
||||
type,
|
||||
dataType: "json",
|
||||
contentType,
|
||||
async: isAsync,
|
||||
data,
|
||||
beforeSend,
|
||||
success,
|
||||
error,
|
||||
complete,
|
||||
}
|
||||
if (contentType === 'application/json') {
|
||||
options.data = JSON.stringify(data)
|
||||
}
|
||||
return $.ajax(options)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 转换字段名为字段id
|
||||
* @param fieldName 字段名
|
||||
* @param detail 表
|
||||
* @returns {*} 字段id
|
||||
*/
|
||||
function convertField2Id(fieldName, detail = "main") {
|
||||
return WfForm.convertFieldNameToId(fieldName, detail)
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定字段改变触发
|
||||
* @param fieldId 字段ID
|
||||
* @param func 处理方法
|
||||
*/
|
||||
function bindEvent(fieldId, func) {
|
||||
WfForm.bindFieldChangeEvent(fieldId, func);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更具字段名获取字段值
|
||||
* @param fieldName 字段名
|
||||
* @param detail 明细表
|
||||
* @returns {*}
|
||||
*/
|
||||
function getValue(fieldName, detail = "main") {
|
||||
return WfForm.getFieldValue(convertField2Id(fieldName))
|
||||
}
|
||||
|
||||
|
||||
async function getCurrentAmount() {
|
||||
let baseInfo = WfForm.getBaseInfo();
|
||||
// let dbInfo = WfForm.getFieldInfo(convertField2Id(config.bindFields.channelField).replace("field",""))
|
||||
let params = {
|
||||
workflowId: baseInfo.workflowid,
|
||||
modelTable: "uf_htyetz",
|
||||
channelId: getValue(config.query.channelField),
|
||||
modelContractAmount: "htje",
|
||||
modelCreditAmount: "xyed",
|
||||
modelChannelField: "qdbh"
|
||||
}
|
||||
let result = await request("/api/frozen-calcula/current-amount", "POST", params, false)
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断是否需要进行计算口款冻结等操作
|
||||
* @param config 配置
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isNeedCalculate(config) {
|
||||
let currentValue = getValue(config.fieldName)
|
||||
if (currentValue == config.value) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否能通过扣款
|
||||
* @param config 配置对象
|
||||
* @param callback 回调方法
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isThroughDeduction(config, callback = undefined) {
|
||||
let contractAmountValue = getValue(config.contractAmount)
|
||||
let creditAmountValue = getValue(config.creditAmount)
|
||||
let orderAmountValue = getValue(config.orderAmount)
|
||||
let contractAmountNum = parseFloat(contractAmountValue === '' ? '0' : contractAmountValue)
|
||||
let creditAmountNum = parseFloat(creditAmountValue === '' ? '0' : creditAmountValue)
|
||||
let orderAmountNum = parseFloat(orderAmountValue === '' ? '0' : orderAmountValue)
|
||||
if (orderAmountNum > (contractAmountNum + creditAmountNum)) {
|
||||
WfForm.showConfirm("请及时充值渠道账户余额和缴纳信用额度!", function () {
|
||||
// alert("点击确认调用的事件");
|
||||
}, function () {
|
||||
// alert("点击取消调用的事件");
|
||||
}, {
|
||||
title: "余额不足提示!",
|
||||
okText: "确认",
|
||||
cancelText: "知道了"
|
||||
});
|
||||
return false
|
||||
}
|
||||
if (typeof callback === "function") {
|
||||
callback()
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算金额扣减
|
||||
* @param config 配置
|
||||
* @param condition 条件配置
|
||||
*/
|
||||
function calculate(config, condition) {
|
||||
if (!isNeedCalculate(condition)) {
|
||||
let contractAmountValue = getValue(config.contractAmount)
|
||||
let creditAmountValue = getValue(config.creditAmount)
|
||||
// 对扣减后字段和冻结字段还原
|
||||
WfForm.changeFieldValue(convertField2Id(config.contractBalance), {value: contractAmountValue})
|
||||
WfForm.changeFieldValue(convertField2Id(config.creditBalance), {value: creditAmountValue})
|
||||
WfForm.changeFieldValue(convertField2Id(config.frozenContractAmount), {value: "0"})
|
||||
WfForm.changeFieldValue(convertField2Id(config.frozenCreditAmount), {value: "0"})
|
||||
return;
|
||||
}
|
||||
if (isThroughDeduction(config)) {
|
||||
let contractAmountValue = getValue(config.contractAmount)
|
||||
let creditAmountValue = getValue(config.creditAmount)
|
||||
let orderAmountValue = getValue(config.orderAmount)
|
||||
let contractAmountNum = parseFloat(contractAmountValue === '' ? '0' : contractAmountValue)
|
||||
let creditAmountNum = parseFloat(creditAmountValue === '' ? '0' : creditAmountValue)
|
||||
let orderAmountNum = parseFloat(orderAmountValue === '' ? '0' : orderAmountValue)
|
||||
if (contractAmountNum >= orderAmountNum) {
|
||||
// TODO 合同金额大于订单金额,直接扣除合同金额
|
||||
let otherContractAmountNum = contractAmountNum - orderAmountNum
|
||||
// 设置扣减后金额
|
||||
WfForm.changeFieldValue(convertField2Id(config.contractBalance), {value: otherContractAmountNum + ""})
|
||||
// 设置冻结渠道金额
|
||||
WfForm.changeFieldValue(convertField2Id(config.frozenContractAmount), {value: orderAmountNum + ""})
|
||||
if (otherContractAmountNum === 0) {
|
||||
WfForm.showConfirm("请及时充值渠道账户!", function () {
|
||||
// alert("点击确认调用的事件");
|
||||
}, function () {
|
||||
// alert("点击取消调用的事件");
|
||||
}, {
|
||||
title: "余额充值提示!",
|
||||
okText: "确认",
|
||||
cancelText: "知道了"
|
||||
});
|
||||
}
|
||||
return
|
||||
}
|
||||
// 合同扣款金额不满足扣款,需要使用到信用额度
|
||||
// 合同金额剩余0元,给出提,并设置扣减后金额
|
||||
WfForm.changeFieldValue(convertField2Id(config.contractBalance), {value: "0"})
|
||||
// 设置冻结渠道金额
|
||||
WfForm.changeFieldValue(convertField2Id(config.frozenContractAmount), {value: contractAmountNum + ""})
|
||||
WfForm.showConfirm("请及时充值渠道账户!", function () {
|
||||
// alert("点击确认调用的事件");
|
||||
}, function () {
|
||||
// alert("点击取消调用的事件");
|
||||
}, {
|
||||
title: "余额充值提示!",
|
||||
okText: "确认",
|
||||
cancelText: "知道了"
|
||||
});
|
||||
let otherOrderAmountNum = orderAmountNum - contractAmountNum
|
||||
let otherCreditAmountNum = creditAmountNum - otherOrderAmountNum
|
||||
// 设置扣减后信用额度
|
||||
WfForm.changeFieldValue(convertField2Id(config.creditBalance), {value: otherCreditAmountNum + ""})
|
||||
//设置信用冻结额度
|
||||
WfForm.changeFieldValue(convertField2Id(config.frozenCreditAmount), {value: otherOrderAmountNum + ""})
|
||||
if (otherCreditAmountNum === 0) {
|
||||
// 信用金额余额为0,给出提示
|
||||
WfForm.showConfirm("请及时充值渠道账户!", function () {
|
||||
// alert("点击确认调用的事件");
|
||||
}, function () {
|
||||
// alert("点击取消调用的事件");
|
||||
}, {
|
||||
title: "余额充值提示!",
|
||||
okText: "确认",
|
||||
cancelText: "知道了"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(() => {
|
||||
let fieldIds = convertField2Id(config.calculate.orderAmount)
|
||||
fieldIds = fieldIds + "," + convertField2Id(config.bindFields.channelField)
|
||||
fieldIds = fieldIds + "," + convertField2Id(config.condition.fieldName)
|
||||
bindEvent(fieldIds, (obj, id, value) => {
|
||||
calculate(config.calculate, config.condition)
|
||||
})
|
||||
if (isNeedCalculate(config.condition)) {
|
||||
WfForm.registerCheckEvent(WfForm.OPER_SUBMIT, function (callback) {
|
||||
isThroughDeduction(config.calculate, callback)
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
//#endregion
|
||||
// </editor-fold>(╰_╯)#(╰_╯)#
|
|
@ -1,4 +1,11 @@
|
|||
|
||||
/**
|
||||
* 修改签署类型
|
||||
* @param detailTable
|
||||
* @param detailField
|
||||
* @param changeField
|
||||
* @param errValue
|
||||
* @param rightValue
|
||||
*/
|
||||
function changeSingedType(detailTable,detailField,changeField,errValue,rightValue){
|
||||
let detailIndexStr = WfForm.getDetailAllRowIndexStr(detailTable)
|
||||
let changeFieldId = WfForm.convertFieldNameToId(changeField)
|
||||
|
@ -9,10 +16,8 @@ function changeSingedType(detailTable,detailField,changeField,errValue,rightValu
|
|||
let detailFieldId = WfForm.convertFieldNameToId(detailField, detailTable);
|
||||
let n = 0;
|
||||
detailIndexArr.forEach(item=>{
|
||||
console.log(item)
|
||||
let fieldId = detailFieldId + "_" + item
|
||||
let value = WfForm.getFieldValue(fieldId);
|
||||
console.log(value)
|
||||
if(value == null || value == ""){
|
||||
WfForm.changeFieldValue(changeFieldId, {value:errValue});
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue