Commit 36e1a3ed by wuwenlong

项目档案OPT

parent 40aaa5ef
...@@ -14,6 +14,8 @@ public class HPConstant { ...@@ -14,6 +14,8 @@ public class HPConstant {
*/ */
public class SequenceId { public class SequenceId {
//项目档案编号
public static final String PROJ_NUMBER = "PROJ_NUMBER";
// 盘点单号 // 盘点单号
public static final String STATISTICAL_NUMBER = "STATISTICAL_NUMBER"; public static final String STATISTICAL_NUMBER = "STATISTICAL_NUMBER";
// 统计单号 // 统计单号
......
...@@ -19,8 +19,10 @@ public class THPSC001 extends DaoEPBase { ...@@ -19,8 +19,10 @@ public class THPSC001 extends DaoEPBase {
private String princ2 = " "; /* 客户项目负责人*/ private String princ2 = " "; /* 客户项目负责人*/
private Integer status = 0; /* 状态 0-未审核,1-已审核*/ private Integer status = 0; /* 状态 0-未审核,1-已审核*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime ; /* 创建时间*/ private String createdTime ; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime ; /* 更新时间*/ private String updatedTime ; /* 更新时间*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
...@@ -67,6 +69,10 @@ public class THPSC001 extends DaoEPBase { ...@@ -67,6 +69,10 @@ public class THPSC001 extends DaoEPBase {
eiColumn.setDescName("创建人"); eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime"); eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间"); eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -75,6 +81,10 @@ public class THPSC001 extends DaoEPBase { ...@@ -75,6 +81,10 @@ public class THPSC001 extends DaoEPBase {
eiColumn.setDescName("更新人"); eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime"); eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间"); eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -264,6 +274,23 @@ public class THPSC001 extends DaoEPBase { ...@@ -264,6 +274,23 @@ public class THPSC001 extends DaoEPBase {
public void setUpdatedTime(String updatedTime) { public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime; this.updatedTime = updatedTime;
} }
public String getCreatedName() {
return createdName;
}
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
public String getUpdatedName() {
return updatedName;
}
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/** /**
* get the depCode - 部门编码 * get the depCode - 部门编码
* @return the depCode * @return the depCode
...@@ -307,9 +334,11 @@ public class THPSC001 extends DaoEPBase { ...@@ -307,9 +334,11 @@ public class THPSC001 extends DaoEPBase {
setPrinc2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("princ2")), princ2)); setPrinc2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("princ2")), princ2));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get("status")), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get("status")), status));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.toString(map.get("createdTime"))); setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")),createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy)); setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.toString(map.get("updatedTime"))); setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")),updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark)); setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("remark")), remark));
} }
...@@ -329,8 +358,10 @@ public class THPSC001 extends DaoEPBase { ...@@ -329,8 +358,10 @@ public class THPSC001 extends DaoEPBase {
map.put("princ2",StringUtils.toString(princ2, eiMetadata.getMeta("princ2"))); map.put("princ2",StringUtils.toString(princ2, eiMetadata.getMeta("princ2")));
map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status"))); map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy"))); map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime"))); map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy"))); map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime"))); map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode"))); map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
map.put("remark",StringUtils.toString(remark, eiMetadata.getMeta("remark"))); map.put("remark",StringUtils.toString(remark, eiMetadata.getMeta("remark")));
......
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sc.domain.THPSC002; import com.baosight.hpjx.hp.sc.domain.THPSC002;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -9,6 +12,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -9,6 +12,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager; import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.hpjx.hp.sc.domain.THPSC001; import com.baosight.hpjx.hp.sc.domain.THPSC001;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -46,18 +50,14 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -46,18 +50,14 @@ public class ServiceHPSC001 extends ServiceBase {
*/ */
@Override @Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
THPSC001 hpsc001 = new THPSC001(); THPSC001 hpsc001 = new THPSC001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); hpsc001.fromMap(map);
hpsc001.setCreatedBy(UserSession.getUserId()); hpsc001.setProjCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PROJ_NUMBER));
hpsc001.setCreatedTime(sdf.format(new Date())); DaoUtils.insert("HPSC001.insert",hpsc001);
hpsc001.setUpdatedBy(null);
hpsc001.setUpdatedTime(null);
this.dao.insert("HPSC001.insert", hpsc001.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!"); inInfo.setMsg("新增成功!");
...@@ -84,9 +84,7 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -84,9 +84,7 @@ public class ServiceHPSC001 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); hpsc001.fromMap(map);
hpsc001.setUpdatedBy(UserSession.getUserId()); DaoUtils.update("HPSC001.insert",hpsc001);
hpsc001.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC001.update", hpsc001.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
......
<?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">
<!-- table information
Generate time : 2024-01-10 9:33:44
Version : 1.0
tableName :hpjx.t_hpsc001
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
PROJ_TYPE TINYINT,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PRINC1 VARCHAR,
PRINC2 VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPSC001">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.iplat4j.hp.sc.domain.THPSC001">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRINC1 as "princ1", <!-- 本公司项目负责人 -->
PRINC2 as "princ2", <!-- 客户项目负责人 -->
STATUS as "status", <!-- 状态 0-未审核,1-已审核 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM hpjx.t_hpsc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
PROJ_TYPE = #projType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
PROJ_TYPE = #projType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ1">
PRINC1 = #princ1#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ2">
PRINC2 = #princ2#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpsc001 (ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
PROJ_TYPE, <!-- 项目类型 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PRINC1, <!-- 本公司项目负责人 -->
PRINC2, <!-- 客户项目负责人 -->
STATUS, <!-- 状态 0-未审核,1-已审核 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #companyCode#, #projType#, #projCode#, #projName#, #princ1#, #princ2#, #status#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpsc001 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpsc001
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
PROJ_TYPE = #projType#, <!-- 项目类型 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PRINC1 = #princ1#, <!-- 本公司项目负责人 -->
PRINC2 = #princ2#, <!-- 客户项目负责人 -->
STATUS = #status#, <!-- 状态 0-未审核,1-已审核 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
...@@ -9,10 +9,14 @@ ...@@ -9,10 +9,14 @@
</head> </head>
<EF:EFPage title="项目档案"> <EF:EFPage title="项目档案">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <%-- blockId="inqu_status" row="0" --%> <div class="row">
<EF:EFInput blockId="inqu_status" ename="projType" cname="项目类型:" row="0"/> <EF:EFSelect ename="inqu_status-0-projType" cname="项目类型" colWidth="3" filter="contains"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0"/> <EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0"/>
<EF:EFSelect cname="单据状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0"> <EF:EFSelect cname="单据状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="未审核" value="0"/> <EF:EFOption label="未审核" value="0"/>
...@@ -25,12 +29,15 @@ ...@@ -25,12 +29,15 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no"> <EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projType" required='true' cname="项目类型"/> <EF:EFComboColumn ename="projType" cname="项目类型" width="100" align="center" required="true"
<EF:EFColumn required="true" ename="projCode" cname="项目编码"/> columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#">
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projCode" enable="false" cname="项目编码"/>
<EF:EFColumn required="true" ename="projName" cname="项目名称"/> <EF:EFColumn required="true" ename="projName" cname="项目名称"/>
<EF:EFColumn required="true" ename="princ1" cname="本公司项目负责人"/> <EF:EFColumn required="true" ename="princ1" cname="本公司项目负责人"/>
<EF:EFColumn required="true" ename="princ2" cname="客户项目负责人"/> <EF:EFColumn required="true" ename="princ2" cname="客户项目负责人"/>
<EF:EFComboColumn required="true" align="center" ename="status" cname="状态"> <EF:EFComboColumn required="true" align="center" ename="status" cname="状态" defaultValue="0">
<EF:EFOption label="未审核" value="0"/> <EF:EFOption label="未审核" value="0"/>
<EF:EFOption label="已审核" value="1"/> <EF:EFOption label="已审核" value="1"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
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