Commit 6cf9f7f8 by 宋祥

1.生产下料仅保留完成按钮

parent c87d4d1c
...@@ -36,6 +36,9 @@ public class HPDM099 extends DaoEPBase { ...@@ -36,6 +36,9 @@ public class HPDM099 extends DaoEPBase {
public static final String FIELD_BIZ_ID = "bizId"; /* 业务ID*/ public static final String FIELD_BIZ_ID = "bizId"; /* 业务ID*/
public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/ public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件名称*/ public static final String FIELD_DOC_NAME = "docName"; /* 文件名称*/
public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/
public static final String FIELD_PREVIEW_NUM = "previewNum"; /* 预览次数*/
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
...@@ -51,6 +54,9 @@ public class HPDM099 extends DaoEPBase { ...@@ -51,6 +54,9 @@ public class HPDM099 extends DaoEPBase {
public static final String COL_BIZ_ID = "BIZ_ID"; /* 业务ID*/ public static final String COL_BIZ_ID = "BIZ_ID"; /* 业务ID*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/ public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件名称*/ public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件名称*/
public static final String COL_DOC_TYPE = "DOC_TYPE"; /* 文件类型*/
public static final String COL_PREVIEW_NUM = "PREVIEW_NUM"; /* 预览次数*/
public static final String COL_DOWNLOAD_NUM = "DOWNLOAD_NUM"; /* 下载次数*/
public static final String QUERY = "HPDM099.query"; public static final String QUERY = "HPDM099.query";
public static final String COUNT = "HPDM099.count"; public static final String COUNT = "HPDM099.count";
...@@ -72,6 +78,9 @@ public class HPDM099 extends DaoEPBase { ...@@ -72,6 +78,9 @@ public class HPDM099 extends DaoEPBase {
private String bizId = " "; /* 业务ID*/ private String bizId = " "; /* 业务ID*/
private String docId = " "; /* 文件ID*/ private String docId = " "; /* 文件ID*/
private String docName = " "; /* 文件名称*/ private String docName = " "; /* 文件名称*/
private String docType = " "; /* 文件类型*/
private Integer previewNum = new Integer(0); /* 预览次数*/
private Integer downloadNum = new Integer(0); /* 下载次数*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -135,7 +144,18 @@ public class HPDM099 extends DaoEPBase { ...@@ -135,7 +144,18 @@ public class HPDM099 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DOC_NAME); eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件名称"); eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PREVIEW_NUM);
eiColumn.setDescName("预览次数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOWNLOAD_NUM);
eiColumn.setDescName("下载次数");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -358,7 +378,7 @@ public class HPDM099 extends DaoEPBase { ...@@ -358,7 +378,7 @@ public class HPDM099 extends DaoEPBase {
* @return the docName * @return the docName
*/ */
public String getDocName() { public String getDocName() {
return this.getDocName(); return docName;
} }
/** /**
...@@ -369,6 +389,48 @@ public class HPDM099 extends DaoEPBase { ...@@ -369,6 +389,48 @@ public class HPDM099 extends DaoEPBase {
public void setDocName(String docName) { public void setDocName(String docName) {
this.docName = docName; this.docName = docName;
} }
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType;
}
/**
* get the previewNum - 预览次数.
* @return the previewNum
*/
public Integer getPreviewNum() {
return this.previewNum;
}
/**
* set the previewNum - 预览次数.
*
* @param previewNum - 预览次数
*/
public void setPreviewNum(Integer previewNum) {
this.previewNum = previewNum;
}
/**
* get the downloadNum - 下载次数.
* @return the downloadNum
*/
public Integer getDownloadNum() {
return this.downloadNum;
}
/**
* set the downloadNum - 下载次数.
*
* @param downloadNum - 下载次数
*/
public void setDownloadNum(Integer downloadNum) {
this.downloadNum = downloadNum;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -390,7 +452,9 @@ public class HPDM099 extends DaoEPBase { ...@@ -390,7 +452,9 @@ public class HPDM099 extends DaoEPBase {
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_TYPE)), bizType)); setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_TYPE)), bizType));
setBizId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_ID)), bizId)); setBizId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_ID)), bizId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId)); setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName)); setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName)); setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
setPreviewNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PREVIEW_NUM)), previewNum));
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
} }
/** /**
...@@ -414,6 +478,9 @@ public class HPDM099 extends DaoEPBase { ...@@ -414,6 +478,9 @@ public class HPDM099 extends DaoEPBase {
map.put(FIELD_BIZ_ID, StringUtils.toString(bizId, eiMetadata.getMeta(FIELD_BIZ_ID))); map.put(FIELD_BIZ_ID, StringUtils.toString(bizId, eiMetadata.getMeta(FIELD_BIZ_ID)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID))); map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME))); map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE)));
map.put(FIELD_PREVIEW_NUM, StringUtils.toString(previewNum, eiMetadata.getMeta(FIELD_PREVIEW_NUM)));
map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM)));
return map; return map;
} }
......
...@@ -49,12 +49,7 @@ public class ServiceHPDM099 extends ServiceEPBase { ...@@ -49,12 +49,7 @@ public class ServiceHPDM099 extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
// 文件存储位置 inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
inInfo = super.query(inInfo, "HPDM099.queryS3", new HPDM099());
} else {
inInfo = super.query(inInfo, "HPDM099.queryLocal", new HPDM099());
}
} catch (Throwable e) { } catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
......
...@@ -3,72 +3,51 @@ ...@@ -3,72 +3,51 @@
<sqlMap namespace="HPDM099"> <sqlMap namespace="HPDM099">
<sql id="column"> <sql id="column">
A.ID as "id", ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 --> DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 --> UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 --> UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 --> UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.BIZ_TYPE as "bizType", <!-- 业务类型 --> BIZ_TYPE as "bizType", <!-- 业务类型 -->
A.BIZ_ID as "bizId", <!-- 业务ID --> BIZ_ID as "bizId", <!-- 业务ID -->
A.DOC_ID as "docId" <!-- 文件ID --> DOC_ID as "docId", <!-- 文件ID -->
</sql> DOC_NAME as "docName", <!-- 文件名称 -->
DOC_TYPE as "docType", <!-- 文件类型 -->
<sql id="columnLocal"> PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
<include refid="column"/>, DOWNLOAD_NUM as "downloadNum" <!-- 下载次数 -->
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnS3">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
AND A.DELETE_FLAG = '0' AND DELETE_FLAG = '0'
<include refid="SqlBase.authCondition"/> <include refid="SqlBase.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType"> <isNotEmpty prepend=" AND " property="bizType">
A.BIZ_TYPE = #bizType# BIZ_TYPE = #bizType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizId"> <isNotEmpty prepend=" AND " property="bizId">
A.BIZ_ID = #bizId# BIZ_ID = #bizId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docId"> <isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId# DOC_ID = #docId#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
<include refid="condition"/> <include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000') CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo"> <isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959') CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<!-- 本地 -->
<sql id="conditionLocal">
AND A.DOC_ID = B.DOC_ID
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- S3地址 -->
<sql id="conditionS3">
AND A.DOC_ID = B.RES_ID
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -78,41 +57,25 @@ ...@@ -78,41 +57,25 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
A.ID asc ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
<select id="queryLocal" resultClass="com.baosight.hpjx.hp.dm.domain.HPDM099"> <select id="query" resultClass="com.baosight.hpjx.hp.dm.domain.HPDM099">
SELECT SELECT
<include refid="columnLocal"/> <include refid="column"/>
FROM ${hpjxSchema}.T_HPDM099 A, ${platSchema}.TEUDM02 B FROM ${hpjxSchema}.T_HPDM099
WHERE 1=1 WHERE 1=1
<include refid="conditionLocal"/> <include refid="customCondition"/>
<include refid="orderBy"/>
</select>
<select id="countLocal" resultClass="int">
SELECT COUNT(*)
FROM ${hpjxSchema}.T_HPDM099 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionLocal"/>
</select>
<select id="queryS3" resultClass="com.baosight.hpjx.hp.dm.domain.HPDM099">
SELECT
<include refid="columnS3"/>
FROM ${hpjxSchema}.T_HPDM099 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionS3"/>
<include refid="orderBy"/> <include refid="orderBy"/>
</select> </select>
<select id="countS3" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) SELECT COUNT(*)
FROM ${hpjxSchema}.T_HPDM099 A, ${platSchema}.TEUDM05 B FROM ${hpjxSchema}.T_HPDM099
WHERE 1=1 WHERE 1=1
<include refid="conditionS3"/> <include refid="customCondition"/>
</select> </select>
<insert id="insert"> <insert id="insert">
...@@ -122,20 +85,54 @@ ...@@ -122,20 +85,54 @@
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 --> DELETE_FLAG, <!-- 是否删除 -->
BIZ_TYPE, <!-- 业务类型 --> BIZ_TYPE, <!-- 业务类型 -->
BIZ_ID, <!-- 业务ID --> BIZ_ID, <!-- 业务ID -->
DOC_ID <!-- 文件ID --> DOC_ID, <!-- 文件ID -->
DOC_NAME, <!-- 文件名称 -->
DOC_TYPE <!-- 文件类型 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId# #updatedBy#, #updatedName#, #updatedTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#
) )
</insert> </insert>
<delete id="delete"> <delete id="deleteBizId">
UPDATE ${hpjxSchema}.T_HPDM099 UPDATE ${hpjxSchema}.T_HPDM099
SET DELETE_FLAG = '1' SET DELETE_FLAG = 1
<include refid="SqlBase.updateRevise"/>
WHERE BIZ_ID = #bizId#
AND BIZ_TYPE = #bizType#
</delete>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPDM099
SET DELETE_FLAG = 1,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id# WHERE ID = #id#
</delete> </delete>
<!-- 预览自增 -->
<update id="previewIncr">
UPDATE ${hpjxSchema}.T_HPDM099
SET
PREVIEW_NUM = PREVIEW_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE DOC_ID = #docId#
</update>
<!-- 下载自增 -->
<update id="downloadIncr">
UPDATE ${hpjxSchema}.T_HPDM099
SET
DOWNLOAD_NUM = DOWNLOAD_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE DOC_ID = #docId#
</update>
</sqlMap> </sqlMap>
...@@ -5,7 +5,6 @@ import com.baosight.hpjx.core.constant.CommonConstant; ...@@ -5,7 +5,6 @@ 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.fw.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant; import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001; import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils; import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
...@@ -98,9 +97,7 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -98,9 +97,7 @@ public class ServiceHPFW001 extends ServiceBase {
for (HPFW001 fFw001 : fFw001s) { for (HPFW001 fFw001 : fFw001s) {
String afterSaleNo = fFw001.getAfterSaleNo(); String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo); HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
AssertUtils.isNull(dbFw001, String.format("售后服务单[%s]不存在", afterSaleNo)); this.checkData(afterSaleNo, dbFw001);
AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw001.getStatus(),
String.format("售后服务单[%s]状态不是\"待处理\",不允许操作", afterSaleNo));
} }
} }
...@@ -117,21 +114,41 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -117,21 +114,41 @@ public class ServiceHPFW001 extends ServiceBase {
} }
/** /**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String afterSaleNo = MapUtils.getString(queryMap, HPFW001.FIELD_AFTER_SALE_NO);
HPFW001 dbFw001 = HpFwUtils.HpFw001.lockAndGet(afterSaleNo);
this.checkData(afterSaleNo, dbFw001);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 处理 * 处理
* *
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "客户回访", operType = "审核") @OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo check(EiInfo inInfo) { public EiInfo deal(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HPFW001> fFw001s = MapUtils.toDaoEPBases(inInfo, HPFW001.class); List<HPFW001> fFw001s = MapUtils.toDaoEPBases(inInfo, HPFW001.class);
// db数据 // db数据
Map<String, HPFW001> dbFw001Map = HpFwUtils.HpFw001.lockAndGet(fFw001s); Map<String, HPFW001> dbFw001Map = HpFwUtils.HpFw001.lockAndGet(fFw001s);
// 数据校验 // 数据校验
this.checkCheckData(fFw001s, dbFw001Map); this.dealCheckData(fFw001s, dbFw001Map);
// 保存数据 // 保存数据
this.checkData(fFw001s); this.dealData(fFw001s, content);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw001s.size() + "]条数据处理成功!"); inInfo.setMsg("操作成功!本次对[" + fFw001s.size() + "]条数据处理成功!");
...@@ -147,13 +164,11 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -147,13 +164,11 @@ public class ServiceHPFW001 extends ServiceBase {
* @param fFw001s * @param fFw001s
* @param dbFw001Map * @param dbFw001Map
*/ */
private void checkCheckData(List<HPFW001> fFw001s, Map<String, HPFW001> dbFw001Map) { private void dealCheckData(List<HPFW001> fFw001s, Map<String, HPFW001> dbFw001Map) {
for (HPFW001 fFw001 : fFw001s) { for (HPFW001 fFw001 : fFw001s) {
String afterSaleNo = fFw001.getAfterSaleNo(); String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo); HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
AssertUtils.isNull(dbFw001, String.format("售后服务单[%s]不存在", afterSaleNo)); this.checkData(afterSaleNo, dbFw001);
AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw001.getStatus(),
String.format("售后服务单[%s]状态不是\"待处理\",不允许操作", afterSaleNo));
} }
} }
...@@ -161,9 +176,11 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -161,9 +176,11 @@ public class ServiceHPFW001 extends ServiceBase {
* 数据保存 * 数据保存
* *
* @param fFw001s * @param fFw001s
* @param content
*/ */
private void checkData(List<HPFW001> fFw001s) { private void dealData(List<HPFW001> fFw001s, String content) {
for (HPFW001 fFw001 : fFw001s) { for (HPFW001 fFw001 : fFw001s) {
fFw001.setDealContent(content);
fFw001.setStatus(HPConstant.dealStatus.S1); fFw001.setStatus(HPConstant.dealStatus.S1);
fFw001.setDealUserId(UserSessionUtils.getLoginName()); fFw001.setDealUserId(UserSessionUtils.getLoginName());
fFw001.setDealUserName(UserSessionUtils.getLoginCName()); fFw001.setDealUserName(UserSessionUtils.getLoginCName());
...@@ -171,4 +188,17 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -171,4 +188,17 @@ public class ServiceHPFW001 extends ServiceBase {
} }
} }
/**
* 数据校验
*
* @param afterSaleNo
* @param dbFw001
*/
private void checkData(String afterSaleNo, HPFW001 dbFw001) {
AssertUtils.isNull(dbFw001, String.format("售后服务单[%s]不存在", afterSaleNo));
AssertUtils.isNotEquals(dbFw001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("售后服务单【%s】不是\"未删除\"状态,不允许操作", afterSaleNo));
AssertUtils.isNotEquals(dbFw001.getStatus(), HPConstant.dealStatus.S0,
String.format("售后服务单【%s】不是\"待回访\"状态,不允许操作", afterSaleNo));
}
} }
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPFW001A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HPDM099.FIELD_BIZ_ID);
HPFW001 dbFw001 = HpFwUtils.HpFw001.lockAndGet(bizId);
this.checkData(dbFw001);
List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
for (HPDM099 fDm099 : fDm099s) {
DaoUtils.update(HPDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param dbFw001
*/
private void checkData(HPFW001 dbFw001) {
AssertUtils.isNotEquals(dbFw001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("售后服务单【%s】不是\"未删除\"状态,不允许操作", dbFw001.getAfterSaleNo()));
AssertUtils.isNotEquals(dbFw001.getStatus(), HPConstant.dealStatus.S0,
String.format("售后服务单【%s】不是\"待处理\"状态,不允许操作", dbFw001.getAfterSaleNo()));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HPDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HpFwTools.HpFw001.get(bizId));
block.addBlockMeta(new HPFW001().eiMetadata);
inInfo.setBlock(block);
}
}
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
CUSTOM_ID as "customId", <!-- 客户ID --> CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 --> CUSTOM_NAME as "customName", <!-- 客户名称 -->
DEAL_USER_ID as "dealUserId", <!-- 处理人ID --> DEAL_USER_ID as "dealUserId", <!-- 处理人ID -->
DEAL_USER_NAME as "dealUserName" <!-- 处理人名称 --> DEAL_USER_NAME as "dealUserName", <!-- 处理人名称 -->
DEAL_CONTENT as "dealContent" <!-- 处理内容 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -98,7 +99,7 @@ ...@@ -98,7 +99,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
...@@ -173,6 +174,7 @@ ...@@ -173,6 +174,7 @@
STATUS = #status#, STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID --> DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 --> DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
DEAL_CONTENT = #dealContent#,
<include refid="SqlBase.updateRevise"/> <include refid="SqlBase.updateRevise"/>
WHERE AFTER_SALE_NO = #afterSaleNo# WHERE AFTER_SALE_NO = #afterSaleNo#
</update> </update>
......
...@@ -170,7 +170,6 @@ public class ServiceHPSC0061 extends ServiceBase { ...@@ -170,7 +170,6 @@ public class ServiceHPSC0061 extends ServiceBase {
* @param fSc0061 * @param fSc0061
*/ */
public void add(HPSC0061 fSc0061) { public void add(HPSC0061 fSc0061) {
fSc0061.setCompleteStatus(HpScConst.CompleteStatus.S0);
fSc0061.setDeleteFlag(CommonConstant.YesNo.NO_0); fSc0061.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPSC0061.INSERT, fSc0061); DaoUtils.insert(HPSC0061.INSERT, fSc0061);
} }
...@@ -192,11 +191,10 @@ public class ServiceHPSC0061 extends ServiceBase { ...@@ -192,11 +191,10 @@ public class ServiceHPSC0061 extends ServiceBase {
try { try {
String prodOrderNo = inInfo.getString("prodOrderNo"); String prodOrderNo = inInfo.getString("prodOrderNo");
List<HPSC0061> fSc0061s = MapUtils.toDaoEPBases(inInfo, CommonConstant.Field.DETAIL, HPSC0061.class); List<HPSC0061> fSc0061s = MapUtils.toDaoEPBases(inInfo, CommonConstant.Field.DETAIL, HPSC0061.class);
Map<Long, HPSC0061> dbSc0061Map = HpScUtils.HpSc0061.lockAndGet(fSc0061s);
// 检查数据 // 检查数据
this.checkCompleteData(fSc0061s, dbSc0061Map); this.checkCompleteData(prodOrderNo, fSc0061s);
// 写入数据 // 写入数据
this.saveCompleteData(fSc0061s, dbSc0061Map); this.saveCompleteData(prodOrderNo, fSc0061s);
// 更新主订单状态 // 更新主订单状态
this.updateMainStatus(prodOrderNo); this.updateMainStatus(prodOrderNo);
// 刷新页面数据 // 刷新页面数据
...@@ -210,32 +208,34 @@ public class ServiceHPSC0061 extends ServiceBase { ...@@ -210,32 +208,34 @@ public class ServiceHPSC0061 extends ServiceBase {
} }
/** /**
* @param prodOrderNo
* @param fSc0061s * @param fSc0061s
* @param dbSc0061Map
*/ */
private void checkCompleteData(List<HPSC0061> fSc0061s, Map<Long, HPSC0061> dbSc0061Map) { private void checkCompleteData(String prodOrderNo, List<HPSC0061> fSc0061s) {
AssertUtils.isEmpty(dbSc0061Map, "请先设置生产组后,再进行\"完成\"操作"); AssertUtils.isEmpty(prodOrderNo, "请选择订单");
for (HPSC0061 fSc0061 : fSc0061s) { for (HPSC0061 fSc0061 : fSc0061s) {
Long id = fSc0061.getId(); AssertUtils.isEmpty(fSc0061.getGroupCode(), String.format("物料【%s】的生产组不能为空",
HPSC0061 dbSc0061 = dbSc0061Map.get(id); fSc0061.getInventName()));
AssertUtils.isNull(dbSc0061, String.format("标识【%s】不存在,请检查", id));
AssertUtils.isNotEquals(dbSc0061.getCompleteStatus(), CommonConstant.YesNo.NO_0,
String.format("标识【%s】状态的不是\"未完成\",", id));
} }
} }
/** /**
* 写入数据 * 写入数据
* *
* @param prodOrderNo
* @param fSc0061s * @param fSc0061s
* @param dbSc0061Map
*/ */
private void saveCompleteData(List<HPSC0061> fSc0061s, Map<Long, HPSC0061> dbSc0061Map) { private void saveCompleteData(String prodOrderNo, List<HPSC0061> fSc0061s) {
for (HPSC0061 fSc0061 : fSc0061s) { for (HPSC0061 fSc0061 : fSc0061s) {
Map paramMap = new HashMap(); String groupCode = fSc0061.getGroupCode();
paramMap.put(HPSC0061.FIELD_ID, fSc0061.getId()); AssertUtils.isEmpty(groupCode, String.format("物料【%s】的生产组不能为空,请检查", fSc0061.getInventName()));
paramMap.put(HPSC0061.FIELD_COMPLETE_STATUS, HpScConst.CompleteStatus.S1); Org groupOrg = HPXSTools.XsOrg.get(groupCode);
DaoUtils.update("HPSC0061.updateCompleteStatus", paramMap); fSc0061.setGroupName(groupOrg.getOrgCname());
fSc0061.setFactoryCode(groupOrg.getFactoryCode());
fSc0061.setFactoryName(groupOrg.getFactoryName());
fSc0061.setProdOrderNo(prodOrderNo);
fSc0061.setCompleteStatus(HpScConst.CompleteStatus.S1);
this.add(fSc0061);
} }
} }
......
...@@ -9,10 +9,38 @@ $(function () { ...@@ -9,10 +9,38 @@ $(function () {
} }
NotificationUtil("附件上传成功"); NotificationUtil("附件上传成功");
try { try {
parent.JSColorbox.setValueCallback(e.response); uploadFile(e);
} catch (e) { } catch (e) {
} }
}, },
} }
}; };
}); });
/**
* 附件上传回调
*
* @param docId
*/
function uploadFile(e) {
let inInfo = new EiInfo();
inInfo.set("result-0-bizId", $("#inqu_status-0-bizId").val());
inInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
inInfo.set("result-0-docId", e.response.docId);
inInfo.set("result-0-docName", e.response.docName);
var index = e.response.docName.lastIndexOf(".");
var type = index == -1 ? e.response.docType : e.response.docName.substring(index + 1);
inInfo.set("result-0-docType", type);
EiCommunicator.send('HPDM099', 'upload', inInfo, {
onSuccess(res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(e);
} else {
message(res.msg);
}
},
onFail(msg, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {async: false});
}
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<EF:EFPage title="附件上传"> <EF:EFPage title="附件上传">
<EF:EFRegion id="result" title="请选择文件"> <EF:EFRegion id="result" title="请选择文件">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="fj_file" path="biz"/> <EF:EFInput ename="bizId" cname="业务ID" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput ename="bizType" cname="业务类型" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFUpload blockId="result" ename="uploadFile" docTag="fj_file" path="biz"/>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
...@@ -15,6 +15,8 @@ $(function () { ...@@ -15,6 +15,8 @@ $(function () {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="modify(\'' + item.afterSaleNo + '\')" >修改</a>&nbsp;&nbsp;'; + 'onclick="modify(\'' + item.afterSaleNo + '\')" >修改</a>&nbsp;&nbsp;';
} }
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.afterSaleNo + '\')" >附件清单</a>';
return template; return template;
} }
}], }],
...@@ -34,7 +36,9 @@ $(function () { ...@@ -34,7 +36,9 @@ $(function () {
// 删除 // 删除
$("#REMOVE").on("click", remove); $("#REMOVE").on("click", remove);
// 处理 // 处理
$("#CHECK").on("click", check); $("#DEAL").on("click", deal);
// 确认处理
$("#DEAL_CONFIRM").on("click", dealConfirm);
// 键盘按键 // 键盘按键
downKeyUp(); downKeyUp();
}); });
...@@ -111,20 +115,55 @@ function remove() { ...@@ -111,20 +115,55 @@ function remove() {
} }
/** /**
* 审核 * 处理
* *
* @param id * @param id
* @param auditStatus * @param auditStatus
*/ */
function check(id) { function deal(id) {
var rows = resultGrid.getCheckedRows(); var rows = resultGrid.getCheckedRows();
if (rows.length == 0) { if (rows.length == 0) {
message("请先勾选数据!"); message("请先勾选数据!");
return; return;
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"处理\"操作?", { JSUtils.confirm("确定对勾选中的" + rows.length + "条数据做\"处理\"操作?", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPFW001", "check", true); $("#dealWindow").data("kendoWindow").center();
$("#dealWindow").data("kendoWindow").open();
} }
}) })
} }
/**
* 确认处理
*/
function dealConfirm() {
let content = $("#deal-0-content").val();
if (isBlank(content)) {
message("请输入处理内容");
return;
}
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-content", content);
JSUtils.submitGridsData("result", "HPFW001", "deal", true,
function (res) {
if (res.status > -1) {
$("#dealWindow").data("kendoWindow").close();
}
}, inInfo
);
}
/**
* 附件清单
*
* @param bizId
*/
function showUploadFile(bizId) {
JSColorbox.open({
href: "HPFW001A?inqu_status-0-bizId=" + bizId,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="customId" cname="客户ID" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="customId" cname="客户ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="customName" cname="客户名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="customName" cname="客户名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="dealUserId" cname="处理人ID" enable="false" width="120" align="center"/> <EF:EFColumn ename="dealContent" cname="处理内容" enable="false" width="220" align="left"/>
<EF:EFColumn ename="dealUserName" cname="处理人名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="dealUserName" cname="处理人名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="dealUserName" cname="处理人名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
...@@ -55,3 +56,12 @@ ...@@ -55,3 +56,12 @@
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
<EF:EFWindow id="dealWindow" title="处理内容" width="50%" height="30%">
<EF:EFRegion id="deal" title="">
<div class="row">
<EF:EFInput blockId="deal" row="0" ename="content" cname="处理内容" colWidth="12" ratio="2:10"
type="textarea" rows="4" required="true"/>
</div>
</EF:EFRegion>
</EF:EFWindow>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#REMOVE").on("click", remove);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
// 隐藏按钮
showButton();
});
/**
* 查询
*/
let query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 显示按钮,如果提交了,则不能修改
*/
let showButton = function () {
let status = $("#detail-0-status").val();
if (!isBlank(status) && status === "0") {
$('#UPLOAD_FILE').show();
$('#REMOVE').show();
} else {
$('#UPLOAD_FILE').hide();
$('#REMOVE').hide();
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile() {
let bizId = $("#inqu_status-0-bizId").val();
let bizType = $("#inqu_status-0-bizType").val();
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-afterSaleNo", bizId);
EiCommunicator.send('HPFW001', 'checkStatus', inInfo, {
onSuccess(res) {
if (res.status !== -1) {
let params = {
"inqu_status-0-bizId": bizId,
"inqu_status-0-bizType": bizType
}
JSColorbox.open({
href: "HPDM099A",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
params: params,
callbackName: uploadFileCallback
});
} else {
message(res.msg);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(e) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPFW001A", "remove", true);
}
});
}
<!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:EFInput cname="售后服务ID" ename="id" blockId="detail" row="0" type="hidden"/>
<EF:EFInput cname="售后服务单状态" ename="status" blockId="detail" row="0" type="hidden"/>
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="AFTER_SALE"/>
<div class="row">
<EF:EFInput cname="售后服务单号" ename="bizId" blockId="inqu_status" row="0" readonly="true"/>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="120"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -32,6 +32,7 @@ $(function () { ...@@ -32,6 +32,7 @@ $(function () {
}, },
"detail": { "detail": {
exportGrid: false, exportGrid: false,
pageable: false,
columns: [] columns: []
} }
} }
...@@ -39,9 +40,6 @@ $(function () { ...@@ -39,9 +40,6 @@ $(function () {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 保存
$("#SAVE").on("click", save);
// 完成 // 完成
$("#COMPLETE").on("click", complete); $("#COMPLETE").on("click", complete);
...@@ -65,36 +63,6 @@ $(window).load(function () { ...@@ -65,36 +63,6 @@ $(window).load(function () {
}); });
/** /**
* 保存
*/
function save() {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
let item = rows[i];
let completeStatus = item['completeStatus'];
let inventName = item['inventName'];
let groupCode = item['groupCode'];
if (completeStatus === "1") {
message("物料【" + inventName + "】的状态不是\"未完成\",不能进行修改");
return;
}
if (isBlank(groupCode)) {
message("物料【" + inventName + "】的生产组不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("detail", "HPSC0061", "save", true);
}
});
}
/**
* 完成 * 完成
*/ */
let complete = function () { let complete = function () {
...@@ -105,14 +73,9 @@ let complete = function () { ...@@ -105,14 +73,9 @@ let complete = function () {
} }
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
let item = rows[i]; let item = rows[i];
let id = item['id'];
let completeStatus = item['completeStatus']; let completeStatus = item['completeStatus'];
let inventName = item['inventName']; let inventName = item['inventName'];
let groupCode = item['groupCode']; let groupCode = item['groupCode'];
if (isBlank(id) || id == 0) {
message("物料【" + inventName + "】请先设置生产组,且保存后再进行\"完成\"操作");
return;
}
if (completeStatus === "1") { if (completeStatus === "1") {
message("物料【" + inventName + "】的状态不是\"未完成\",不能进行操作"); message("物料【" + inventName + "】的状态不是\"未完成\",不能进行操作");
return; return;
......
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