Commit eeacca29 by 江和松

存货档案修改导入模板

parent f7df497c
...@@ -4,20 +4,20 @@ ...@@ -4,20 +4,20 @@
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
tableName : HGPZ004 tableName : HGPZ004
ID INTEGER NOT NULL primarykey, ID INTEGER NOT NULL primarykey,
ACCOUNT_CODE VARCHAR, ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR, DEP_CODE VARCHAR,
INVENT_TYPE VARCHAR NOT NULL, INVENT_TYPE VARCHAR NOT NULL,
INVENT_TYPE_NAME VARCHAR NOT NULL, INVENT_TYPE_NAME VARCHAR NOT NULL,
PAR_INVENT_TYPE VARCHAR NOT NULL, PAR_INVENT_TYPE VARCHAR NOT NULL,
PAR_INVENT_TYPE_NAME VARCHAR NOT NULL, PAR_INVENT_TYPE_NAME VARCHAR NOT NULL,
STATUS TINYINT NOT NULL, STATUS TINYINT NOT NULL,
CREATED_BY VARCHAR, CREATED_BY VARCHAR,
CREATED_NAME VARCHAR, CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR, CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR, UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR, UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR, UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT DELETE_FLAG TINYINT
--> -->
<sqlMap namespace="HGPZ004"> <sqlMap namespace="HGPZ004">
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ004"> resultClass="com.baosight.hggp.hg.pz.domain.HGPZ004">
SELECT SELECT
ID as "id", ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 --> ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
DEP_CODE as "depCode", <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
INVENT_TYPE as "inventType", <!-- 类型编码 --> INVENT_TYPE as "inventType", <!-- 类型编码 -->
...@@ -114,71 +114,73 @@ ...@@ -114,71 +114,73 @@
INVENT_TYPE_DETAIL as "inventTypeDetail" INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGPZ004 WHERE 1=1 AND DELETE_FLAG = 0 FROM ${hggpSchema}.HGPZ004 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" /> <include refid="condition" />
<include refid="authCondition" /> <!-- 物料类型需要全部账套公用,如果不公用需要对HGPZ004表存货类型的键进行处理
<dynamic prepend="ORDER BY"> <include refid="authCondition" />
<isNotEmpty property="orderBy"> -->
$orderBy$ <dynamic prepend="ORDER BY">
</isNotEmpty> <isNotEmpty property="orderBy">
<isEmpty property="orderBy"> $orderBy$
CREATED_TIME desc </isNotEmpty>
</isEmpty> <isEmpty property="orderBy">
</dynamic> CREATED_TIME desc
</isEmpty>
</dynamic>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ004 WHERE 1=1 AND DELETE_FLAG = 0 SELECT COUNT(*) FROM ${hggpSchema}.HGPZ004 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" /> <include refid="condition" />
<include refid="authCondition" /> <include refid="authCondition" />
</select> </select>
<!-- <!--
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType"> <isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType# INVENT_TYPE = #inventType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeName"> <isNotEmpty prepend=" AND " property="inventTypeName">
INVENT_TYPE_NAME = #inventTypeName# INVENT_TYPE_NAME = #inventTypeName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="parInventType"> <isNotEmpty prepend=" AND " property="parInventType">
PAR_INVENT_TYPE = #parInventType# PAR_INVENT_TYPE = #parInventType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="parInventTypeName"> <isNotEmpty prepend=" AND " property="parInventTypeName">
PAR_INVENT_TYPE_NAME = #parInventTypeName# PAR_INVENT_TYPE_NAME = #parInventTypeName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
STATUS = #status# STATUS = #status#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy"> <isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy# CREATED_BY = #createdBy#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName"> <isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName# CREATED_NAME = #createdName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime"> <isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime# CREATED_TIME = #createdTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy"> <isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy# UPDATED_BY = #updatedBy#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName"> <isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName# UPDATED_NAME = #updatedName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime"> <isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime# UPDATED_TIME = #updatedTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
--> -->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ004 (ID, INSERT INTO ${hggpSchema}.HGPZ004 (ID,
......
...@@ -589,7 +589,8 @@ public class HGPZTools { ...@@ -589,7 +589,8 @@ public class HGPZTools {
List<HGPZ004> hgpz004s = DaoBase.getInstance().query(HGPZ004.QUERY, new HashMap<String, Object>(){{ List<HGPZ004> hgpz004s = DaoBase.getInstance().query(HGPZ004.QUERY, new HashMap<String, Object>(){{
put(HGPZ004.FIELD_STATUS, CommonConstant.YesNo.YES_1); put(HGPZ004.FIELD_STATUS, CommonConstant.YesNo.YES_1);
}}); }});
Map parmap = hgpz004s.stream().filter(item-> !Objects.equals(item.getParInventType(), "root")).collect(Collectors.toMap(HGPZ004::getInventTypeName, HGPZ004::getInventType,(v1, v2) -> v1)); // Map parmap = hgpz004s.stream().filter(item-> !Objects.equals(item.getParInventType(), "root")).collect(Collectors.toMap(HGPZ004::getInventTypeName, HGPZ004::getInventType,(v1, v2) -> v1));
Map parmap = hgpz004s.stream().collect(Collectors.toMap(HGPZ004::getInventTypeName, HGPZ004::getInventType,(v1, v2) -> v1));
for (Map map:list) { for (Map map:list) {
String inventType = MapUtils.getString(parmap, StringUtils.trimToEmpty(map.get(HGPZ005.FIELD_INVENT_TYPE).toString())); String inventType = MapUtils.getString(parmap, StringUtils.trimToEmpty(map.get(HGPZ005.FIELD_INVENT_TYPE).toString()));
AssertUtils.isEmpty(inventType, String.format("存货类型[%s]代码不存在,添加失败!", map.get(HGPZ005.FIELD_INVENT_TYPE))); AssertUtils.isEmpty(inventType, String.format("存货类型[%s]代码不存在,添加失败!", map.get(HGPZ005.FIELD_INVENT_TYPE)));
......
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