Commit 3ccdb22b by wancheng

0228优化

parent cb467e88
...@@ -6,6 +6,8 @@ import com.baosight.hpjx.core.constant.CommonConstant; ...@@ -6,6 +6,8 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
...@@ -89,6 +91,57 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -89,6 +91,57 @@ public class ServiceHPSC001 extends ServiceBase {
} }
/** /**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "企业管理",operType = "插入",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPSC001 hpsc001 = new HPSC001();
hpsc001.fromMap(resultRows.get(i));
if (hpsc001.getId() == null || hpsc001.getId() == 0) {
this.add(hpsc001);
} else {
this.modify(hpsc001);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增企业信息
*
* @param hpsc001
* @throws Exception
*/
private void add(HPSC001 hpsc001) throws Exception {
hpsc001.setStatus(CommonConstant.YesNo.NO_0);
hpsc001.setProjCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PROJ_NUMBER));
DaoUtils.insert("HPSC001.insert", hpsc001);
}
/**
* 修改数据
*
* @param hpsc001
*/
private void modify(HPSC001 hpsc001) {
DaoUtils.update("HPSC001.update", hpsc001);
}
/**
* 修改操作. * 修改操作.
*/ */
@OperationLogAnnotation(operModul = "销售管理",operType = "修改") @OperationLogAnnotation(operModul = "销售管理",operType = "修改")
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</isNotEmpty> </isNotEmpty>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc STATUS,CREATED_TIME desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc STATUS,CREATED_TIME asc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
$order$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="order"> <isEmpty property="order">
ID asc STATUS,CREATED_TIME desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
A.STATUS as "status", <!-- 状态 --> A.STATUS as "status", <!-- 状态 -->
A.PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 --> A.PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
A.FILE_PATH1 as "filePath1", A.FILE_PATH1 as "filePath1",
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
B.ID as "childId", B.ID as "childId",
B.PROD_TASK_NO as "prodTaskNo", B.PROD_TASK_NO as "prodTaskNo",
B.PROD_ORDER_NO as "prodOrderNo", B.PROD_ORDER_NO as "prodOrderNo",
...@@ -106,7 +107,7 @@ ...@@ -106,7 +107,7 @@
$order$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="order"> <isEmpty property="order">
ID ASC A.CREATED_TIME desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
......
...@@ -46,8 +46,7 @@ $(function () { ...@@ -46,8 +46,7 @@ $(function () {
deleteFunc(); deleteFunc();
}, },
onSuccess: function (e) { onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update' if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'insert'
||e.eiInfo.extAttr.methodName == 'delete' ){ ||e.eiInfo.extAttr.methodName == 'delete' ){
query(); query();
} }
...@@ -114,7 +113,7 @@ function check(id, auditStatus) { ...@@ -114,7 +113,7 @@ function check(id, auditStatus) {
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPSC001", "insert", true); JSUtils.submitGridsData("result", "HPSC001", "save", true);
} }
}); });
} }
......
...@@ -5,8 +5,8 @@ $(function () { ...@@ -5,8 +5,8 @@ $(function () {
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
pageable: { pageable: {
pageSize: 20, pageSize: 5,
pageSizes: [10, 20, 50, 70, 100], pageSizes: [5, 10, 20, 50, 100],
}, },
columns: [{ columns: [{
field: "operator", field: "operator",
......
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