Commit 18b3df0f by wuwenlong

整改通知单dev

parent dbcb909a
...@@ -6,8 +6,8 @@ package com.baosight.hggp.common; ...@@ -6,8 +6,8 @@ package com.baosight.hggp.common;
*/ */
public enum HandleStatusEnum { public enum HandleStatusEnum {
UNPROCESS(0,"待处理"), UNPROCESS(0,"待处理"),
processing(1,"处理中"), PROCESSING(1,"处理中"),
processed(2,"已处理"); PROCESSED(2,"已处理");
private Integer code; private Integer code;
private String value; private String value;
......
...@@ -6,6 +6,7 @@ package com.baosight.hggp.hg.constant; ...@@ -6,6 +6,7 @@ package com.baosight.hggp.hg.constant;
*/ */
public class HGSqlConstant { public class HGSqlConstant {
/** /**
* HGCG001 SQL 定义 * HGCG001 SQL 定义
* *
...@@ -535,6 +536,10 @@ public class HGSqlConstant { ...@@ -535,6 +536,10 @@ public class HGSqlConstant {
public static final String UPDATE_COMPLETE_NUM = "HPSC006.updateCompleteNum"; public static final String UPDATE_COMPLETE_NUM = "HPSC006.updateCompleteNum";
} }
public class HGZL004 {
public static final String LOCK = "HGZL004.lock";
}
/** /**
* 用户 * 用户
* *
......
...@@ -92,6 +92,7 @@ public class HGZL004 extends DaoEPBase { ...@@ -92,6 +92,7 @@ public class HGZL004 extends DaoEPBase {
public static final String INSERT = "HGZL004.insert"; public static final String INSERT = "HGZL004.insert";
public static final String UPDATE = "HGZL004.update"; public static final String UPDATE = "HGZL004.update";
public static final String DELETE = "HGZL004.delete"; public static final String DELETE = "HGZL004.delete";
public static final String BATCH_COMPLETE= "HGZL004.batch_complete";
private Long id = new Long(0); private Long id = new Long(0);
private Long checkId = new Long(0); /* 质检单ID*/ private Long checkId = new Long(0); /* 质检单ID*/
......
package com.baosight.hggp.hg.zl.service; package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.HandleStatusEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.domain.HGZL004; import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.lang.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
...@@ -52,6 +60,53 @@ public class ServiceHGZL004 extends ServiceBase { ...@@ -52,6 +60,53 @@ public class ServiceHGZL004 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "整改通知单", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<HGZL004> hgzl004List = MapUtils.toDaoEPBase(inInfo,HGZL004.class);
hgzl004List.forEach( o -> {
HGZL004 db004 = HGZLTools.THGZL004.get(o.getId());
HGZLTools.THGZL004.lock(o.getId());
HandleStatusEnum stat = HandleStatusEnum.getEnumByCode(db004.getHandleStatus());
switch (stat){
case UNPROCESS:
if(StringUtils.isNotBlank(o.getProcessSugges())||StringUtils.isNotBlank(o.getRectificatSugges())){
o.setHandleStatus(HandleStatusEnum.PROCESSING.getCode());
}
DaoUtils.update(HGZL004.UPDATE,o);
break;
case PROCESSING:
break;
case PROCESSED:
AssertUtils.isTrue(true,String.format("检查单号[%s]已处理完成,不能修改!"));
break;
default:
break;
}
});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgzl004List.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "整改通知单", operType = "处理完成", operDesc = "处理完成")
public EiInfo complete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGZL004.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;
}
} }
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
* @author wwl
* @date 2025年05月29日 17:18
*/
public class ServiceHGZL004A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "整改通知单-沟通记录", operType = "查询", operDesc = "初始化查询")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGZL004A.QUERY, new HGZL004A());
EiInfoUtils.addBlock(inInfo,"userBlockId", UserSessionUtils.getUser(), User.class);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "整改通知单-沟通记录", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGZL004A.QUERY, new HGZL004A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
...@@ -369,5 +369,28 @@ ...@@ -369,5 +369,28 @@
WHERE WHERE
id = #id# id = #id#
</update> </update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGZL004
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</update>
<update id="batch_complete">
UPDATE ${hggpSchema}.HGZL004
SET
handle_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> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-06-03 13:23:04
Version : 1.0
schema : hggp
tableName : HGZL004A
id BIGINT NOT NULL primarykey,
inform_id BIGINT NOT NULL,
content VARCHAR,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGZL004A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="informId">
inform_id = #informId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="content">
content = #content#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.zl.domain.HGZL004A">
SELECT
id as "id",
inform_id as "informId", <!-- 整改通知单ID -->
content as "content", <!-- 沟通内容 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGZL004A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL004A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="informId">
inform_id = #informId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="content">
content = #content#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL004A (id,
inform_id, <!-- 整改通知单ID -->
content, <!-- 沟通内容 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #informId#, #content#, #companyCode#, #companyName#, #depCode#, #depName#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGZL004A WHERE
id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGZL004A
SET
inform_id = #informId#, <!-- 整改通知单ID -->
content = #content#, <!-- 沟通内容 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id = #id#
</update>
</sqlMap>
...@@ -7,6 +7,7 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -7,6 +7,7 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC008; import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.domain.HGZL001; import com.baosight.hggp.hg.zl.domain.HGZL001;
...@@ -22,6 +23,7 @@ import java.math.BigDecimal; ...@@ -22,6 +23,7 @@ import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -133,6 +135,21 @@ public class HGZLTools { ...@@ -133,6 +135,21 @@ public class HGZLTools {
public static class THGZL004 { public static class THGZL004 {
/**
* 锁
*
* @param id
* @return
*/
public static void lock(Long id) {
if (Objects.isNull(id)||id<=0) {
return;
}
Map queryMap = new HashMap();
queryMap.put(HGZL004.FIELD_id, id);
DaoBase.getInstance().update(HGSqlConstant.HGZL004.LOCK, queryMap);
}
public static void addByHGZL002(HGZL002 hgzl002) { public static void addByHGZL002(HGZL002 hgzl002) {
List<HGZL004> hgzl004DbList = listByCheckId(hgzl002.getId(),CheckTypeEnum.PROCESS_CHECK.getCode()); List<HGZL004> hgzl004DbList = listByCheckId(hgzl002.getId(),CheckTypeEnum.PROCESS_CHECK.getCode());
if(hgzl002.getUnpassQuantity()>0&&CollectionUtils.isEmpty(hgzl004DbList)) { if(hgzl002.getUnpassQuantity()>0&&CollectionUtils.isEmpty(hgzl004DbList)) {
...@@ -174,6 +191,18 @@ public class HGZLTools { ...@@ -174,6 +191,18 @@ public class HGZLTools {
queryMap.put(HGZL004.FIELD_check_type, checkType); queryMap.put(HGZL004.FIELD_check_type, checkType);
return DaoBase.getInstance().query(HGZL004.QUERY, queryMap); return DaoBase.getInstance().query(HGZL004.QUERY, queryMap);
} }
/**
* @param id
*/
public static HGZL004 get(Long id) {
AssertUtils.isNull(id, "ID不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL004.FIELD_id, id);
List<HGZL004> results = DaoBase.getInstance().query(HGZL004.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
} }
} }
\ No newline at end of file
...@@ -69,27 +69,9 @@ let save = function () { ...@@ -69,27 +69,9 @@ let save = function () {
message("请选择数据") message("请选择数据")
return; return;
} }
for (let i = 0; i < rows.length; i++) { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做保存操作吗? ", {
let passQuantity = rows[i]['passQuantity'];
let unpassQuantity = rows[i]['unpassQuantity'];
let quantity = rows[i]['quantity'];
if (!isNumber(passQuantity)||!isNumber(unpassQuantity)) {
message("第" + (i + 1) + "行合格数量与不合格数量必须是大于等于0的数字!");
return;
}
if (passQuantity > quantity) {
message("第" + (i + 1) + "行合格数量不能大于报工数量!");
return;
}
if (unpassQuantity > quantity) {
message("第" + (i + 1) + "行不合格数量不能大于报工数量!");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做质检完成操作吗? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGZL002", "save", true); JSUtils.submitGridsData("result", "HGZL004", "save", true);
} }
}); });
} }
...@@ -108,3 +90,12 @@ function showUploadFile(id,bizType,title) { ...@@ -108,3 +90,12 @@ function showUploadFile(id,bizType,title) {
height: "80%", height: "80%",
}); });
} }
function communication(id) {
JSColorbox.open({
href: "HGZL004A?methodName=initLoad&inqu_status-0-informId=" + id,
title: "<div style='text-align: center;'>沟通记录</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [],
onSuccess: function (e) {
},
loadComplete: function(grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="整改通知单-沟通记录">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="通知单ID" ename="informId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="content" cname="内容" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="chreatedName" cname="创建人" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker cname="沟通日期" ename="inqu_status-0-createdTime" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="content" cname="内容" width="150" enable="false" 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"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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