Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
4437228d
Commit
4437228d
authored
Sep 15, 2022
by
郑勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1008406] 【优化】ERP出版基金相关环节优化
parent
9c9f46fd
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
6 deletions
+60
-6
BookFundDetailDto.java
...main/java/com/pcloud/book/book/dto/BookFundDetailDto.java
+3
-0
BookFundBiz.java
...k/src/main/java/com/pcloud/book/book/biz/BookFundBiz.java
+5
-0
BookFundBizImpl.java
...n/java/com/pcloud/book/book/biz/impl/BookFundBizImpl.java
+13
-5
BookFundDao.java
...k/src/main/java/com/pcloud/book/book/dao/BookFundDao.java
+2
-0
BookFundDaoImpl.java
...n/java/com/pcloud/book/book/dao/impl/BookFundDaoImpl.java
+7
-0
BookFreezeFacadeImpl.java
...om/pcloud/book/book/facade/impl/BookFreezeFacadeImpl.java
+11
-0
BookFundFacadeImpl.java
.../com/pcloud/book/book/facade/impl/BookFundFacadeImpl.java
+10
-0
ErpConsr.java
.../src/main/java/com/pcloud/book/consumer/erp/ErpConsr.java
+2
-1
BookFund.Mapper.xml
...e-book/src/main/resources/mapper/book/BookFund.Mapper.xml
+7
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookFundDetailDto.java
View file @
4437228d
...
@@ -72,4 +72,7 @@ public class BookFundDetailDto implements Serializable {
...
@@ -72,4 +72,7 @@ public class BookFundDetailDto implements Serializable {
@ApiModelProperty
(
"解冻时间"
)
@ApiModelProperty
(
"解冻时间"
)
private
Date
thawTime
;
private
Date
thawTime
;
@ApiModelProperty
(
"批次号"
)
private
String
batchNumber
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookFundBiz.java
View file @
4437228d
...
@@ -180,4 +180,9 @@ public interface BookFundBiz {
...
@@ -180,4 +180,9 @@ public interface BookFundBiz {
* 同步旧数据
* 同步旧数据
*/
*/
Map
<
Long
,
BookFundDetailDto
>
synOldFundData
(
List
<
Long
>
bookIds
);
Map
<
Long
,
BookFundDetailDto
>
synOldFundData
(
List
<
Long
>
bookIds
);
/**
* 验证批次号是否重复
*/
Boolean
checkRepeatBatchNumber
(
String
batchNumber
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookFundBizImpl.java
View file @
4437228d
...
@@ -46,6 +46,7 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -46,6 +46,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
lombok.val
;
/**
/**
* @描述:书刊基金业务实现层
* @描述:书刊基金业务实现层
...
@@ -91,8 +92,8 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -91,8 +92,8 @@ public class BookFundBizImpl implements BookFundBiz {
BookFundDto
dto
=
bookFundDao
.
getMaxEndTimeByBookId
(
bookId
);
BookFundDto
dto
=
bookFundDao
.
getMaxEndTimeByBookId
(
bookId
);
if
(
null
!=
dto
)
{
if
(
null
!=
dto
)
{
//如果endTime最大的一个复合要求就同步
//如果endTime最大的一个复合要求就同步
if
(
new
Date
().
before
(
dto
.
get
StartTime
())
||
(
new
Date
().
after
(
dto
.
getStartTime
())
&&
new
Date
().
before
(
dto
.
getEndTime
()))
)
{
if
(
new
Date
().
before
(
dto
.
get
EndTime
()))
{
erpConsr
.
addFund
(
bookId
,
DateUtil
.
formatDateTime
(
dto
.
getStartTime
()),
DateUtil
.
formatDateTime
(
dto
.
getEndTime
()),
dto
.
getFundName
(),
dto
.
getPurchaseMoney
());
erpConsr
.
addFund
(
bookId
,
DateUtil
.
formatDateTime
(
dto
.
getStartTime
()),
DateUtil
.
formatDateTime
(
dto
.
getEndTime
()),
dto
.
getFundName
(),
dto
.
getPurchaseMoney
()
,
dto
.
getBatchNumber
()
);
}
else
{
}
else
{
//否则删除
//否则删除
erpConsr
.
deleteFund
(
bookId
);
erpConsr
.
deleteFund
(
bookId
);
...
@@ -425,6 +426,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -425,6 +426,7 @@ public class BookFundBizImpl implements BookFundBiz {
return
;
return
;
}
}
// erp逻辑,此处先解冻。
// erp逻辑,此处先解冻。
// 可能有的没有冻结
List
<
BookFund
>
list
=
new
ArrayList
<>();
List
<
BookFund
>
list
=
new
ArrayList
<>();
BookFund
build
=
null
;
BookFund
build
=
null
;
for
(
Long
bookId
:
bookFund
.
getBookIds
())
{
for
(
Long
bookId
:
bookFund
.
getBookIds
())
{
...
@@ -482,7 +484,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -482,7 +484,7 @@ public class BookFundBizImpl implements BookFundBiz {
BookFundDetailDto
dto
=
new
BookFundDetailDto
();
BookFundDetailDto
dto
=
new
BookFundDetailDto
();
if
(
CollUtil
.
isNotEmpty
(
bookFundMap
)
&&
bookFundMap
.
containsKey
(
bookId
)){
if
(
CollUtil
.
isNotEmpty
(
bookFundMap
)
&&
bookFundMap
.
containsKey
(
bookId
)){
List
<
BookFundDto
>
bookFundDtos
=
bookFundMap
.
get
(
bookId
);
List
<
BookFundDto
>
bookFundDtos
=
bookFundMap
.
get
(
bookId
);
bookFundDtos
.
sort
(
Comparator
.
comparing
(
BookFundDto:
:
get
EndTime
));
bookFundDtos
.
sort
(
Comparator
.
comparing
(
BookFundDto:
:
get
StartTime
).
reversed
(
));
for
(
BookFundDto
bookFundDto
:
bookFundDtos
)
{
for
(
BookFundDto
bookFundDto
:
bookFundDtos
)
{
Date
startTime
=
bookFundDto
.
getStartTime
();
Date
startTime
=
bookFundDto
.
getStartTime
();
Date
endTime
=
bookFundDto
.
getEndTime
();
Date
endTime
=
bookFundDto
.
getEndTime
();
...
@@ -494,8 +496,8 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -494,8 +496,8 @@ public class BookFundBizImpl implements BookFundBiz {
if
(
new
Date
().
before
(
endTime
))
{
if
(
new
Date
().
before
(
endTime
))
{
isFundSupport
=
true
;
isFundSupport
=
true
;
}
}
//这些字段取最后一个
//这些字段取最后一个
,因为排序是从最后开始。所以第一个取到了后面就不更新了。
if
(
BookFreezeEnum
.
NO_FREEZE
.
value
.
equals
(
freezeStatus
))
{
if
(
BookFreezeEnum
.
NO_FREEZE
.
value
.
equals
(
freezeStatus
)
&&
null
==
dto
.
getStartTime
()
)
{
dto
.
setStartTime
(
startTime
);
dto
.
setStartTime
(
startTime
);
dto
.
setEndTime
(
endTime
);
dto
.
setEndTime
(
endTime
);
dto
.
setFundName
(
bookFundDto
.
getFundName
());
dto
.
setFundName
(
bookFundDto
.
getFundName
());
...
@@ -522,4 +524,10 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -522,4 +524,10 @@ public class BookFundBizImpl implements BookFundBiz {
}
}
return
result
;
return
result
;
}
}
@Override
public
Boolean
checkRepeatBatchNumber
(
String
batchNumber
)
{
Integer
count
=
bookFundDao
.
getCountByBatchNumber
(
batchNumber
);
return
count
>
0
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/BookFundDao.java
View file @
4437228d
...
@@ -141,4 +141,6 @@ public interface BookFundDao extends BaseDao<BookFund> {
...
@@ -141,4 +141,6 @@ public interface BookFundDao extends BaseDao<BookFund> {
List
<
BookFundDto
>
getListByBookIds
(
List
<
Long
>
bookIds
);
List
<
BookFundDto
>
getListByBookIds
(
List
<
Long
>
bookIds
);
BookFundDto
getMaxEndTimeByBookId
(
Long
bookId
);
BookFundDto
getMaxEndTimeByBookId
(
Long
bookId
);
Integer
getCountByBatchNumber
(
String
batchNumber
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/impl/BookFundDaoImpl.java
View file @
4437228d
...
@@ -144,4 +144,11 @@ public class BookFundDaoImpl extends BaseDaoImpl<BookFund> implements BookFundDa
...
@@ -144,4 +144,11 @@ public class BookFundDaoImpl extends BaseDaoImpl<BookFund> implements BookFundDa
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"bookId"
,
bookId
);
return
super
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getMaxEndTimeByBookId"
),
paramMap
);
return
super
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getMaxEndTimeByBookId"
),
paramMap
);
}
}
@Override
public
Integer
getCountByBatchNumber
(
String
batchNumber
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"batchNumber"
,
batchNumber
);
return
super
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getCountByBatchNumber"
),
paramMap
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookFreezeFacadeImpl.java
View file @
4437228d
...
@@ -119,4 +119,15 @@ public class BookFreezeFacadeImpl implements BookFreezeFacade {
...
@@ -119,4 +119,15 @@ public class BookFreezeFacadeImpl implements BookFreezeFacade {
public
ResponseDto
<
List
<
BookFreezeInfoDto
>>
listBookFreezeInfo
(
@RequestBody
List
<
Long
>
bookIds
){
public
ResponseDto
<
List
<
BookFreezeInfoDto
>>
listBookFreezeInfo
(
@RequestBody
List
<
Long
>
bookIds
){
return
new
ResponseDto
<>(
bookFreezeBiz
.
listBookFreezeInfo
(
bookIds
));
return
new
ResponseDto
<>(
bookFreezeBiz
.
listBookFreezeInfo
(
bookIds
));
}
}
@ApiOperation
(
"filterFreezeBook"
)
@PostMapping
(
"filterFreezeBook"
)
public
ResponseDto
<
List
<
Long
>>
filterFreezeBook
(
@RequestBody
List
<
Long
>
bookIds
){
return
new
ResponseDto
<>(
bookFreezeBiz
.
filterFreezeBook
(
bookIds
));
}
@PostMapping
(
"listFreezeInfo"
)
public
ResponseDto
<
List
<
BookFreezeDto
>>
listFreezeInfo
(
@RequestBody
List
<
Long
>
bookIds
){
return
new
ResponseDto
<>(
bookFreezeBiz
.
listFreezeInfo
(
bookIds
));
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookFundFacadeImpl.java
View file @
4437228d
package
com
.
pcloud
.
book
.
book
.
facade
.
impl
;
package
com
.
pcloud
.
book
.
book
.
facade
.
impl
;
import
com.pcloud.book.book.biz.BookFundBiz
;
import
com.pcloud.book.book.biz.BookFundBiz
;
import
com.pcloud.book.book.dto.BookFreezeDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.entity.BookFund
;
import
com.pcloud.book.book.entity.BookFund
;
import
com.pcloud.book.book.facade.BookFundFacade
;
import
com.pcloud.book.book.facade.BookFundFacade
;
...
@@ -12,6 +13,7 @@ import com.pcloud.common.permission.PermissionException;
...
@@ -12,6 +13,7 @@ import com.pcloud.common.permission.PermissionException;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.SessionUtil
;
import
org.codehaus.jackson.JsonParseException
;
import
org.codehaus.jackson.JsonParseException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -145,4 +147,12 @@ public class BookFundFacadeImpl implements BookFundFacade {
...
@@ -145,4 +147,12 @@ public class BookFundFacadeImpl implements BookFundFacade {
return
new
ResponseDto
<>(
bookFundBiz
.
synOldFundData
(
bookIds
));
return
new
ResponseDto
<>(
bookFundBiz
.
synOldFundData
(
bookIds
));
}
}
/**
* 验证批次号是否重复
*/
@RequestMapping
(
"checkRepeatBatchNumber"
)
public
ResponseDto
<
Boolean
>
checkRepeatBatchNumber
(
@RequestParam
(
value
=
"batchNumber"
)
String
batchNumber
){
return
new
ResponseDto
<>(
bookFundBiz
.
checkRepeatBatchNumber
(
batchNumber
));
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/erp/ErpConsr.java
View file @
4437228d
...
@@ -465,13 +465,14 @@ public class ErpConsr {
...
@@ -465,13 +465,14 @@ public class ErpConsr {
/**
/**
* 添加基金书刊
* 添加基金书刊
*/
*/
public
void
addFund
(
Long
bookId
,
String
startTime
,
String
endTime
,
String
fundName
,
BigDecimal
purchaseMoney
)
{
public
void
addFund
(
Long
bookId
,
String
startTime
,
String
endTime
,
String
fundName
,
BigDecimal
purchaseMoney
,
String
batchNumber
)
{
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
querys
.
put
(
"bookId"
,
bookId
.
toString
());
querys
.
put
(
"bookId"
,
bookId
.
toString
());
querys
.
put
(
"startTime"
,
startTime
);
querys
.
put
(
"startTime"
,
startTime
);
querys
.
put
(
"endTime"
,
endTime
);
querys
.
put
(
"endTime"
,
endTime
);
querys
.
put
(
"fundName"
,
fundName
);
querys
.
put
(
"fundName"
,
fundName
);
querys
.
put
(
"purchaseMoney"
,
purchaseMoney
.
toString
());
querys
.
put
(
"purchaseMoney"
,
purchaseMoney
.
toString
());
querys
.
put
(
"batchNumber"
,
batchNumber
);
try
{
try
{
HttpResponse
response
=
HttpUtils
.
doGet
(
domain
,
"/erp/project4Third/addFund"
,
"GET"
,
new
HashMap
<>(),
querys
);
HttpResponse
response
=
HttpUtils
.
doGet
(
domain
,
"/erp/project4Third/addFund"
,
"GET"
,
new
HashMap
<>(),
querys
);
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
...
...
pcloud-service-book/src/main/resources/mapper/book/BookFund.Mapper.xml
View file @
4437228d
...
@@ -311,4 +311,10 @@
...
@@ -311,4 +311,10 @@
limit 1
limit 1
</select>
</select>
<select
id=
"getCountByBatchNumber"
parameterType=
"map"
resultType=
"Integer"
>
select ifnull(count(1),0)
from BOOK_FUND
where BATCH_NUMBER=#{batchNumber}
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment