商品详情开工,商品首页调整
This commit is contained in:
@@ -40,5 +40,9 @@ public class ProductController {
|
|||||||
return productService.queryProductSku(shopId,productId,spec_tag);
|
return productService.queryProductSku(shopId,productId,spec_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @GetMapping("/productInfo")
|
||||||
|
// public Result productInfo(@RequestParam Integer productId){
|
||||||
|
// return productService.productInfo()
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.dao;
|
|||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
|
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs;
|
import com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs;
|
||||||
|
import com.chaozhanggui.system.cashierservice.entity.TbSystemCoupons;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -32,4 +33,6 @@ public interface TbProductMapper {
|
|||||||
List<TbProduct> selectByIds(@Param("list") List<String> ids);
|
List<TbProduct> selectByIds(@Param("list") List<String> ids);
|
||||||
Integer selectByQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId);
|
Integer selectByQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId);
|
||||||
Integer selectByNewQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId,@Param("list") List<String> list);
|
Integer selectByNewQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId,@Param("list") List<String> list);
|
||||||
|
|
||||||
|
TbSystemCoupons selectLimit();
|
||||||
}
|
}
|
||||||
@@ -40,6 +40,8 @@ public class TbProduct implements Serializable {
|
|||||||
|
|
||||||
private String shareImg;
|
private String shareImg;
|
||||||
|
|
||||||
|
private String images;
|
||||||
|
|
||||||
private String videoCoverImg;
|
private String videoCoverImg;
|
||||||
|
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
@@ -128,6 +130,14 @@ public class TbProduct implements Serializable {
|
|||||||
|
|
||||||
private String cartNumber="0";
|
private String cartNumber="0";
|
||||||
|
|
||||||
|
public String getImages() {
|
||||||
|
return images;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImages(String images) {
|
||||||
|
this.images = images;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCartNumber() {
|
public String getCartNumber() {
|
||||||
return cartNumber;
|
return cartNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.chaozhanggui.system.cashierservice.entity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (TbSystemCoupons)实体类
|
||||||
|
*
|
||||||
|
* @author lyf
|
||||||
|
* @since 2024-04-09 18:27:08
|
||||||
|
*/
|
||||||
|
public class TbSystemCoupons implements Serializable {
|
||||||
|
private static final long serialVersionUID = -42549701370854624L;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Double couponsPrice;
|
||||||
|
|
||||||
|
private Double couponsAmount;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
private Integer dayNum;
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getCouponsPrice() {
|
||||||
|
return couponsPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCouponsPrice(Double couponsPrice) {
|
||||||
|
this.couponsPrice = couponsPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getCouponsAmount() {
|
||||||
|
return couponsAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCouponsAmount(Double couponsAmount) {
|
||||||
|
this.couponsAmount = couponsAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(Date endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDayNum() {
|
||||||
|
return dayNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDayNum(Integer dayNum) {
|
||||||
|
this.dayNum = dayNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.chaozhanggui.system.cashierservice.entity.vo;
|
||||||
|
|
||||||
|
import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 12847
|
||||||
|
*/
|
||||||
|
public class BannerVO {
|
||||||
|
|
||||||
|
private String coupons;
|
||||||
|
|
||||||
|
private List<TbPlatformDict> logo;
|
||||||
|
|
||||||
|
public String getCoupons() {
|
||||||
|
return coupons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoupons(String coupons) {
|
||||||
|
this.coupons = coupons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TbPlatformDict> getLogo() {
|
||||||
|
return logo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLogo(List<TbPlatformDict> logo) {
|
||||||
|
this.logo = logo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,6 +31,18 @@ public class HomeUpVO {
|
|||||||
* 销量飙升
|
* 销量飙升
|
||||||
*/
|
*/
|
||||||
HotRankingVO salesList;
|
HotRankingVO salesList;
|
||||||
|
/**
|
||||||
|
* 小横幅
|
||||||
|
*/
|
||||||
|
BannerVO bannerVO;
|
||||||
|
|
||||||
|
public BannerVO getBannerVO() {
|
||||||
|
return bannerVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBannerVO(BannerVO bannerVO) {
|
||||||
|
this.bannerVO = bannerVO;
|
||||||
|
}
|
||||||
|
|
||||||
public TodayRankingVO getTodayList() {
|
public TodayRankingVO getTodayList() {
|
||||||
return todayList;
|
return todayList;
|
||||||
|
|||||||
@@ -62,14 +62,13 @@ public class HomeVO {
|
|||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
private Long endTime;
|
||||||
private String endTime;
|
|
||||||
|
|
||||||
public String getEndTime() {
|
public Long getEndTime() {
|
||||||
return endTime;
|
return endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEndTime(String endTime) {
|
public void setEndTime(Long endTime) {
|
||||||
this.endTime = endTime;
|
this.endTime = endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.chaozhanggui.system.cashierservice.entity.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyf
|
||||||
|
*/
|
||||||
|
public class productInfoVo {
|
||||||
|
/**
|
||||||
|
* 商品图片
|
||||||
|
*/
|
||||||
|
private List<String>images;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原价
|
||||||
|
*/
|
||||||
|
private BigDecimal originPrice;
|
||||||
|
/**
|
||||||
|
* 现价
|
||||||
|
*/
|
||||||
|
private BigDecimal salePrice;
|
||||||
|
/**
|
||||||
|
* 折扣
|
||||||
|
*/
|
||||||
|
private Float discount;
|
||||||
|
/**
|
||||||
|
* 共省金额
|
||||||
|
*/
|
||||||
|
private BigDecimal save;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销量
|
||||||
|
*/
|
||||||
|
private BigDecimal realSalesNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Long endTime;
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ import javax.annotation.Resource;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@@ -83,7 +84,8 @@ public class HomePageService {
|
|||||||
homeVO.setShopTag(new ArrayList<>());
|
homeVO.setShopTag(new ArrayList<>());
|
||||||
}else {
|
}else {
|
||||||
TbPlatformDict tbPlatformDict = platformDictMapper.queryById(Integer.valueOf(tbShopInfo.getTag()));
|
TbPlatformDict tbPlatformDict = platformDictMapper.queryById(Integer.valueOf(tbShopInfo.getTag()));
|
||||||
homeVO.setShopTag(tbPlatformDict == null ? new ArrayList<>() : Collections.singletonList(tbPlatformDict.getName()));
|
|
||||||
|
homeVO.setShopTag(tbPlatformDict == null ? new ArrayList<>() : Collections.singletonList(tbPlatformDict.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,16 +108,25 @@ public class HomePageService {
|
|||||||
}
|
}
|
||||||
for (TagProductVO tagProductVO :dictPro.get()) {
|
for (TagProductVO tagProductVO :dictPro.get()) {
|
||||||
if (o.getRelationIds().equals(tagProductVO.getProductId().toString())){
|
if (o.getRelationIds().equals(tagProductVO.getProductId().toString())){
|
||||||
homeVO.setProTag(Collections.singletonList(tagProductVO.getTags()));
|
homeVO.setProTag(tagList(tagProductVO.getTags()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
homeVO.setEndTime(DateUtils.getTodayEndTimeAsString());
|
homeVO.setEndTime(DateUtils.getDayEndLong());
|
||||||
homeVOList.add(homeVO);
|
homeVOList.add(homeVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS, homeVOList);
|
return Result.success(CodeEnum.SUCCESS, homeVOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<String> tagList(String tag){
|
||||||
|
if (tag == null){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}else {
|
||||||
|
String[] arr = tag.split(",");
|
||||||
|
return new ArrayList<>(Arrays.asList(arr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Result homePageUp(String environment) {
|
public Result homePageUp(String environment) {
|
||||||
HomeUpVO homeUpVO = new HomeUpVO();
|
HomeUpVO homeUpVO = new HomeUpVO();
|
||||||
//轮播图
|
//轮播图
|
||||||
@@ -161,6 +172,16 @@ public class HomePageService {
|
|||||||
TodayRankingVO todayRankingVO = new TodayRankingVO();
|
TodayRankingVO todayRankingVO = new TodayRankingVO();
|
||||||
todayRankingVO.setTodayList(homeVODay);
|
todayRankingVO.setTodayList(homeVODay);
|
||||||
homeUpVO.setTodayList(todayRankingVO);
|
homeUpVO.setTodayList(todayRankingVO);
|
||||||
|
/**
|
||||||
|
* 小条幅
|
||||||
|
*/
|
||||||
|
TbSystemCoupons tbSystemCoupons = productMapper.selectLimit();
|
||||||
|
BannerVO bannerVO = new BannerVO();
|
||||||
|
bannerVO.setCoupons(tbSystemCoupons == null?"":tbSystemCoupons.getName());
|
||||||
|
List<TbPlatformDict> tbPlatformDicts = platformDictMapper.queryAllByType("icon", environment);
|
||||||
|
bannerVO.setLogo(tbPlatformDicts);
|
||||||
|
homeUpVO.setBannerVO(bannerVO);
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS, homeUpVO);
|
return Result.success(CodeEnum.SUCCESS, homeUpVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,4 +118,9 @@ public class ProductService {
|
|||||||
return Result.success(CodeEnum.SUCCESS,tbProductSkuWithBLOBs);
|
return Result.success(CodeEnum.SUCCESS,tbProductSkuWithBLOBs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public Result productInfo(Integer productId){
|
||||||
|
// TbShopInfo tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(productId);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -259,6 +260,18 @@ public class DateUtils {
|
|||||||
cal.set(Calendar.MILLISECOND, 999);
|
cal.set(Calendar.MILLISECOND, 999);
|
||||||
return cal.getTime();
|
return cal.getTime();
|
||||||
}
|
}
|
||||||
|
public static Long getDayEndLong() {
|
||||||
|
// 获取今天的日期和时间(00:00:00)
|
||||||
|
LocalDateTime todayStart = LocalDateTime.now().toLocalDate().atStartOfDay();
|
||||||
|
|
||||||
|
// 将时间设置为今天的结束时间(23:59:59.999999999)
|
||||||
|
LocalDateTime endOfDay = todayStart.plusDays(1).minusNanos(1);
|
||||||
|
|
||||||
|
// 转换为UTC时间戳(毫秒)
|
||||||
|
long timestampInMillis = endOfDay.toInstant(ZoneOffset.UTC).toEpochMilli();
|
||||||
|
|
||||||
|
return timestampInMillis;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getTodayEndTimeAsString() {
|
public static String getTodayEndTimeAsString() {
|
||||||
// 获取今天的日期
|
// 获取今天的日期
|
||||||
|
|||||||
62
src/main/resources/application-dev2.yml
Normal file
62
src/main/resources/application-dev2.yml
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://121.40.128.145:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||||
|
username: root
|
||||||
|
password: mysqlroot@123
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
initialSize: 5
|
||||||
|
minIdle: 5
|
||||||
|
maxActive: 20
|
||||||
|
maxWait: 60000
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.chaozhanggui.system.openness: info
|
||||||
|
redis:
|
||||||
|
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
|
||||||
|
database: 5
|
||||||
|
# redis服务器地址(默认为localhost)
|
||||||
|
# host: 101.37.12.135
|
||||||
|
host: 127.0.0.1
|
||||||
|
# redis端口(默认为6379)
|
||||||
|
port: 6379
|
||||||
|
# redis访问密码(默认为空)
|
||||||
|
password: 111111
|
||||||
|
# redis连接超时时间(单位为毫秒)
|
||||||
|
timeout: 1000
|
||||||
|
block-when-exhausted: true
|
||||||
|
# redis连接池配置
|
||||||
|
jedis:
|
||||||
|
pool:
|
||||||
|
max-active: 8
|
||||||
|
max-idle: 1024
|
||||||
|
min-idle: 0
|
||||||
|
max-wait: -1
|
||||||
|
main:
|
||||||
|
allow-circular-references: true
|
||||||
|
rabbitmq:
|
||||||
|
host: 101.37.12.135
|
||||||
|
port: 5672
|
||||||
|
username: admin
|
||||||
|
password: Czg666888
|
||||||
|
#分页配置
|
||||||
|
pagehelper:
|
||||||
|
supportMethodsArguments: true
|
||||||
|
reasonable: true
|
||||||
|
helperDialect: mysql
|
||||||
|
params: count=countSql
|
||||||
|
|
||||||
|
mybatis:
|
||||||
|
configuration:
|
||||||
|
map-underscore-to-camel-case: true
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
mapper-locations: classpath:mapper/*.xml
|
||||||
|
ysk:
|
||||||
|
url: https://gatewaytestapi.sxczgkj.cn/gate-service/
|
||||||
|
callBackurl: https://p40312246f.goho.co/cashierService/notify/notifyCallBack
|
||||||
|
callBackIn: https://p40312246f.goho.co/cashierService/notify/memberInCallBack
|
||||||
|
default: 18710449883
|
||||||
|
prod: prod2
|
||||||
|
queue: cart_queue_putprod2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -933,4 +933,7 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectLimit" resultType="com.chaozhanggui.system.cashierservice.entity.TbSystemCoupons">
|
||||||
|
select * from tb_system_coupons limit 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user