Commit 67ff52c2 by liuyang

2024-07-17 业务账期维护优化防止重复提交

parent fad7a97c
......@@ -72,6 +72,10 @@ public class ServiceHGCW001 extends ServiceBase {
if (!roleCompanyCode.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW001.FIELD_COMPANY_CODES,roleCompanyCode);
}
String accountPeriod = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW001.FIELD_ACCOUNT_PERIOD);
if (StringUtils.isNotEmpty(accountPeriod)) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW001.FIELD_ACCOUNT_PERIOD,DateUtils.formatShort(accountPeriod));
}
inInfo = super.query(inInfo, HGCW001.QUERY, new HGCW001());
}catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -137,6 +137,16 @@
ACCOUNT_PERIOD <= #accountPeriodEnd#
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
COMPANY_CODE ASC, ACCOUNT_YEAR desc, ACCOUNT_PERIOD desc, ID desc
</isEmpty>
</dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW001">
......@@ -159,14 +169,7 @@
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW001 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ACCOUNT_YEAR desc, ACCOUNT_PERIOD desc, ID desc
</isEmpty>
</dynamic>
<include refid="order" />
</select>
......
......@@ -62,7 +62,9 @@ $(function () {
},
loadComplete: function (grid) {
$("#SWITCH").on("click", function () {
switchRow();
let btnNode = $(this);
btnNode.attr("disabled", true);
switchRow(btnNode);
});
grid.dataSource.bind("change",function(e){
var item = e.items[0];
......@@ -86,7 +88,9 @@ $(function () {
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveFunc();
let btnNode = $(this);
btnNode.attr("disabled", true);
saveFunc(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
......@@ -126,7 +130,7 @@ var query = function () {
/**
* 保存
*/
function saveFunc() {
function saveFunc(btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
......@@ -180,6 +184,7 @@ function saveFunc() {
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW001", "save", info, {
onSuccess: function (ei) {
btnNode.attr("disabled", false);
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
......@@ -192,12 +197,14 @@ function saveFunc() {
}
},
onFail: function (ei) {
btnNode.attr("disabled", false);
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
},cancel: function () {
btnNode.attr("disabled", false);
}
});
}
......@@ -230,7 +237,7 @@ function deleteFunc() {
}
}
function switchRow() {
function switchRow(btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
......@@ -257,14 +264,18 @@ function switchRow() {
} else {
NotificationUtil(ei, "error");
}
btnNode.attr("disabled", false);
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
btnNode.attr("disabled", false);
}
});
},);
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
},cancel: function () {
btnNode.attr("disabled", false);
}
});
}
......
......@@ -24,7 +24,7 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center"
filter="contains" readonly="true">
......
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