Commit 22b7b901 by wuwenlong

沟通记录dev

parent 18b3df0f
......@@ -93,6 +93,10 @@ public class HGZL004 extends DaoEPBase {
public static final String UPDATE = "HGZL004.update";
public static final String DELETE = "HGZL004.delete";
public static final String BATCH_COMPLETE= "HGZL004.batch_complete";
public static final String DELETE_BY_CHECK_IDS = "HGZL004.delete_by_check_ids";
public static final String DELETE_BY_IDS = "HGZL004.delete_by_ids";
private Long id = new Long(0);
private Long checkId = new Long(0); /* 质检单ID*/
......
......@@ -19,7 +19,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
*/
public class HGZL004A extends DaoEPBase {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id";
public static final String FIELD_inform_id = "informId"; /* 整改通知单ID*/
......@@ -56,6 +56,8 @@ public class HGZL004A extends DaoEPBase {
public static final String INSERT = "HGZL004A.insert";
public static final String UPDATE = "HGZL004A.update";
public static final String DELETE = "HGZL004A.delete";
public static final String DELETE_BY_INFORM_IDS = "HGZL004A.delete_by_inform_ids";
private Long id = new Long(0);
private Long informId = new Long(0); /* 整改通知单ID*/
......
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.domain.HGZL004A;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Map;
import java.util.Objects;
/**
* @author wwl
......@@ -51,6 +56,26 @@ public class ServiceHGZL004A extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "整改通知单-沟通记录", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
Long informId = Long.valueOf(EiInfoUtils.getFirstRow(inInfo).get(HGZL004A.FIELD_inform_id).toString());
Map resultMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.resultBlock);
HGZL004A hgzl004a = new HGZL004A();
hgzl004a.fromMap(resultMap);
hgzl004a.setInformId(informId);
if(Objects.nonNull(hgzl004a.getId())&&hgzl004a.getId()!=0){
DaoUtils.update(HGZL004A.UPDATE, hgzl004a);
}else {
DaoUtils.insert(HGZL004A.INSERT, hgzl004a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
......@@ -136,6 +136,9 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkIds">
check_id IN <iterate close=")" open="(" conjunction="," property="checkIds">#checkIds[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -393,4 +396,14 @@
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
<delete id="delete_by_check_ids">
DELETE FROM ${hggpSchema}.HGZL004 WHERE
check_type = #checkType#
AND check_id IN <iterate close=")" open="(" conjunction="," property="checkIds">#checkIds[]#</iterate>
</delete>
<delete id="delete_by_ids">
DELETE FROM ${hggpSchema}.HGZL004 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
</sqlMap>
......@@ -29,7 +29,7 @@
inform_id = #informId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="content">
content = #content#
content like ('%$content$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
......@@ -50,10 +50,10 @@
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
created_name like ('%$createdName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
date_format(created_time,'%Y-%m-%d') = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
......@@ -190,4 +190,9 @@
id = #id#
</update>
<delete id="delete_by_inform_ids">
DELETE FROM ${hggpSchema}.HGZL004A WHERE
inform_id IN <iterate close=")" open="(" conjunction="," property="informIds">#informIds[]#</iterate>
</delete>
</sqlMap>
......@@ -13,6 +13,7 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.hg.zl.domain.HGZL004A;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
......@@ -127,6 +128,8 @@ public class HGZLTools {
}
public static void deleteByWorkIds(List<Long> workIds) {
List<HGZL002> hgzl002s = list(workIds);
THGZL004.deleteByCheckIds(hgzl002s.stream().map(HGZL002::getId).collect(Collectors.toList()), CheckTypeEnum.PROCESS_CHECK);
DaoUtils.update(HGZL002.DELETE_BY_WORKS, new HashMap<String, Object>() {{
put("workIds", workIds);
}});
......@@ -173,6 +176,17 @@ public class HGZLTools {
// }
}
public static void deleteByCheckIds(List<Long> checkIds,CheckTypeEnum checkType){
List<HGZL004> hgzl004List = listByCheckIds(checkIds,checkType.getCode());
List<Long> ids = hgzl004List.stream().map(HGZL004::getId).collect(Collectors.toList());
DaoUtils.update(HGZL004.DELETE_BY_IDS,new HashMap<String,Object>(){{put("ids",ids);}});
// THGZL004A.deleteByInformIds(ids);
ids.forEach( id -> {
HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_DEFECT);
HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_HANDLE);
});
}
private static void cleanBaseInfo(HGZL004 hgzl004) {
hgzl004.setCreatedBy(null);
hgzl004.setCreatedName(null);
......@@ -185,6 +199,13 @@ public class HGZLTools {
hgzl004.setId(null);
}
public static List<HGZL004> listByCheckIds(List<Long> checkIds, Integer checkType) {
Map queryMap = new HashMap();
queryMap.put("checkIds", checkIds);
queryMap.put(HGZL004.FIELD_check_type, checkType);
return DaoBase.getInstance().query(HGZL004.QUERY, queryMap);
}
public static List<HGZL004> listByCheckId(Long checkId, Integer checkType) {
Map queryMap = new HashMap();
queryMap.put(HGZL004.FIELD_check_id, checkId);
......@@ -205,4 +226,12 @@ public class HGZLTools {
}
public static class THGZL004A {
public static void deleteByInformIds(List<Long> informIds){
AssertUtils.isEmpty(informIds, "通知单ID不能为空");
DaoUtils.update(HGZL004A.DELETE_BY_INFORM_IDS,new HashMap<String,Object>(){{put("informIds",informIds);}});
}
}
}
\ No newline at end of file
......@@ -21,7 +21,7 @@
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="createdBy" cname="创建人" hidden="true"/>
<EF:EFColumn ename="updatedBy" cname="修改人" hidden="true"/>
......
......@@ -32,7 +32,8 @@ $(function () {
onSuccess: function (e) {
},
loadComplete: function(grid) {
//复检完工
$("#BNT_COMPLETE").on("click", complete);
},
onSave: function(e){
// 阻止默认请求,使用自定义保存
......@@ -98,4 +99,46 @@ function communication(id) {
width: "80%",
height: "80%",
});
}
function complete() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message2("复检合格","没有选中的行");
return;
}
let flag = true;
$.each(rows, function(index, item) {
if(item.handleStatus==='0'){
message2("复检合格","【非处理中的数据】未填写处理意见或整改措施,无法进行复检操作!");
flag = false;
return;
}
});
if(flag) {
IPLAT.confirm({
title: '复检合格',
message: '确认复检此数据么?',
okFn: function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("HGZL004", "complete", post, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
}
\ No newline at end of file
......@@ -11,6 +11,14 @@ $(function () {
onSuccess: function (e) {
},
loadComplete: function(grid) {
},
onSave: function(e){
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
}
}
}
......@@ -26,3 +34,15 @@ let query = function () {
resultGrid.dataSource.page(1);
}
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做保存操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL004A", "save", true);
}
});
}
......@@ -18,9 +18,9 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="content" cname="内容" width="150" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="content" cname="内容" width="150" required="true" readonly="true" align="center"/>
<EF:EFColumn ename="chreatedName" cname="创建人" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" editType="date"
dateFormat="yyyy-MM-dd HH:mm:ss" parseFormats="['yyyyMMddHHmmss']" enable="true" width="130" align="center" 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