Commit 5d532a82 by liuyang

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

 Conflicts:
	src/main/java/com/baosight/hpjx/hp/constant/HPConstant.java
parents bc8f28c2 6cf9f7f8
package com.baosight.hpjx.core.dao;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.data.DaoEPBase;
......@@ -120,7 +119,7 @@ public class DaoUtils {
}
try {
BeanUtils.setProperty(bean, "createdBy", userId);
BeanUtils.setProperty(bean, "updatedBy", "");
BeanUtils.setProperty(bean, "updatedBy", userId);
} catch (Exception e) {
log.warn("写入创建人ID失败", e);
}
......@@ -133,7 +132,7 @@ public class DaoUtils {
userName = "System";
}
BeanUtils.setProperty(bean, "createdName", userName);
BeanUtils.setProperty(bean, "updatedName", "");
BeanUtils.setProperty(bean, "updatedName", userName);
} catch (Exception e) {
log.warn("写入创建人姓名失败", e);
}
......@@ -155,8 +154,9 @@ public class DaoUtils {
}
// 创建时刻
try {
BeanUtils.setProperty(bean, "createdTime", DateUtils.shortDateTime());
BeanUtils.setProperty(bean, "updatedTime", "");
String dateTime = DateUtils.shortDateTime();
BeanUtils.setProperty(bean, "createdTime", dateTime);
BeanUtils.setProperty(bean, "updatedTime", dateTime);
} catch (Exception e) {
log.error("写入创建时刻失败:{}", e.getMessage(), e);
}
......@@ -179,7 +179,7 @@ public class DaoUtils {
userId = "System";
}
map.put("createdBy", userId);
map.put("updatedBy", "");
map.put("updatedBy", userId);
// 创建人姓名
String userName = MapUtils.getString(map, "createdName");
try {
......@@ -190,7 +190,7 @@ public class DaoUtils {
userName = "System";
}
map.put("createdName", userName);
map.put("updatedName", "");
map.put("updatedName", userName);
// 创建人企业编码
String companyCode = UserSessionUtils.getCompanyCode();
AssertUtils.isEmpty(companyCode, "当前用户未绑定公司,无法操作数据,请联系管理员!");
......@@ -209,8 +209,9 @@ public class DaoUtils {
}
// 创建时刻
try {
map.put("createdTime", DateUtils.shortDateTime());
map.put("updatedTime", "");
String dateTime = DateUtils.shortDateTime();
map.put("createdTime", dateTime);
map.put("updatedTime", dateTime);
} catch (PlatException e) {
log.warn("写入创建时刻失败", e);
}
......
......@@ -97,6 +97,10 @@ public class HPConstant {
public static final String HPCW002_BILL_NUMBER = "HPCW002_BILL_NUMBER";
public static final String WD_FILE_ID = "WD_FILE_ID";
// 售后单号
public static final String AFTER_SALE_NO = "AFTER_SALE_NO";
// 客户关怀单号
public static final String CARE_NO = "CARE_NO";
}
/**
......@@ -129,4 +133,17 @@ public class HPConstant {
public static final Integer S_1 = 1;
}
/**
* 处理状态
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class dealStatus {
// 未处理
public static final Integer S0 = 0;
// 已处理
public static final Integer S1 = 1;
}
}
......@@ -368,9 +368,9 @@ public class HPSqlConstant {
// 更新完成数量
public static final String UPDATE_COMPLETE_NUM = "HPSC005A.updateCompleteNum";
}
public class HPSC006 {
// 锁
public static final String LOCK = "HPSC006.lock";
// 更新完成数量
......@@ -378,6 +378,18 @@ public class HPSqlConstant {
}
/**
* HPSC0061 定义
*
* @author:songx
* @date:2024/9/26,10:08
*/
public class HPSC0061 {
// 锁
public static final String LOCK = "HPSC0061.lock";
}
/**
* 质量巡检单
*
* @author:songx
......
......@@ -36,6 +36,9 @@ public class HPDM099 extends DaoEPBase {
public static final String FIELD_BIZ_ID = "bizId"; /* 业务ID*/
public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/
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_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -51,6 +54,9 @@ public class HPDM099 extends DaoEPBase {
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_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 COUNT = "HPDM099.count";
......@@ -72,6 +78,9 @@ public class HPDM099 extends DaoEPBase {
private String bizId = " "; /* 业务ID*/
private String docId = " "; /* 文件ID*/
private String docName = " "; /* 文件名称*/
private String docType = " "; /* 文件类型*/
private Integer previewNum = new Integer(0); /* 预览次数*/
private Integer downloadNum = new Integer(0); /* 下载次数*/
/**
* initialize the metadata.
......@@ -135,7 +144,18 @@ public class HPDM099 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件名称");
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 {
* @return the docName
*/
public String getDocName() {
return this.getDocName();
return docName;
}
/**
......@@ -369,6 +389,48 @@ public class HPDM099 extends DaoEPBase {
public void setDocName(String 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.
*
......@@ -390,7 +452,9 @@ public class HPDM099 extends DaoEPBase {
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_TYPE)), bizType));
setBizId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_ID)), bizId));
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 {
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_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;
}
......
......@@ -49,12 +49,7 @@ public class ServiceHPDM099 extends ServiceEPBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 文件存储位置
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());
}
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -3,72 +3,51 @@
<sqlMap namespace="HPDM099">
<sql id="column">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.BIZ_TYPE as "bizType", <!-- 业务类型 -->
A.BIZ_ID as "bizId", <!-- 业务ID -->
A.DOC_ID as "docId" <!-- 文件ID -->
</sql>
<sql id="columnLocal">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnS3">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
BIZ_TYPE as "bizType", <!-- 业务类型 -->
BIZ_ID as "bizId", <!-- 业务ID -->
DOC_ID as "docId", <!-- 文件ID -->
DOC_NAME as "docName", <!-- 文件名称 -->
DOC_TYPE as "docType", <!-- 文件类型 -->
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum" <!-- 下载次数 -->
</sql>
<sql id="condition">
AND A.DELETE_FLAG = '0'
AND DELETE_FLAG = '0'
<include refid="SqlBase.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
A.BIZ_TYPE = #bizType#
BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizId">
A.BIZ_ID = #bizId#
BIZ_ID = #bizId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
DOC_ID = #docId#
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.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#, '%')
CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
......@@ -78,41 +57,25 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.ID asc
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="queryLocal" resultClass="com.baosight.hpjx.hp.dm.domain.HPDM099">
<select id="query" resultClass="com.baosight.hpjx.hp.dm.domain.HPDM099">
SELECT
<include refid="columnLocal"/>
FROM ${hpjxSchema}.T_HPDM099 A, ${platSchema}.TEUDM02 B
<include refid="column"/>
FROM ${hpjxSchema}.T_HPDM099
WHERE 1=1
<include refid="conditionLocal"/>
<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="customCondition"/>
<include refid="orderBy"/>
</select>
<select id="countS3" resultClass="int">
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hpjxSchema}.T_HPDM099 A, ${platSchema}.TEUDM05 B
FROM ${hpjxSchema}.T_HPDM099
WHERE 1=1
<include refid="conditionS3"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
......@@ -122,20 +85,54 @@
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 -->
BIZ_TYPE, <!-- 业务类型 -->
BIZ_ID, <!-- 业务ID -->
DOC_ID <!-- 文件ID -->
DOC_ID, <!-- 文件ID -->
DOC_NAME, <!-- 文件名称 -->
DOC_TYPE <!-- 文件类型 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#
#updatedBy#, #updatedName#, #updatedTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#
)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPDM099
SET DELETE_FLAG = '1'
<delete id="deleteBizId">
UPDATE ${hpjxSchema}.T_HPDM099
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#
</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>
package com.baosight.hpjx.hp.fw.constant;
/**
* @author:songx
* @date:2024/9/24,17:53
*/
public class HpFwConstant {
/**
* HPFW001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HpFw001 {
}
/**
* HPFW001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HpFw002 {
}
}
package com.baosight.hpjx.hp.fw.constant;
/**
* @author:songx
* @date:2024/9/24,18:09
*/
public class HpFwSqlConstant {
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpFw001 {
// 锁
public static final String LOCK = "HPFW001.lock";
// 修改
public static final String UPDATE_DEAL = "HPFW001.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpFw002 {
// 锁
public static final String LOCK = "HPFW002.lock";
// 修改
public static final String UPDATE_DEAL = "HPFW002.updateDeal";
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
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.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
import java.util.Map;
/**
* 售后服务
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPFW001 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW001().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "售后维修", operType = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPFW001.FIELD_AFTER_SALE_DATE,
DateUtils.formatShort(queryMap.get(HPFW001.FIELD_AFTER_SALE_DATE)));
inInfo = super.query(inInfo, HPFW001.QUERY, new HPFW001());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HPFW001> fFw001s = MapUtils.toDaoEPBases(inInfo, HPFW001.class);
// db数据
Map<String, HPFW001> dbFw001Map = HpFwUtils.HpFw001.lockAndGet(fFw001s);
// 数据校验
this.checkRemoveData(fFw001s, dbFw001Map);
// 保存数据
this.removeData(fFw001s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw001s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw001s
* @param dbFw001Map
*/
private void checkRemoveData(List<HPFW001> fFw001s, Map<String, HPFW001> dbFw001Map) {
for (HPFW001 fFw001 : fFw001s) {
String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
this.checkData(afterSaleNo, dbFw001);
}
}
/**
* 数据保存
*
* @param fFw001s
*/
private void removeData(List<HPFW001> fFw001s) {
for (HPFW001 fFw001 : fFw001s) {
fFw001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPFW001.DELETE, fFw001.toMap());
}
}
/**
* 检查状态
*
* @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
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo deal(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HPFW001> fFw001s = MapUtils.toDaoEPBases(inInfo, HPFW001.class);
// db数据
Map<String, HPFW001> dbFw001Map = HpFwUtils.HpFw001.lockAndGet(fFw001s);
// 数据校验
this.dealCheckData(fFw001s, dbFw001Map);
// 保存数据
this.dealData(fFw001s, content);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw001s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw001s
* @param dbFw001Map
*/
private void dealCheckData(List<HPFW001> fFw001s, Map<String, HPFW001> dbFw001Map) {
for (HPFW001 fFw001 : fFw001s) {
String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
this.checkData(afterSaleNo, dbFw001);
}
}
/**
* 数据保存
*
* @param fFw001s
* @param content
*/
private void dealData(List<HPFW001> fFw001s, String content) {
for (HPFW001 fFw001 : fFw001s) {
fFw001.setDealContent(content);
fFw001.setStatus(HPConstant.dealStatus.S1);
fFw001.setDealUserId(UserSessionUtils.getLoginName());
fFw001.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HpFwSqlConstant.HpFw001.UPDATE_DEAL, fFw001.toMap());
}
}
/**
* 数据校验
*
* @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);
}
}
package com.baosight.hpjx.hp.fw.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.hp.constant.HPConstant;
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.CommonMethod;
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.StringUtils;
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 com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPFW001B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
this.setBaseInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
HPFW001 fFw001 = MapUtils.toDaoEPBase(inInfo, HPFW001.class);
fFw001.setAfterSaleDate(DateUtils.formatShort(fFw001.getAfterSaleDate()));
if (StringUtils.isBlank(fFw001.getAfterSaleNo())) {
this.add(fFw001);
} else {
this.modify(fFw001);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw001
*/
private void add(HPFW001 fFw001) {
fFw001.setAfterSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.AFTER_SALE_NO));
fFw001.setStatus(HPConstant.dealStatus.S0);
fFw001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPFW001.INSERT, fFw001);
}
/**
* 修改数据
*
* @param fFw001
*/
private void modify(HPFW001 fFw001) {
HPFW001 dbFw001 = HpFwUtils.HpFw001.lockAndGet(fFw001);
this.checkData(fFw001, dbFw001);
DaoUtils.update(HPFW001.UPDATE, fFw001);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String afterSaleNo = MapUtils.getString(queryRow, HPFW001.FIELD_AFTER_SALE_NO);
if (StringUtils.isBlank(afterSaleNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpFwTools.HpFw001.get(afterSaleNo));
resultBlock.addBlockMeta(new HPFW001().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw001
* @param dbFw001
*/
private void checkData(HPFW001 fFw001, HPFW001 dbFw001) {
AssertUtils.isNull(dbFw001, String.format("售后服务单【%s】不存在", fFw001.getAfterSaleNo()));
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()));
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
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.domain.HPFW002;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
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.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
import java.util.Map;
/**
* 客户关怀
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPFW002 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW002().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "售后维修", operType = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPFW002.FIELD_CARE_DATE,
DateUtils.formatShort(queryMap.get(HPFW002.FIELD_CARE_DATE)));
inInfo = super.query(inInfo, HPFW002.QUERY, new HPFW002());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HPFW002> fFw002s = MapUtils.toDaoEPBases(inInfo, HPFW002.class);
// db数据
Map<String, HPFW002> dbFw002Map = HpFwUtils.HpFw002.lockAndGet(fFw002s);
// 数据校验
this.checkRemoveData(fFw002s, dbFw002Map);
// 保存数据
this.removeData(fFw002s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw002s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw002s
* @param dbFw002Map
*/
private void checkRemoveData(List<HPFW002> fFw002s, Map<String, HPFW002> dbFw002Map) {
for (HPFW002 fFw002 : fFw002s) {
String careNo = fFw002.getCareNo();
HPFW002 dbFw002 = dbFw002Map.get(careNo);
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw002.getStatus(),
String.format("客户关怀单[%s]状态不是\"待处理\",不允许操作", careNo));
}
}
/**
* 数据保存
*
* @param fFw002s
*/
private void removeData(List<HPFW002> fFw002s) {
for (HPFW002 fFw002 : fFw002s) {
fFw002.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPFW002.DELETE, fFw002.toMap());
}
}
/**
* 处理
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo check(EiInfo inInfo) {
try {
List<HPFW002> fFw002s = MapUtils.toDaoEPBases(inInfo, HPFW002.class);
// db数据
Map<String, HPFW002> dbFw002Map = HpFwUtils.HpFw002.lockAndGet(fFw002s);
// 数据校验
this.checkCheckData(fFw002s, dbFw002Map);
// 保存数据
this.checkData(fFw002s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw002s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw002s
* @param dbFw002Map
*/
private void checkCheckData(List<HPFW002> fFw002s, Map<String, HPFW002> dbFw002Map) {
for (HPFW002 fFw002 : fFw002s) {
String careNo = fFw002.getCareNo();
HPFW002 dbFw002 = dbFw002Map.get(careNo);
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw002.getStatus(),
String.format("客户关怀单[%s]状态不是\"待处理\",不允许操作", careNo));
}
}
/**
* 数据保存
*
* @param fFw002s
*/
private void checkData(List<HPFW002> fFw002s) {
for (HPFW002 fFw002 : fFw002s) {
fFw002.setStatus(HPConstant.dealStatus.S1);
fFw002.setDealUserId(UserSessionUtils.getLoginName());
fFw002.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HpFwSqlConstant.HpFw002.UPDATE_DEAL, fFw002.toMap());
}
}
}
package com.baosight.hpjx.hp.fw.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.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
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.CommonMethod;
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.StringUtils;
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 com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPFW002B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
this.setBaseInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
HPFW002 fFw002 = MapUtils.toDaoEPBase(inInfo, HPFW002.class);
fFw002.setCareDate(DateUtils.formatShort(fFw002.getCareDate()));
if (StringUtils.isBlank(fFw002.getCareNo())) {
this.add(fFw002);
} else {
this.modify(fFw002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw002
*/
private void add(HPFW002 fFw002) {
fFw002.setCareNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CARE_NO));
fFw002.setStatus(HPConstant.dealStatus.S0);
fFw002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPFW002.INSERT, fFw002);
}
/**
* 修改数据
*
* @param fFw002
*/
private void modify(HPFW002 fFw002) {
HPFW002 dbFw002 = HpFwUtils.HpFw002.lockAndGet(fFw002);
this.checkData(fFw002, dbFw002);
DaoUtils.update(HPFW002.UPDATE, fFw002);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String careNo = MapUtils.getString(queryRow, HPFW002.FIELD_CARE_NO);
if (StringUtils.isBlank(careNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpFwTools.HpFw002.get(careNo));
resultBlock.addBlockMeta(new HPFW002().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw002
* @param dbFw002
*/
private void checkData(HPFW002 fFw002, HPFW002 dbFw002) {
String careNo = fFw002.getCareNo();
AssertUtils.isNull(dbFw002, String.format("客户关怀单【%s】不存在", careNo));
AssertUtils.isNotEquals(dbFw002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("客户关怀单【%s】不是\"未删除\"状态,不允许操作", careNo));
AssertUtils.isNotEquals(dbFw002.getStatus(), HPConstant.dealStatus.S0,
String.format("客户关怀单【%s】不是\"待处理\"状态,不允许操作", careNo));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPFW001">
<sql id="column">
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
STATUS as "status", <!-- 维修状态 0-未处理 1-已维修 -->
AFTER_SALE_DATE as "afterSaleDate", <!-- 售后日期 -->
AFTER_SALE_NO as "afterSaleNo", <!-- 售后单号 -->
AFTER_SALE_TYPE as "afterSaleType", <!-- 售后方式 -->
URGENCY as "urgency", <!-- 紧急程度 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
DEAL_USER_ID as "dealUserId", <!-- 处理人ID -->
DEAL_USER_NAME as "dealUserName", <!-- 处理人名称 -->
DEAL_CONTENT as "dealContent" <!-- 处理内容 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</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>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="afterSaleDate">
AFTER_SALE_DATE = #afterSaleDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="afterSaleType">
AFTER_SALE_TYPE = #afterSaleType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="urgency">
URGENCY = #urgency#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="customId">
CUSTOM_ID = #customId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="customName">
CUSTOM_NAME LIKE CONCAT('%', #customName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dealUserId">
DEAL_USER_ID = #dealUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dealUserName">
DEAL_USER_NAME LIKE CONCAT('%', #dealUserName#, '%')
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="afterSaleNo">
AFTER_SALE_NO = #afterSaleNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="afterSaleNos">
AFTER_SALE_NO IN <iterate close=")" open="(" conjunction="," property="afterSaleNos">#afterSaleNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.fw.domain.HPFW001">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPFW001 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPFW001 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPFW001 (
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 维修状态 0-未处理 1-已维修 -->
AFTER_SALE_DATE, <!-- 售后日期 -->
AFTER_SALE_NO, <!-- 售后单号 -->
AFTER_SALE_TYPE, <!-- 售后方式 -->
URGENCY, <!-- 紧急程度 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_USER_ID, <!-- 处理人ID -->
DEAL_USER_NAME <!-- 处理人名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #afterSaleDate#, #afterSaleNo#, #afterSaleType#, #urgency#, #customId#,
#customName#, #dealUserId#, #dealUserName#)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPFW001 SET DELETE_FLAG = 1 WHERE AFTER_SALE_NO = #afterSaleNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPFW001
SET
AFTER_SALE_DATE = #afterSaleDate#, <!-- 售后日期 -->
AFTER_SALE_TYPE = #afterSaleType#, <!-- 售后方式 -->
URGENCY = #urgency#, <!-- 紧急程度 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE AFTER_SALE_NO = #afterSaleNo#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPFW001
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hpjxSchema}.T_HPFW001
SET
STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
DEAL_CONTENT = #dealContent#,
<include refid="SqlBase.updateRevise"/>
WHERE AFTER_SALE_NO = #afterSaleNo#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPFW002">
<sql id="column">
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
STATUS as "status", <!-- 状态 0-未处理 1-已维修 -->
CARE_DATE as "careDate", <!-- 关怀日期 -->
CARE_NO as "careNo", <!-- 关怀单号 -->
CARE_WAY as "careWay", <!-- 关怀方式 -->
CARE_TYPE as "careType", <!-- 关怀类型 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
DEAL_USER_ID as "dealUserId", <!-- 执行人ID -->
DEAL_USER_NAME as "dealUserName" <!-- 执行人名称 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</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>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careDate">
CARE_DATE = #careDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careWay">
CARE_WAY = #careWay#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careType">
CARE_TYPE = #careType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="customId">
CUSTOM_ID = #customId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="customName">
CUSTOM_NAME LIKE CONCAT('%', #customName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dealUserId">
DEAL_USER_ID = #dealUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dealUserName">
DEAL_USER_NAME LIKE CONCAT('%', #dealUserName#, '%')
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careNo">
CARE_NO = #careNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careNos">
CARE_NO IN <iterate close=")" open="(" conjunction="," property="careNos">#careNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.fw.domain.HPFW002">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPFW002 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPFW002 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPFW002 (
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 状态 0-未处理 1-已维修 -->
CARE_DATE, <!-- 关怀日期 -->
CARE_NO, <!-- 关怀单号 -->
CARE_WAY, <!-- 关怀方式 -->
CARE_TYPE, <!-- 关怀类型 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_USER_ID, <!-- 执行人ID -->
DEAL_USER_NAME <!-- 执行人名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #careDate#, #careNo#, #careWay#, #careType#,
#customId#, #customName#, #dealUserId#, #dealUserName#)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPFW002 SET DELETE_FLAG = 1 WHERE CARE_NO = #careNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPFW002
SET
CARE_DATE = #careDate#, <!-- 关怀日期 -->
CARE_NO = #careNo#, <!-- 关怀单号 -->
CARE_WAY = #careWay#, <!-- 关怀方式 -->
CARE_TYPE = #careType#, <!-- 关怀类型 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPFW002
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hpjxSchema}.T_HPFW002
SET
STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE CARE_NO = #careNo#
</update>
</sqlMap>
package com.baosight.hpjx.hp.fw.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public class HpFwTools {
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpFw001 {
/**
* 锁.
*
* @param afterSaleNo
*/
public static void lock(String afterSaleNo) {
AssertUtils.isEmpty(afterSaleNo, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW001.FIELD_AFTER_SALE_NO, afterSaleNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw001.LOCK, paramMap);
}
/**
* 锁.
*
* @param afterSaleNos
*/
public static void lock(List<String> afterSaleNos) {
AssertUtils.isEmpty(afterSaleNos, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("afterSaleNos", afterSaleNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw001.LOCK, paramMap);
}
/**
* 查询
*
* @param afterSaleNo
* @return
*/
public static HPFW001 get(String afterSaleNo) {
AssertUtils.isEmpty(afterSaleNo, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPFW001.FIELD_AFTER_SALE_NO, afterSaleNo);
List<HPFW001> results = DaoBase.getInstance().query(HPFW001.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param afterSaleNos
* @return
*/
public static List<HPFW001> list(List<String> afterSaleNos) {
AssertUtils.isEmpty(afterSaleNos, "售后服务单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("afterSaleNos", afterSaleNos);
return DaoBase.getInstance().query(HPFW001.QUERY, paramMap);
}
/**
* 查询
*
* @param afterSaleNos
* @return
*/
public static Map<String, HPFW001> map(List<String> afterSaleNos) {
List<HPFW001> results = list(afterSaleNos);
return results.stream().collect(Collectors.toMap(HPFW001::getAfterSaleNo, item -> item));
}
}
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpFw002 {
/**
* 锁.
*
* @param careNo
*/
public static void lock(String careNo) {
AssertUtils.isEmpty(careNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW002.FIELD_CARE_NO, careNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap);
}
/**
* 锁.
*
* @param careNos
*/
public static void lock(List<String> careNos) {
AssertUtils.isEmpty(careNos, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("careNos", careNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap);
}
/**
* 查询
*
* @param careNo
* @return
*/
public static HPFW002 get(String careNo) {
AssertUtils.isEmpty(careNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPFW002.FIELD_CARE_NO, careNo);
List<HPFW002> results = DaoBase.getInstance().query(HPFW002.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param careNos
* @return
*/
public static List<HPFW002> list(List<String> careNos) {
AssertUtils.isEmpty(careNos, "客户关怀单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("careNos", careNos);
return DaoBase.getInstance().query(HPFW002.QUERY, paramMap);
}
/**
* 查询
*
* @param careNos
* @return
*/
public static Map<String, HPFW002> map(List<String> careNos) {
List<HPFW002> results = list(careNos);
return results.stream().collect(Collectors.toMap(HPFW002::getCareNo, item -> item));
}
}
}
package com.baosight.hpjx.hp.fw.utils;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.util.ObjectUtils;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/9/24,18:06
*/
public class HpFwUtils {
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpFw001 {
/**
* 锁并获取数据
*
* @param fFw001s
* @return
*/
public static Map<String, HPFW001> lockAndGet(List<HPFW001> fFw001s) {
List<String> afterSaleNos = ObjectUtils.listEpKey(fFw001s, HPFW001.FIELD_AFTER_SALE_NO);
// 锁
HpFwTools.HpFw001.lock(afterSaleNos);
// 查询数据
return HpFwTools.HpFw001.map(afterSaleNos);
}
/**
* 锁并获取数据
*
* @param fFw001
* @return
*/
public static HPFW001 lockAndGet(HPFW001 fFw001) {
return lockAndGet(fFw001.getAfterSaleNo());
}
/**
* 锁并获取数据
*
* @param afterSaleNo
* @return
*/
public static HPFW001 lockAndGet(String afterSaleNo) {
// 锁
HpFwTools.HpFw001.lock(afterSaleNo);
// 查询数据
return HpFwTools.HpFw001.get(afterSaleNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpFw002 {
/**
* 锁并获取数据
*
* @param fFw002s
* @return
*/
public static Map<String, HPFW002> lockAndGet(List<HPFW002> fFw002s) {
List<String> careNos = ObjectUtils.listEpKey(fFw002s, HPFW002.FIELD_CARE_NO);
// 锁
HpFwTools.HpFw002.lock(careNos);
// 查询数据
return HpFwTools.HpFw002.map(careNos);
}
/**
* 锁并获取数据
*
* @param fFw002
* @return
*/
public static HPFW002 lockAndGet(HPFW002 fFw002) {
return lockAndGet(fFw002.getCareNo());
}
/**
* 锁并获取数据
*
* @param careNo
* @return
*/
public static HPFW002 lockAndGet(String careNo) {
// 锁
HpFwTools.HpFw002.lock(careNo);
// 查询数据
return HpFwTools.HpFw002.get(careNo);
}
}
}
......@@ -183,8 +183,8 @@ public class HPKC003 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setScaleLength(1);
eiColumn.setFieldLength(15);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
......
package com.baosight.hpjx.hp.sc.constant;
/**
* @author:songx
* @date:2024/9/25,10:06
*/
public class HpScConst {
/**
* 完成状态
*
* @author:songx
* @date:2024/9/25,10:07
*/
public static class CompleteStatus {
// 未完成
public static final Integer S0 = 0;
// 已完成
public static final Integer S1 = 1;
// 部分完成
public static final Integer S2 = 2;
}
}
......@@ -72,6 +72,7 @@ public class HPSC005 extends DaoEPBase {
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_MAT_ID = "matId"; /* 材料ID*/
public static final String FIELD_DELIVERY_DATE = "deliveryDate";
public static final String FIELD_COMPLETE_STATUS = "completeStatus"; /* 完成状态*/
public static final String COL_MAT_ID = "MAT_ID"; /* 材料ID*/
public static final String COL_ID = "ID";
......@@ -122,6 +123,7 @@ public class HPSC005 extends DaoEPBase {
public static final String COL_FILE_PATH5 = "FILE_PATH5"; /* 文件地址5*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE";
public static final String COL_COMPLETE_STATUS = "COMPLETE_STATUS";
public static final String QUERY = "HPSC005.query";
public static final String COUNT = "HPSC005.count";
......@@ -178,6 +180,7 @@ public class HPSC005 extends DaoEPBase {
private Long inventRecordId; /* 存货档案ID*/
private Long matId; /* 材料ID*/
private String deliveryDate = " ";
private Integer completeStatus = new Integer(0);
/**
* initialize the metadata.
......@@ -414,6 +417,10 @@ public class HPSC005 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DELIVERY_DATE);
eiColumn.setDescName("交货日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPLETE_STATUS);
eiColumn.setDescName("完成状态");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -1192,7 +1199,15 @@ public class HPSC005 extends DaoEPBase {
public void setDeliveryDate(String deliveryDate) {
this.deliveryDate = deliveryDate;
}
public Integer getCompleteStatus() {
return completeStatus;
}
public void setCompleteStatus(Integer completeStatus) {
this.completeStatus = completeStatus;
}
/**
* get the value from Map.
*
......@@ -1250,6 +1265,7 @@ public class HPSC005 extends DaoEPBase {
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setCompleteStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_COMPLETE_STATUS)), completeStatus));
}
......@@ -1309,6 +1325,7 @@ public class HPSC005 extends DaoEPBase {
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
map.put(FIELD_COMPLETE_STATUS, StringUtils.toString(completeStatus, eiMetadata.getMeta(FIELD_COMPLETE_STATUS)));
return map;
}
......
......@@ -56,6 +56,7 @@ public class HPSC006 extends DaoEPBase {
public static final String FIELD_FILE_PATH1 = "filePath1"; /* 文件地址1*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_COMPLETE_STATUS = "completeStatus"; /* 完成状态*/
public static final String FIELD_PRDT_NAME = "prdtName"; /* 产品名称*/
public static final String FIELD_PART_NAME = "partName"; /* 零件名称*/
......@@ -104,6 +105,7 @@ public class HPSC006 extends DaoEPBase {
public static final String COL_CUT_SCHEDULE = "CUT_SCHEDULE"; /* 下料进度*/
public static final String COL_REQ_NUM = "REQ_NUM"; /* 领料记录*/
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE";
public static final String COL_COMPLETE_STATUS = "COMPLETE_STATUS";
public static final String QUERY = "HPSC006.query";
......@@ -161,6 +163,7 @@ public class HPSC006 extends DaoEPBase {
private Integer reqNum = new Integer(0);
private String deliveryDate = " ";
private Integer completeStatus = new Integer(0);
/**
* initialize the metadata.
......@@ -344,6 +347,11 @@ public class HPSC006 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DELIVERY_DATE);
eiColumn.setDescName("交货日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPLETE_STATUS);
eiColumn.setDescName("完成状态");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -947,8 +955,16 @@ public class HPSC006 extends DaoEPBase {
public void setDeliveryDate(String deliveryDate) {
this.deliveryDate = deliveryDate;
}
/**
public Integer getCompleteStatus() {
return completeStatus;
}
public void setCompleteStatus(Integer completeStatus) {
this.completeStatus = completeStatus;
}
/**
* get the value from Map.
*
* @param map - source data map
......@@ -994,6 +1010,7 @@ public class HPSC006 extends DaoEPBase {
setCutSchedule(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CUT_SCHEDULE)), cutSchedule));
setReqNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REQ_NUM)), reqNum));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setCompleteStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_COMPLETE_STATUS)), completeStatus));
}
/**
......@@ -1041,6 +1058,7 @@ public class HPSC006 extends DaoEPBase {
map.put(FIELD_CUT_SCHEDULE, StringUtils.toString(cutSchedule, eiMetadata.getMeta(FIELD_CUT_SCHEDULE)));
map.put(FIELD_REQ_NUM, StringUtils.toString(reqNum, eiMetadata.getMeta(FIELD_REQ_NUM)));
map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
return map;
map.put(FIELD_COMPLETE_STATUS, StringUtils.toString(completeStatus, eiMetadata.getMeta(FIELD_COMPLETE_STATUS)));
return map;
}
}
......@@ -73,7 +73,7 @@ public class HPSC010 extends DaoEPBase {
private String registerDate = " "; /* 登记日期*/
private String factoryCode = " "; /* 工厂代码*/
private BigDecimal weight = new BigDecimal("0"); /* 产量*/
private Long userCount = new Long(0); /* 用工人数*/
private BigDecimal userCount = new BigDecimal(0); /* 用工人数*/
/**
* initialize the metadata.
......@@ -138,6 +138,9 @@ public class HPSC010 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_COUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(1);
eiColumn.setFieldLength(18);
eiColumn.setDescName("用工人数");
eiMetadata.addMeta(eiColumn);
......@@ -363,7 +366,7 @@ public class HPSC010 extends DaoEPBase {
* get the userCount - 用工人数.
* @return the userCount
*/
public Long getUserCount() {
public BigDecimal getUserCount() {
return this.userCount;
}
......@@ -372,7 +375,7 @@ public class HPSC010 extends DaoEPBase {
*
* @param userCount - 用工人数
*/
public void setUserCount(Long userCount) {
public void setUserCount(BigDecimal userCount) {
this.userCount = userCount;
}
/**
......@@ -396,7 +399,7 @@ public class HPSC010 extends DaoEPBase {
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REGISTER_DATE)), registerDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setUserCount(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_USER_COUNT)), userCount));
setUserCount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_USER_COUNT)), userCount));
}
/**
......
......@@ -92,7 +92,7 @@ public class HPSC010A extends DaoEPBase {
private BigDecimal weight = new BigDecimal("0"); /* 产量*/
private BigDecimal weightJh = new BigDecimal("0"); /* 加焊产量*/
private Integer groupUserCount = 0; /* 组用工人数*/
private BigDecimal groupUserCount = new BigDecimal(0); /* 组用工人数*/
private Integer rowNo = 0;
private Long parentId = new Long(0); /* 父级ID*/
private Integer deleteFlag; /* 是否删除0:否1.是*/
......@@ -165,6 +165,9 @@ public class HPSC010A extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_USER_COUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(1);
eiColumn.setFieldLength(20);
eiColumn.setDescName("组人数");
eiMetadata.addMeta(eiColumn);
......@@ -408,7 +411,7 @@ public class HPSC010A extends DaoEPBase {
* get the groupUserCount - 组人数.
* @return the groupUserCount
*/
public Integer getGroupUserCount() {
public BigDecimal getGroupUserCount() {
return this.groupUserCount;
}
......@@ -417,7 +420,7 @@ public class HPSC010A extends DaoEPBase {
*
* @param groupUserCount - 组人数
*/
public void setGroupUserCount(Integer groupUserCount) {
public void setGroupUserCount(BigDecimal groupUserCount) {
this.groupUserCount = groupUserCount;
}
......@@ -578,7 +581,7 @@ public class HPSC010A extends DaoEPBase {
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setWeightJh(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT_JH)), weightJh));
setGroupUserCount(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_GROUP_USER_COUNT)), groupUserCount));
setGroupUserCount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_GROUP_USER_COUNT)), groupUserCount));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
......
......@@ -84,7 +84,7 @@ public class ServiceHPSC002 extends ServiceBase {
try {
inInfo = super.query(inInfo, HPSC002.APPQUERY, new HPSC002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.constant.HpScConst;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC0061;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.sc.utils.HpScUtils;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ProjectInfo;
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.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.NumberUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/9/26,9:37
*/
public class ServiceHPSC0061 extends ServiceBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产下料", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005().eiMetadata);
inInfo.addBlock(CommonConstant.Field.DETAIL).addBlockMeta(new HPSC006().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产下料", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPSC003.FIELD_DELIVERY_DATE, DateUtils.formatShort(queryMap.get(HPSC003.FIELD_DELIVERY_DATE)));
queryMap.put(HPSC005.FIELD_WORK_DATE, DateUtils.formatShort(queryMap.get(HPSC005.FIELD_WORK_DATE)));
queryMap.put(HPSC005.FIELD_PLAN_COMPLETION_DATE,
DateUtils.formatShort(queryMap.get(HPSC005.FIELD_PLAN_COMPLETION_DATE)));
inInfo = super.query(inInfo, "HPSC005.query", new HPSC005());
// 统计各个状态数量
List<Map> statusStats = dao.query("HPSC005.statByCompleteStatus", queryMap);
inInfo.set("statusStat", statusStats);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 明细
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产下料", operType = "查询", operDesc = "查询明细")
public EiInfo queryDetail(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("prodOrderNo", inInfo.getString("prodOrderNo"));
List<HPSC0061> dbSc0061s = dao.query("HPSC0061.queryDetail", queryMap);
inInfo.addBlock(CommonConstant.Field.DETAIL).setRows(dbSc0061s);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询明细失败");
}
return inInfo;
}
/**
* 刷新主信息
*
* @param inInfo
* @param prodOrderNo
* @return
*/
private EiInfo refreshMain(EiInfo inInfo, String prodOrderNo) {
Map queryMap = new HashMap();
queryMap.put("prodOrderNo", prodOrderNo);
List<HPSC0061> dbSc0061s = dao.query("HPSC0061.queryDetail", queryMap);
inInfo.addBlock(CommonConstant.Field.DETAIL).setRows(dbSc0061s);
return inInfo;
}
/**
* 保存操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产下料", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
String prodOrderNo = inInfo.getString("prodOrderNo");
List<HPSC0061> fSc0061s = MapUtils.toDaoEPBases(inInfo, CommonConstant.Field.DETAIL, HPSC0061.class);
for (HPSC0061 fSc0061 : fSc0061s) {
String groupCode = fSc0061.getGroupCode();
AssertUtils.isEmpty(groupCode, String.format("物料【%s】的生产组不能为空,请检查", fSc0061.getInventName()));
Org groupOrg = HPXSTools.XsOrg.get(groupCode);
fSc0061.setGroupName(groupOrg.getOrgCname());
fSc0061.setFactoryCode(groupOrg.getFactoryCode());
fSc0061.setFactoryName(groupOrg.getFactoryName());
fSc0061.setProdOrderNo(prodOrderNo);
if (fSc0061.getId() == null || fSc0061.getId() == 0) {
this.add(fSc0061);
} else {
this.modify(fSc0061);
}
}
// 更新主订单状态
this.updateMainStatus(prodOrderNo);
inInfo = this.queryDetail(inInfo);
inInfo.setMsg("操作成功!本次对[" + fSc0061s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param fSc0061
*/
public void add(HPSC0061 fSc0061) {
fSc0061.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPSC0061.INSERT, fSc0061);
}
/**
* 修改操作.
*/
public void modify(HPSC0061 fSc006) {
DaoUtils.update(HPSC0061.UPDATE, fSc006);
}
/**
* 完成
*
* @param inInfo
* @return
*/
public EiInfo complete(EiInfo inInfo) {
try {
String prodOrderNo = inInfo.getString("prodOrderNo");
List<HPSC0061> fSc0061s = MapUtils.toDaoEPBases(inInfo, CommonConstant.Field.DETAIL, HPSC0061.class);
// 检查数据
this.checkCompleteData(prodOrderNo, fSc0061s);
// 写入数据
this.saveCompleteData(prodOrderNo, fSc0061s);
// 更新主订单状态
this.updateMainStatus(prodOrderNo);
// 刷新页面数据
inInfo = this.query(inInfo);
inInfo = this.refreshMain(inInfo, prodOrderNo);
inInfo.setMsg("操作成功,本次完成" + fSc0061s.size() + "条数据");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* @param prodOrderNo
* @param fSc0061s
*/
private void checkCompleteData(String prodOrderNo, List<HPSC0061> fSc0061s) {
AssertUtils.isEmpty(prodOrderNo, "请选择订单");
for (HPSC0061 fSc0061 : fSc0061s) {
AssertUtils.isEmpty(fSc0061.getGroupCode(), String.format("物料【%s】的生产组不能为空",
fSc0061.getInventName()));
}
}
/**
* 写入数据
*
* @param prodOrderNo
* @param fSc0061s
*/
private void saveCompleteData(String prodOrderNo, List<HPSC0061> fSc0061s) {
for (HPSC0061 fSc0061 : fSc0061s) {
String groupCode = fSc0061.getGroupCode();
AssertUtils.isEmpty(groupCode, String.format("物料【%s】的生产组不能为空,请检查", fSc0061.getInventName()));
Org groupOrg = HPXSTools.XsOrg.get(groupCode);
fSc0061.setGroupName(groupOrg.getOrgCname());
fSc0061.setFactoryCode(groupOrg.getFactoryCode());
fSc0061.setFactoryName(groupOrg.getFactoryName());
fSc0061.setProdOrderNo(prodOrderNo);
fSc0061.setCompleteStatus(HpScConst.CompleteStatus.S1);
this.add(fSc0061);
}
}
/**
* 更新主订单状态
*
* @param prodOrderNo
*/
private void updateMainStatus(String prodOrderNo) {
Integer completeStatus = calcCompleteStatus(prodOrderNo);
Map paramMap = new HashMap();
paramMap.put(HPSC005.FIELD_PROD_ORDER_NO, prodOrderNo);
paramMap.put(HPSC0061.FIELD_COMPLETE_STATUS, completeStatus);
DaoUtils.update("HPSC005.updateCompleteStatus", paramMap);
}
/**
* 计算完成状态
*
* @param prodOrderNo
* @return
*/
private Integer calcCompleteStatus(String prodOrderNo) {
List<HPSC0061> dbSc0061s = HPSCTools.HpSc0061.getDetailByOrder(prodOrderNo);
List<Integer> statuses = dbSc0061s.stream().map(HPSC0061::getCompleteStatus).distinct()
.collect(Collectors.toList());
if (statuses.size() > 1) {
return HpScConst.CompleteStatus.S2;
} else {
return statuses.get(0);
}
}
}
......@@ -81,6 +81,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HPSC010 hpsc010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List<Map> list = eiBlock.getRows();
......@@ -99,7 +100,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
hpsc010.setWeight(BigDecimal.valueOf(weight/2));
hpsc010.setId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_ID)));
hpsc010.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpsc010.setUserCount(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_USER_COUNT)));
hpsc010.setUserCount(MapUtils.getBigDecimal(queryMap, HPSC010.FIELD_USER_COUNT));
DaoUtils.update(HPSC010.UPDATE, hpsc010);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......@@ -119,17 +120,18 @@ public class ServiceHPSC010 extends ServiceEPBase {
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HPSC010 hpxs010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List<Map> list = eiBlock.getRows();
list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
double weight = 0;
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
Map queryMap = new HashMap();
queryMap.put(HPSC010.FIELD_FACTORY_CODE,list.get(0).get(HPSC010.FIELD_FACTORY_CODE));
queryMap.put(HPSC010.FIELD_REGISTER_DATE,StringUtil.removeHorizontalLine(registerDate));
queryMap.put(HPSC010.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
queryFactoryCode(inInfo,queryMap);
Map paramMap = new HashMap();
paramMap.put(HPSC010.FIELD_FACTORY_CODE,list.get(0).get(HPSC010.FIELD_FACTORY_CODE));
paramMap.put(HPSC010.FIELD_REGISTER_DATE,StringUtil.removeHorizontalLine(registerDate));
paramMap.put(HPSC010.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
queryFactoryCode(inInfo,paramMap);
for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i);
HPSC010A hpsc010A = new HPSC010A();
......@@ -138,10 +140,10 @@ public class ServiceHPSC010 extends ServiceEPBase {
}
hpxs010.fromMap(eiBlock.getRow(0));
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpxs010.setWeight(BigDecimal.valueOf(weight/2));
hpxs010.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs010.setUserCount(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_USER_COUNT)));
DaoUtils.insert(HPSC010.INSERT, hpxs010);
hpxs010.setWeight(BigDecimal.valueOf(weight / 2));
hpxs010.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs010.setUserCount(MapUtils.getBigDecimal(queryMap, HPSC010.FIELD_USER_COUNT));
DaoUtils.insert(HPSC010.INSERT, hpxs010);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
......@@ -165,4 +167,4 @@ public class ServiceHPSC010 extends ServiceEPBase {
AssertUtils.isNotEmpty(hpsc010List, String.format("日期[%s]工厂数据以存在,添加失败!",
queryMap.get(HPSC010.FIELD_REGISTER_DATE)));
}
}
\ No newline at end of file
}
......@@ -204,28 +204,39 @@
<include refid="order"/>
</select>
<select id="appQuery" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002">
<select id="appQuery" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002">
SELECT * FROM (
SELECT
<include refid="column1"/>
,ifnull(C.CKNUM,0) as "cknum",ifnull(C.RKNUM,0) as "rknum",ifnull(C.PROJ_STATUS,1) as "projStatus"
FROM ${hpjxSchema}.t_hpsc002 A
LEFT JOIN ${hpjxSchema}.t_hpsc005 B on A.ID = B.MAT_ID
LEFT JOIN (select A.COMPANY_CODE,A.PROJ_CODE,A.PRDT_CODE,A.PARENT_PRDT_NAME,sum(ifnull(A.NUM,0)) as JHNUM,sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) as RKNUM,sum(ifnull(B.AMOUNT,0)) as CKNUM,
LEFT JOIN (select A.COMPANY_CODE,A.PROJ_CODE,A.PRDT_CODE,A.PARENT_PRDT_NAME,
A.LENGTH, A.WIDTH, A.THICK,
sum(ifnull(A.NUM,0)) as JHNUM,sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) as RKNUM,sum(ifnull(B.AMOUNT,0)) as CKNUM,
case when sum(ifnull(A.NUM,0)) <![CDATA[ <> ]]> sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) and sum(ifnull(A.NUM,0)) <![CDATA[ <> ]]> sum(ifnull(B.AMOUNT,0)) then 1
when sum(ifnull(A.NUM,0)) = sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) and sum(ifnull(A.NUM,0)) <![CDATA[ <> ]]> sum(ifnull(B.AMOUNT,0)) then 2
when sum(ifnull(A.NUM,0)) = sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) and sum(ifnull(A.NUM,0)) = sum(ifnull(B.AMOUNT,0)) then 3 else 0 end as PROJ_STATUS
from ${hpjxSchema}.T_HPSC004 a
left join ${hpjxSchema}.T_HPKC004 b on a.PROJ_CODE = b.PROJ_CODE and a.PRDT_CODE = b.SUB_INVENT_CODE
group by A.COMPANY_CODE,A.PROJ_CODE,A.PRDT_CODE,A.PARENT_PRDT_NAME) C on A.COMPANY_CODE = C.COMPANY_CODE and A.PROJ_CODE = C.PROJ_CODE
and A.PARENT_PRDT_NAME = C.PARENT_PRDT_NAME and A.PRDT_CODE = C.PRDT_CODE
group by A.COMPANY_CODE,A.PROJ_CODE,A.PRDT_CODE,A.PARENT_PRDT_NAME,A.LENGTH, A.WIDTH, A.THICK) C
on A.COMPANY_CODE = C.COMPANY_CODE
and A.PROJ_CODE = C.PROJ_CODE
and A.PARENT_PRDT_NAME = C.PARENT_PRDT_NAME
and A.PRDT_CODE = C.PRDT_CODE
and A.LENGTH = C.LENGTH
and A.WIDTH = C.WIDTH
and A.THICK = C.THICK
WHERE 1=1
AND PARENT_ID NOT IN ('root')
AND DEL_STATUS = 0
<include refid="condition1"/>
) T
WHERE 1=1
<isNotEmpty prepend=" AND " property="projStatus">
C.PROJ_STATUS = #projStatus#
T.projStatus = #projStatus#
</isNotEmpty>
<include refid="order"/>
ORDER BY ID ASC
</select>
<!-- 查询统计 -->
......
......@@ -51,7 +51,8 @@
FILE_PATH4 as "filePath4", <!-- 文件地址4 -->
FILE_PATH5 as "filePath5", <!-- 文件地址5 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
DELIVERY_DATE as "deliveryDate"
DELIVERY_DATE as "deliveryDate",
COMPLETE_STATUS as "completeStatus"
</sql>
<sql id="condition">
......@@ -132,6 +133,9 @@
<isNotEmpty prepend=" AND " property="prodOrderNos">
PROD_ORDER_NO IN <iterate close=")" open="(" conjunction="," property="prodOrderNos">#prodOrderNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="completeStatus">
COMPLETE_STATUS = #completeStatus#
</isNotEmpty>
</sql>
<sql id="authCondition">
......@@ -410,4 +414,24 @@
STATUS IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty>
</select>
<!-- 修改完成状态 -->
<update id="updateCompleteStatus">
UPDATE ${hpjxSchema}.T_HPSC005
SET
COMPLETE_STATUS = #completeStatus#,
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE PROD_ORDER_NO = #prodOrderNo#
</update>
<!-- 按状态统计 -->
<select id="statByCompleteStatus" resultClass="java.util.HashMap">
SELECT COMPLETE_STATUS AS "completeStatus", COUNT(1) AS "num"
FROM ${hpjxSchema}.T_HPSC005
WHERE 1=1
<include refid="condition"/>
GROUP BY COMPLETE_STATUS
</select>
</sqlMap>
......@@ -36,11 +36,13 @@
REMARK as "remark", <!-- 备注 -->
FILE_PATH1 as "filePath1", <!-- 文件地址1 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
DELIVERY_DATE as "deliveryDate"
DELIVERY_DATE as "deliveryDate",
COMPLETE_STATUS as "completeStatus"
</sql>
<sql id="condition">
<include refid="authCondition"/>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......@@ -151,6 +153,12 @@
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......@@ -162,19 +170,18 @@
</dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC006">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC006 WHERE 1=1
<include refid="condition" />
<include refid="order" />
</select>
<select id="query" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC006">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC006 WHERE 1=1
<include refid="condition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC006 WHERE 1=1
<include refid="condition" />
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC006 WHERE 1=1
<include refid="condition"/>
</select>
<select id="queryDetail" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC006">
......@@ -236,41 +243,37 @@
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC006
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PRODUCTION_ORDER_NO = #productionOrderNo#, <!-- 生产订单号 -->
INVENT_TYPE = #inventType#, <!-- 物料类型 -->
INVENT_CODE = #inventCode#, <!-- 物料编码 -->
INVENT_NAME = #inventName#, <!-- 物料名称 -->
INVENT_LENGTH = #inventLength#, <!-- 物料-长 -->
INVENT_WIDTH = #inventWidth#, <!-- 物料-宽 -->
INVENT_THICK = #inventThick#, <!-- 物料-厚 -->
INVENT_SPEC = #inventSpec#, <!-- 物料规格 -->
MATERIAL = #material#,
PLAN_COMPLETION_DATE = #planCompletionDate#, <!-- 计划完成日期 -->
NUM = #num#, <!-- 计划数量 -->
UNIT_WT = #unitWt#, <!-- 计划单重 -->
TOTAL_WT = #totalWt#, <!-- 计划重量 -->
ACTUAL_COMPLETION_DATE = #actualCompletionDate#, <!-- 实际完工日期 -->
ACTUAL_COMPLETION_NUM = #actualCompletionNum#, <!-- 实际完工数量 -->
ACTUAL_COMPLETION_TOTAL_WT = #actualCompletionTotalWt#,
STATUS = #status#, <!-- 状态 0-计划中,1-生产中,2-已完成 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
REMARK = #remark#, <!-- 备注 -->
FILE_PATH1 = #filePath1#, <!-- 文件地址1 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案ID -->
DELIVERY_DATE = #deliveryDate#
WHERE
ID = #id#
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
INVENT_TYPE = #inventType#, <!-- 物料类型 -->
INVENT_CODE = #inventCode#, <!-- 物料编码 -->
INVENT_NAME = #inventName#, <!-- 物料名称 -->
INVENT_LENGTH = #inventLength#, <!-- 物料-长 -->
INVENT_WIDTH = #inventWidth#, <!-- 物料-宽 -->
INVENT_THICK = #inventThick#, <!-- 物料-厚 -->
INVENT_SPEC = #inventSpec#, <!-- 物料规格 -->
MATERIAL = #material#,
PLAN_COMPLETION_DATE = #planCompletionDate#, <!-- 计划完成日期 -->
NUM = #num#, <!-- 计划数量 -->
UNIT_WT = #unitWt#, <!-- 计划单重 -->
TOTAL_WT = #totalWt#, <!-- 计划重量 -->
ACTUAL_COMPLETION_DATE = #actualCompletionDate#, <!-- 实际完工日期 -->
ACTUAL_COMPLETION_NUM = #actualCompletionNum#, <!-- 实际完工数量 -->
ACTUAL_COMPLETION_TOTAL_WT = #actualCompletionTotalWt#,
STATUS = #status#, <!-- 状态 0-计划中,1-生产中,2-已完成 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
REMARK = #remark#, <!-- 备注 -->
FILE_PATH1 = #filePath1#, <!-- 文件地址1 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案ID -->
DELIVERY_DATE = #deliveryDate#,
COMPLETE_STATUS = #completeStatus#
WHERE ID = #id#
</update>
<update id="updateAssign">
......@@ -294,7 +297,11 @@
<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="updateCompleteNum">
UPDATE ${hpjxSchema}.T_HPSC006
SET
......@@ -306,4 +313,14 @@
ID = #id#
</update>
<!-- 修改完成状态 -->
<update id="updateCompleteStatus">
UPDATE ${hpjxSchema}.T_HPSC006
SET
COMPLETE_STATUS = #completeStatus#,
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPSC0061">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
INVENT_CODE as "inventCode", <!-- 物料编码 -->
INVENT_NAME as "inventName", <!-- 物料名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
GROUP_CODE as "groupCode", <!-- 生产组编码 -->
GROUP_NAME as "groupName", <!-- 生产组名称 -->
COMPLETE_STATUS as "completeStatus" <!-- 完成状态,0.未完成,1.已完成 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNo">
PROD_ORDER_NO = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="completeStatus">
COMPLETE_STATUS = #completeStatus#
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC0061">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC0061 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 ${hpjxSchema}.T_HPSC0061 WHERE 1=1
<include refid="condition"/>
</select>
<select id="queryDetail" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC0061">
SELECT
B.ID as "id",
B.PROD_ORDER_NO as "prodOrderNo",
A.INVENT_CODE as "inventCode",
A.INVENT_NAME as "inventName",
B.FACTORY_CODE as "factoryCode",
B.FACTORY_NAME as "factoryName",
B.GROUP_CODE as "groupCode",
B.GROUP_NAME as "groupName",
IFNULL(B.COMPLETE_STATUS, 0) as "completeStatus"
FROM ${hpjxSchema}.T_HPSC0061A A
LEFT JOIN ${hpjxSchema}.T_HPSC0061 B
ON A.INVENT_CODE = B.INVENT_CODE AND B.PROD_ORDER_NO = #prodOrderNo#
ORDER BY A.INVENT_CODE ASC
</select>
<select id="countDetail" resultClass="int">
SELECT COUNT(1)
FROM ${hpjxSchema}.T_HPSC0061A A
LEFT JOIN ${hpjxSchema}.T_HPSC0061 B
ON A.INVENT_CODE = B.INVENT_CODE
WHERE B.PROD_ORDER_NO = #prodOrderNo#
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC0061 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
PROD_ORDER_NO, <!-- 生产订单号 -->
INVENT_CODE, <!-- 物料编码 -->
INVENT_NAME, <!-- 物料名称 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
GROUP_CODE, <!-- 生产组编码 -->
GROUP_NAME, <!-- 生产组名称 -->
COMPLETE_STATUS <!-- 完成状态,0.未完成,1.已完成 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #prodOrderNo#, #inventCode#, #inventName#,
#factoryCode#, #factoryName#, #groupCode#, #groupName#, #completeStatus#
)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC0061 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC0061
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
GROUP_CODE = #groupCode#, <!-- 生产组编码 -->
GROUP_NAME = #groupName#, <!-- 生产组名称 -->
WHERE ID = #id#
</update>
<update id="lock">
UPDATE ${hpjxSchema}.T_HPSC0061
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="updateCompleteStatus">
UPDATE ${hpjxSchema}.T_HPSC0061
SET
COMPLETE_STATUS = #completeStatus#,
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPSC0061A">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
INVENT_CODE as "inventCode", <!-- 物料编码 -->
INVENT_NAME as "inventName" <!-- 物料名称 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC0061A">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC0061A 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 ${hpjxSchema}.T_HPSC0061A WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC0061A (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
INVENT_CODE, <!-- 物料编码 -->
INVENT_NAME <!-- 物料名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #inventCode#, #inventName#
)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC0061A WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC0061A
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
INVENT_CODE = #inventCode#, <!-- 物料编码 -->
INVENT_NAME = #inventName# <!-- 物料名称 -->
WHERE ID = #id#
</update>
</sqlMap>
......@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.core.utils.QrCodeUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -1191,8 +1192,13 @@ public class HPSCTools {
}
}
/**
*
* @author:songx
* @date:2024/9/25,9:32
*/
public static class Hpsc006 {
/**
* 锁
*
......@@ -1205,6 +1211,20 @@ public class HPSCTools {
queryMap.put("id", id);
DaoBase.getInstance().update(HPSqlConstant.HPSC006.LOCK, queryMap);
}
/**
* 锁
*
* @param ids
* @return
*/
public static void lock(List<Long> ids) {
AssertUtils.isEmpty(ids, "生产下料号不能为空");
Map queryMap = new HashMap();
queryMap.put("ids", ids);
DaoBase.getInstance().update(HPSqlConstant.HPSC006.LOCK, queryMap);
}
/**
* 更新已完成数量
*
......@@ -1253,8 +1273,142 @@ public class HPSCTools {
AssertUtils.isEmpty(results, String.format("生产订单[%s]信息不存在", productionOrderNo));
return results;
}
/**
* 查询其他入库信息
*
* @param ids
* @return
*/
public static List<HPSC006> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPSC006.QUERY, queryMap);
}
/**
* 查询其他入库信息
*
* @param ids
* @return
*/
public static Map<Long, HPSC006> map(List<Long> ids) {
List<HPSC006> results = list(ids);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPSC006::getId, item -> item));
}
}
/**
*
* @author:songx
* @date:2024/9/25,9:32
*/
public static class HpSc0061 {
/**
* 锁
*
* @param id
* @return
*/
public static void lock(Long id) {
AssertUtils.isNull(id, "生产下料号不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
DaoBase.getInstance().update(HPSqlConstant.HPSC0061.LOCK, queryMap);
}
/**
* 锁
*
* @param ids
* @return
*/
public static void lock(List<Long> ids) {
AssertUtils.isEmpty(ids, "生产下料号不能为空");
Map queryMap = new HashMap();
queryMap.put("ids", ids);
DaoBase.getInstance().update(HPSqlConstant.HPSC0061.LOCK, queryMap);
}
/**
* 查询
*
* @param id
* @return
*/
public static HPSC0061 getById(Long id) {
AssertUtils.isNull(id, "生产下料ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPSC0061> results = DaoBase.getInstance().query(HPSC0061.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param prodOrderNo
* @return
*/
public static List<HPSC0061> getByOrder(String prodOrderNo) {
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("prodOrderNo", prodOrderNo);
return DaoBase.getInstance().query(HPSC0061.QUERY, queryMap);
}
/**
* 查询
*
* @param prodOrderNo
* @return
*/
public static List<HPSC0061> getDetailByOrder(String prodOrderNo) {
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("prodOrderNo", prodOrderNo);
return DaoBase.getInstance().query("HPSC0061.queryDetail", queryMap);
}
/**
* 查询其他入库信息
*
* @param ids
* @return
*/
public static List<HPSC0061> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPSC0061.QUERY, queryMap);
}
/**
* 查询其他入库信息
*
* @param ids
* @return
*/
public static Map<Long, HPSC0061> map(List<Long> ids) {
List<HPSC0061> results = list(ids);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPSC0061::getId, item -> item));
}
}
public static class Hpsc007 {
/**
* 查询
......
package com.baosight.hpjx.hp.sc.utils;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC0061;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.ObjectUtils;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/9/25,9:29
*/
public class HpScUtils {
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpSc006 {
/**
* 锁并获取数据
*
* @param fSc006s
* @return
*/
public static Map<Long, HPSC006> lockAndGet(List<HPSC006> fSc006s) {
List<Long> ids = ObjectUtils.listEpKey(fSc006s, HPSC006.FIELD_ID);
// 锁
HPSCTools.Hpsc006.lock(ids);
// 查询数据
return HPSCTools.Hpsc006.map(ids);
}
/**
* 锁并获取数据
*
* @param id
* @return
*/
public static HPSC006 lockAndGet(Long id) {
// 锁
HPSCTools.Hpsc006.lock(id);
// 查询数据
return HPSCTools.Hpsc006.getById(id);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpSc0061 {
/**
* 锁并获取数据
*
* @param fSc0061s
* @return
*/
public static Map<Long, HPSC0061> lockAndGet(List<HPSC0061> fSc0061s) {
List<Long> ids = ObjectUtils.listEpKey(fSc0061s, HPSC0061.FIELD_ID);
// 锁
HPSCTools.HpSc0061.lock(ids);
// 查询数据
return HPSCTools.HpSc0061.map(ids);
}
/**
* 锁并获取数据
*
* @param id
* @return
*/
public static HPSC0061 lockAndGet(Long id) {
// 锁
HPSCTools.HpSc0061.lock(id);
// 查询数据
return HPSCTools.HpSc0061.getById(id);
}
}
}
......@@ -119,7 +119,7 @@ public class ServiceXS0102 extends ServiceEPBase implements LoginConstants {
return inInfo;
}
inInfoRowMap.put("accountExpireDate", DateUtils.toDateStr8(gc.getTime()));
inInfoRowMap.put("accountExpireDate", "29991231");
gc.setTime(new Date());
try {
......
<%@ page import="com.baosight.iplat4j.core.ei.EiInfo" %>
<%@ page import="com.baosight.iplat4j.core.log.Logger" %>
<%@ page import="com.baosight.iplat4j.core.log.LoggerFactory" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%@ page import="com.baosight.iplat4j.core.ei.EiConstant" %>
<%@ page import="com.baosight.iplat4j.core.service.soa.XLocalManager" %>
<%@ page import="com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext" %>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
final Logger logger = LoggerFactory.getLogger("index");
//门户插件跳转逻辑
String loginName = UserSession.getLoginName()==null? "admin":UserSession.getLoginName();
String userId = UserSession.getUserUuid();
String url = "";
String frameOpenWeb = "";
String frameOpenCname = "";
try {
EiInfo setInfo = new EiInfo();
setInfo.set("username", loginName);
setInfo.set(EiConstant.serviceName, "EDPR00");
setInfo.set(EiConstant.methodName, "queryIndexPageUrl");
logger.info("loginName" + loginName);
logger.info("调用EDPR00.queryIndexPageUrl!");
EiInfo getInfo = XLocalManager.call(setInfo);
int status = getInfo.getStatus();
if(status < 0){
logger.error("配置首页获取失败:调用EDPR00.queryIndexPageUrl失败!" + getInfo.getMsg());
}else{
if("1".equals(getInfo.get("enableStatus"))){
if ("openSeparately".equals(getInfo.get("openWith"))){
url = getInfo.get("url") + "";
}else {
frameOpenWeb = getInfo.get("url").toString();
frameOpenCname = getInfo.get("formCname").toString();
}
}
}
}catch (Exception e) {
logger.error("配置首页获取失败!" + e.getMessage(), e);
}
//以上门户插件跳转逻辑
//设置session过期时间
HttpSession currentSession = request.getSession();
String sessionTimeout= PlatApplicationContext.getProperty("iplat4j.ui.sessionTimeout");
if (!sessionTimeout.isEmpty()){
if(-1==Integer.valueOf(sessionTimeout)){
currentSession.setMaxInactiveInterval(-1);
}else{
Integer sessionTimeoutNumber =Integer.valueOf(sessionTimeout)*60;
currentSession.setMaxInactiveInterval(sessionTimeoutNumber);
}
// 获取会话的最大非活动间隔时间(单位为秒)
int maxInactiveInterval = currentSession.getMaxInactiveInterval();
int maxInactiveIntervalMinutes = maxInactiveInterval / 60;
logger.info("获取会话的最大非活动间隔时间(单位为秒)!"+maxInactiveInterval);
}
String ip="";
if (request.getHeader("x-forwarded-for") == null) {
ip=request.getRemoteAddr();
}else {
ip=request.getHeader("x-forwarded-for");
}
%>
<c:set var="url" value="<%=url%>"/>
<c:set var="frameOpenWeb" value="<%=frameOpenWeb%>"/>
<c:set var="frameOpenCname" value="<%=frameOpenCname%>"/>
<c:set var="ip" value="<%=ip%>"/>
<html lang="zh">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
</head>
<body>
</body>
<script type="text/javascript">
var load_time = new Date();
var load_label = "indexReal" + load_time.getTime();
let url = "${url}";
let frameOpenWeb = "${frameOpenWeb}";
let frameOpenCname = "${frameOpenCname}"
console.log("redirect to " + url);
var userId = '<%=userId%>';
var loginName = '<%=loginName%>';
let ip = "${ip}";
sessionStorage.setItem("userId", userId);
sessionStorage.setItem("loginName", loginName);
sessionStorage.setItem("ip", ip);
if(url != null && url != "") {
window.location.href = '${ctx}/web/' + url;
sessionStorage.removeItem("frameOpenWeb");
sessionStorage.removeItem("frameOpenCname");
} else {
if (frameOpenWeb != null && frameOpenWeb != ""){
sessionStorage.setItem("frameOpenWeb", frameOpenWeb);
sessionStorage.setItem("frameOpenCname", frameOpenCname);
}else {
sessionStorage.removeItem("frameOpenWeb");
sessionStorage.removeItem("frameOpenCname");
}
window.location.href = '${ctx}/iPlatV7-index.jsp';
}
</script>
</html>
......@@ -132,7 +132,7 @@
<script src="${iPlatStaticURL}/iplatui/assets/js/polyfills/iplat.ui.ie8.polyfills.min.js"></script>
<![endif]-->
<script src="${iPlatStaticURL}/iPlatV6-login.js"></script>
<script src="${iPlatStaticURL}/iPlatV7-login.js"></script>
<%--引入RSA加密js--%>
<script src="${iPlatStaticURL}/iplatui/js/jsencrypt.js"></script>
<%
......
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.baosight.iplat4j.core.FrameworkInfo" %>
<%@ page import="java.io.File" %>
<%
String domain = FrameworkInfo.getProjectAppTopDomain();
if (domain != null && domain.startsWith(".")) {
domain = domain.substring(1);
%>
<script type="text/javascript">
try {
document.domain = '<%= domain %>';
} catch (ex) {
alert('model not valid[<%= domain %>]');
}
</script>
<%
}
%>
<%
String directmode = request.getParameter("maintain") != null ? request.getParameter("maintain").toString() : "";
RequestDispatcher rd;
String appName = FrameworkInfo.getProjectAppName();
org.springframework.security.core.context.SecurityContextHolder.clearContext();
session.setAttribute("iplat.logout", "1");
session.invalidate();
String entryChoice = FrameworkInfo.getText("entryChoice");
String url = "/DispatchAction.do?efFormEname=ECTM40&nodeId=0000000099999999&nodeType=s&templateType=0";
if (entryChoice.equals("template")) {
//从模板进入登录页面
rd = request.getRequestDispatcher(url);
try {
rd.forward(request, response);
} catch (ServletException e1) {
e1.printStackTrace();
} finally {
out.clear();
out = pageContext.pushBody();
}
} else if (entryChoice.equals("static")) {
// 从静态页面进入登录页面
// 判断缓存文件是否存在
String requestURL = request.getRequestURL().toString();
String _url = requestURL.substring(0, requestURL.indexOf(request.getContextPath())) + request.getContextPath();
String _urlHtml = "/login.html";
java.io.File file = new java.io.File(request.getRealPath("") + _urlHtml);
if (!file.exists()) {
//生成对应的html静态文件
try {
//+url;
java.io.FileOutputStream blankFile = new java.io.FileOutputStream(request.getRealPath("") + _urlHtml);
blankFile.write(new byte[0]);
java.net.URL requestUrl = new java.net.URL(_url);
System.out.println(_url);
java.net.HttpURLConnection con = (java.net.HttpURLConnection) requestUrl.openConnection();
con.connect();
java.io.FileOutputStream fileout = new java.io.FileOutputStream(request.getRealPath("") + _urlHtml);
byte[] bytes = new byte[1024];
int len = 0;
while ((len = con.getInputStream().read(bytes)) != -1) {
fileout.write(bytes, 0, len);
}
} catch (Exception e) {
e.printStackTrace();
out.print("生成静态html文件出错!");
}
}
File _file = new File(request.getRealPath("") + _urlHtml);
if (_file.length() == 0) {
rd = request.getRequestDispatcher(url);
try {
rd.forward(request, response);
} catch (ServletException e1) {
e1.printStackTrace();
} finally {
out.clear();
out = pageContext.pushBody();
}
} else {
response.sendRedirect(request.getContextPath() + _urlHtml);
}
} else {
//以正常方式进入登录首页
rd = request.getRequestDispatcher("iPlatV7-login.jsp");
try {
rd.forward(request, response);
} catch (ServletException e1) {
e1.printStackTrace();
} finally {
out.clear();
out = pageContext.pushBody();
}
}
%>
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" monitorInterval="10">
<Properties>
<Property name="PID">mylog</Property>
<Configuration status="WARN">
<properties>
<property name="LOG_HOME">./logs</property>
<Property name="LOG_EXCEPTION_CONVERSION_WORD">%xwEx</Property>
<Property name="LOG_LEVEL_PATTERN">%5p</Property> <!--<Property name="LOG_PATTERN">%d{yyyy-MM-dd HH:mm:ss} %-5level [%thread][%file:%line] - %msg%n</Property>-->
<!--参考文档 https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout -->
<Property name="LOG_PATTERN">%highlight{%d{yyyy-MM-dd HH:mm:ss} %-5level [%thread] %logger{1.} - %msg%n%}</Property>
<Property name="filename">iplat.$${date:yyyy-MM-dd}.log</Property>
</Properties>
<Appenders> <!--<Console name="Console" target="SYSTEM_OUT" follow="true">--> <!--<PatternLayout pattern="${LOG_PATTERN}"/>--> <!--</Console>--> <!-- 用来定义输出到控制台的配置 -->
<Console name="Console" target="SYSTEM_OUT"> <!-- 设置控制台只输出error及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY" />
<PatternLayout pattern="${LOG_PATTERN}" />
<Property name="LOG_LEVEL_PATTERN">%5p</Property>
<Property name="LOG_PATTERN">%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level[%thread] %logger{1.} - %msg%n</Property>
</properties>
<Appenders>
<!--*********************控制台日志***********************-->
<Console name="Console" target="SYSTEM_OUT" follow="true">
<PatternLayout charset="GBK" pattern="${LOG_PATTERN}"/>
</Console>
<RollingRandomAccessFile name="MyFile" fileName="apps/logs/iplat.log" filePattern="apps/logs/iplat.%d{yyyy-MM-dd}-%i.log.gz">
<TextArea name="platLogAppender">
<PatternLayout pattern="%m%n"/>
</TextArea>
<!--*********************文件日志***********************-->
<!--info级别日志-->
<RollingFile name="InfoAppender" fileName="${LOG_HOME}/info.log"
filePattern="${LOG_HOME}/%d{yyyy-MM-dd}/info-%i.log.gz">
<!-- <Filters>-->
<!-- &lt;!&ndash;过滤掉warn及更高级别日志&ndash;&gt;-->
<!-- <ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>-->
<!-- </Filters>-->
<!--设置日志格式-->
<PatternLayout>
<Pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level [%thread] %logger{1.} - %msg%n%throwable{short}</Pattern>
<pattern>${LOG_PATTERN}</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
<SizeBasedTriggeringPolicy size="1024 MB" />
<!-- 设置日志文件切分参数 -->
<!--<OnStartupTriggeringPolicy/>-->
<!--设置日志基础文件大小,超过该大小就触发日志文件滚动更新-->
<SizeBasedTriggeringPolicy size="20MB"/>
<!--设置日志文件滚动更新的时间,依赖于文件命名filePattern的设置-->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<DefaultRolloverStrategy max="50" />
</RollingRandomAccessFile>
<TextArea name="platLogAppender">
<PatternLayout pattern="%m%n" />
</TextArea>
<!--设置日志的文件个数上限,不设置默认为7个,超过大小后会被覆盖;依赖于filePattern中的%i-->
<DefaultRolloverStrategy max="100"/>
</RollingFile>
<!--warn级别日志-->
<RollingFile name="WarnAppender" fileName="${LOG_HOME}/warn.log"
filePattern="${LOG_HOME}/%d{yyyy-MM-dd}/warn-%i.log.gz">
<Filters>
<!--过滤掉error及更高级别日志-->
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
</Filters>
<!--设置日志格式-->
<PatternLayout>
<pattern>${LOG_PATTERN}</pattern>
</PatternLayout>
<Policies>
<!-- 设置日志文件切分参数 -->
<!--<OnStartupTriggeringPolicy/>-->
<!--设置日志基础文件大小,超过该大小就触发日志文件滚动更新-->
<SizeBasedTriggeringPolicy size="20MB"/>
<!--设置日志文件滚动更新的时间,依赖于文件命名filePattern的设置-->
<TimeBasedTriggeringPolicy/>
</Policies>
<!--设置日志的文件个数上限,不设置默认为7个,超过大小后会被覆盖;依赖于filePattern中的%i-->
<DefaultRolloverStrategy max="100"/>
</RollingFile>
<!--error及更高级别日志-->
<RollingFile name="ErrorAppender" fileName="${LOG_HOME}/error.log"
filePattern="${LOG_HOME}/%d{yyyy-MM-dd}/error-%i.log.gz">
<!--设置日志格式-->
<PatternLayout>
<pattern>${LOG_PATTERN}</pattern>
</PatternLayout>
<Policies>
<!-- 设置日志文件切分参数 -->
<!--<OnStartupTriggeringPolicy/>-->
<!--设置日志基础文件大小,超过该大小就触发日志文件滚动更新-->
<SizeBasedTriggeringPolicy size="20MB"/>
<!--设置日志文件滚动更新的时间,依赖于文件命名filePattern的设置-->
<TimeBasedTriggeringPolicy/>
</Policies>
<!--设置日志的文件个数上限,不设置默认为7个,超过大小后会被覆盖;依赖于filePattern中的%i-->
<DefaultRolloverStrategy max="100"/>
</RollingFile>
<Async name="Async">
<AppenderRef ref="InfoAppender" level="info"/>
<AppenderRef ref="WarnAppender" level="warn"/>
<AppenderRef ref="ErrorAppender" level="error"/>
</Async>
</Appenders>
<Loggers> <!--用来增加sql的日志,无论下面root logger级别是什么都输出sql log-->
<logger name="com.baosight.iplat4j.core.data.ibatis.dao.SqlMapDaoLogProxy" level="ERROR" />
<AsyncLogger name="com.baosight.iplat4j" level="INFO" additivity="false">
<AppenderRef ref="Console" />
<AppenderRef ref="MyFile" />
<AppenderRef ref="platLogAppender" />
</AsyncLogger>
<logger name="org.springframework" level="ERROR" />
<logger name="org.thymeleaf" level="ERROR" />
<Root level="INFO">
<AppenderRef ref="Console" />
<AppenderRef ref="MyFile" />
<AppenderRef ref="platLogAppender" />
<Loggers>
<!-- 根日志设置 -->
<Root level="info">
<AppenderRef ref="Console"/>
<AppenderRef ref="Async"/>
</Root>
<!--用来增加sql的日志,无论下面root logger级别是什么都输出sql log-->
<logger name="com.baosight.iplat4j.core.data.ibatis.dao.SqlMapDaoLogProxy" level="info"/>
<!--spring日志-->
<Logger name="org.springframework" level="error"/>
<!-- mybatis日志 -->
<Logger name="com.mybatis" level="warn"/>
<Logger name="org.hibernate" level="warn"/>
<Logger name="com.zaxxer.hikari" level="warn"/>
<Logger name="org.quartz" level="warn"/>
</Loggers>
</Configuration>
......@@ -15,6 +15,10 @@
<!-- 用户服务 -->
<sqlMap resource="com/baosight/hpjx/hp/xs/sql/HPXS007A.xml"/>
<!-- 产品服务 -->
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW001.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW002.xml"/>
<!--财务服务-->
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW001.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW002.xml"/>
......
......@@ -9,10 +9,38 @@ $(function () {
}
NotificationUtil("附件上传成功");
try {
parent.JSColorbox.setValueCallback(e.response);
uploadFile(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 @@
<EF:EFPage 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:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let status = item.status;
let template = '';
if (status && status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ '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;
}
}],
loadComplete: function (grid) {
},
onSuccess: function (e) {
},
onRowClick: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 新增
$("#ADD").on("click", add);
// 删除
$("#REMOVE").on("click", remove);
// 处理
$("#DEAL").on("click", deal);
// 确认处理
$("#DEAL_CONFIRM").on("click", dealConfirm);
// 键盘按键
downKeyUp();
});
/**
* 页面加载完成
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (afterSaleNo) {
let params = "inqu_status-0-afterSaleNo=" + afterSaleNo;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HPFW001B?" + params,
title: "<div style='text-align: center;'>" + (isBlank(params) ? "新增售后服务" : "修改售后服务") + "</div>",
width: "60%",
height: "70%",
callbackName: addOrUpdateCallback
});
}
/**
* 新增成功后回调
*/
let addOrUpdateCallback = function (res) {
// 消息
message(res.msg);
// 刷新列表
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPFW001", "remove", true);
}
})
}
/**
* 处理
*
* @param id
* @param auditStatus
*/
function deal(id) {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的" + rows.length + "条数据做\"处理\"操作?", {
ok: function () {
$("#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%",
});
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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:EFDatePicker ename="afterSaleDate" cname="售后日期" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="afterSaleType" cname="售后方式" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.afterSaleType"/>
</EF:EFSelect>
<EF:EFSelect ename="status" cname="状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFSelect>
<EF:EFInput ename="customName" cname="客户名称" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFInput ename="dealUserName" cname="处理人名称" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="afterSaleNo" cname="售后单号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="afterSaleDate" cname="售后日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="afterSaleType" cname="售后方式" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.afterSaleType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="urgency" cname="紧急程度" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.afterSaleUrgency"/>
</EF:EFComboColumn>
<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="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="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" width="100" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</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>
$(function () {
IPLATUI.EFSelect = {
"result-0-customId": {
select: function (e) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = dataItem['textField'];
if (valueField) {
textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
$("#result-0-customName").val(textField);
} else {
$("#result-0-customName").val("");
}
}
}
}
IPLATUI.EFGrid = {
"result": {
pageable: false,
exportGrid: false,
toolbarConfig: {
hidden: false,
},
columns: [],
loadComplete: function (grid) {
},
onSuccess: function (e) {
}
}
};
// 确认
$('#SAVE').on('click', save);
// 键盘按键
downKeyUp();
})
/**
* 保存
*/
let save = function () {
let afterSaleDate = $("#result-0-afterSaleDate").val();
if (isBlank(afterSaleDate)) {
message("售后日期不能为空");
return;
}
let afterSaleType = $("#result-0-afterSaleType").val();
if (isBlank(afterSaleType)) {
message("售后方式不能为空");
return;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HPFW001B", "save", true, function (res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
});
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="售后服务单详情">
<EF:EFRegion id="result" title="数据区域">
<EF:EFInput cname="ID" blockId="result" ename="id" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="售后服务单号" blockId="result" ename="afterSaleNo" row="0" colWidth="6" ratio="2:10"
required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker cname="售后日期" ename="afterSaleDate" blockId="result" row="0" colWidth="6" ratio="2:10"
format="yyyy-MM-dd" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect cname="售后方式" ename="afterSaleType" blockId="result" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.afterSaleType"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="urgency" cname="紧急程度" blockId="result" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.afterSaleUrgency"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="customId" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="customName" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<br/>
<span style="color: red; ">说明:售后服务单号由系统自动生成</span><br>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let status = item.status;
let template = '';
if (status && status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="modify(\'' + item.careNo + '\')" >修改</a>&nbsp;&nbsp;';
}
return template;
}
}],
loadComplete: function (grid) {
},
onSuccess: function (e) {
},
onRowClick: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 新增
$("#ADD").on("click", add);
// 删除
$("#REMOVE").on("click", remove);
// 处理
$("#CHECK").on("click", check);
// 键盘按键
downKeyUp();
});
/**
* 页面加载完成
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (careNo) {
let params = "inqu_status-0-careNo=" + careNo;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HPFW002B?" + params,
title: "<div style='text-align: center;'>" + (isBlank(params) ? "新增客户关怀" : "修改客户关怀") + "</div>",
width: "60%",
height: "70%",
callbackName: addOrUpdateCallback
});
}
/**
* 新增成功后回调
*/
let addOrUpdateCallback = function (res) {
// 消息
message(res.msg);
// 刷新列表
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPFW002", "remove", true);
}
})
}
/**
* 处理
*
* @param id
* @param auditStatus
*/
function check(id) {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"处理\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPFW002", "check", true);
}
})
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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:EFDatePicker ename="careDate" cname="关怀日期" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="careWay" cname="关怀方式" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.careWay"/>
</EF:EFSelect>
<EF:EFSelect ename="careType" cname="关怀类型" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.careType"/>
</EF:EFSelect>
<EF:EFSelect ename="status" cname="状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput ename="customName" cname="客户名称" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput ename="dealUserName" cname="处理人名称" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="careNo" cname="关怀单号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="careDate" cname="关怀日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="careWay" cname="关怀方式" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.careWay"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="careType" cname="关怀类型" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.careType"/>
</EF:EFComboColumn>
<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="dealUserId" cname="处理人ID" 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="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" width="100" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"result-0-customId": {
select: function (e) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = dataItem['textField'];
if (valueField) {
textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
$("#result-0-customName").val(textField);
} else {
$("#result-0-customName").val("");
}
}
}
}
IPLATUI.EFGrid = {
"result": {
pageable: false,
exportGrid: false,
toolbarConfig: {
hidden: false,
},
columns: [],
loadComplete: function (grid) {
},
onSuccess: function (e) {
}
}
};
// 确认
$('#SAVE').on('click', save);
// 键盘按键
downKeyUp();
})
/**
* 保存
*/
let save = function () {
let careDate = $("#result-0-careDate").val();
if (isBlank(careDate)) {
message("关怀日期不能为空");
return;
}
let careWay = $("#result-0-careWay").val();
if (isBlank(careWay)) {
message("关怀方式不能为空");
return;
}
let careType = $("#result-0-careType").val();
if (isBlank(careType)) {
message("关怀类型不能为空");
return;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HPFW002B", "save", true, function (res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
});
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="客户关怀单详情">
<EF:EFRegion id="result" title="数据区域">
<EF:EFInput ename="id" cname="ID" blockId="result" row="0" type="hidden"/>
<div class="row">
<EF:EFInput ename="careNo" cname="客户关怀单号" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="careDate" cname="关怀日期" blockId="result" row="0" colWidth="6" ratio="2:10"
format="yyyy-MM-dd" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect ename="careWay" cname="关怀方式" blockId="result" row="0" colWidth="6" ratio="2:10">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.careWay"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="careType" cname="关怀类型" blockId="result" row="0" colWidth="6" ratio="2:10">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.careType"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="customId" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="customName" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<br/>
<span style="color: red; ">说明:客户关怀单号由系统自动生成</span><br>
</EF:EFRegion>
</EF:EFPage>
......@@ -58,7 +58,7 @@
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" width="120" align="right" format="{0:N1}"/>
<EF:EFColumn ename="weight" cname="总重(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
......
......@@ -93,8 +93,8 @@ let select = function () {
message("第" + (i + 1) + "行请选择仓库名称");
return;
}
if (!isPositiveInteger(applyNum)) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的整数");
if (!isPositiveNumber(applyNum)) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的数字");
return;
}
if (parseFloat(applyNum) > parseFloat(num) - parseFloat(completeNum)) {
......
......@@ -44,10 +44,10 @@
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="applyNum" cname="入库数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="remark1" cname="入库说明" width="150"/>
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N0}"
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N1}"
hidden="true"/>
<EF:EFColumn ename="unCompleteNum" cname="待入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unCompleteNum" cname="待入库数量" enable="false" width="120" align="right" format="{0:N1}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N1}"/>
<EF:EFColumn ename="totalWt" cname="任务重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
......
......@@ -58,7 +58,7 @@
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="100" align="right" format="{0:N3}" hidden="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="100" align="right" format="{0:N3}" hidden="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="100" align="right" format="{0:N3}" hidden="true"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" width="100" align="right" format="{0:N1}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="isPrint" cname="是否制单" width="80" align="center">
......
......@@ -50,8 +50,8 @@ let select = function () {
for (let i = 0; i < rows.length; i++) {
let applyAmount = rows[i]['applyAmount'];
let amount = rows[i]['amount'];
if (!isPositiveInteger(applyAmount)) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的整数");
if (!isPositiveNumber(applyAmount)) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的数字");
return;
}
if (parseFloat(applyAmount) > parseFloat(amount)) {
......
......@@ -31,9 +31,9 @@
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="subInventName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N1}" required="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N1}"/>
<EF:EFColumn ename="weight" cname="库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150" hidden="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" enable="false" width="140" align="center" hidden="true"/>
......
......@@ -45,8 +45,8 @@ let select = function () {
for (let i = 0; i < rows.length; i++) {
let applyAmount = rows[i]['applyAmount'];
let amount = rows[i]['amount'];
if (!isPositiveInteger(applyAmount)) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的整数");
if (!isPositiveNumber(applyAmount)) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的数字");
return;
}
if (parseFloat(applyAmount) > parseFloat(amount)) {
......
......@@ -53,9 +53,9 @@
filter="contains" >
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField" />
</EF:EFComboColumn>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N1}" required="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="200" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N1}"
sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"
......
......@@ -53,8 +53,8 @@
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="assignedNum" cname="派工数量" enable="false" width="80" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unassignedNum" cname="剩余数量" enable="false" width="80" align="right" format="{0:N0}"/>
<EF:EFColumn ename="assignedNum" cname="派工数量" enable="false" width="80" align="right" format="{0:N1}"/>
<EF:EFColumn ename="unassignedNum" cname="剩余数量" enable="false" width="80" align="right" format="{0:N1}"/>
<EF:EFColumn ename="num" cname="数量" enable="false" width="80" align="right" format="{0:N0}"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="80" align="right" format="{0:N3}"/>
<%--<EF:EFColumn ename="remark" cname="部件备注" enable="false"/>--%>
......
......@@ -112,8 +112,8 @@ let save = function () {
message("勾选的第" + (i + 1) + "行\"分派数量\",不能为空");
return;
}
if (!isPositiveInteger(rows[i]['num'])) {
message("勾选的第" + (i + 1) + "行\"分派数量\"必须是大于0的整数");
if (!isPositiveNumber(rows[i]['num'])) {
message("勾选的第" + (i + 1) + "行\"分派数量\"必须是大于0的数字");
return;
}
}
......
......@@ -66,9 +66,9 @@
valueField="textField" textField="textField" readonly="true" required="true"/>--%>
<%--<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="厂区" enable="false" align="center"/>--%>
<EF:EFColumn ename="num" cname="分派数量" format="{0:N0}" required="true"/>
<EF:EFColumn ename="num" cname="分派数量" format="{0:N1}" required="true"/>
<EF:EFColumn ename="totalWt" cname="分派重量(T)" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="completeNum" cname="已完工数量" enable="false" format="{0:N0}"/>
<EF:EFColumn ename="completeNum" cname="已完工数量" enable="false" format="{0:N1}"/>
</EF:EFGrid>
<br/>
<span style='color: red;font-size: 13px;'>说明:厂区和生产组仅新增的时候可以编辑</span>
......
......@@ -43,9 +43,9 @@
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="completeNum" cname="完成数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unCompleteNum" cname="剩余数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="completeNum" cname="完成数量" enable="false" width="100" align="right" format="{0:N1}"/>
<EF:EFColumn ename="unCompleteNum" cname="剩余数量" enable="false" width="100" align="right" format="{0:N1}"/>
<EF:EFColumn ename="num" cname="数量" enable="false" width="100" align="right" format="{0:N1}"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="140" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="140" align="center"/>
......
......@@ -3,9 +3,9 @@ prdtNameGlobalData = [];
factoryGroupGlobalData = [];
$(function () {
$("#QUERY").on("click", function () {
query();
});
$("#QUERY").on("click", query);
$("#COMPLETE").on("click", complete);
$("#ASSIGN").on("click", function () {
//重置全局变量
......@@ -389,7 +389,8 @@ $(function () {
});
downKeyUp();
});
query = function () {
let query = function () {
resultGrid.dataSource.page(1);
}
......@@ -398,6 +399,8 @@ query = function () {
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
// 生产组名称
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-orgType", 'cutGroup');
......@@ -547,3 +550,18 @@ function saveFunc() {
}
}
/**
* 完成
*/
let complete = function (){
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"完成\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result,detail", "HPSC006", "complete", true);
}
});
}
......@@ -14,16 +14,25 @@
<EF:EFPage title="生产下料">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<div class="row"> <%-- blockId="inqu_status" row="0" --%>
<div class="row">
<EF:EFInput blockId="inqu_status" ename="projCode" cname="项目号:" colWidth="3" row="0"/>
<EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" colWidth="3" row="0"/>
<EF:EFInput blockId="inqu_status" ename="prodOrderNo" cname="生产订单号:" colWidth="3" row="0"/>
<EF:EFDatePicker blockId="inqu_status" ename="deliveryDate" cname="交货日期" row="0" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3" />
<EF:EFDatePicker blockId="inqu_status" ename="workDate" cname="派工时间" row="0" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3" />
<EF:EFDatePicker blockId="inqu_status" ename="planCompletionDate" cname="计划完成日期:" row="0" colWidth="3" format="yyyy-MM-dd" />
<EF:EFDatePicker blockId="inqu_status" ename="deliveryDate" cname="交货日期" row="0" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</div>
<%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%>
<div class="row">
<EF:EFDatePicker blockId="inqu_status" ename="workDate" cname="派工时间" row="0" role="date" format="yyyy-MM-dd"
parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" ename="planCompletionDate" cname="计划完成日期:" row="0" colWidth="3"
format="yyyy-MM-dd"/>
<EF:EFSelect ename="completeStatus" cname="状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="未完成" value="0"/>
<EF:EFOption label="部分完成" value="2"/>
<EF:EFOption label="已完成" value="1"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="生产任务集">
......@@ -42,7 +51,10 @@
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn enable="false" ename="planCompletionDate" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"
cname="计划完成日期"/>
<EF:EFComboColumn ename="completeStatus" cname="状态" enable="false" align="center" width="80">
<EF:EFOption label="未完成" value="0"/>
<EF:EFOption label="已完成" value="1"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
......@@ -52,14 +64,13 @@
<EF:EFInput ename="productionOrderNo" type="hidden"/>
<EF:EFInput ename="deliveryDate" type="hidden"/>
<EF:EFInput ename="factoryCode" type="hidden"/>
<EF:EFGrid blockId="detail" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
<EF:EFColumn enable="false" ename="reqNum" cname="领料记录" width="80" align="center" readonly="true"/>
<%-- <EF:EFComboColumn cname="材料类型" ename="inventType" width="80" align="center" required="true" >--%>
<%-- <EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('7')"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFGrid blockId="detail" autoDraw="no" checkMode="row">
<EF:EFColumn ename="id" cname="标识" enable="false" width="60" align="center"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="100" align="center"/>
<EF:EFColumn enable="false" ename="reqNum" cname="领料记录" width="80" align="center" readonly="true"/>
<%-- <EF:EFComboColumn cname="材料类型" ename="inventType" width="80" align="center" required="true" >--%>
<%-- <EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('7')"/>--%>
<%-- </EF:EFComboColumn>--%>
<%-- <EF:EFPopupColumn ename="inventName" cname="材料名称" width="200" popupType="ServiceGrid"
popupTitle="材料信息" serviceName="HPPZ004" methodName="queryComboBox" resultId="invent_name_block_id"
columnEnames="textField,valueField"
......@@ -107,12 +118,15 @@
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="120" enable="false"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="完工数量" width="100" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionTotalWt" cname="完工重量(T)" width="100" readonly="true"/>
<EF:EFComboColumn enable="false" align="center" ename="status" width="80" cname="状态">
<EF:EFComboColumn enable="false" align="center" ename="status" width="80" cname="状态" hidden="true">
<EF:EFOption label="计划中" value="0"/>
<EF:EFOption label="生产中" value="1"/>
<EF:EFOption label="已完成" value="2"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="completeStatus" cname="状态" enable="false" align="center" width="80">
<EF:EFOption label="未完成" value="0"/>
<EF:EFOption label="已完成" value="1"/>
</EF:EFComboColumn>
</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