Commit 2c66ff4a by wuwenlong

项目立项提交、完工dev;

parent 8a2d7a2e
......@@ -86,6 +86,8 @@ public class HGSC001 extends DaoEPBase {
public static final String UPDATE = "HGSC001.update";
public static final String DELETE = "HGSC001.delete";
public static final String BATCH_DELETE = "HGSC001.batch_delete";
public static final String BATCH_COMPLETE = "HGSC001.batch_complete";
public static final String BATCH_COMMIT = "HGSC001.batch_commit";
private Long id = new Long(0);
......
......@@ -72,6 +72,36 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo;
}
public EiInfo complete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGSC001.BATCH_COMPLETE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo commit(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGSC001.BATCH_COMMIT, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
......
......@@ -338,4 +338,27 @@
id = #id#
</update>
<update id="complete">
UPDATE ${hggpSchema}.HGSC001
SET
proj_status = 1, <!-- 项目状态 0:在建;1:完工 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
<update id="commit">
UPDATE ${hggpSchema}.HGSC001
SET
approval_status = 2, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
</sqlMap>
......@@ -47,7 +47,13 @@ $(function () {
// 新增
$("#add").click(create);
//修改
$("#BNT_UPDATE").on("click", update);
$("#BNT_MODIFY").on("click", update);
//删除
$("#BNT_REMOVE").on("click", remove);
//删除
$("#BNT_COMPLETE").on("click", complete);
//删除
$("#BNT_COMMIT").on("click", commit);
},
onAdd: function(e) {
e.preventDefault();
......@@ -98,6 +104,99 @@ function update() {
callbackName: windowCallback
});}
function remove() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("删除","没有选中的行");
return;
}
IPLAT.confirm({
title:'删除',
message:'确认删除此数据么?',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("HGSC001","delete",post,{
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
})
}
function complete() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("完工","没有选中的行");
return;
}
IPLAT.confirm({
title:'完工',
message:'确认完工此数据么?',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("HGSC001","complete",post,{
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
})
}
function commit() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("提交","没有选中的行");
return;
}
IPLAT.confirm({
title:'提交',
message:'确认提交此数据么?',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("HGSC001","commit",post,{
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
})
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
......
......@@ -32,7 +32,7 @@
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center"/>
......
......@@ -81,6 +81,18 @@ function message(msg) {
}
/**
* 消息提示
* @param title
* @param msg
*/
function message(title,msg) {
WindowUtil({
title: title,
content: "<div class='kendo-del-message'>" + msg + "</div>"
});
}
/**
* 文件下载路径
*
* @param docId
......
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