Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
05d6f362
Commit
05d6f362
authored
May 31, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拍卖专场1
parent
0c6738fe
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1525 additions
and
24 deletions
+1525
-24
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
...src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
+5
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/SpecialPerformanceConfigDao.java
...z/ch/db/dao/distribution/SpecialPerformanceConfigDao.java
+16
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/SpecialPerformanceDao.java
...om/wwdz/ch/db/dao/distribution/SpecialPerformanceDao.java
+8
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SpecialPerformance.java
...om/wwdz/ch/db/domain/distribution/SpecialPerformance.java
+19
-1
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SpecialPerformanceExample.java
.../ch/db/domain/distribution/SpecialPerformanceExample.java
+264
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/AuctionRecordRequestDto.java
.../db/dto/request/distribution/AuctionRecordRequestDto.java
+7
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SpecialPerformanceConfigRequestDto.java
...uest/distribution/SpecialPerformanceConfigRequestDto.java
+39
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SpecialPerformanceRequestDto.java
...to/request/distribution/SpecialPerformanceRequestDto.java
+43
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/AuctionRecordDaoImpl.java
...om/wwdz/ch/db/impl/distribution/AuctionRecordDaoImpl.java
+1
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SpecialPerformanceConfigDaoImpl.java
...db/impl/distribution/SpecialPerformanceConfigDaoImpl.java
+57
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SpecialPerformanceDaoImpl.java
...dz/ch/db/impl/distribution/SpecialPerformanceDaoImpl.java
+38
-0
ch-dao/src/main/java/com/wwdz/ch/db/mapper/distribution/SpecialPerformanceConfigMapper.java
...b/mapper/distribution/SpecialPerformanceConfigMapper.java
+7
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SpecialPerformanceConfigMapper.xml
...db/mapper/distribution/SpecialPerformanceConfigMapper.xml
+327
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SpecialPerformanceMapper.xml
...dz/ch/db/mapper/distribution/SpecialPerformanceMapper.xml
+354
-0
ch-dao/src/main/resources/generatorConfig_new.xml
ch-dao/src/main/resources/generatorConfig_new.xml
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
.../main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
+3
-3
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/SpecialPerformanceVo.java
...dz/ch/wx/entity/vo/distribution/SpecialPerformanceVo.java
+47
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
...wdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
+31
-19
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SpecialPerformanceServiceImpl.java
...h/wx/impl/distribution/SpecialPerformanceServiceImpl.java
+189
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SpecialPerformanceService.java
...ch/wx/service/distribution/SpecialPerformanceService.java
+20
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SpecialPerformanceController.java
.../ch/wx/web/distribution/SpecialPerformanceController.java
+49
-0
No files found.
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
View file @
05d6f362
...
...
@@ -151,6 +151,11 @@ public class SupplierItemVo implements Entity {
*/
private
Date
realEndTime
;
/**
* 出价记录
*/
private
Long
offerNum
;
/**
* 起拍价
* 单位元 需要转为分
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/SpecialPerformanceConfigDao.java
View file @
05d6f362
package
com.wwdz.ch.db.dao.distribution
;
import
com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig
;
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceConfigRequestDto
;
import
java.util.List
;
public
interface
SpecialPerformanceConfigDao
{
List
<
SpecialPerformanceConfig
>
findList
(
SpecialPerformanceConfigRequestDto
dto
);
List
<
SpecialPerformanceConfig
>
findAllItem
(
int
specialPerformanceId
);
boolean
insert
(
SpecialPerformanceConfig
specialPerformanceConfig
);
boolean
update
(
SpecialPerformanceConfig
specialPerformanceConfig
);
long
countViewNum
(
int
specialPerformanceId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/SpecialPerformanceDao.java
View file @
05d6f362
package
com.wwdz.ch.db.dao.distribution
;
import
com.wwdz.ch.db.domain.distribution.SpecialPerformance
;
public
interface
SpecialPerformanceDao
{
SpecialPerformance
findByType
(
int
type
);
SpecialPerformance
findById
(
int
id
);
boolean
update
(
SpecialPerformance
specialPerformance
);
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SpecialPerformance.java
View file @
05d6f362
...
...
@@ -10,7 +10,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2024/05/
29
* @date 2024/05/
31
*/
@Data
public
class
SpecialPerformance
implements
Entity
{
...
...
@@ -31,6 +31,16 @@ public class SpecialPerformance implements Entity {
*/
private
Date
updateTime
;
/**
* 开始时间
*/
private
Date
startTime
;
/**
* 结束时间
*/
private
Date
endTime
;
/**
* 专场类型1拍卖
*/
...
...
@@ -53,6 +63,8 @@ public class SpecialPerformance implements Entity {
sb
.
append
(
", title="
).
append
(
title
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", startTime="
).
append
(
startTime
);
sb
.
append
(
", endTime="
).
append
(
endTime
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", state="
).
append
(
state
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
...
...
@@ -76,6 +88,8 @@ public class SpecialPerformance implements Entity {
&&
(
this
.
getTitle
()
==
null
?
other
.
getTitle
()
==
null
:
this
.
getTitle
().
equals
(
other
.
getTitle
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getStartTime
()
==
null
?
other
.
getStartTime
()
==
null
:
this
.
getStartTime
().
equals
(
other
.
getStartTime
()))
&&
(
this
.
getEndTime
()
==
null
?
other
.
getEndTime
()
==
null
:
this
.
getEndTime
().
equals
(
other
.
getEndTime
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getState
()
==
null
?
other
.
getState
()
==
null
:
this
.
getState
().
equals
(
other
.
getState
()));
}
...
...
@@ -88,6 +102,8 @@ public class SpecialPerformance implements Entity {
result
=
prime
*
result
+
((
getTitle
()
==
null
)
?
0
:
getTitle
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getStartTime
()
==
null
)
?
0
:
getStartTime
().
hashCode
());
result
=
prime
*
result
+
((
getEndTime
()
==
null
)
?
0
:
getEndTime
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getState
()
==
null
)
?
0
:
getState
().
hashCode
());
return
result
;
...
...
@@ -105,6 +121,8 @@ public class SpecialPerformance implements Entity {
title
(
"title"
,
"title"
,
"VARCHAR"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
startTime
(
"start_time"
,
"startTime"
,
"TIMESTAMP"
,
false
),
endTime
(
"end_time"
,
"endTime"
,
"TIMESTAMP"
,
false
),
type
(
"type"
,
"type"
,
"INTEGER"
,
true
),
state
(
"state"
,
"state"
,
"INTEGER"
,
true
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/SpecialPerformanceExample.java
View file @
05d6f362
...
...
@@ -686,6 +686,270 @@ public class SpecialPerformanceExample {
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeIsNull
()
{
addCriterion
(
"start_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeIsNotNull
()
{
addCriterion
(
"start_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeEqualTo
(
Date
value
)
{
addCriterion
(
"start_time ="
,
value
,
"startTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andStartTimeEqualToColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"start_time = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"start_time <>"
,
value
,
"startTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andStartTimeNotEqualToColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"start_time <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"start_time >"
,
value
,
"startTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andStartTimeGreaterThanColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"start_time > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"start_time >="
,
value
,
"startTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andStartTimeGreaterThanOrEqualToColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"start_time >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeLessThan
(
Date
value
)
{
addCriterion
(
"start_time <"
,
value
,
"startTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andStartTimeLessThanColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"start_time < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"start_time <="
,
value
,
"startTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andStartTimeLessThanOrEqualToColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"start_time <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"start_time in"
,
values
,
"startTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"start_time not in"
,
values
,
"startTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"start_time between"
,
value1
,
value2
,
"startTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStartTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"start_time not between"
,
value1
,
value2
,
"startTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeIsNull
()
{
addCriterion
(
"end_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeIsNotNull
()
{
addCriterion
(
"end_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeEqualTo
(
Date
value
)
{
addCriterion
(
"end_time ="
,
value
,
"endTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andEndTimeEqualToColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"end_time = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"end_time <>"
,
value
,
"endTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andEndTimeNotEqualToColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"end_time <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"end_time >"
,
value
,
"endTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andEndTimeGreaterThanColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"end_time > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"end_time >="
,
value
,
"endTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andEndTimeGreaterThanOrEqualToColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"end_time >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeLessThan
(
Date
value
)
{
addCriterion
(
"end_time <"
,
value
,
"endTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andEndTimeLessThanColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"end_time < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"end_time <="
,
value
,
"endTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andEndTimeLessThanOrEqualToColumn
(
SpecialPerformance
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"end_time <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"end_time in"
,
values
,
"endTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"end_time not in"
,
values
,
"endTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"end_time between"
,
value1
,
value2
,
"endTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEndTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"end_time not between"
,
value1
,
value2
,
"endTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNull
()
{
addCriterion
(
"`type` is null"
);
return
(
Criteria
)
this
;
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/AuctionRecordRequestDto.java
View file @
05d6f362
...
...
@@ -5,6 +5,7 @@ import com.xxdxxs.entity.Entity;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
AuctionRecordRequestDto
extends
BaseRequestDto
implements
Entity
{
...
...
@@ -16,6 +17,12 @@ public class AuctionRecordRequestDto extends BaseRequestDto implements Entity {
*/
private
Long
itemId
;
/**
* 商品id
*/
private
List
<
Long
>
itemIdList
;
/**
* 用户id
*/
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SpecialPerformanceConfigRequestDto.java
0 → 100644
View file @
05d6f362
package
com.wwdz.ch.db.dto.request.distribution
;
import
com.wwdz.ch.db.dto.request.BaseRequestDto
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
SpecialPerformanceConfigRequestDto
extends
BaseRequestDto
implements
Entity
{
private
Integer
id
;
/**
* 专场id
*/
private
Integer
specialPerformanceId
;
/**
* 商品id
*/
private
Long
itemId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 浏览次数
*/
private
Integer
viewNum
;
/**
* 状态
*/
private
Integer
state
;
}
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SpecialPerformanceRequestDto.java
0 → 100644
View file @
05d6f362
package
com.wwdz.ch.db.dto.request.distribution
;
import
com.wwdz.ch.db.dto.request.BaseRequestDto
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
SpecialPerformanceRequestDto
extends
BaseRequestDto
implements
Entity
{
private
Integer
id
;
/**
* 专场id
*/
private
Integer
specialPerformanceId
;
/**
* 专场名称
*/
private
String
title
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 专场类型1拍卖
*/
private
Integer
type
;
/**
* 状态
*/
private
Integer
state
;
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/AuctionRecordDaoImpl.java
View file @
05d6f362
...
...
@@ -98,6 +98,7 @@ public class AuctionRecordDaoImpl implements AuctionRecordDao {
public
long
count
(
AuctionRecordRequestDto
dto
)
{
AuctionRecordExample
example
=
new
AuctionRecordExample
();
AuctionRecordExample
.
Criteria
criteria
=
example
.
createCriteria
();
JdbcHelper
.
ifPresent
(
dto
.
getItemIdList
(),
criteria:
:
andItemIdIn
);
JdbcHelper
.
ifPresent
(
dto
.
getItemId
(),
criteria:
:
andItemIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getUserId
(),
criteria:
:
andUserIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getIsLead
(),
criteria:
:
andIsLeadEqualTo
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SpecialPerformanceConfigDaoImpl.java
0 → 100644
View file @
05d6f362
package
com.wwdz.ch.db.impl.distribution
;
import
com.github.pagehelper.PageHelper
;
import
com.wwdz.ch.db.dao.distribution.SpecialPerformanceConfigDao
;
import
com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig
;
import
com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample
;
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceConfigRequestDto
;
import
com.wwdz.ch.db.mapper.distribution.SpecialPerformanceConfigMapper
;
import
com.xxdxxs.db.component.JdbcHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
class
SpecialPerformanceConfigDaoImpl
implements
SpecialPerformanceConfigDao
{
@Autowired
SpecialPerformanceConfigMapper
specialPerformanceConfigMapper
;
@Override
public
List
<
SpecialPerformanceConfig
>
findList
(
SpecialPerformanceConfigRequestDto
dto
)
{
SpecialPerformanceConfigExample
example
=
new
SpecialPerformanceConfigExample
();
SpecialPerformanceConfigExample
.
Criteria
criteria
=
example
.
createCriteria
();
JdbcHelper
.
ifPresent
(
dto
.
getSpecialPerformanceId
(),
criteria:
:
andSpecialPerformanceIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getItemId
(),
criteria:
:
andItemIdEqualTo
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
specialPerformanceConfigMapper
.
selectByExample
(
example
);
}
@Override
public
List
<
SpecialPerformanceConfig
>
findAllItem
(
int
specialPerformanceId
)
{
SpecialPerformanceConfigExample
example
=
new
SpecialPerformanceConfigExample
();
SpecialPerformanceConfigExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andSpecialPerformanceIdEqualTo
(
specialPerformanceId
);
return
specialPerformanceConfigMapper
.
selectByExampleSelective
(
example
,
SpecialPerformanceConfig
.
Column
.
itemId
);
}
@Override
public
boolean
insert
(
SpecialPerformanceConfig
specialPerformanceConfig
)
{
return
specialPerformanceConfigMapper
.
insert
(
specialPerformanceConfig
)
>
0
;
}
@Override
public
boolean
update
(
SpecialPerformanceConfig
specialPerformanceConfig
)
{
SpecialPerformanceConfigExample
example
=
new
SpecialPerformanceConfigExample
();
SpecialPerformanceConfigExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andSpecialPerformanceIdEqualTo
(
specialPerformanceConfig
.
getSpecialPerformanceId
());
return
specialPerformanceConfigMapper
.
updateByExampleSelective
(
specialPerformanceConfig
,
example
)
>
0
;
}
@Override
public
long
countViewNum
(
int
specialPerformanceId
)
{
return
specialPerformanceConfigMapper
.
countViewNum
(
specialPerformanceId
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SpecialPerformanceDaoImpl.java
0 → 100644
View file @
05d6f362
package
com.wwdz.ch.db.impl.distribution
;
import
com.wwdz.ch.db.dao.distribution.SpecialPerformanceDao
;
import
com.wwdz.ch.db.domain.distribution.SpecialPerformance
;
import
com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample
;
import
com.wwdz.ch.db.mapper.distribution.SpecialPerformanceMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
@Repository
public
class
SpecialPerformanceDaoImpl
implements
SpecialPerformanceDao
{
@Autowired
SpecialPerformanceMapper
specialPerformanceMapper
;
@Override
public
SpecialPerformance
findByType
(
int
type
)
{
SpecialPerformanceExample
example
=
new
SpecialPerformanceExample
();
SpecialPerformanceExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andTypeEqualTo
(
type
);
return
specialPerformanceMapper
.
selectOneByExample
(
example
);
}
@Override
public
SpecialPerformance
findById
(
int
id
)
{
SpecialPerformanceExample
example
=
new
SpecialPerformanceExample
();
SpecialPerformanceExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andIdEqualTo
(
id
);
return
specialPerformanceMapper
.
selectOneByExample
(
example
);
}
@Override
public
boolean
update
(
SpecialPerformance
specialPerformance
)
{
return
specialPerformanceMapper
.
updateByPrimaryKeySelective
(
specialPerformance
)
>
0
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/mapper/distribution/SpecialPerformanceConfigMapper.java
View file @
05d6f362
...
...
@@ -66,4 +66,11 @@ public interface SpecialPerformanceConfigMapper {
int
updateByPrimaryKeySelective
(
SpecialPerformanceConfig
record
);
int
updateByPrimaryKey
(
SpecialPerformanceConfig
record
);
/**
* 统计专场总围观数
* @param specialPerformanceId
* @return
*/
long
countViewNum
(
@Param
(
"specialPerformanceId"
)
Integer
specialPerformanceId
);
}
\ No newline at end of file
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SpecialPerformanceConfigMapper.xml
0 → 100644
View file @
05d6f362
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.wwdz.ch.db.mapper.distribution.SpecialPerformanceConfigMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"special_performance_id"
jdbcType=
"INTEGER"
property=
"specialPerformanceId"
/>
<result
column=
"item_id"
jdbcType=
"BIGINT"
property=
"itemId"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"view_num"
jdbcType=
"INTEGER"
property=
"viewNum"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, special_performance_id, item_id, create_time, view_num, `state`
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
'true' as QUERYID,
<include
refid=
"Base_Column_List"
/>
from special_performance_config
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByExampleSelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if
test=
"example.distinct"
>
distinct
</if>
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, special_performance_id, item_id, create_time, view_num, `state`
</otherwise>
</choose>
from special_performance_config
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from special_performance_config
where id = #{id,jdbcType=INTEGER}
</select>
<select
id=
"selectByPrimaryKeySelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, special_performance_id, item_id, create_time, view_num, `state`
</otherwise>
</choose>
from special_performance_config
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from special_performance_config
where id = #{id,jdbcType=INTEGER}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample"
>
delete from special_performance_config
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into special_performance_config (special_performance_id, item_id, create_time,
view_num, `state`)
values (#{specialPerformanceId,jdbcType=INTEGER}, #{itemId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{viewNum,jdbcType=INTEGER}, #{state,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into special_performance_config
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"specialPerformanceId != null"
>
special_performance_id,
</if>
<if
test=
"itemId != null"
>
item_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"viewNum != null"
>
view_num,
</if>
<if
test=
"state != null"
>
`state`,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"specialPerformanceId != null"
>
#{specialPerformanceId,jdbcType=INTEGER},
</if>
<if
test=
"itemId != null"
>
#{itemId,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"viewNum != null"
>
#{viewNum,jdbcType=INTEGER},
</if>
<if
test=
"state != null"
>
#{state,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample"
resultType=
"java.lang.Long"
>
select count(*) from special_performance_config
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update special_performance_config
<set>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=INTEGER},
</if>
<if
test=
"record.specialPerformanceId != null"
>
special_performance_id = #{record.specialPerformanceId,jdbcType=INTEGER},
</if>
<if
test=
"record.itemId != null"
>
item_id = #{record.itemId,jdbcType=BIGINT},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.viewNum != null"
>
view_num = #{record.viewNum,jdbcType=INTEGER},
</if>
<if
test=
"record.state != null"
>
`state` = #{record.state,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update special_performance_config
set id = #{record.id,jdbcType=INTEGER},
special_performance_id = #{record.specialPerformanceId,jdbcType=INTEGER},
item_id = #{record.itemId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
view_num = #{record.viewNum,jdbcType=INTEGER},
`state` = #{record.state,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig"
>
update special_performance_config
<set>
<if
test=
"specialPerformanceId != null"
>
special_performance_id = #{specialPerformanceId,jdbcType=INTEGER},
</if>
<if
test=
"itemId != null"
>
item_id = #{itemId,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"viewNum != null"
>
view_num = #{viewNum,jdbcType=INTEGER},
</if>
<if
test=
"state != null"
>
`state` = #{state,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig"
>
update special_performance_config
set special_performance_id = #{specialPerformanceId,jdbcType=INTEGER},
item_id = #{itemId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
view_num = #{viewNum,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include
refid=
"Base_Column_List"
/>
from special_performance_config
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
limit 1
</select>
<select
id=
"selectOneByExampleSelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, special_performance_id, item_id, create_time, view_num, `state`
</otherwise>
</choose>
from special_performance_config
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
limit 1
</select>
<select
id=
"countViewNum"
parameterType=
"java.lang.Integer"
resultType=
"java.lang.Long"
>
select IFNULL(sum(view_num),0) from special_performance_config where special_performance_id = #{specialPerformanceId} and state = 1
</select>
</mapper>
\ No newline at end of file
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/SpecialPerformanceMapper.xml
0 → 100644
View file @
05d6f362
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.wwdz.ch.db.mapper.distribution.SpecialPerformanceMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.wwdz.ch.db.domain.distribution.SpecialPerformance"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"title"
jdbcType=
"VARCHAR"
property=
"title"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"start_time"
jdbcType=
"TIMESTAMP"
property=
"startTime"
/>
<result
column=
"end_time"
jdbcType=
"TIMESTAMP"
property=
"endTime"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, title, create_time, update_time, start_time, end_time, `type`, `state`
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
'true' as QUERYID,
<include
refid=
"Base_Column_List"
/>
from special_performance
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByExampleSelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if
test=
"example.distinct"
>
distinct
</if>
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, title, create_time, update_time, start_time, end_time, `type`, `state`
</otherwise>
</choose>
from special_performance
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from special_performance
where id = #{id,jdbcType=INTEGER}
</select>
<select
id=
"selectByPrimaryKeySelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, title, create_time, update_time, start_time, end_time, `type`, `state`
</otherwise>
</choose>
from special_performance
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from special_performance
where id = #{id,jdbcType=INTEGER}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample"
>
delete from special_performance
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformance"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into special_performance (title, create_time, update_time,
start_time, end_time, `type`,
`state`)
values (#{title,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{type,jdbcType=INTEGER},
#{state,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformance"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into special_performance
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"title != null"
>
title,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"startTime != null"
>
start_time,
</if>
<if
test=
"endTime != null"
>
end_time,
</if>
<if
test=
"type != null"
>
`type`,
</if>
<if
test=
"state != null"
>
`state`,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"title != null"
>
#{title,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"startTime != null"
>
#{startTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"endTime != null"
>
#{endTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
<if
test=
"state != null"
>
#{state,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample"
resultType=
"java.lang.Long"
>
select count(*) from special_performance
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update special_performance
<set>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=INTEGER},
</if>
<if
test=
"record.title != null"
>
title = #{record.title,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.startTime != null"
>
start_time = #{record.startTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.endTime != null"
>
end_time = #{record.endTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.type != null"
>
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if
test=
"record.state != null"
>
`state` = #{record.state,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update special_performance
set id = #{record.id,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
start_time = #{record.startTime,jdbcType=TIMESTAMP},
end_time = #{record.endTime,jdbcType=TIMESTAMP},
`type` = #{record.type,jdbcType=INTEGER},
`state` = #{record.state,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformance"
>
update special_performance
<set>
<if
test=
"title != null"
>
title = #{title,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"startTime != null"
>
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"endTime != null"
>
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"type != null"
>
`type` = #{type,jdbcType=INTEGER},
</if>
<if
test=
"state != null"
>
`state` = #{state,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformance"
>
update special_performance
set title = #{title,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
`type` = #{type,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include
refid=
"Base_Column_List"
/>
from special_performance
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
limit 1
</select>
<select
id=
"selectOneByExampleSelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, title, create_time, update_time, start_time, end_time, `type`, `state`
</otherwise>
</choose>
from special_performance
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
05d6f362
...
...
@@ -72,7 +72,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper.distribution"
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"special_performance
_config
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"special_performance"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
View file @
05d6f362
...
...
@@ -46,10 +46,10 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/distributionOrder/refund"
,
"/wx/supplierItem/findItemsOfCurrentDistributor"
,
"/wx/selfPage/updateSwitch"
,
"/wx/supplierItem/findHomePage"
//下列路径上线注释
/*
, "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**",
,
"/wx/specialPerformance/**"
,
"/wx/supplierItem/**"
,
"/wx/shareRecord/**"
,
"/wx/distributionOrder/**"
,
"/wx/selfPage/**"
,
"/wx/auctionRecord/**"
,
"/wx/shareRecord/**"
,
"/wx/collectionBook/**"
,
"/wx/collectedRecord/**"
,
"/wx/collectionItemsRelation/**"
,
"/wx/collectionShareRecord/**"
,"/wx/logistics/**","/wx/follow/**"
*/
,
"/wx/logistics/**"
,
"/wx/follow/**"
// , "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**"
/* "/wx/officialAccount/**",
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/SpecialPerformanceVo.java
0 → 100644
View file @
05d6f362
package
com.wwdz.ch.wx.entity.vo.distribution
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
@Data
public
class
SpecialPerformanceVo
implements
Entity
{
/**
* 专场总围观次数
*/
private
Long
totalViewNum
;
/**
* 总商品数
*/
private
Long
totalItemNum
;
/**
* 开始时间
*/
private
Date
startTime
;
/**
* 截止日期
*/
private
Date
endTime
;
/**
* 状态
*/
private
Integer
state
;
private
String
stateName
;
/**
* 专场标题
*/
private
String
title
;
private
List
<
Map
<
String
,
Object
>>
itemList
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
View file @
05d6f362
...
...
@@ -23,6 +23,7 @@ import com.wwdz.ch.wx.service.distribution.AuctionRecordService;
import
com.wwdz.ch.core.service.SendMsgService
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.EntityMapper
;
import
com.xxdxxs.utils.StringUtils
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.slf4j.Logger
;
...
...
@@ -88,6 +89,9 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
@Autowired
WxAppletApi
wxAppletApi
;
@Autowired
SpecialPerformanceConfigDao
specialPerformanceConfigDao
;
@Override
@Transactional
...
...
@@ -109,10 +113,16 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
return
Result
.
failed
(
"该商品已截拍"
);
}
String
shareRecordId
=
dto
.
getShareRecordId
();
DistributorShareRecord
distributorShareRecord
=
distributorShareRecordDao
.
findById
(
shareRecordId
);
if
(
distributorShareRecord
==
null
||
!
distributorShareRecord
.
getEnabled
())
{
logger
.
info
(
"======== 拍卖出价,对应分享id = {}, 无效 ========"
,
shareRecordId
);
return
Result
.
failed
(
"该商品分享链接已失效"
);
DistributorShareRecord
distributorShareRecord
=
new
DistributorShareRecord
();
//拍卖专场进入的用户出价时没有分享记录的id,默认系统账号为分销商
if
(
StringUtils
.
isEmpty
(
shareRecordId
))
{
distributorShareRecord
.
setDistributorId
(
CommConsts
.
SYSTEM_ACCOUNT
);
}
else
{
distributorShareRecord
=
distributorShareRecordDao
.
findById
(
shareRecordId
);
if
(
distributorShareRecord
==
null
||
!
distributorShareRecord
.
getEnabled
())
{
logger
.
info
(
"======== 拍卖出价,对应分享id = {}, 无效 ========"
,
shareRecordId
);
return
Result
.
failed
(
"该商品分享链接已失效"
);
}
}
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
itemId
);
//查询当前最新的价格
...
...
@@ -168,26 +178,28 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
logger
.
info
(
"商品id:{}, 用户id:{}, 本次出价时间: {}, 原先截拍时间为:{}, 延长截拍时间为{}"
,
itemId
,
dto
.
getUserId
(),
now
,
endTime
,
newRealEndTime
);
}
//发送消息通知对应的分销商有用户出价
String
openId
=
sendMsgService
.
getOpenIdByUserId
(
distributorShareRecord
.
getDistributorId
());
if
(
com
.
xxdxxs
.
utils
.
StringUtils
.
hasLength
(
openId
))
{
AuctionOfferNoticeMsg
auctionOfferNoticeMsg
=
new
AuctionOfferNoticeMsg
();
auctionOfferNoticeMsg
.
setItemId
(
supplierItem
.
getId
());
auctionOfferNoticeMsg
.
setOpenId
(
openId
);
auctionOfferNoticeMsg
.
setItemName
(
supplierItem
.
getName
());
auctionOfferNoticeMsg
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
price
));
Result
result
=
sendMsgService
.
offerNoticeToDistributorMsg
(
auctionOfferNoticeMsg
);
if
(!
result
.
getSuccess
())
{
//发送消息通知对应的分销商有用户出价, 排除分销商id为系统默认账号的情况
if
(
distributorShareRecord
.
getDistributorId
().
longValue
()
!=
CommConsts
.
SYSTEM_ACCOUNT
)
{
String
openId
=
sendMsgService
.
getOpenIdByUserId
(
distributorShareRecord
.
getDistributorId
());
if
(
com
.
xxdxxs
.
utils
.
StringUtils
.
hasLength
(
openId
))
{
AuctionOfferNoticeMsg
auctionOfferNoticeMsg
=
new
AuctionOfferNoticeMsg
();
auctionOfferNoticeMsg
.
setItemId
(
supplierItem
.
getId
());
auctionOfferNoticeMsg
.
setOpenId
(
openId
);
auctionOfferNoticeMsg
.
setItemName
(
supplierItem
.
getName
());
auctionOfferNoticeMsg
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
price
));
Result
result
=
sendMsgService
.
offerNoticeToDistributorMsg
(
auctionOfferNoticeMsg
);
if
(!
result
.
getSuccess
())
{
String
url
=
wxAppletApi
.
getUrlLink
(
AUCTION_MSG_URL
,
"itemId="
+
itemId
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"有人成出价"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
"元,请前往"
+
url
+
"查看"
;
aliSmsSender
.
sendSms
(
distributorShareRecord
.
getDistributorId
(),
msg
);
}
}
else
{
String
url
=
wxAppletApi
.
getUrlLink
(
AUCTION_MSG_URL
,
"itemId="
+
itemId
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"有人成出价"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
"元,请前往"
+
url
+
"查看"
;
aliSmsSender
.
sendSms
(
distributorShareRecord
.
getDistributorId
(),
msg
);
}
}
else
{
String
url
=
wxAppletApi
.
getUrlLink
(
AUCTION_MSG_URL
,
"itemId="
+
itemId
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"有人成出价"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
"元,请前往"
+
url
+
"查看"
;
aliSmsSender
.
sendSms
(
distributorShareRecord
.
getDistributorId
(),
msg
);
}
return
Result
.
success
();
}
else
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SpecialPerformanceServiceImpl.java
0 → 100644
View file @
05d6f362
package
com.wwdz.ch.wx.impl.distribution
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.entity.SupplierItemVo
;
import
com.wwdz.ch.core.type.PageSearchResult
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.MediaUtil
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.db.dao.distribution.*
;
import
com.wwdz.ch.db.domain.distribution.*
;
import
com.wwdz.ch.db.dto.request.distribution.AuctionRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceConfigRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
import
com.wwdz.ch.wx.entity.vo.distribution.SpecialPerformanceVo
;
import
com.wwdz.ch.wx.service.distribution.SpecialPerformanceService
;
import
com.xxdxxs.utils.EntityMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
public
class
SpecialPerformanceServiceImpl
implements
SpecialPerformanceService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SpecialPerformanceServiceImpl
.
class
);
@Autowired
SpecialPerformanceDao
specialPerformanceDao
;
@Autowired
SpecialPerformanceConfigDao
specialPerformanceConfigDao
;
@Autowired
SupplierItemDao
supplierItemDao
;
@Autowired
AuctionRecordDao
auctionRecordDao
;
@Autowired
AuctionConfigDao
auctionConfigDao
;
@Override
public
Result
findInfo
(
SpecialPerformanceRequestDto
dto
)
{
try
{
SpecialPerformance
specialPerformance
=
specialPerformanceDao
.
findByType
(
dto
.
getType
());
Date
now
=
new
Date
();
if
(
now
.
after
(
specialPerformance
.
getEndTime
()))
{
SpecialPerformance
updateDto
=
new
SpecialPerformance
();
updateDto
.
setId
(
dto
.
getSpecialPerformanceId
());
updateDto
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
END
.
getCode
());
updateDto
.
setUpdateTime
(
now
);
specialPerformanceDao
.
update
(
updateDto
);
specialPerformance
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
END
.
getCode
());
}
int
specialPerformanceId
=
specialPerformance
.
getId
();
SpecialPerformanceConfigRequestDto
specialPerformanceConfigRequestDto
=
new
SpecialPerformanceConfigRequestDto
();
specialPerformanceConfigRequestDto
.
setPage
(
dto
.
getPage
());
specialPerformanceConfigRequestDto
.
setLimit
(
dto
.
getLimit
());
specialPerformanceConfigRequestDto
.
setSpecialPerformanceId
(
specialPerformanceId
);
List
<
SpecialPerformanceConfig
>
list
=
specialPerformanceConfigDao
.
findList
(
specialPerformanceConfigRequestDto
);
PageInfo
pageInfo
=
new
PageInfo
<>(
list
);
SpecialPerformanceVo
specialPerformanceVo
=
new
SpecialPerformanceVo
();
specialPerformanceVo
.
setTotalItemNum
(
pageInfo
.
getTotal
());
specialPerformanceVo
.
setTitle
(
specialPerformance
.
getTitle
());
specialPerformanceVo
.
setState
(
specialPerformance
.
getState
());
specialPerformanceVo
.
setStateName
(
DistributionEnum
.
AuctionStateEnum
.
getNameByCode
(
specialPerformance
.
getState
()));
specialPerformanceVo
.
setStartTime
(
specialPerformance
.
getStartTime
());
specialPerformanceVo
.
setEndTime
(
specialPerformance
.
getEndTime
());
long
totalViewNum
=
specialPerformanceConfigDao
.
countViewNum
(
specialPerformanceId
);
specialPerformanceVo
.
setTotalViewNum
(
totalViewNum
);
List
<
Map
<
String
,
Object
>>
dataList
=
new
ArrayList
<>();
for
(
SpecialPerformanceConfig
specialPerformanceConfig
:
list
)
{
long
itemId
=
specialPerformance
.
getId
();
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
itemId
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"homePageImage"
,
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
map
.
put
(
"itemName"
,
supplierItem
.
getName
());
map
.
put
(
"viewNum"
,
specialPerformanceConfig
.
getViewNum
());
dataList
.
add
(
map
);
}
specialPerformanceVo
.
setItemList
(
dataList
);
return
Result
.
success
(
specialPerformanceVo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询专场信息失败 error : {}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
findItemList
(
SpecialPerformanceRequestDto
dto
)
{
try
{
SpecialPerformance
specialPerformance
=
specialPerformanceDao
.
findById
(
dto
.
getSpecialPerformanceId
());
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
SupplierItemVo
>
supplierItemVos
=
new
ArrayList
<>();
SpecialPerformanceConfigRequestDto
specialPerformanceConfigRequestDto
=
new
SpecialPerformanceConfigRequestDto
();
specialPerformanceConfigRequestDto
.
setPage
(
dto
.
getPage
());
specialPerformanceConfigRequestDto
.
setLimit
(
dto
.
getLimit
());
specialPerformanceConfigRequestDto
.
setSpecialPerformanceId
(
dto
.
getSpecialPerformanceId
());
List
<
SpecialPerformanceConfig
>
list
=
specialPerformanceConfigDao
.
findList
(
specialPerformanceConfigRequestDto
);
PageInfo
<
SupplierItem
>
pageInfo
=
new
PageInfo
(
list
);
//商品总数
resultMap
.
put
(
"totalItemNum"
,
pageInfo
.
getTotal
());
//围观总数
long
totalViewNum
=
specialPerformanceConfigDao
.
countViewNum
(
dto
.
getSpecialPerformanceId
());
resultMap
.
put
(
"totalViewNum"
,
totalViewNum
);
//出价总数
List
<
SpecialPerformanceConfig
>
allItemlist
=
specialPerformanceConfigDao
.
findAllItem
(
dto
.
getSpecialPerformanceId
());
List
<
Long
>
itemIdList
=
allItemlist
.
stream
().
map
(
SpecialPerformanceConfig:
:
getItemId
).
collect
(
Collectors
.
toList
());
AuctionRecordRequestDto
auctionRecordRequestDtoOfTotal
=
new
AuctionRecordRequestDto
();
auctionRecordRequestDtoOfTotal
.
setItemIdList
(
itemIdList
);
long
totalOfferNum
=
auctionRecordDao
.
count
(
auctionRecordRequestDtoOfTotal
);
resultMap
.
put
(
"totalOfferNum"
,
totalOfferNum
);
List
<
Long
>
itemList
=
list
.
stream
().
map
(
SpecialPerformanceConfig:
:
getItemId
).
collect
(
Collectors
.
toList
());
SupplierItemRequestDto
supplierItemRequestDto
=
new
SupplierItemRequestDto
();
supplierItemRequestDto
.
setIds
(
itemList
);
List
<
SupplierItem
>
supplierItemList
=
supplierItemDao
.
findList
(
supplierItemRequestDto
);
supplierItemList
.
forEach
(
supplierItem
->
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
supplierItemVo
.
setItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setSupplyPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getSupplyPrice
()));
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
BigDecimal
decimal
=
supplierItem
.
getRebate
().
divide
(
new
BigDecimal
(
"100"
)).
multiply
(
new
BigDecimal
(
supplierItem
.
getDistributionPrice
().
toString
()));
supplierItemVo
.
setRebateAmount
(
PriceUtil
.
convertDoubleToString
(
decimal
.
doubleValue
()));
supplierItemVo
.
setRebate
(
supplierItem
.
getRebate
().
toPlainString
()
+
"%"
);
//竞拍商品需要展示当前价
if
(
supplierItem
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
AUCTION
.
getCode
())
{
Date
now
=
new
Date
();
AuctionRecord
lastedRecord
=
auctionRecordDao
.
findLastedRecord
(
supplierItem
.
getId
());
if
(
lastedRecord
!=
null
&&
lastedRecord
.
getPrice
()
!=
null
)
{
supplierItemVo
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
lastedRecord
.
getPrice
()));
}
else
{
supplierItemVo
.
setCurrentPrice
(
"0"
);
}
AuctionConfig
auctionConfig
=
auctionConfigDao
.
findByItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setRealEndTime
(
auctionConfig
.
getRealEndTime
());
if
(
now
.
before
(
auctionConfig
.
getStartTime
()))
{
supplierItemVo
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
NOT_START
.
getCode
());
supplierItemVo
.
setStateName
(
DistributionEnum
.
AuctionStateEnum
.
NOT_START
.
getDes
());
}
else
if
(
now
.
after
(
auctionConfig
.
getRealEndTime
()))
{
supplierItemVo
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
END
.
getCode
());
supplierItemVo
.
setStateName
(
DistributionEnum
.
AuctionStateEnum
.
END
.
getDes
());
//如果当前时间已经超过截拍时间,并且竞拍配置还未改成无效,则进行修改
if
(
auctionConfig
.
getIsValid
())
{
auctionConfigDao
.
setEnd
(
supplierItem
.
getId
());
}
}
else
{
supplierItemVo
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
IN_AUCTION
.
getCode
());
supplierItemVo
.
setStateName
(
DistributionEnum
.
AuctionStateEnum
.
IN_AUCTION
.
getDes
());
}
AuctionRecordRequestDto
auctionRecordRequestDto
=
new
AuctionRecordRequestDto
();
auctionRecordRequestDto
.
setItemId
(
supplierItemVo
.
getItemId
());
long
count
=
auctionRecordDao
.
count
(
auctionRecordRequestDto
);
supplierItemVo
.
setOfferNum
(
count
);
}
supplierItemVos
.
add
(
supplierItemVo
);
});
resultMap
.
put
(
"dataList"
,
PageSearchResult
.
of
(
pageInfo
,
supplierItemVos
));
resultMap
.
put
(
"endTime"
,
specialPerformance
.
getEndTime
());
Date
now
=
new
Date
();
//当前时间大于专场结束时间则修改专场的状态
if
(
now
.
after
(
specialPerformance
.
getEndTime
()))
{
SpecialPerformance
updateDto
=
new
SpecialPerformance
();
updateDto
.
setId
(
dto
.
getSpecialPerformanceId
());
updateDto
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
END
.
getCode
());
updateDto
.
setUpdateTime
(
now
);
specialPerformanceDao
.
update
(
updateDto
);
resultMap
.
put
(
"state"
,
DistributionEnum
.
AuctionStateEnum
.
END
.
getCode
());
resultMap
.
put
(
"stateName"
,
DistributionEnum
.
AuctionStateEnum
.
END
.
getDes
());
}
else
{
resultMap
.
put
(
"state"
,
specialPerformance
.
getState
());
resultMap
.
put
(
"stateName"
,
DistributionEnum
.
AuctionStateEnum
.
getNameByCode
(
specialPerformance
.
getState
()));
}
return
Result
.
success
(
resultMap
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"拍卖专场商品列表 error : {}"
,
e
);
}
return
Result
.
failed
();
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SpecialPerformanceService.java
0 → 100644
View file @
05d6f362
package
com.wwdz.ch.wx.service.distribution
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceRequestDto
;
public
interface
SpecialPerformanceService
{
/**
* 查询专场信息
* @return
*/
Result
findInfo
(
SpecialPerformanceRequestDto
dto
);
/**
* 查询专场商品列表
* @param dto
* @return
*/
Result
findItemList
(
SpecialPerformanceRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SpecialPerformanceController.java
0 → 100644
View file @
05d6f362
package
com.wwdz.ch.wx.web.distribution
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
import
com.wwdz.ch.wx.service.distribution.SpecialPerformanceService
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/wx/specialPerformance"
)
public
class
SpecialPerformanceController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SpecialPerformanceController
.
class
);
@Autowired
SpecialPerformanceService
specialPerformanceService
;
@ApiOperation
(
value
=
"查询专场信息"
)
@PostMapping
(
"/findInfo"
)
public
Result
findInfo
(
@RequestBody
SpecialPerformanceRequestDto
dto
)
{
logger
.
info
(
"查询专场信息,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getType
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
specialPerformanceService
.
findInfo
(
dto
);
}
@ApiOperation
(
value
=
"查询专场商品列表"
)
@PostMapping
(
"/findItemList"
)
public
Result
findItemList
(
@RequestBody
SpecialPerformanceRequestDto
dto
)
{
logger
.
info
(
"查询专场商品列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getSpecialPerformanceId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
specialPerformanceService
.
findItemList
(
dto
);
}
}
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