Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-Connect-Pre-Clearance
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
zelong.shao
2024-11-04 19:40:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9f0beaf74b49ca84f432c84a4b0984d096248241
9f0beaf7
1 parent
98cee560
customer|查询调整,通过中间表查询
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
86 additions
and
20 deletions
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/biz/IAttachmentController.java
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/biz/impl/ConsignmentControllerImpl.java
server/biz-customer/src/main/java/com/fedex/connect/customer/data/query/ConsignmentQuery.java
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/base/BaseDao.java
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/dao/AttachmentMapper.java → server/biz-customer/src/main/java/com/fedex/connect/customer/repository/dao/AttachmentExtMapper.java
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/mapper/AttachmentMapper.xml → server/biz-customer/src/main/java/com/fedex/connect/customer/repository/mapper/AttachmentExtMapper.xml
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/mapper/ConsignmentExtMapper.xml
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/repo/IConsignmentExtRepository.java
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/repo/impl/AttachmentRepositoryImpl.java → server/biz-customer/src/main/java/com/fedex/connect/customer/repository/repo/impl/AttachmentExtRepositoryImpl.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/ConsignmentServiceImpl.java
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/biz/IAttachmentController.java
View file @
9f0beaf
package
com
.
fedex
.
connect
.
customer
.
controller
.
biz
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseResultVo
;
import
com.fedex.connect.customer.data.bo.LongBo
;
import
org.springframework.web.bind.annotation.RequestBody
;
public
interface
IAttachmentController
{
ResponseResultVo
findHistory
(
@RequestBody
LongBo
bo
);
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/biz/impl/ConsignmentControllerImpl.java
View file @
9f0beaf
...
...
@@ -4,6 +4,7 @@ import com.fedex.connect.common.dependencies.date.model.LogShowModel;
import
com.fedex.connect.common.dependencies.date.vo.ResponseResultVo
;
import
com.fedex.connect.common.dependencies.enums.ResponseCode
;
import
com.fedex.connect.common.dependencies.util.CurrentUserInfo
;
import
com.fedex.connect.common.model.sys.User
;
import
com.fedex.connect.customer.controller.AbstractEtController
;
import
com.fedex.connect.customer.controller.biz.IConsignmentController
;
import
com.fedex.connect.customer.data.query.ConsignmentQuery
;
...
...
@@ -32,9 +33,12 @@ public class ConsignmentControllerImpl extends AbstractEtController implements I
@ApiOperation
(
value
=
"运单查询"
)
public
ResponseResultVo
findConsignment
(
@RequestBody
ConsignmentQuery
consignmentQuery
)
{
Long
userId
=
null
;
String
uuid
=
null
;
try
{
userId
=
CurrentUserInfo
.
getUserId
();
//userId = 0L;
User
user
=
CurrentUserInfo
.
getUser
();
userId
=
user
.
getId
();
uuid
=
user
.
getUserUuid
();
userId
=
0L
;
}
catch
(
Exception
e
)
{
logger
.
error
(
LogShowModel
.
showException
(
"Exception"
,
e
));
return
ResponseResultVo
.
fail
(
localeMessageUtil
.
getMessage
(
ResponseCode
.
TOKEN_FORMAT_ERROR
.
getMsg
()));
...
...
@@ -45,6 +49,7 @@ public class ConsignmentControllerImpl extends AbstractEtController implements I
ConsignmentQuery
query
=
ConsignmentQuery
.
dataProcessing
(
consignmentQuery
);
query
.
setUserId
(
userId
);
query
.
setUuid
(
uuid
);
return
consignmentService
.
findConsignments
(
query
);
}
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/data/query/ConsignmentQuery.java
View file @
9f0beaf
...
...
@@ -51,6 +51,17 @@ public class ConsignmentQuery extends PageBase {
@JsonIgnore
private
Long
userId
;
@JsonIgnore
private
String
uuid
;
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
public
String
getCreateTimeFrom
()
{
return
createTimeFrom
;
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/base/BaseDao.java
View file @
9f0beaf
package
com
.
fedex
.
connect
.
customer
.
repository
.
base
;
import
com.fedex.connect.customer.repository.dao.AttachmentMapper
;
import
com.fedex.connect.customer.repository.dao.Attachment
Ext
Mapper
;
import
com.fedex.connect.customer.repository.dao.ConsignmentExtMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -8,5 +8,5 @@ public class BaseDao {
@Autowired
public
ConsignmentExtMapper
consignmentExtMapper
;
@Autowired
public
Attachment
Mapper
attachmen
tMapper
;
public
Attachment
ExtMapper
attachmentEx
tMapper
;
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/dao/AttachmentMapper.java
→
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/dao/Attachment
Ext
Mapper.java
View file @
9f0beaf
...
...
@@ -7,6 +7,6 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
@Mapper
public
interface
AttachmentMapper
{
public
interface
Attachment
Ext
Mapper
{
List
<
AttachmentHistoryDto
>
findHistory
(
@Param
(
"bizId"
)
Long
bizId
);
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/mapper/AttachmentMapper.xml
→
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/mapper/Attachment
Ext
Mapper.xml
View file @
9f0beaf
File moved
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/mapper/ConsignmentExtMapper.xml
View file @
9f0beaf
...
...
@@ -46,39 +46,83 @@
</resultMap>
<select
id=
"findConsignments"
resultType=
"com.fedex.connect.common.model.biz.Consignment"
>
SELECT *
FROM T_BIZ_CONSIGNMENT
WHERE CREATE_USER_ID = #{userId}
SELECT c.*
FROM T_BIZ_USER_CONSIGNMENT_MAPPING m
JOIN T_BIZ_CONSIGNMENT c ON m.consignment_id = c.id
WHERE m.user_id = #{userId}
<if
test=
"createTimeFrom != null and createTimeFrom != ''"
>
AND CREATE_TIME
>
= TO_DATE(#{createTimeFrom}, 'YYYY-MM-DD HH24:MI:SS')
AND
c.
CREATE_TIME
>
= TO_DATE(#{createTimeFrom}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"createTimeTo != null and createTimeTo != ''"
>
AND CREATE_TIME
<
= TO_DATE(#{createTimeTo}, 'YYYY-MM-DD HH24:MI:SS')
AND
c.
CREATE_TIME
<
= TO_DATE(#{createTimeTo}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"consignmentCodeList != null and consignmentCodeList.size() != 0"
>
AND CONSIGNMENT_CODE IN
AND c.CONSIGNMENT_CODE IN
<foreach
collection=
"consignmentCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</if>
UNION
SELECT c.*
FROM T_BIZ_CONSIGNMENT c
WHERE c.user_uuid = #{uuid,jdbcType=VARCHAR}
<!-- 明确指定 jdbcType -->
<if
test=
"createTimeFrom != null and createTimeFrom != ''"
>
AND c.CREATE_TIME
>
= TO_DATE(#{createTimeFrom}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"createTimeTo != null and createTimeTo != ''"
>
AND c.CREATE_TIME
<
= TO_DATE(#{createTimeTo}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"consignmentCodeList != null and consignmentCodeList.size() != 0"
>
AND c.CONSIGNMENT_CODE IN
<foreach
collection=
"consignmentCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</if>
</select>
<select
id=
"findAllCount"
resultType=
"java.lang.Long"
>
SELECT COUNT(*)
FROM T_BIZ_CONSIGNMENT
WHERE CREATE_USER_ID = #{userId}
FROM (
SELECT c.id AS consignment_id
FROM T_BIZ_USER_CONSIGNMENT_MAPPING m
JOIN T_BIZ_CONSIGNMENT c ON m.consignment_id = c.id
WHERE m.user_id = #{userId}
<if
test=
"createTimeFrom != null and createTimeFrom != ''"
>
AND CREATE_TIME
>
= TO_DATE(#{createTimeFrom}, 'YYYY-MM-DD HH24:MI:SS')
AND
c.
CREATE_TIME
>
= TO_DATE(#{createTimeFrom}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"createTimeTo != null and createTimeTo != ''"
>
AND CREATE_TIME
<
= TO_DATE(#{createTimeTo}, 'YYYY-MM-DD HH24:MI:SS')
AND
c.
CREATE_TIME
<
= TO_DATE(#{createTimeTo}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"consignmentCodeList != null and consignmentCodeList.size() != 0"
>
AND CONSIGNMENT_CODE IN
AND
c.
CONSIGNMENT_CODE IN
<foreach
collection=
"consignmentCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</if>
UNION
SELECT c.id AS consignment_id
FROM T_BIZ_CONSIGNMENT c
WHERE c.user_uuid = #{uuid,jdbcType=VARCHAR}
<if
test=
"createTimeFrom != null and createTimeFrom != ''"
>
AND c.CREATE_TIME
>
= TO_DATE(#{createTimeFrom}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"createTimeTo != null and createTimeTo != ''"
>
AND c.CREATE_TIME
<
= TO_DATE(#{createTimeTo}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"consignmentCodeList != null and consignmentCodeList.size() != 0"
>
AND c.CONSIGNMENT_CODE IN
<foreach
collection=
"consignmentCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
</if>
) combined_results
</select>
</mapper>
\ No newline at end of file
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/repo/IConsignmentExtRepository.java
View file @
9f0beaf
...
...
@@ -8,5 +8,5 @@ import java.util.List;
public
interface
IConsignmentExtRepository
{
List
<
Consignment
>
findConsignments
(
ConsignmentQuery
query
);
public
Long
findAllCount
(
ConsignmentQuery
query
);
Long
findAllCount
(
ConsignmentQuery
query
);
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/repo/impl/AttachmentRepositoryImpl.java
→
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/repo/impl/Attachment
Ext
RepositoryImpl.java
View file @
9f0beaf
...
...
@@ -8,9 +8,9 @@ import org.springframework.stereotype.Repository;
import
java.util.List
;
@Repository
public
class
AttachmentRepositoryImpl
extends
BaseDao
implements
IAttachmentRepository
{
public
class
Attachment
Ext
RepositoryImpl
extends
BaseDao
implements
IAttachmentRepository
{
@Override
public
List
<
AttachmentHistoryDto
>
findHistory
(
Long
bizId
)
{
return
attachmentMapper
.
findHistory
(
bizId
);
return
attachment
Ext
Mapper
.
findHistory
(
bizId
);
}
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/ConsignmentServiceImpl.java
View file @
9f0beaf
...
...
@@ -37,7 +37,8 @@ public class ConsignmentServiceImpl extends AbstractEtService implements IConsig
List
<
Consignment
>
consignments
=
consignmentExtRepository
.
findConsignments
(
query
);
pageResult
.
setList
(
consignments
);
}
List
<
Consignment
>
consignments
=
consignmentExtRepository
.
findConsignments
(
query
);
pageResult
.
setList
(
consignments
);
return
ResponseResultVo
.
succ
(
pageResult
);
}
}
...
...
Please
register
or
login
to post a comment