Commit be86a227 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hp-smart into dev-ly

parents 5fcc8dd6 592fef70
......@@ -51,9 +51,9 @@ public class ServiceHPDM099 extends ServiceEPBase {
try {
// 文件存储位置
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
inInfo = super.query(inInfo, "HPDM099.queryS3", new HPXS007A());
inInfo = super.query(inInfo, "HPDM099.queryS3", new HPDM099());
} else {
inInfo = super.query(inInfo, "HPDM099.queryLocal", new HPXS007A());
inInfo = super.query(inInfo, "HPDM099.queryLocal", new HPDM099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -6,10 +6,9 @@ import com.baosight.hpjx.core.enums.HandleStatusEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.dm.constant.HpDmConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.dm.tools.HpDmTools;
import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.hp.zl.domain.HPZL004;
import com.baosight.hpjx.hp.zl.domain.HPZL004C;
import com.baosight.hpjx.hp.zl.tools.HPZLTools;
import com.baosight.hpjx.hp.zl.utils.HpZlUtils;
import com.baosight.hpjx.util.AssertUtils;
......@@ -17,12 +16,10 @@ import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils;
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.HashMap;
import java.util.List;
import java.util.Map;
......@@ -109,9 +106,9 @@ public class ServiceHPZL004 extends ServiceBase {
AssertUtils.isEmpty(dbZl004.getRectifySugges(), String.format("整改通知单【%s】的整改措施不能为空!",
dbZl004.getRectifyId()));
// 处理照片不能为空
List<HPDM099> dbDm099s = HpDmTools.HpDm099.list(HpDmConstant.BizType.RECTIFY_HANDLE,
dbZl004.getRectifyId());
AssertUtils.isEmpty(dbDm099s, String.format("整改通知单【%s】还未上传处理照片!",
List<HPZL004C> dbZl004s = HPZLTools.HpZl004c.listById(dbZl004.getRectifyId(),
HpDmConstant.BizType.RECTIFY_HANDLE);
AssertUtils.isEmpty(dbZl004s, String.format("整改通知单【%s】还未上传处理照片!",
dbZl004.getRectifyId()));
}
}
......
package com.baosight.hpjx.hp.zl.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.enums.HandleStatusEnum;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.hp.zl.domain.HPZL004;
import com.baosight.hpjx.hp.zl.tools.HPZLTools;
import com.baosight.hpjx.hp.zl.utils.HpZlUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
......@@ -19,7 +27,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.List;
import java.util.Arrays;
import java.util.Map;
/**
......@@ -42,6 +50,10 @@ public class ServiceHPZL004B extends ServiceEPBase {
try {
// 查询物料信息
this.setQualityInfo(inInfo);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.ORG_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPZL004().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -75,6 +87,8 @@ public class ServiceHPZL004B extends ServiceEPBase {
public EiInfo save(EiInfo inInfo) {
try {
HPZL004 fZl004 = MapUtils.toDaoEPBase(inInfo, HPZL004.class);
// 填充基础信息
this.setBaseInfo(fZl004);
// 判断是新增还是修改
if (StringUtils.isBlank(fZl004.getRectifyId())) {
addData(fZl004);
......@@ -129,4 +143,31 @@ public class ServiceHPZL004B extends ServiceEPBase {
AssertUtils.isEmpty(fZl004.getProcessSugges(), "处理意见不能为空");
}
/**
* 填充基础信息
*
* @param fZl004
*/
private void setBaseInfo(HPZL004 fZl004) {
// 项目信息
String projCode = fZl004.getProjCode();
HPSC001 dbSc001 = HPSCTools.HpSc001.get(projCode);
fZl004.setProjType(dbSc001.getProjType());
fZl004.setProjName(dbSc001.getProjName());
// 产品信息
String prdtCode = fZl004.getPrdtCode();
HPSC002 dbSc002 = HPSCTools.HpSc002.getByPrdt(prdtCode);
fZl004.setPrdtType(dbSc002.getPrdtType());
fZl004.setPrdtName(dbSc002.getPrdtName());
// 责任部门
String depCode = fZl004.getResponDepCode();
Org dbOrg = HPXSTools.XsOrg.get(depCode);
fZl004.setResponDepCode(dbOrg.getOrgId());
fZl004.setResponDepName(dbOrg.getOrgCname());
// 责任人
String userId = fZl004.getResponUserId();
User user = HPXSTools.XsUser.get(userId);
fZl004.setResponUserName(user.getUserName());
}
}
......@@ -15,12 +15,22 @@
DELETE_FLAG as "deleteFlag", <!-- 是否删除 -->
RECTIFY_ID as "rectifyId", <!-- 整改ID -->
STATUS as "status", <!-- 状态,0:待处理;1:处理中;2:已处理 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
QUALITY_PROBLEM as "qualityProblem", <!-- 质量问题 -->
PROCESS_SUGGES as "processSugges", <!-- 处理意见 -->
RECTIFY_SUGGES as "rectifySugges", <!-- 整改措施 -->
CHECK_BY as "checkBy", <!-- 质检人 -->
CHECK_NAME as "checkName", <!-- 质检人名称 -->
CHECK_TIME as "checkTime" <!-- 质检时间 -->
CHECK_TIME as "checkTime", <!-- 质检时间 -->
RESPON_DEP_CODE as "responDepCode", <!-- 责任部门编码 -->
RESPON_DEP_NAME as "responDepName", <!-- 责任部门名称 -->
RESPON_USER_ID as "responUserId", <!-- 责任人 -->
RESPON_USER_NAME as "responUserName" <!-- 责任名称 -->
</sql>
<sql id="condition">
......@@ -45,6 +55,15 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE LIKE CONCAT('%', #projCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME LIKE CONCAT('%', #prdtName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityProblem">
QUALITY_PROBLEM = #qualityProblem#
</isNotEmpty>
......@@ -58,7 +77,7 @@
CHECK_BY = #checkBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkName">
CHECK_NAME = #checkName#
CHECK_NAME LIKE CONCAT('%', #checkName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkTime">
CHECK_TIME = #checkTime#
......@@ -107,18 +126,32 @@
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除 -->
RECTIFY_ID, <!-- 整改ID -->
STATUS, <!-- 状态,0:待处理;1:处理中;2:已处理 -->
PROJ_TYPE, <!-- 项目类型 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PRDT_TYPE, <!-- 产品类型 -->
PRDT_CODE, <!-- 产品编码 -->
PRDT_NAME, <!-- 产品名称 -->
QUALITY_PROBLEM, <!-- 质量问题 -->
PROCESS_SUGGES, <!-- 处理意见 -->
RECTIFY_SUGGES <!-- 整改措施 -->
RECTIFY_SUGGES, <!-- 整改措施 -->
CHECK_BY, <!-- 质检人 -->
CHECK_NAME, <!-- 质检人名称 -->
CHECK_TIME, <!-- 质检时间 -->
RESPON_DEP_CODE, <!-- 责任部门编码 -->
RESPON_DEP_NAME, <!-- 责任部门名称 -->
RESPON_USER_ID, <!-- 责任人 -->
RESPON_USER_NAME <!-- 责任名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #rectifyId#, #status#, #qualityProblem#, #processSugges#,
#rectifySugges#
#rectifyId#, #status#, #projType#, #projCode#, #projName#,
#prdtType#, #prdtCode#, #prdtName#, #qualityProblem#, #processSugges#,
#rectifySugges#, #checkBy#, #checkName#, #checkTime#, #responDepCode#,
#responDepName#, #responUserId#, #responUserName#
)
</insert>
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
......@@ -139,9 +172,19 @@
<update id="update">
UPDATE ${hpjxSchema}.T_HPZL004
SET
PROJ_TYPE = #projType#, <!-- 项目类型 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PRDT_TYPE = #prdtType#, <!-- 产品类型 -->
PRDT_CODE = #prdtCode#, <!-- 产品编码 -->
PRDT_NAME = #prdtName#, <!-- 产品名称 -->
QUALITY_PROBLEM = #qualityProblem#, <!-- 质量问题 -->
PROCESS_SUGGES = #processSugges#, <!-- 处理意见 -->
RECTIFY_SUGGES = #rectifySugges#, <!-- 整改措施 -->
RESPON_DEP_CODE = #responDepCode#, <!-- 责任部门编码 -->
RESPON_DEP_NAME = #responDepName#, <!-- 责任部门名称 -->
RESPON_USER_ID = #responUserId#, <!-- 责任人 -->
RESPON_USER_NAME = #responUserName#, <!-- 责任名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE RECTIFY_ID = #rectifyId#
</update>
......
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.hp.zl.domain.HPZL004;
import com.baosight.hpjx.hp.zl.domain.HPZL004C;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -11,7 +12,6 @@ import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -128,4 +128,28 @@ public class HPZLTools {
}
/**
* @author:songx
* @date:2024/8/26,10:30
*/
public static class HpZl004c {
/**
* 查询
*
* @param rectifyId
* @param bizType
* @return
*/
public static List<HPZL004C> listById(String rectifyId, String bizType) {
AssertUtils.isEmpty(rectifyId, "ID不能为空");
AssertUtils.isEmpty(bizType, "类型不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPZL004C.FIELD_RECTIFY_ID, rectifyId);
paramMap.put(HPZL004C.FIELD_RECTIFY_TYPE, bizType);
return DaoBase.getInstance().query(HPZL004C.QUERY, paramMap);
}
}
}
......@@ -39,7 +39,7 @@ public class HpZlUtils {
* @return
*/
public static Map<String, HPZL004> lockGetDataEp(List<? extends HPZL004> zl004s) {
return lockGetData(ObjectUtils.listEpKey(zl004s, HPZL004.FIELD_ID));
return lockGetData(ObjectUtils.listEpKey(zl004s, HPZL004.FIELD_RECTIFY_ID));
}
/**
......
......@@ -156,7 +156,6 @@ public class MapUtils extends org.apache.commons.collections.MapUtils {
return resultMap;
}
/**
* map 转 DaoEPBase
*
......
......@@ -69,6 +69,7 @@ function uploadFileCallback(res) {
inEiInfo.set("result-0-bizId", $("#inqu_status-0-bizId").val());
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
inEiInfo.set("result-0-docId", res.docId);
inEiInfo.set("result-0-docName", res.docName);
EiCommunicator.send('HPDM099', 'upload', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
......
......@@ -10,15 +10,14 @@
<div class="row">
<EF:EFInput ename="projCode" cname="项目编号" blockId="inqu_status" row="0" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput ename="projName" cname="项目名称" blockId="inqu_status" row="0" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput ename="productName" cname="产品名称" blockId="inqu_status" row="0" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect cname="处理状态" ename="handleStatus" blockId="inqu_status" row="0" colWidth="3">
<EF:EFInput ename="prdtName" cname="产品名称" blockId="inqu_status" row="0" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect ename="status" cname="处理状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpzl.handleStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput ename="checkName" cname="处理人" blockId="inqu_status" row="0" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput ename="checkName" cname="质检人" blockId="inqu_status" row="0" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
......@@ -31,15 +30,20 @@
<EF:EFColumn ename="processPic" cname="处理照片" width="90" enable="false" align="center"/>
<EF:EFColumn ename="rectifyId" cname="单据ID" enable="false" width="130" align="center"/>
<EF:EFColumn ename="createdTime" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd"
parseFormats="['yyyyMMdd']" enable="true" width="120" align="center" readOnly="true"/>
parseFormats="['yyyyMMdd']" enable="false" width="120" align="center" readOnly="true"/>
<EF:EFComboColumn ename="status" cname="处理状态" width="80" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpzl.handleStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="qualityProblem" cname="质量问题描述" enable="true" width="130" align="center"/>
<EF:EFColumn ename="processSugges" cname="处理意见" enable="true" width="130" align="center"/>
<EF:EFColumn ename="rectifySugges" cname="整改措施" enable="true" width="130" align="center"/>
<EF:EFColumn ename="checkName" cname="处理人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="checkTime" cname="处理时间" enable="true" width="140" align="center" editType="datetime"
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="130" align="left"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="left"/>
<EF:EFColumn ename="prdtName" cname="产品名称" enable="false" width="130" align="left"/>
<EF:EFColumn ename="qualityProblem" cname="质量问题描述" enable="false" width="130" align="center"/>
<EF:EFColumn ename="processSugges" cname="处理意见" enable="false" width="130" align="center"/>
<EF:EFColumn ename="rectifySugges" cname="整改措施" enable="false" width="130" align="center"/>
<EF:EFColumn ename="responDepName" cname="责任部门" enable="false" width="130" align="left"/>
<EF:EFColumn ename="responUserName" cname="责任人" enable="false" width="130" align="left"/>
<EF:EFColumn ename="checkName" cname="质检人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="checkTime" cname="质检时间" enable="false" width="140" align="center" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" parseFormats="['yyyyMMddHHmmss']" readOnly="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -52,6 +52,14 @@ let save = function () {
* 参数校验
*/
let checkParams = function () {
let projCode = $("#result-0-projCode").val();
if (isBlank(projCode)) {
return "项目名称不能为空";
}
let prdtCode = $("#result-0-prdtCode").val();
if (isBlank(prdtCode)) {
return "产品名称不能为空";
}
let qualityProblem = $("#result-0-qualityProblem").val();
if (isBlank(qualityProblem)) {
return "质量问题不能为空";
......@@ -64,5 +72,13 @@ let checkParams = function () {
if (isBlank(rectifySugges)) {
return "整改措施不能为空";
}
let responDepCode = $("#result-0-responDepCode").val();
if (isBlank(responDepCode)) {
return "责任部门不能为空";
}
let responUserId = $("#result-0-responUserId").val();
if (isBlank(responUserId)) {
return "责任人不能为空";
}
return null;
}
......@@ -12,6 +12,20 @@
readonly="true"/>
</div>
<div class="row">
<EF:EFSelect cname="项目名称" blockId="result" ename="projCode" row="0" colWidth="3" ratio="2:10"
required="true" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="产品名称" blockId="result" ename="prdtCode" row="0" colWidth="3" ratio="2:10"
required="true" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="质量问题" blockId="result" ename="qualityProblem" row="0" colWidth="6" ratio="2:10"
required="true" type="textarea" rows="4" maxLength="500"/>
</div>
......@@ -23,6 +37,20 @@
<EF:EFInput cname="整改措施" blockId="result" ename="rectifySugges" row="0" colWidth="6" ratio="2:10"
required="true" type="textarea" rows="4" maxLength="500"/>
</div>
<div class="row">
<EF:EFSelect cname="责任部门" blockId="result" ename="responDepCode" row="0" colWidth="3" ratio="2:10"
required="true" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="org_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="责任人" blockId="result" ename="responUserId" row="0" colWidth="3" ratio="2:10"
required="true" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<br/>
<span style="color: red; ">说明:单据ID由系统自动生成</span><br>
</EF:EFRegion>
......
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