zelong.shao

dao|task|重新生成email表|打zip包部分

...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
20 <result column="MODIFY_TIME" jdbcType="TIMESTAMP" property="modifyTime" /> 20 <result column="MODIFY_TIME" jdbcType="TIMESTAMP" property="modifyTime" />
21 <result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" /> 21 <result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" />
22 <result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" /> 22 <result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" />
23 + <result column="FILE_PATH" jdbcType="VARCHAR" property="filePath" />
23 </resultMap> 24 </resultMap>
24 <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fedex.connect.common.model.biz.Email"> 25 <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fedex.connect.common.model.biz.Email">
25 <result column="BODY" jdbcType="CLOB" property="body" /> 26 <result column="BODY" jdbcType="CLOB" property="body" />
...@@ -85,7 +86,7 @@ ...@@ -85,7 +86,7 @@
85 <sql id="Base_Column_List"> 86 <sql id="Base_Column_List">
86 ID, BIZ_ID, BIZ_CODE, TO_ADDRESS, CC_ADDRESS, SUBJECT, TYPE_CODE, TYPE_NAME, STATUS_CODE, 87 ID, BIZ_ID, BIZ_CODE, TO_ADDRESS, CC_ADDRESS, SUBJECT, TYPE_CODE, TYPE_NAME, STATUS_CODE,
87 STATUS_NAME, SEND_NUM, SEND_TIME, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, 88 STATUS_NAME, SEND_NUM, SEND_TIME, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME,
88 - MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME 89 + MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, FILE_PATH
89 </sql> 90 </sql>
90 <sql id="Blob_Column_List"> 91 <sql id="Blob_Column_List">
91 BODY 92 BODY
...@@ -152,14 +153,14 @@ ...@@ -152,14 +153,14 @@
152 STATUS_NAME, SEND_NUM, SEND_TIME, 153 STATUS_NAME, SEND_NUM, SEND_TIME,
153 CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, 154 CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME,
154 MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, 155 MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME,
155 - BODY) 156 + FILE_PATH, BODY)
156 values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizCode,jdbcType=VARCHAR}, 157 values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizCode,jdbcType=VARCHAR},
157 #{toAddress,jdbcType=VARCHAR}, #{ccAddress,jdbcType=VARCHAR}, #{subject,jdbcType=VARCHAR}, 158 #{toAddress,jdbcType=VARCHAR}, #{ccAddress,jdbcType=VARCHAR}, #{subject,jdbcType=VARCHAR},
158 #{typeCode,jdbcType=VARCHAR}, #{typeName,jdbcType=VARCHAR}, #{statusCode,jdbcType=VARCHAR}, 159 #{typeCode,jdbcType=VARCHAR}, #{typeName,jdbcType=VARCHAR}, #{statusCode,jdbcType=VARCHAR},
159 #{statusName,jdbcType=VARCHAR}, #{sendNum,jdbcType=NUMERIC}, #{sendTime,jdbcType=TIMESTAMP}, 160 #{statusName,jdbcType=VARCHAR}, #{sendNum,jdbcType=NUMERIC}, #{sendTime,jdbcType=TIMESTAMP},
160 #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC}, #{createUserName,jdbcType=VARCHAR}, 161 #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC}, #{createUserName,jdbcType=VARCHAR},
161 #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC}, #{modifyUserName,jdbcType=VARCHAR}, 162 #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC}, #{modifyUserName,jdbcType=VARCHAR},
162 - #{body,jdbcType=CLOB}) 163 + #{filePath,jdbcType=VARCHAR}, #{body,jdbcType=CLOB})
163 </insert> 164 </insert>
164 <insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.Email"> 165 <insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.Email">
165 <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> 166 <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
...@@ -219,6 +220,9 @@ ...@@ -219,6 +220,9 @@
219 <if test="modifyUserName != null"> 220 <if test="modifyUserName != null">
220 MODIFY_USER_NAME, 221 MODIFY_USER_NAME,
221 </if> 222 </if>
223 + <if test="filePath != null">
224 + FILE_PATH,
225 + </if>
222 <if test="body != null"> 226 <if test="body != null">
223 BODY, 227 BODY,
224 </if> 228 </if>
...@@ -276,6 +280,9 @@ ...@@ -276,6 +280,9 @@
276 <if test="modifyUserName != null"> 280 <if test="modifyUserName != null">
277 #{modifyUserName,jdbcType=VARCHAR}, 281 #{modifyUserName,jdbcType=VARCHAR},
278 </if> 282 </if>
283 + <if test="filePath != null">
284 + #{filePath,jdbcType=VARCHAR},
285 + </if>
279 <if test="body != null"> 286 <if test="body != null">
280 #{body,jdbcType=CLOB}, 287 #{body,jdbcType=CLOB},
281 </if> 288 </if>
...@@ -344,6 +351,9 @@ ...@@ -344,6 +351,9 @@
344 <if test="record.modifyUserName != null"> 351 <if test="record.modifyUserName != null">
345 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}, 352 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
346 </if> 353 </if>
354 + <if test="record.filePath != null">
355 + FILE_PATH = #{record.filePath,jdbcType=VARCHAR},
356 + </if>
347 <if test="record.body != null"> 357 <if test="record.body != null">
348 BODY = #{record.body,jdbcType=CLOB}, 358 BODY = #{record.body,jdbcType=CLOB},
349 </if> 359 </if>
...@@ -372,6 +382,7 @@ ...@@ -372,6 +382,7 @@
372 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, 382 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
373 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC}, 383 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
374 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}, 384 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
385 + FILE_PATH = #{record.filePath,jdbcType=VARCHAR},
375 BODY = #{record.body,jdbcType=CLOB} 386 BODY = #{record.body,jdbcType=CLOB}
376 <if test="_parameter != null"> 387 <if test="_parameter != null">
377 <include refid="Update_By_Example_Where_Clause" /> 388 <include refid="Update_By_Example_Where_Clause" />
...@@ -396,7 +407,8 @@ ...@@ -396,7 +407,8 @@
396 CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR}, 407 CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR},
397 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, 408 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
398 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC}, 409 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
399 - MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR} 410 + MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
411 + FILE_PATH = #{record.filePath,jdbcType=VARCHAR}
400 <if test="_parameter != null"> 412 <if test="_parameter != null">
401 <include refid="Update_By_Example_Where_Clause" /> 413 <include refid="Update_By_Example_Where_Clause" />
402 </if> 414 </if>
...@@ -455,6 +467,9 @@ ...@@ -455,6 +467,9 @@
455 <if test="modifyUserName != null"> 467 <if test="modifyUserName != null">
456 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}, 468 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
457 </if> 469 </if>
470 + <if test="filePath != null">
471 + FILE_PATH = #{filePath,jdbcType=VARCHAR},
472 + </if>
458 <if test="body != null"> 473 <if test="body != null">
459 BODY = #{body,jdbcType=CLOB}, 474 BODY = #{body,jdbcType=CLOB},
460 </if> 475 </if>
...@@ -480,6 +495,7 @@ ...@@ -480,6 +495,7 @@
480 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, 495 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
481 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC}, 496 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
482 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}, 497 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
498 + FILE_PATH = #{filePath,jdbcType=VARCHAR},
483 BODY = #{body,jdbcType=CLOB} 499 BODY = #{body,jdbcType=CLOB}
484 where ID = #{id,jdbcType=NUMERIC} 500 where ID = #{id,jdbcType=NUMERIC}
485 </update> 501 </update>
...@@ -501,7 +517,8 @@ ...@@ -501,7 +517,8 @@
501 CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR}, 517 CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
502 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, 518 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
503 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC}, 519 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
504 - MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR} 520 + MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
521 + FILE_PATH = #{filePath,jdbcType=VARCHAR}
505 where ID = #{id,jdbcType=NUMERIC} 522 where ID = #{id,jdbcType=NUMERIC}
506 </update> 523 </update>
507 <sql id="OracleDialectPrefix"> 524 <sql id="OracleDialectPrefix">
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
20 <result column="MODIFY_TIME" jdbcType="TIMESTAMP" property="modifyTime" /> 20 <result column="MODIFY_TIME" jdbcType="TIMESTAMP" property="modifyTime" />
21 <result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" /> 21 <result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" />
22 <result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" /> 22 <result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" />
23 + <result column="FILE_PATH" jdbcType="VARCHAR" property="filePath" />
23 </resultMap> 24 </resultMap>
24 <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fedex.connect.common.model.log.EmailHistory"> 25 <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fedex.connect.common.model.log.EmailHistory">
25 <result column="BODY" jdbcType="CLOB" property="body" /> 26 <result column="BODY" jdbcType="CLOB" property="body" />
...@@ -85,7 +86,7 @@ ...@@ -85,7 +86,7 @@
85 <sql id="Base_Column_List"> 86 <sql id="Base_Column_List">
86 ID, BIZ_ID, BIZ_CODE, TO_ADDRESS, CC_ADDRESS, SUBJECT, TYPE_CODE, TYPE_NAME, STATUS_CODE, 87 ID, BIZ_ID, BIZ_CODE, TO_ADDRESS, CC_ADDRESS, SUBJECT, TYPE_CODE, TYPE_NAME, STATUS_CODE,
87 STATUS_NAME, SEND_NUM, SEND_TIME, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, 88 STATUS_NAME, SEND_NUM, SEND_TIME, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME,
88 - MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME 89 + MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, FILE_PATH
89 </sql> 90 </sql>
90 <sql id="Blob_Column_List"> 91 <sql id="Blob_Column_List">
91 BODY 92 BODY
...@@ -152,14 +153,14 @@ ...@@ -152,14 +153,14 @@
152 STATUS_NAME, SEND_NUM, SEND_TIME, 153 STATUS_NAME, SEND_NUM, SEND_TIME,
153 CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, 154 CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME,
154 MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, 155 MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME,
155 - BODY) 156 + FILE_PATH, BODY)
156 values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizCode,jdbcType=VARCHAR}, 157 values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizCode,jdbcType=VARCHAR},
157 #{toAddress,jdbcType=VARCHAR}, #{ccAddress,jdbcType=VARCHAR}, #{subject,jdbcType=VARCHAR}, 158 #{toAddress,jdbcType=VARCHAR}, #{ccAddress,jdbcType=VARCHAR}, #{subject,jdbcType=VARCHAR},
158 #{typeCode,jdbcType=VARCHAR}, #{typeName,jdbcType=VARCHAR}, #{statusCode,jdbcType=VARCHAR}, 159 #{typeCode,jdbcType=VARCHAR}, #{typeName,jdbcType=VARCHAR}, #{statusCode,jdbcType=VARCHAR},
159 #{statusName,jdbcType=VARCHAR}, #{sendNum,jdbcType=NUMERIC}, #{sendTime,jdbcType=TIMESTAMP}, 160 #{statusName,jdbcType=VARCHAR}, #{sendNum,jdbcType=NUMERIC}, #{sendTime,jdbcType=TIMESTAMP},
160 #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC}, #{createUserName,jdbcType=VARCHAR}, 161 #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC}, #{createUserName,jdbcType=VARCHAR},
161 #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC}, #{modifyUserName,jdbcType=VARCHAR}, 162 #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC}, #{modifyUserName,jdbcType=VARCHAR},
162 - #{body,jdbcType=CLOB}) 163 + #{filePath,jdbcType=VARCHAR}, #{body,jdbcType=CLOB})
163 </insert> 164 </insert>
164 <insert id="insertSelective" parameterType="com.fedex.connect.common.model.log.EmailHistory"> 165 <insert id="insertSelective" parameterType="com.fedex.connect.common.model.log.EmailHistory">
165 <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> 166 <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
...@@ -219,6 +220,9 @@ ...@@ -219,6 +220,9 @@
219 <if test="modifyUserName != null"> 220 <if test="modifyUserName != null">
220 MODIFY_USER_NAME, 221 MODIFY_USER_NAME,
221 </if> 222 </if>
223 + <if test="filePath != null">
224 + FILE_PATH,
225 + </if>
222 <if test="body != null"> 226 <if test="body != null">
223 BODY, 227 BODY,
224 </if> 228 </if>
...@@ -276,6 +280,9 @@ ...@@ -276,6 +280,9 @@
276 <if test="modifyUserName != null"> 280 <if test="modifyUserName != null">
277 #{modifyUserName,jdbcType=VARCHAR}, 281 #{modifyUserName,jdbcType=VARCHAR},
278 </if> 282 </if>
283 + <if test="filePath != null">
284 + #{filePath,jdbcType=VARCHAR},
285 + </if>
279 <if test="body != null"> 286 <if test="body != null">
280 #{body,jdbcType=CLOB}, 287 #{body,jdbcType=CLOB},
281 </if> 288 </if>
...@@ -344,6 +351,9 @@ ...@@ -344,6 +351,9 @@
344 <if test="record.modifyUserName != null"> 351 <if test="record.modifyUserName != null">
345 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}, 352 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
346 </if> 353 </if>
354 + <if test="record.filePath != null">
355 + FILE_PATH = #{record.filePath,jdbcType=VARCHAR},
356 + </if>
347 <if test="record.body != null"> 357 <if test="record.body != null">
348 BODY = #{record.body,jdbcType=CLOB}, 358 BODY = #{record.body,jdbcType=CLOB},
349 </if> 359 </if>
...@@ -372,6 +382,7 @@ ...@@ -372,6 +382,7 @@
372 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, 382 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
373 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC}, 383 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
374 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}, 384 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
385 + FILE_PATH = #{record.filePath,jdbcType=VARCHAR},
375 BODY = #{record.body,jdbcType=CLOB} 386 BODY = #{record.body,jdbcType=CLOB}
376 <if test="_parameter != null"> 387 <if test="_parameter != null">
377 <include refid="Update_By_Example_Where_Clause" /> 388 <include refid="Update_By_Example_Where_Clause" />
...@@ -396,7 +407,8 @@ ...@@ -396,7 +407,8 @@
396 CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR}, 407 CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR},
397 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, 408 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
398 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC}, 409 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
399 - MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR} 410 + MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
411 + FILE_PATH = #{record.filePath,jdbcType=VARCHAR}
400 <if test="_parameter != null"> 412 <if test="_parameter != null">
401 <include refid="Update_By_Example_Where_Clause" /> 413 <include refid="Update_By_Example_Where_Clause" />
402 </if> 414 </if>
...@@ -455,6 +467,9 @@ ...@@ -455,6 +467,9 @@
455 <if test="modifyUserName != null"> 467 <if test="modifyUserName != null">
456 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}, 468 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
457 </if> 469 </if>
470 + <if test="filePath != null">
471 + FILE_PATH = #{filePath,jdbcType=VARCHAR},
472 + </if>
458 <if test="body != null"> 473 <if test="body != null">
459 BODY = #{body,jdbcType=CLOB}, 474 BODY = #{body,jdbcType=CLOB},
460 </if> 475 </if>
...@@ -480,6 +495,7 @@ ...@@ -480,6 +495,7 @@
480 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, 495 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
481 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC}, 496 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
482 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}, 497 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
498 + FILE_PATH = #{filePath,jdbcType=VARCHAR},
483 BODY = #{body,jdbcType=CLOB} 499 BODY = #{body,jdbcType=CLOB}
484 where ID = #{id,jdbcType=NUMERIC} 500 where ID = #{id,jdbcType=NUMERIC}
485 </update> 501 </update>
...@@ -501,7 +517,8 @@ ...@@ -501,7 +517,8 @@
501 CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR}, 517 CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
502 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, 518 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
503 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC}, 519 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
504 - MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR} 520 + MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
521 + FILE_PATH = #{filePath,jdbcType=VARCHAR}
505 where ID = #{id,jdbcType=NUMERIC} 522 where ID = #{id,jdbcType=NUMERIC}
506 </update> 523 </update>
507 <sql id="OracleDialectPrefix"> 524 <sql id="OracleDialectPrefix">
......
...@@ -99,6 +99,11 @@ public class Email implements Serializable { ...@@ -99,6 +99,11 @@ public class Email implements Serializable {
99 private String modifyUserName; 99 private String modifyUserName;
100 100
101 /** 101 /**
102 + * 附件目录
103 + */
104 + private String filePath;
105 +
106 + /**
102 * 邮件内容 107 * 邮件内容
103 */ 108 */
104 private String body; 109 private String body;
...@@ -249,6 +254,14 @@ public class Email implements Serializable { ...@@ -249,6 +254,14 @@ public class Email implements Serializable {
249 this.modifyUserName = modifyUserName == null ? null : modifyUserName.trim(); 254 this.modifyUserName = modifyUserName == null ? null : modifyUserName.trim();
250 } 255 }
251 256
257 + public String getFilePath() {
258 + return filePath;
259 + }
260 +
261 + public void setFilePath(String filePath) {
262 + this.filePath = filePath == null ? null : filePath.trim();
263 + }
264 +
252 public String getBody() { 265 public String getBody() {
253 return body; 266 return body;
254 } 267 }
...@@ -281,6 +294,7 @@ public class Email implements Serializable { ...@@ -281,6 +294,7 @@ public class Email implements Serializable {
281 sb.append(", modifyTime=").append(modifyTime); 294 sb.append(", modifyTime=").append(modifyTime);
282 sb.append(", modifyUserId=").append(modifyUserId); 295 sb.append(", modifyUserId=").append(modifyUserId);
283 sb.append(", modifyUserName=").append(modifyUserName); 296 sb.append(", modifyUserName=").append(modifyUserName);
297 + sb.append(", filePath=").append(filePath);
284 sb.append(", body=").append(body); 298 sb.append(", body=").append(body);
285 sb.append(", serialVersionUID=").append(serialVersionUID); 299 sb.append(", serialVersionUID=").append(serialVersionUID);
286 sb.append("]"); 300 sb.append("]");
......
...@@ -1304,6 +1304,76 @@ public class EmailExample { ...@@ -1304,6 +1304,76 @@ public class EmailExample {
1304 addCriterion("MODIFY_USER_NAME not between", value1, value2, "modifyUserName"); 1304 addCriterion("MODIFY_USER_NAME not between", value1, value2, "modifyUserName");
1305 return (Criteria) this; 1305 return (Criteria) this;
1306 } 1306 }
1307 +
1308 + public Criteria andFilePathIsNull() {
1309 + addCriterion("FILE_PATH is null");
1310 + return (Criteria) this;
1311 + }
1312 +
1313 + public Criteria andFilePathIsNotNull() {
1314 + addCriterion("FILE_PATH is not null");
1315 + return (Criteria) this;
1316 + }
1317 +
1318 + public Criteria andFilePathEqualTo(String value) {
1319 + addCriterion("FILE_PATH =", value, "filePath");
1320 + return (Criteria) this;
1321 + }
1322 +
1323 + public Criteria andFilePathNotEqualTo(String value) {
1324 + addCriterion("FILE_PATH <>", value, "filePath");
1325 + return (Criteria) this;
1326 + }
1327 +
1328 + public Criteria andFilePathGreaterThan(String value) {
1329 + addCriterion("FILE_PATH >", value, "filePath");
1330 + return (Criteria) this;
1331 + }
1332 +
1333 + public Criteria andFilePathGreaterThanOrEqualTo(String value) {
1334 + addCriterion("FILE_PATH >=", value, "filePath");
1335 + return (Criteria) this;
1336 + }
1337 +
1338 + public Criteria andFilePathLessThan(String value) {
1339 + addCriterion("FILE_PATH <", value, "filePath");
1340 + return (Criteria) this;
1341 + }
1342 +
1343 + public Criteria andFilePathLessThanOrEqualTo(String value) {
1344 + addCriterion("FILE_PATH <=", value, "filePath");
1345 + return (Criteria) this;
1346 + }
1347 +
1348 + public Criteria andFilePathLike(String value) {
1349 + addCriterion("FILE_PATH like", value, "filePath");
1350 + return (Criteria) this;
1351 + }
1352 +
1353 + public Criteria andFilePathNotLike(String value) {
1354 + addCriterion("FILE_PATH not like", value, "filePath");
1355 + return (Criteria) this;
1356 + }
1357 +
1358 + public Criteria andFilePathIn(List<String> values) {
1359 + addCriterion("FILE_PATH in", values, "filePath");
1360 + return (Criteria) this;
1361 + }
1362 +
1363 + public Criteria andFilePathNotIn(List<String> values) {
1364 + addCriterion("FILE_PATH not in", values, "filePath");
1365 + return (Criteria) this;
1366 + }
1367 +
1368 + public Criteria andFilePathBetween(String value1, String value2) {
1369 + addCriterion("FILE_PATH between", value1, value2, "filePath");
1370 + return (Criteria) this;
1371 + }
1372 +
1373 + public Criteria andFilePathNotBetween(String value1, String value2) {
1374 + addCriterion("FILE_PATH not between", value1, value2, "filePath");
1375 + return (Criteria) this;
1376 + }
1307 } 1377 }
1308 1378
1309 public static class Criteria extends GeneratedCriteria { 1379 public static class Criteria extends GeneratedCriteria {
......
...@@ -99,6 +99,11 @@ public class EmailHistory implements Serializable { ...@@ -99,6 +99,11 @@ public class EmailHistory implements Serializable {
99 private String modifyUserName; 99 private String modifyUserName;
100 100
101 /** 101 /**
102 + * 附件备份目录
103 + */
104 + private String filePath;
105 +
106 + /**
102 * 邮件内容 107 * 邮件内容
103 */ 108 */
104 private String body; 109 private String body;
...@@ -249,6 +254,14 @@ public class EmailHistory implements Serializable { ...@@ -249,6 +254,14 @@ public class EmailHistory implements Serializable {
249 this.modifyUserName = modifyUserName == null ? null : modifyUserName.trim(); 254 this.modifyUserName = modifyUserName == null ? null : modifyUserName.trim();
250 } 255 }
251 256
257 + public String getFilePath() {
258 + return filePath;
259 + }
260 +
261 + public void setFilePath(String filePath) {
262 + this.filePath = filePath == null ? null : filePath.trim();
263 + }
264 +
252 public String getBody() { 265 public String getBody() {
253 return body; 266 return body;
254 } 267 }
...@@ -281,6 +294,7 @@ public class EmailHistory implements Serializable { ...@@ -281,6 +294,7 @@ public class EmailHistory implements Serializable {
281 sb.append(", modifyTime=").append(modifyTime); 294 sb.append(", modifyTime=").append(modifyTime);
282 sb.append(", modifyUserId=").append(modifyUserId); 295 sb.append(", modifyUserId=").append(modifyUserId);
283 sb.append(", modifyUserName=").append(modifyUserName); 296 sb.append(", modifyUserName=").append(modifyUserName);
297 + sb.append(", filePath=").append(filePath);
284 sb.append(", body=").append(body); 298 sb.append(", body=").append(body);
285 sb.append(", serialVersionUID=").append(serialVersionUID); 299 sb.append(", serialVersionUID=").append(serialVersionUID);
286 sb.append("]"); 300 sb.append("]");
......
...@@ -1304,6 +1304,76 @@ public class EmailHistoryExample { ...@@ -1304,6 +1304,76 @@ public class EmailHistoryExample {
1304 addCriterion("MODIFY_USER_NAME not between", value1, value2, "modifyUserName"); 1304 addCriterion("MODIFY_USER_NAME not between", value1, value2, "modifyUserName");
1305 return (Criteria) this; 1305 return (Criteria) this;
1306 } 1306 }
1307 +
1308 + public Criteria andFilePathIsNull() {
1309 + addCriterion("FILE_PATH is null");
1310 + return (Criteria) this;
1311 + }
1312 +
1313 + public Criteria andFilePathIsNotNull() {
1314 + addCriterion("FILE_PATH is not null");
1315 + return (Criteria) this;
1316 + }
1317 +
1318 + public Criteria andFilePathEqualTo(String value) {
1319 + addCriterion("FILE_PATH =", value, "filePath");
1320 + return (Criteria) this;
1321 + }
1322 +
1323 + public Criteria andFilePathNotEqualTo(String value) {
1324 + addCriterion("FILE_PATH <>", value, "filePath");
1325 + return (Criteria) this;
1326 + }
1327 +
1328 + public Criteria andFilePathGreaterThan(String value) {
1329 + addCriterion("FILE_PATH >", value, "filePath");
1330 + return (Criteria) this;
1331 + }
1332 +
1333 + public Criteria andFilePathGreaterThanOrEqualTo(String value) {
1334 + addCriterion("FILE_PATH >=", value, "filePath");
1335 + return (Criteria) this;
1336 + }
1337 +
1338 + public Criteria andFilePathLessThan(String value) {
1339 + addCriterion("FILE_PATH <", value, "filePath");
1340 + return (Criteria) this;
1341 + }
1342 +
1343 + public Criteria andFilePathLessThanOrEqualTo(String value) {
1344 + addCriterion("FILE_PATH <=", value, "filePath");
1345 + return (Criteria) this;
1346 + }
1347 +
1348 + public Criteria andFilePathLike(String value) {
1349 + addCriterion("FILE_PATH like", value, "filePath");
1350 + return (Criteria) this;
1351 + }
1352 +
1353 + public Criteria andFilePathNotLike(String value) {
1354 + addCriterion("FILE_PATH not like", value, "filePath");
1355 + return (Criteria) this;
1356 + }
1357 +
1358 + public Criteria andFilePathIn(List<String> values) {
1359 + addCriterion("FILE_PATH in", values, "filePath");
1360 + return (Criteria) this;
1361 + }
1362 +
1363 + public Criteria andFilePathNotIn(List<String> values) {
1364 + addCriterion("FILE_PATH not in", values, "filePath");
1365 + return (Criteria) this;
1366 + }
1367 +
1368 + public Criteria andFilePathBetween(String value1, String value2) {
1369 + addCriterion("FILE_PATH between", value1, value2, "filePath");
1370 + return (Criteria) this;
1371 + }
1372 +
1373 + public Criteria andFilePathNotBetween(String value1, String value2) {
1374 + addCriterion("FILE_PATH not between", value1, value2, "filePath");
1375 + return (Criteria) this;
1376 + }
1307 } 1377 }
1308 1378
1309 public static class Criteria extends GeneratedCriteria { 1379 public static class Criteria extends GeneratedCriteria {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
40 sys:系统 系统相关表,例如kafka表 40 sys:系统 系统相关表,例如kafka表
41 log: 日志 日志记录表,例如邮件发送日志表 41 log: 日志 日志记录表,例如邮件发送日志表
42 --> 42 -->
43 - <javaModelGenerator targetPackage="com.fedex.connect.common.model.biz" targetProject="src/main/java"> 43 + <javaModelGenerator targetPackage="com.fedex.connect.common.model.log" targetProject="src/main/java">
44 <!---enableSubPackages:如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性--> 44 <!---enableSubPackages:如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性-->
45 <property name="enableSubPackages" value="false"/> 45 <property name="enableSubPackages" value="false"/>
46 <!--该属性只对MyBatis3有效,如果true就会使用构造方法入参,如果false就会使用setter方式。默认为false--> 46 <!--该属性只对MyBatis3有效,如果true就会使用构造方法入参,如果false就会使用setter方式。默认为false-->
...@@ -52,13 +52,13 @@ ...@@ -52,13 +52,13 @@
52 </javaModelGenerator> 52 </javaModelGenerator>
53 53
54 <!-- 生成映射文件*.xml的位置--> 54 <!-- 生成映射文件*.xml的位置-->
55 - <sqlMapGenerator targetPackage="mapper.biz" targetProject="src/main/java/com/fedex/connect/common"> 55 + <sqlMapGenerator targetPackage="mapper.log" targetProject="src/main/java/com/fedex/connect/common">
56 <!--如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性。默认为false--> 56 <!--如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性。默认为false-->
57 <property name="enableSubPackages" value="false"/> 57 <property name="enableSubPackages" value="false"/>
58 </sqlMapGenerator> 58 </sqlMapGenerator>
59 59
60 <!-- 生成DAO的包名和位置 --> 60 <!-- 生成DAO的包名和位置 -->
61 - <javaClientGenerator type="XMLMAPPER" targetPackage="com.fedex.connect.common.dao.biz" targetProject="src/main/java"> 61 + <javaClientGenerator type="XMLMAPPER" targetPackage="com.fedex.connect.common.dao.log" targetProject="src/main/java">
62 <!--如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性。默认为false--> 62 <!--如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性。默认为false-->
63 <property name="enableSubPackages" value="false"/> 63 <property name="enableSubPackages" value="false"/>
64 </javaClientGenerator> 64 </javaClientGenerator>
...@@ -87,24 +87,24 @@ ...@@ -87,24 +87,24 @@
87 <!-- selectByExampleQueryId="true">--> 87 <!-- selectByExampleQueryId="true">-->
88 <!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_OPERATION.NEXTVAL FROM DUAL" />--> 88 <!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_OPERATION.NEXTVAL FROM DUAL" />-->
89 <!-- </table>--> 89 <!-- </table>-->
90 -<!-- <table tableName="T_LOG_EMAIL_HISTORY" domainObjectName="EmailHistory"--> 90 + <table tableName="T_LOG_EMAIL_HISTORY" domainObjectName="EmailHistory"
91 + enableCountByExample="true" enableUpdateByExample="true"
92 + enableDeleteByExample="true" enableSelectByExample="true"
93 + selectByExampleQueryId="true">
94 + <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_EMAIL_HISTORY.NEXTVAL FROM DUAL" />
95 + </table>
96 +<!-- <table tableName="T_LOG_USER_LOGIN_INFO" domainObjectName="UserLoginInfo"-->
91 <!-- enableCountByExample="true" enableUpdateByExample="true"--> 97 <!-- enableCountByExample="true" enableUpdateByExample="true"-->
92 <!-- enableDeleteByExample="true" enableSelectByExample="true"--> 98 <!-- enableDeleteByExample="true" enableSelectByExample="true"-->
93 <!-- selectByExampleQueryId="true">--> 99 <!-- selectByExampleQueryId="true">-->
94 -<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_EMAIL_HISTORY.NEXTVAL FROM DUAL" />--> 100 +<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_USER_LOGIN_INFO.NEXTVAL FROM DUAL" />-->
95 <!-- </table>--> 101 <!-- </table>-->
96 -<!-- <table tableName="T_LOG_USER_LOGIN_INFO" domainObjectName="UserLoginInfo"--> 102 +<!-- <table tableName="T_BIZ_ATTACHMENT" domainObjectName="Attachment"-->
97 <!-- enableCountByExample="true" enableUpdateByExample="true"--> 103 <!-- enableCountByExample="true" enableUpdateByExample="true"-->
98 <!-- enableDeleteByExample="true" enableSelectByExample="true"--> 104 <!-- enableDeleteByExample="true" enableSelectByExample="true"-->
99 <!-- selectByExampleQueryId="true">--> 105 <!-- selectByExampleQueryId="true">-->
100 -<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_USER_LOGIN_INFO.NEXTVAL FROM DUAL" />--> 106 +<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL" />-->
101 <!-- </table>--> 107 <!-- </table>-->
102 - <table tableName="T_BIZ_ATTACHMENT" domainObjectName="Attachment"
103 - enableCountByExample="true" enableUpdateByExample="true"
104 - enableDeleteByExample="true" enableSelectByExample="true"
105 - selectByExampleQueryId="true">
106 - <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL" />
107 - </table>
108 <!-- <table tableName="T_BIZ_UPLOAD_RECORD" domainObjectName="UploadRecord"--> 108 <!-- <table tableName="T_BIZ_UPLOAD_RECORD" domainObjectName="UploadRecord"-->
109 <!-- enableCountByExample="true" enableUpdateByExample="true"--> 109 <!-- enableCountByExample="true" enableUpdateByExample="true"-->
110 <!-- enableDeleteByExample="true" enableSelectByExample="true"--> 110 <!-- enableDeleteByExample="true" enableSelectByExample="true"-->
......
...@@ -50,4 +50,20 @@ public interface BaseConstants { ...@@ -50,4 +50,20 @@ public interface BaseConstants {
50 //描述 50 //描述
51 String MSG = "msg"; 51 String MSG = "msg";
52 } 52 }
53 +
54 + //文件后缀字符串keys
55 + interface FILE_SUFFIX_KEYS{
56 + /**
57 + * json字符串
58 + */
59 + String JSON = ".json";
60 + /**
61 + * temp临时文件
62 + */
63 + String TEMP = ".temp";
64 + /**
65 + * zip文件后缀
66 + */
67 + String ZIP = ".zip";
68 + }
53 } 69 }
...\ No newline at end of file ...\ No newline at end of file
......
1 +package com.fedex.connect.task.data.dto;
2 +
3 +import lombok.Data;
4 +
5 +@Data
6 +public class PortFileDto {
7 + private String destIataCode;
8 + private String zipPath;
9 +}
1 package com.fedex.connect.task.data.dto; 1 package com.fedex.connect.task.data.dto;
2 2
3 -import com.fedex.connect.common.model.biz.Attachment;
4 import lombok.Data; 3 import lombok.Data;
5 -
6 -import java.util.List;
7 @Data 4 @Data
8 public class PushZipEmailDto { 5 public class PushZipEmailDto {
9 private String destIataCode; 6 private String destIataCode;
10 - private List<Attachment> attachments; 7 + private String filePath;
11 } 8 }
......
1 package com.fedex.connect.task.repository.dao; 1 package com.fedex.connect.task.repository.dao;
2 2
3 import com.fedex.connect.task.data.dto.PushZipEmailDto; 3 import com.fedex.connect.task.data.dto.PushZipEmailDto;
4 -import org.apache.ibatis.annotations.Mapper; 4 +import org.apache.ibatis.annotations.*;
5 -import org.apache.ibatis.annotations.Param;
6 -import org.apache.ibatis.annotations.Select;
7 5
8 import java.util.List; 6 import java.util.List;
9 7
10 @Mapper 8 @Mapper
11 public interface AttachmentExtMapper { 9 public interface AttachmentExtMapper {
12 10
13 - @Select("SELECT c.DEST_IATA_CODE, a.* " + 11 + @Select("SELECT c.DEST_IATA_CODE, a.FILE_PATH " +
14 - "FROM T_BIZ_CONSIGNMENT c " + 12 + "FROM T_BIZ_EMAIL e " +
15 - "JOIN T_BIZ_ATTACHMENT a ON c.ID = a.BIZ_ID " + 13 + "JOIN T_BIZ_CONSIGNMENT c ON e.BIZ_ID = c.ID " +
16 - "WHERE c.ID = #{conId}") 14 + "JOIN T_BIZ_ATTACHMENT a ON a.BIZ_ID = c.ID " +
17 - List<PushZipEmailDto> findAttachmentAndPortByCode(@Param("conId") Long conId); 15 + "WHERE a.STATUS = 1 " +
16 + "AND e.TYPE_CODE = #{typeCode} " +
17 + "AND e.STATUS_CODE = #{statusCode}")
18 + List<PushZipEmailDto> findPathWithPortCode(@Param("typeCode") String typeCode, @Param("statusCode") String statusCode);
18 } 19 }
......
...@@ -5,5 +5,5 @@ import com.fedex.connect.task.data.dto.PushZipEmailDto; ...@@ -5,5 +5,5 @@ import com.fedex.connect.task.data.dto.PushZipEmailDto;
5 import java.util.List; 5 import java.util.List;
6 6
7 public interface IAttachmentExtRepository { 7 public interface IAttachmentExtRepository {
8 - List<PushZipEmailDto> findAttachmentAndPortByCode(Long conId); 8 + List<PushZipEmailDto> findPathWithPortCode(String typeCode,String statusCode);
9 } 9 }
......
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
11 public class AttachmentExtRepositoryImpl extends AbstractDaoRepository implements IAttachmentExtRepository { 11 public class AttachmentExtRepositoryImpl extends AbstractDaoRepository implements IAttachmentExtRepository {
12 12
13 @Override 13 @Override
14 - public List<PushZipEmailDto> findAttachmentAndPortByCode(Long conId) { 14 + public List<PushZipEmailDto> findPathWithPortCode(String typeCode, String statusCode) {
15 - return attachmentExtMapper.findAttachmentAndPortByCode(conId); 15 + return attachmentExtMapper.findPathWithPortCode(typeCode,statusCode);
16 } 16 }
17 } 17 }
......
...@@ -3,15 +3,22 @@ package com.fedex.connect.task.service.biz.impl; ...@@ -3,15 +3,22 @@ package com.fedex.connect.task.service.biz.impl;
3 import com.fedex.connect.common.dependencies.cache.CacheSystem; 3 import com.fedex.connect.common.dependencies.cache.CacheSystem;
4 import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; 4 import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum;
5 import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; 5 import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum;
6 +import com.fedex.connect.common.dependencies.util.ZipUtils;
6 import com.fedex.connect.common.model.biz.Email; 7 import com.fedex.connect.common.model.biz.Email;
8 +import com.fedex.connect.task.data.dto.PortFileDto;
7 import com.fedex.connect.task.data.dto.PushZipEmailDto; 9 import com.fedex.connect.task.data.dto.PushZipEmailDto;
8 import com.fedex.connect.task.service.base.BaseService; 10 import com.fedex.connect.task.service.base.BaseService;
9 import com.fedex.connect.task.service.biz.IPushConsignmentFileService; 11 import com.fedex.connect.task.service.biz.IPushConsignmentFileService;
12 +import com.fedex.connect.task.utils.sys.ConFileEmailUtil;
13 +import lombok.extern.slf4j.Slf4j;
10 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
12 import org.springframework.util.CollectionUtils; 16 import org.springframework.util.CollectionUtils;
13 17
18 +import java.util.ArrayList;
19 +import java.util.HashMap;
14 import java.util.List; 20 import java.util.List;
21 +import java.util.Map;
15 22
16 /** 23 /**
17 * @Author Szl 24 * @Author Szl
...@@ -19,10 +26,18 @@ import java.util.List; ...@@ -19,10 +26,18 @@ import java.util.List;
19 * @Date 2024/11/7 26 * @Date 2024/11/7
20 */ 27 */
21 @Service 28 @Service
29 +@Slf4j
22 public class PushConsignmentFileServiceImpl extends BaseService implements IPushConsignmentFileService { 30 public class PushConsignmentFileServiceImpl extends BaseService implements IPushConsignmentFileService {
23 31
24 @Autowired 32 @Autowired
25 private CacheSystem cacheSystem; 33 private CacheSystem cacheSystem;
34 +
35 + @Autowired
36 + private ZipUtils zipUtils;
37 +
38 + @Autowired
39 + private ConFileEmailUtil conFileEmailUtil;
40 +
26 /** 41 /**
27 * @Author Szl 42 * @Author Szl
28 * @Description 功能说明 推送清关文件 43 * @Description 功能说明 推送清关文件
...@@ -32,21 +47,27 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush ...@@ -32,21 +47,27 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush
32 */ 47 */
33 @Override 48 @Override
34 public void pushConsignmentFileTask(){ 49 public void pushConsignmentFileTask(){
50 + List<Email> emails = new ArrayList<>();
51 + String tempPath = "";
52 + String finalPath = "";
35 //查询需要发送的数据 53 //查询需要发送的数据
36 - List<Email> conPushEmails = iEmailExtRepository.findConPushEmails(cacheSystem.getDicEmailType(EmailTypeEnum.PENDING.getEnMsg()).getId(), cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getEnMsg()).getId()); 54 + List<PushZipEmailDto> pathWithPortCode = attachmentExtRepository.findPathWithPortCode(cacheSystem.getDicEmailType(EmailTypeEnum.PENDING.getEnMsg()).getCode(),
37 - //打zip包 55 + cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getEnMsg()).getCode());
38 - if (!CollectionUtils.isEmpty(conPushEmails)){ 56 + if (CollectionUtils.isEmpty(pathWithPortCode)){
39 - for (Email conPushEmail : conPushEmails) { 57 + return;
40 - /**
41 - * 获取每个运单的附件
42 - */
43 - List<PushZipEmailDto> attachmentAndPortByCode = attachmentExtRepository.findAttachmentAndPortByCode(conPushEmail.getBizId());
44 - }
45 } 58 }
46 - //发送邮件
47 59
48 - //更新邮件状态 60 + //根据口岸分类构成map(口岸,filePaths)
61 + Map<String, List<PushZipEmailDto>> portAttachmentsMap = new HashMap<>();
62 + portAttachmentsMap = conFileEmailUtil.getPortAttachmentsMap(portAttachmentsMap,pathWithPortCode);
49 63
64 + //根据口岸构成zipPath的map(口岸,zip path)
65 + List<PortFileDto> portFileDtoList = new ArrayList<>();
66 + portFileDtoList = conFileEmailUtil.getPortZipMap(portFileDtoList, portAttachmentsMap, tempPath, finalPath, zipUtils);
50 67
68 + //发送邮件
69 + for (PortFileDto portFileDto : portFileDtoList) {
70 + Email email = new Email();
71 + }
51 } 72 }
52 } 73 }
......
1 +package com.fedex.connect.task.utils.sys;
2 +
3 +import com.fedex.connect.common.dependencies.contants.BaseConstants;
4 +import com.fedex.connect.common.dependencies.contants.BaseSeparatorConstants;
5 +import com.fedex.connect.common.dependencies.util.DateUtil;
6 +import com.fedex.connect.common.dependencies.util.ZipUtils;
7 +import com.fedex.connect.task.data.dto.PortFileDto;
8 +import com.fedex.connect.task.data.dto.PushZipEmailDto;
9 +import lombok.extern.slf4j.Slf4j;
10 +import org.springframework.stereotype.Component;
11 +
12 +import java.io.File;
13 +import java.io.FileOutputStream;
14 +import java.io.IOException;
15 +import java.util.ArrayList;
16 +import java.util.Date;
17 +import java.util.List;
18 +import java.util.Map;
19 +
20 +/**
21 + * @Author Szl
22 + * @Description 类说明 用于推送运单图像邮件
23 + * @Date 2024/11/13
24 + */
25 +@Slf4j
26 +@Component
27 +public class ConFileEmailUtil {
28 +
29 + /**
30 + * @Author Szl
31 + * @Description 功能说明 构建map(口岸,文件目录)
32 + * @Date 2024/11/14
33 + * @param portAttachmentsMap
34 + * @param pathWithPortCode
35 + * @return java.util.Map<java.lang.String,java.util.List<com.fedex.connect.task.data.dto.PushZipEmailDto>>
36 + */
37 + public Map<String, List<PushZipEmailDto>> getPortAttachmentsMap(Map<String, List<PushZipEmailDto>> portAttachmentsMap,List<PushZipEmailDto> pathWithPortCode){
38 + for (PushZipEmailDto dto : pathWithPortCode) {
39 + String destIataCode = dto.getDestIataCode();
40 + if (destIataCode == null || destIataCode.isEmpty()) {
41 + destIataCode = "null"; // 使用 "null" 代替空口岸
42 + }
43 + portAttachmentsMap.computeIfAbsent(destIataCode, k -> new ArrayList<>()).add(dto);
44 + }
45 + return portAttachmentsMap;
46 + }
47 +
48 + /**
49 + * @Author Szl
50 + * @Description 功能说明 根据口岸打包,每个口岸的文件打成一个zip包
51 + * @Date 2024/11/14
52 + * @param portFileDtoList
53 + * @param portAttachmentsMap
54 + * @param tempPath
55 + * @param finalPath
56 + * @param zipUtils
57 + * @return void
58 + */
59 + public List<PortFileDto> getPortZipMap(List<PortFileDto> portFileDtoList, Map<String, List<PushZipEmailDto>> portAttachmentsMap, String tempPath, String finalPath, ZipUtils zipUtils){
60 + for (Map.Entry<String, List<PushZipEmailDto>> entry : portAttachmentsMap.entrySet()) {
61 + List<File> filesList = new ArrayList<>();
62 + String portCode = entry.getKey();
63 + List<PushZipEmailDto> portAttachments = entry.getValue();
64 +
65 + // 打zip包
66 + String date = DateUtil.formatTimeWithoutSlash(new Date());
67 + String fileName = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP;
68 + String fileNameTemp = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP + BaseConstants.FILE_SUFFIX_KEYS.TEMP;
69 + FileOutputStream fos = null;
70 +
71 + for (PushZipEmailDto portAttachment : portAttachments) {
72 + File file = new File(portAttachment.getFilePath());
73 + if (file.exists()) {
74 + filesList.add(file);
75 + }
76 + }
77 +
78 + try {
79 + fos = new FileOutputStream(tempPath + fileNameTemp);
80 + zipUtils.toZip(filesList, fos);
81 +
82 + File file = new File(tempPath + fileNameTemp);
83 + File finalFile = new File(finalPath + fileName);
84 +
85 + // 打包完成后重命名为正式文件
86 + if (!file.renameTo(finalFile)) {
87 + throw new IOException("无法重命名文件 " + file.getAbsolutePath() + " 到 " + finalFile.getAbsolutePath());
88 + }
89 +
90 + // 将结果添加到 portFileDtoList
91 + PortFileDto portFileDto = new PortFileDto();
92 + portFileDto.setDestIataCode(portCode);
93 + portFileDto.setZipPath(finalPath + fileName);
94 + portFileDtoList.add(portFileDto);
95 +
96 + } catch (Exception e) {
97 + log.error("生成压缩包错误:{}", e.getMessage(), e);
98 + } finally {
99 + try {
100 + if (fos != null) {
101 + fos.close();
102 + fos = null;
103 + }
104 + } catch (Exception e) {
105 + log.error(e.getMessage(), e);
106 + }
107 + }
108 + }
109 + return portFileDtoList;
110 + }
111 +
112 +}