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
5f32768f
Commit
5f32768f
authored
Sep 02, 2022
by
郑勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1008302] 出版基金项目状态线上化
parent
b9e91335
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
481 additions
and
10 deletions
+481
-10
BookFundDetailDto.java
...main/java/com/pcloud/book/book/dto/BookFundDetailDto.java
+75
-0
BookFreeze.java
...src/main/java/com/pcloud/book/book/entity/BookFreeze.java
+10
-0
BookFund.java
...k/src/main/java/com/pcloud/book/book/entity/BookFund.java
+38
-3
ThawEarning.java
...rc/main/java/com/pcloud/book/book/entity/ThawEarning.java
+10
-0
BookFundBiz.java
...k/src/main/java/com/pcloud/book/book/biz/BookFundBiz.java
+11
-0
BookFreezeBizImpl.java
...java/com/pcloud/book/book/biz/impl/BookFreezeBizImpl.java
+14
-0
BookFundBizImpl.java
...n/java/com/pcloud/book/book/biz/impl/BookFundBizImpl.java
+162
-0
BookFundDao.java
...k/src/main/java/com/pcloud/book/book/dao/BookFundDao.java
+4
-0
BookFundDaoImpl.java
...n/java/com/pcloud/book/book/dao/impl/BookFundDaoImpl.java
+15
-0
BookFreezeFacade.java
...in/java/com/pcloud/book/book/facade/BookFreezeFacade.java
+2
-2
BookFreezeFacadeImpl.java
...om/pcloud/book/book/facade/impl/BookFreezeFacadeImpl.java
+10
-5
BookFundFacadeImpl.java
.../com/pcloud/book/book/facade/impl/BookFundFacadeImpl.java
+19
-0
BookFreezeInfoDto.java
.../main/java/com/pcloud/book/book/vo/BookFreezeInfoDto.java
+2
-0
ErpConsr.java
.../src/main/java/com/pcloud/book/consumer/erp/ErpConsr.java
+70
-0
BookFreeze.Mapper.xml
...book/src/main/resources/mapper/book/BookFreeze.Mapper.xml
+1
-0
BookFund.Mapper.xml
...e-book/src/main/resources/mapper/book/BookFund.Mapper.xml
+38
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookFundDetailDto.java
0 → 100644
View file @
5f32768f
package
com
.
pcloud
.
book
.
book
.
dto
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
BookFundDetailDto
implements
Serializable
{
/**
* 书刊ID
*/
@ApiModelProperty
(
value
=
"书刊ID"
)
private
Long
bookId
;
/**
* 基金名字
*/
@ApiModelProperty
(
value
=
"基金名字"
)
private
String
fundName
;
/**
* 转让方名字
*/
@ApiModelProperty
(
value
=
"转让方名字"
)
private
String
transferor
;
/**
* 购买金额
*/
@ApiModelProperty
(
value
=
"购买金额"
)
private
BigDecimal
purchaseMoney
;
/**
* 开始时间
*/
@ApiModelProperty
(
value
=
"开始时间"
)
private
Date
startTime
;
/**
* 结束时间
*/
@ApiModelProperty
(
value
=
"结束时间"
)
private
Date
endTime
;
/**
* 书刊是否有编辑关联
*/
private
Boolean
isHaveAdviser
;
/**
* 书刊是否有基金支持
*/
private
Boolean
isFundSupport
;
/**
* 书刊是否有基金
*/
private
Boolean
isHaveFund
;
/**
* 冻结状态
*/
private
Integer
FreezeStatus
;
@ApiModelProperty
(
"冻结时间"
)
private
Date
freezeTime
;
@ApiModelProperty
(
"解冻时间"
)
private
Date
thawTime
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/book/entity/BookFreeze.java
View file @
5f32768f
...
@@ -60,6 +60,16 @@ public class BookFreeze extends BaseEntity{
...
@@ -60,6 +60,16 @@ public class BookFreeze extends BaseEntity{
*/
*/
private
String
transferor
;
private
String
transferor
;
private
Integer
fromErp
;
public
Integer
getFromErp
()
{
return
fromErp
;
}
public
void
setFromErp
(
Integer
fromErp
)
{
this
.
fromErp
=
fromErp
;
}
public
Long
getId
()
{
public
Long
getId
()
{
return
id
;
return
id
;
}
}
...
...
pcloud-facade-book/src/main/java/com/pcloud/book/book/entity/BookFund.java
View file @
5f32768f
...
@@ -3,6 +3,7 @@ package com.pcloud.book.book.entity;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.book.entity;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
/**
* @描述:书刊基金实体
* @描述:书刊基金实体
...
@@ -79,6 +80,26 @@ public class BookFund extends BaseEntity {
...
@@ -79,6 +80,26 @@ public class BookFund extends BaseEntity {
*/
*/
private
Integer
isTransferor
;
private
Integer
isTransferor
;
private
Integer
fromErp
;
private
List
<
Long
>
bookIds
;
public
List
<
Long
>
getBookIds
()
{
return
bookIds
;
}
public
void
setBookIds
(
List
<
Long
>
bookIds
)
{
this
.
bookIds
=
bookIds
;
}
public
Integer
getFromErp
()
{
return
fromErp
;
}
public
void
setFromErp
(
Integer
fromErp
)
{
this
.
fromErp
=
fromErp
;
}
public
Integer
getIsTransferor
()
{
public
Integer
getIsTransferor
()
{
return
isTransferor
;
return
isTransferor
;
}
}
...
@@ -185,8 +206,22 @@ public class BookFund extends BaseEntity {
...
@@ -185,8 +206,22 @@ public class BookFund extends BaseEntity {
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"BookFund [bookFundId="
+
bookFundId
+
", bookId="
+
bookId
+
", fundName="
+
fundName
return
"BookFund{"
+
+
", purchaseMoney="
+
purchaseMoney
+
", startTime="
+
startTime
+
", endTime="
+
endTime
"bookFundId="
+
bookFundId
+
+
", createdUser="
+
createdUser
+
", lastModifiedUser="
+
lastModifiedUser
+
"]"
;
", bookId="
+
bookId
+
", fundName='"
+
fundName
+
'\''
+
", purchaseMoney="
+
purchaseMoney
+
", startTime='"
+
startTime
+
'\''
+
", endTime='"
+
endTime
+
'\''
+
", createdUser="
+
createdUser
+
", lastModifiedUser="
+
lastModifiedUser
+
", proxyMode="
+
proxyMode
+
", transferor='"
+
transferor
+
'\''
+
", contractNo='"
+
contractNo
+
'\''
+
", batchNumber='"
+
batchNumber
+
'\''
+
", isTransferor="
+
isTransferor
+
", fromErp="
+
fromErp
+
", bookIds="
+
bookIds
+
'}'
;
}
}
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/book/entity/ThawEarning.java
View file @
5f32768f
...
@@ -37,6 +37,16 @@ public class ThawEarning extends BaseEntity {
...
@@ -37,6 +37,16 @@ public class ThawEarning extends BaseEntity {
*/
*/
private
BookFund
bookFund
;
private
BookFund
bookFund
;
private
Integer
fromErp
;
public
Integer
getFromErp
()
{
return
fromErp
;
}
public
void
setFromErp
(
Integer
fromErp
)
{
this
.
fromErp
=
fromErp
;
}
public
Long
getBookId
()
{
public
Long
getBookId
()
{
return
bookId
;
return
bookId
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookFundBiz.java
View file @
5f32768f
package
com
.
pcloud
.
book
.
book
.
biz
;
package
com
.
pcloud
.
book
.
book
.
biz
;
import
com.pcloud.book.book.dto.BookFundDetailDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookFundInfoDto
;
import
com.pcloud.book.book.dto.BookFundInfoDto
;
import
com.pcloud.book.book.entity.BookFund
;
import
com.pcloud.book.book.entity.BookFund
;
...
@@ -169,4 +170,14 @@ public interface BookFundBiz {
...
@@ -169,4 +170,14 @@ public interface BookFundBiz {
* * @param null
* * @param null
*/
*/
Integer
getFundBookCount
();
Integer
getFundBookCount
();
/**
* 批量创建书刊基金状态
*/
void
batchCreate
(
BookFund
bookFund
);
/**
* 同步旧数据
*/
Map
<
Long
,
BookFundDetailDto
>
synOldFundData
(
List
<
Long
>
bookIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookFreezeBizImpl.java
View file @
5f32768f
...
@@ -11,6 +11,7 @@ import com.pcloud.book.book.entity.BookFund;
...
@@ -11,6 +11,7 @@ import com.pcloud.book.book.entity.BookFund;
import
com.pcloud.book.book.entity.ThawEarning
;
import
com.pcloud.book.book.entity.ThawEarning
;
import
com.pcloud.book.book.vo.BookFreezeFilterVO
;
import
com.pcloud.book.book.vo.BookFreezeFilterVO
;
import
com.pcloud.book.book.vo.BookFreezeInfoDto
;
import
com.pcloud.book.book.vo.BookFreezeInfoDto
;
import
com.pcloud.book.consumer.erp.ErpConsr
;
import
com.pcloud.common.core.constant.MQTopicProducer
;
import
com.pcloud.common.core.constant.MQTopicProducer
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
...
@@ -29,6 +30,8 @@ import java.util.Collections;
...
@@ -29,6 +30,8 @@ import java.util.Collections;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
cn.hutool.core.date.DateUtil
;
/**
/**
* 图书冻结业务层实现类
* 图书冻结业务层实现类
*
*
...
@@ -48,6 +51,8 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -48,6 +51,8 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
private
BookFundBiz
bookFundBiz
;
private
BookFundBiz
bookFundBiz
;
@Autowired
@Autowired
private
AmqpTemplate
amqpTemplate
;
private
AmqpTemplate
amqpTemplate
;
@Autowired
private
ErpConsr
erpConsr
;
/**
/**
* 获取图书是否被冻结
* 获取图书是否被冻结
...
@@ -73,6 +78,8 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -73,6 +78,8 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
}
}
try
{
try
{
bookFreezeDao
.
insert
(
bookFreeze
);
bookFreezeDao
.
insert
(
bookFreeze
);
//同步到erp
erpConsr
.
freezeFund
(
bookFreeze
.
getBookId
(),
bookFreeze
.
getFreezetime
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【图书收益冻结管理(平台端)】冻结收益,<ERROR>.[bookFreezeDao.insert]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【图书收益冻结管理(平台端)】冻结收益,<ERROR>.[bookFreezeDao.insert]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"冻结收益失败!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"冻结收益失败!"
);
...
@@ -109,6 +116,7 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -109,6 +116,7 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
BookFund
bookFund
=
thawEarning
.
getBookFund
();
BookFund
bookFund
=
thawEarning
.
getBookFund
();
if
(
thawEarning
.
getIsFund
().
equals
(
1
))
{
// 被基金购买
if
(
thawEarning
.
getIsFund
().
equals
(
1
))
{
// 被基金购买
// 校验参数
// 校验参数
bookFund
.
setFromErp
(
thawEarning
.
getFromErp
());
this
.
checkFundParam
(
bookFund
,
bookFreezeDto
.
getFreezetime
());
this
.
checkFundParam
(
bookFund
,
bookFreezeDto
.
getFreezetime
());
bookFund
.
setProxyMode
(
bookFreezeDto
.
getProxyMode
());
bookFund
.
setProxyMode
(
bookFreezeDto
.
getProxyMode
());
bookFund
.
setTransferor
(
bookFreezeDto
.
getTransferor
());
bookFund
.
setTransferor
(
bookFreezeDto
.
getTransferor
());
...
@@ -119,6 +127,7 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -119,6 +127,7 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
Long
bookFundId
=
bookFund
==
null
?
null
:
bookFund
.
getBookFundId
();
Long
bookFundId
=
bookFund
==
null
?
null
:
bookFund
.
getBookFundId
();
try
{
try
{
bookFreezeDao
.
thaw
(
bookFundId
,
thawEarning
.
getBookId
(),
partyId
);
bookFreezeDao
.
thaw
(
bookFundId
,
thawEarning
.
getBookId
(),
partyId
);
erpConsr
.
thawFund
(
thawEarning
.
getBookId
(),
DateUtil
.
now
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【图书收益冻结管理(平台端)】解冻收益,<ERROR>.[bookFreezeDao.thaw]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【图书收益冻结管理(平台端)】解冻收益,<ERROR>.[bookFreezeDao.thaw]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"解冻收益失败!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"解冻收益失败!"
);
...
@@ -191,6 +200,9 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -191,6 +200,9 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
if
(
fundStartTime
.
before
(
freezetime
))
{
if
(
fundStartTime
.
before
(
freezetime
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"基金开始日期必须大于冻结开始日期!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"基金开始日期必须大于冻结开始日期!"
);
}
}
if
(
null
!=
bookFund
.
getFromErp
()){
return
;
}
if
(
StringUtil
.
isEmpty
(
bookFund
.
getContractNo
())){
if
(
StringUtil
.
isEmpty
(
bookFund
.
getContractNo
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"挂牌/合同编号不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"挂牌/合同编号不能为空!"
);
}
}
...
@@ -261,6 +273,8 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -261,6 +273,8 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
this
.
checkFundParam
(
bookFreeze
);
this
.
checkFundParam
(
bookFreeze
);
try
{
try
{
bookFreezeDao
.
insert
(
bookFreeze
);
bookFreezeDao
.
insert
(
bookFreeze
);
//同步到erp
erpConsr
.
freezeFund
(
bookFreeze
.
getBookId
(),
bookFreeze
.
getFreezetime
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【图书收益冻结(ERP)】冻结收益,<ERROR>.[bookFreezeDao.insert]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【图书收益冻结(ERP)】冻结收益,<ERROR>.[bookFreezeDao.insert]"
+
e
.
getMessage
(),
e
);
return
false
;
return
false
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookFundBizImpl.java
View file @
5f32768f
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
import
com.pcloud.book.base.enums.BookFreezeEnum
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookFreezeBiz
;
import
com.pcloud.book.book.biz.BookFundBiz
;
import
com.pcloud.book.book.biz.BookFundBiz
;
import
com.pcloud.book.book.dao.BookFreezeDao
;
import
com.pcloud.book.book.dao.BookFundDao
;
import
com.pcloud.book.book.dao.BookFundDao
;
import
com.pcloud.book.book.dto.BookDto
;
import
com.pcloud.book.book.dto.BookFreezeDto
;
import
com.pcloud.book.book.dto.BookFundDetailDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookFundInfoDto
;
import
com.pcloud.book.book.dto.BookFundInfoDto
;
import
com.pcloud.book.book.entity.BookFund
;
import
com.pcloud.book.book.entity.BookFund
;
import
com.pcloud.book.book.entity.ThawEarning
;
import
com.pcloud.book.book.vo.BookFreezeInfoDto
;
import
com.pcloud.book.consumer.erp.ErpConsr
;
import
com.pcloud.book.elasticsearch7.domain.entity.Es7BookFreeze
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQTopicProducer
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
...
@@ -14,17 +25,27 @@ import com.pcloud.common.utils.DateUtils;
...
@@ -14,17 +25,27 @@ import com.pcloud.common.utils.DateUtils;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.apache.commons.lang.BooleanUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
/**
/**
* @描述:书刊基金业务实现层
* @描述:书刊基金业务实现层
...
@@ -38,6 +59,12 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -38,6 +59,12 @@ public class BookFundBizImpl implements BookFundBiz {
@Autowired
@Autowired
private
BookFundDao
bookFundDao
;
private
BookFundDao
bookFundDao
;
@Autowired
private
ErpConsr
erpConsr
;
@Autowired
private
BookFreezeDao
bookFreezeDao
;
@Autowired
private
AmqpTemplate
amqpTemplate
;
/**
/**
* 创建书刊基金状态
* 创建书刊基金状态
...
@@ -52,12 +79,27 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -52,12 +79,27 @@ public class BookFundBizImpl implements BookFundBiz {
this
.
timeIsExsit
(
bookFund
);
this
.
timeIsExsit
(
bookFund
);
try
{
try
{
bookFundDao
.
insert
(
bookFund
);
bookFundDao
.
insert
(
bookFund
);
//同步到erp,找endTime最大的一个
synErp
(
bookFund
.
getBookId
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书刊管理(平台端)】创建书刊基金状态,<ERROR>.[bookFundDao.insert]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书刊管理(平台端)】创建书刊基金状态,<ERROR>.[bookFundDao.insert]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"创建书刊基金状态失败!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"创建书刊基金状态失败!"
);
}
}
}
}
private
void
synErp
(
Long
bookId
)
{
BookFundDto
dto
=
bookFundDao
.
getMaxEndTimeByBookId
(
bookId
);
if
(
null
!=
dto
)
{
//如果endTime最大的一个复合要求就同步
if
(
new
Date
().
before
(
dto
.
getStartTime
())
||
(
new
Date
().
after
(
dto
.
getStartTime
())
&&
new
Date
().
before
(
dto
.
getEndTime
()))
)
{
erpConsr
.
addFund
(
bookId
,
DateUtil
.
formatDateTime
(
dto
.
getStartTime
()),
DateUtil
.
formatDateTime
(
dto
.
getEndTime
()),
dto
.
getFundName
(),
dto
.
getPurchaseMoney
());
}
else
{
//否则删除
erpConsr
.
deleteFund
(
bookId
);
}
}
}
/**
/**
* 修改刊基金状态
* 修改刊基金状态
*/
*/
...
@@ -80,6 +122,8 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -80,6 +122,8 @@ public class BookFundBizImpl implements BookFundBiz {
this
.
timeIsExsit
(
bookFund
);
this
.
timeIsExsit
(
bookFund
);
try
{
try
{
bookFundDao
.
update
(
bookFund
);
bookFundDao
.
update
(
bookFund
);
//同步到erp,找endTime最大的一个
synErp
(
bookFund
.
getBookId
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书刊管理(平台端)】修改刊基金状态,<ERROR>.[bookFundDao.insert]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书刊管理(平台端)】修改刊基金状态,<ERROR>.[bookFundDao.insert]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"修改刊基金状态失败!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"修改刊基金状态失败!"
);
...
@@ -106,6 +150,9 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -106,6 +150,9 @@ public class BookFundBizImpl implements BookFundBiz {
if
(
null
==
bookFund
.
getEndTime
())
{
if
(
null
==
bookFund
.
getEndTime
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"基金结束时间不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"基金结束时间不能为空!"
);
}
}
if
(
null
!=
bookFund
.
getFromErp
()){
return
;
}
if
(
StringUtil
.
isEmpty
(
bookFund
.
getContractNo
())){
if
(
StringUtil
.
isEmpty
(
bookFund
.
getContractNo
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"挂牌/合同编号不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"挂牌/合同编号不能为空!"
);
}
}
...
@@ -310,7 +357,17 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -310,7 +357,17 @@ public class BookFundBizImpl implements BookFundBiz {
if
(
null
==
bookFundId
)
{
if
(
null
==
bookFundId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"基金标识不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"基金标识不能为空!"
);
}
}
BookFundDto
bookFundDto
=
bookFundDao
.
getByBookFundId
(
bookFundId
);
bookFundDao
.
deleteById
(
bookFundId
);
bookFundDao
.
deleteById
(
bookFundId
);
//同步到erp
List
<
BookFundDto
>
list
=
bookFundDao
.
getByBookId
(
bookFundDto
.
getBookId
());
if
(
CollUtil
.
isEmpty
(
list
)){
//如果都没有了
erpConsr
.
deleteFund
(
bookFundDto
.
getBookId
());
}
else
{
//如果还有就同步最后一个
synErp
(
bookFundDto
.
getBookId
());
}
}
}
/**
/**
...
@@ -360,4 +417,109 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -360,4 +417,109 @@ public class BookFundBizImpl implements BookFundBiz {
public
Integer
getFundBookCount
()
{
public
Integer
getFundBookCount
()
{
return
bookFundDao
.
getFundBookCount
();
return
bookFundDao
.
getFundBookCount
();
}
}
@Override
public
void
batchCreate
(
BookFund
bookFund
)
{
LOGGER
.
info
(
"【书刊管理(平台端)】批量创建书刊基金状态,<START>.[bookFund]:{}"
,
bookFund
);
if
(
CollUtil
.
isEmpty
(
bookFund
.
getBookIds
())){
return
;
}
// erp逻辑,此处先解冻。
List
<
BookFund
>
list
=
new
ArrayList
<>();
BookFund
build
=
null
;
for
(
Long
bookId
:
bookFund
.
getBookIds
())
{
//此处先解冻
Boolean
operate
=
true
;
BookFreezeDto
bookFreezeDto
=
bookFreezeDao
.
getBaseById
(
bookId
);
if
(
bookFreezeDto
!=
null
)
{
ThawEarning
thawEarning
=
new
ThawEarning
();
thawEarning
.
setBookId
(
bookId
);
thawEarning
.
setIsFund
(
0
);
try
{
bookFreezeDao
.
thaw
(
null
,
thawEarning
.
getBookId
(),
null
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【图书收益冻结管理(erp端)】解冻收益,<ERROR>.[bookFreezeDao.thaw]"
+
e
.
getMessage
(),
e
);
operate
=
false
;
}
if
(
operate
)
{
thawEarning
.
setFreezetime
(
bookFreezeDto
.
getFreezetime
());
amqpTemplate
.
convertAndSend
(
MQTopicProducer
.
EXCHAGE
,
MQTopicProducer
.
BOOK_THAW
,
thawEarning
);
}
}
build
=
new
BookFund
();
BeanUtil
.
copyProperties
(
bookFund
,
build
,
false
);
build
.
setBookId
(
bookId
);
try
{
timeIsExsit
(
build
);
}
catch
(
BizException
e
)
{
continue
;
}
list
.
add
(
build
);
}
try
{
if
(
CollUtil
.
isNotEmpty
(
list
))
{
bookFundDao
.
insert
(
list
);
}
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书刊管理(平台端)】批量创建书刊基金状态,<ERROR>.[bookFundDao.insert]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量创建书刊基金状态失败!"
);
}
}
@Override
public
Map
<
Long
,
BookFundDetailDto
>
synOldFundData
(
List
<
Long
>
bookIds
)
{
if
(
CollUtil
.
isEmpty
(
bookIds
)){
return
new
HashMap
<>();
}
Map
<
Long
,
BookFundDetailDto
>
result
=
new
HashMap
<>();
List
<
BookFundDto
>
listByBookIds
=
bookFundDao
.
getListByBookIds
(
bookIds
);
Map
<
Long
,
List
<
BookFundDto
>>
bookFundMap
=
CollUtil
.
isEmpty
(
listByBookIds
)
?
new
HashMap
<>()
:
listByBookIds
.
stream
().
collect
(
Collectors
.
groupingBy
(
a
->
a
.
getBookId
()));
List
<
BookFreezeInfoDto
>
bookFreezeInfoDtos
=
bookFreezeDao
.
listBookFreezeInfo
(
bookIds
);
Map
<
Long
,
List
<
BookFreezeInfoDto
>>
bookFreezeMap
=
CollUtil
.
isEmpty
(
bookFreezeInfoDtos
)
?
new
HashMap
<>()
:
bookFreezeInfoDtos
.
stream
().
collect
(
Collectors
.
groupingBy
(
a
->
a
.
getBookId
()));
for
(
Long
bookId
:
bookIds
)
{
boolean
isFundSupport
=
false
;
Integer
freezeStatus
=
BookFreezeEnum
.
WAIT_FREEZE
.
value
;
BookFundDetailDto
dto
=
new
BookFundDetailDto
();
if
(
CollUtil
.
isNotEmpty
(
bookFundMap
)
&&
bookFundMap
.
containsKey
(
bookId
)){
List
<
BookFundDto
>
bookFundDtos
=
bookFundMap
.
get
(
bookId
);
bookFundDtos
.
sort
(
Comparator
.
comparing
(
BookFundDto:
:
getEndTime
));
for
(
BookFundDto
bookFundDto
:
bookFundDtos
)
{
Date
startTime
=
bookFundDto
.
getStartTime
();
Date
endTime
=
bookFundDto
.
getEndTime
();
if
(
new
Date
().
before
(
startTime
))
{
freezeStatus
=
BookFreezeEnum
.
NO_FREEZE
.
value
;
}
else
if
(
new
Date
().
after
(
startTime
)
&&
new
Date
().
before
(
endTime
))
{
freezeStatus
=
BookFreezeEnum
.
NO_FREEZE
.
value
;
}
if
(
new
Date
().
before
(
endTime
))
{
isFundSupport
=
true
;
}
//这些字段取最后一个
if
(
BookFreezeEnum
.
NO_FREEZE
.
value
.
equals
(
freezeStatus
))
{
dto
.
setStartTime
(
startTime
);
dto
.
setEndTime
(
endTime
);
dto
.
setFundName
(
bookFundDto
.
getFundName
());
dto
.
setTransferor
(
bookFundDto
.
getTransferor
());
dto
.
setPurchaseMoney
(
bookFundDto
.
getPurchaseMoney
());
}
}
dto
.
setIsHaveFund
(
true
);
}
if
(
CollUtil
.
isNotEmpty
(
bookFreezeMap
)
&&
bookFreezeMap
.
containsKey
(
bookId
)){
List
<
BookFreezeInfoDto
>
listFreeze
=
bookFreezeMap
.
get
(
bookId
);
listFreeze
.
sort
(
Comparator
.
comparing
(
BookFreezeInfoDto:
:
getId
).
reversed
());
BookFreezeInfoDto
bookFreezeInfoDto
=
listFreeze
.
get
(
0
);
if
(
bookFreezeInfoDto
.
getFreezeStatus
().
equals
(
BookFreezeEnum
.
FREEZE
.
value
.
intValue
())){
dto
.
setFreezeTime
(
null
!=
bookFreezeInfoDto
.
getFreezeTime
()
?
DateUtil
.
parse
(
bookFreezeInfoDto
.
getFreezeTime
(),
DatePattern
.
NORM_DATE_FORMAT
)
:
null
);
}
else
{
dto
.
setThawTime
(
null
!=
bookFreezeInfoDto
.
getThawTime
()
?
DateUtil
.
parse
(
bookFreezeInfoDto
.
getThawTime
(),
DatePattern
.
NORM_DATE_FORMAT
)
:
null
);
}
}
dto
.
setIsFundSupport
(
isFundSupport
);
dto
.
setFreezeStatus
(
BooleanUtils
.
toIntegerObject
(
dto
.
getFreezeTime
()
==
null
,
freezeStatus
,
BookFreezeEnum
.
FREEZE
.
value
));
result
.
put
(
bookId
,
dto
);
}
return
result
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/BookFundDao.java
View file @
5f32768f
...
@@ -137,4 +137,8 @@ public interface BookFundDao extends BaseDao<BookFund> {
...
@@ -137,4 +137,8 @@ public interface BookFundDao extends BaseDao<BookFund> {
* * @param null
* * @param null
*/
*/
Integer
getFundBookCount
();
Integer
getFundBookCount
();
List
<
BookFundDto
>
getListByBookIds
(
List
<
Long
>
bookIds
);
BookFundDto
getMaxEndTimeByBookId
(
Long
bookId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/impl/BookFundDaoImpl.java
View file @
5f32768f
package
com
.
pcloud
.
book
.
book
.
dao
.
impl
;
package
com
.
pcloud
.
book
.
book
.
dao
.
impl
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -129,4 +130,18 @@ public class BookFundDaoImpl extends BaseDaoImpl<BookFund> implements BookFundDa
...
@@ -129,4 +130,18 @@ public class BookFundDaoImpl extends BaseDaoImpl<BookFund> implements BookFundDa
public
Integer
getFundBookCount
()
{
public
Integer
getFundBookCount
()
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getFundBookCount"
));
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getFundBookCount"
));
}
}
@Override
public
List
<
BookFundDto
>
getListByBookIds
(
List
<
Long
>
bookIds
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookIds"
,
bookIds
);
return
super
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getListByBookIds"
),
paramMap
);
}
@Override
public
BookFundDto
getMaxEndTimeByBookId
(
Long
bookId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
return
super
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getMaxEndTimeByBookId"
),
paramMap
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/BookFreezeFacade.java
View file @
5f32768f
...
@@ -36,7 +36,7 @@ public interface BookFreezeFacade {
...
@@ -36,7 +36,7 @@ public interface BookFreezeFacade {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"bookFreeze"
,
value
=
"图书冻结实体"
,
dataType
=
"BookFreeze"
,
paramType
=
"body"
)
})
@ApiImplicitParam
(
name
=
"bookFreeze"
,
value
=
"图书冻结实体"
,
dataType
=
"BookFreeze"
,
paramType
=
"body"
)
})
@RequestMapping
(
value
=
"create"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"create"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<?>
create
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
BookFreeze
bookFreeze
)
ResponseDto
<?>
create
(
@RequestHeader
(
value
=
"token"
,
required
=
false
)
String
token
,
@RequestBody
BookFreeze
bookFreeze
)
throws
BizException
,
PermissionException
,
JsonParseException
;
throws
BizException
,
PermissionException
,
JsonParseException
;
/**
/**
...
@@ -70,7 +70,7 @@ public interface BookFreezeFacade {
...
@@ -70,7 +70,7 @@ public interface BookFreezeFacade {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"thawEarning"
,
value
=
"图书解冻实体"
,
dataType
=
"ThawEarning"
,
paramType
=
"body"
)
})
@ApiImplicitParam
(
name
=
"thawEarning"
,
value
=
"图书解冻实体"
,
dataType
=
"ThawEarning"
,
paramType
=
"body"
)
})
@RequestMapping
(
value
=
"thaw"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"thaw"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<?>
thaw
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ThawEarning
thawEarning
)
ResponseDto
<?>
thaw
(
@RequestHeader
(
value
=
"token"
,
required
=
false
)
String
token
,
@RequestBody
ThawEarning
thawEarning
)
throws
BizException
,
PermissionException
,
JsonParseException
;
throws
BizException
,
PermissionException
,
JsonParseException
;
/**
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookFreezeFacadeImpl.java
View file @
5f32768f
...
@@ -44,10 +44,12 @@ public class BookFreezeFacadeImpl implements BookFreezeFacade {
...
@@ -44,10 +44,12 @@ public class BookFreezeFacadeImpl implements BookFreezeFacade {
*/
*/
@Override
@Override
@RequestMapping
(
value
=
"create"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"create"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
create
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
BookFreeze
bookFreeze
)
public
ResponseDto
<?>
create
(
@RequestHeader
(
value
=
"token"
,
required
=
false
)
String
token
,
@RequestBody
BookFreeze
bookFreeze
)
throws
BizException
,
PermissionException
,
JsonParseException
{
throws
BizException
,
PermissionException
,
JsonParseException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
null
!=
bookFreeze
&&
null
==
bookFreeze
.
getFromErp
())
{
bookFreeze
.
setCreatedUser
(
partyId
);
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
bookFreeze
.
setCreatedUser
(
partyId
);
}
bookFreezeBiz
.
create
(
bookFreeze
);
bookFreezeBiz
.
create
(
bookFreeze
);
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
...
@@ -83,9 +85,12 @@ public class BookFreezeFacadeImpl implements BookFreezeFacade {
...
@@ -83,9 +85,12 @@ public class BookFreezeFacadeImpl implements BookFreezeFacade {
*/
*/
@Override
@Override
@RequestMapping
(
value
=
"thaw"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"thaw"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
thaw
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ThawEarning
thawEarning
)
public
ResponseDto
<?>
thaw
(
@RequestHeader
(
value
=
"token"
,
required
=
false
)
String
token
,
@RequestBody
ThawEarning
thawEarning
)
throws
BizException
,
PermissionException
,
JsonParseException
{
throws
BizException
,
PermissionException
,
JsonParseException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
Long
partyId
=
null
;
if
(
null
!=
thawEarning
&&
null
==
thawEarning
.
getFromErp
())
{
partyId
=(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
}
bookFreezeBiz
.
thaw
(
thawEarning
,
partyId
);
bookFreezeBiz
.
thaw
(
thawEarning
,
partyId
);
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookFundFacadeImpl.java
View file @
5f32768f
...
@@ -126,4 +126,23 @@ public class BookFundFacadeImpl implements BookFundFacade {
...
@@ -126,4 +126,23 @@ public class BookFundFacadeImpl implements BookFundFacade {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
/**
* 批量创建书刊基金状态,接口给erp调用。逻辑不一样。请勿用
*/
@RequestMapping
(
value
=
"batchCreate"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
batchCreate
(
@RequestBody
BookFund
bookFund
)
throws
BizException
,
PermissionException
,
JsonParseException
{
bookFundBiz
.
batchCreate
(
bookFund
);
return
new
ResponseDto
<>();
}
/**
* 同步旧数据
*/
@RequestMapping
(
value
=
"synOldFundData"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
synOldFundData
(
@RequestBody
List
<
Long
>
bookIds
)
throws
BizException
,
PermissionException
,
JsonParseException
{
return
new
ResponseDto
<>(
bookFundBiz
.
synOldFundData
(
bookIds
));
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/vo/BookFreezeInfoDto.java
View file @
5f32768f
...
@@ -13,6 +13,8 @@ import lombok.ToString;
...
@@ -13,6 +13,8 @@ import lombok.ToString;
@AllArgsConstructor
@AllArgsConstructor
public
class
BookFreezeInfoDto
{
public
class
BookFreezeInfoDto
{
private
Long
id
;
private
Long
bookId
;
private
Long
bookId
;
private
String
freezeTime
;
private
String
freezeTime
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/erp/ErpConsr.java
View file @
5f32768f
...
@@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory;
...
@@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -427,4 +428,73 @@ public class ErpConsr {
...
@@ -427,4 +428,73 @@ public class ErpConsr {
}
}
}
}
/**
* 冻结书刊收益
*/
public
void
freezeFund
(
Long
bookId
,
String
freezetime
)
{
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
querys
.
put
(
"bookId"
,
bookId
.
toString
());
querys
.
put
(
"freezetime"
,
freezetime
);
try
{
HttpResponse
response
=
HttpUtils
.
doGet
(
domain
,
"/erp/project4Third/freezeFund"
,
"GET"
,
new
HashMap
<>(),
querys
);
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
LOGGER
.
info
(
"冻结书刊收益[project4Third.freezeFund]:"
+
entityString
);
}
catch
(
Exception
e
){
LOGGER
.
error
(
"erp冻结书刊收益失败[project4Third.freezeFund]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CONTENT_ERROR
,
"冻结erp书刊收益失败~!"
);
}
}
/**
* 解冻书刊收益
*/
public
void
thawFund
(
Long
bookId
,
String
thawTime
)
{
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
querys
.
put
(
"bookId"
,
bookId
.
toString
());
querys
.
put
(
"thawTime"
,
thawTime
);
try
{
HttpResponse
response
=
HttpUtils
.
doGet
(
domain
,
"/erp/project4Third/thawFund"
,
"GET"
,
new
HashMap
<>(),
querys
);
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
LOGGER
.
info
(
"解冻书刊收益[project4Third.thawFund]:"
+
entityString
);
}
catch
(
Exception
e
){
LOGGER
.
error
(
"erp冻结书刊收益失败[project4Third.thawFund]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CONTENT_ERROR
,
"冻结erp书刊收益失败~!"
);
}
}
/**
* 添加基金书刊
*/
public
void
addFund
(
Long
bookId
,
String
startTime
,
String
endTime
,
String
fundName
,
BigDecimal
purchaseMoney
)
{
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
querys
.
put
(
"bookId"
,
bookId
.
toString
());
querys
.
put
(
"startTime"
,
startTime
);
querys
.
put
(
"endTime"
,
endTime
);
querys
.
put
(
"fundName"
,
fundName
);
querys
.
put
(
"purchaseMoney"
,
purchaseMoney
.
toString
());
try
{
HttpResponse
response
=
HttpUtils
.
doGet
(
domain
,
"/erp/project4Third/addFund"
,
"GET"
,
new
HashMap
<>(),
querys
);
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
LOGGER
.
info
(
"添加基金书刊[project4Third.addFund]:"
+
entityString
);
}
catch
(
Exception
e
){
LOGGER
.
error
(
"erp设置基金信息失败[project4Third.addFund]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CONTENT_ERROR
,
"erp设置基金信息失败~!"
);
}
}
/**
* 删除基金设置
*/
public
void
deleteFund
(
Long
bookId
)
{
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
querys
.
put
(
"bookId"
,
bookId
.
toString
());
try
{
HttpResponse
response
=
HttpUtils
.
doGet
(
domain
,
"/erp/project4Third/deleteFund"
,
"GET"
,
new
HashMap
<>(),
querys
);
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
LOGGER
.
info
(
"删除基金设置[project4Third.deleteFund]:"
+
entityString
);
}
catch
(
Exception
e
){
LOGGER
.
error
(
"erp删除基金信息失败[project4Third.deleteFund]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CONTENT_ERROR
,
"erp删除基金信息失败~!"
);
}
}
}
}
pcloud-service-book/src/main/resources/mapper/book/BookFreeze.Mapper.xml
View file @
5f32768f
...
@@ -190,6 +190,7 @@
...
@@ -190,6 +190,7 @@
<select
id=
"listBookFreezeInfo"
parameterType=
"map"
resultType=
"com.pcloud.book.book.vo.BookFreezeInfoDto"
>
<select
id=
"listBookFreezeInfo"
parameterType=
"map"
resultType=
"com.pcloud.book.book.vo.BookFreezeInfoDto"
>
SELECT
SELECT
id id,
BOOK_ID bookId,
BOOK_ID bookId,
DATE_FORMAT( FREEZETIME, '%Y-%m-%d' ) freezeTime,
DATE_FORMAT( FREEZETIME, '%Y-%m-%d' ) freezeTime,
IS_FREEZE freezeStatus,
IS_FREEZE freezeStatus,
...
...
pcloud-service-book/src/main/resources/mapper/book/BookFund.Mapper.xml
View file @
5f32768f
...
@@ -58,6 +58,22 @@
...
@@ -58,6 +58,22 @@
#{proxyMode,jdbcType=BIT},#{transferor,jdbcType=VARCHAR},#{isTransferor,jdbcType=BIT})
#{proxyMode,jdbcType=BIT},#{transferor,jdbcType=VARCHAR},#{isTransferor,jdbcType=BIT})
</insert>
</insert>
<insert
id=
"batchInsert"
parameterType=
"java.util.List"
useGeneratedKeys=
"true"
keyProperty=
"bookFundId"
flushCache=
"true"
>
insert into book_fund (BOOK_ID, FUND_NAME,
PURCHASE_MONEY, START_TIME, END_TIME,
CREATED_USER, CREATED_DATE, LAST_MODIFIED_USER,
LAST_MODIFIED_DATE, VERSION,CONTRACT_NO,BATCH_NUMBER,PROXY_MODE,TRANSFEROR,IS_TRANSFEROR)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.bookId,jdbcType=BIGINT}, #{item.fundName,jdbcType=VARCHAR},
#{item.purchaseMoney,jdbcType=DECIMAL}, #{item.startTime,jdbcType=TIMESTAMP},
#{item.endTime,jdbcType=TIMESTAMP},#{item.createdUser,jdbcType=BIGINT},
now(), #{item.createdUser,jdbcType=BIGINT},now(),1,
#{item.contractNo,jdbcType=VARCHAR},#{item.batchNumber,jdbcType=VARCHAR},
#{item.proxyMode,jdbcType=BIT},#{item.transferor,jdbcType=VARCHAR},#{item.isTransferor,jdbcType=BIT})
</foreach>
</insert>
<!-- 修改书籍基金信息-->
<!-- 修改书籍基金信息-->
<!--michael 修改于20180807-->
<!--michael 修改于20180807-->
<update
id=
"update"
parameterType=
"bookFund"
flushCache=
"true"
>
<update
id=
"update"
parameterType=
"bookFund"
flushCache=
"true"
>
...
@@ -274,4 +290,25 @@
...
@@ -274,4 +290,25 @@
AND bf.BOOK_FUND_ID IS NOT NULL
AND bf.BOOK_FUND_ID IS NOT NULL
</select>
</select>
<select
id=
"getListByBookIds"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from book_fund
WHERE
BOOK_ID IN
<foreach
collection=
"bookIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</select>
<select
id=
"getMaxEndTimeByBookId"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
SELECT
BOOK_FUND_ID, BOOK_ID, FUND_NAME, PURCHASE_MONEY,
START_TIME, END_TIME,VERSION,CONTRACT_NO,BATCH_NUMBER,PROXY_MODE,TRANSFEROR,IS_TRANSFEROR
FROM BOOK_FUND
WHERE BOOK_ID = #{bookId,jdbcType=BIGINT}
ORDER BY END_TIME DESC
limit 1
</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