Commit 052851e7 authored by ysongq's avatar ysongq

条件商品列表搜索

parent 39dab40a
alter table t_data_goods add use_person varchar(64) DEFAULT '0' COMMENT '使用人数';
\ No newline at end of file
...@@ -47,14 +47,13 @@ public class LoginController { ...@@ -47,14 +47,13 @@ public class LoginController {
*/ */
@PostMapping(value = "/login") @PostMapping(value = "/login")
@ApiOperation(value = "登录功能", notes = "登录功能") @ApiOperation(value = "登录功能", notes = "登录功能")
public Result<MallCustomer> login(String username, String password, HttpServletRequest request) throws Exception { public Result<CustomerDto> login(String username, String password, HttpServletRequest request) throws Exception {
// 手机 // 手机
String ph = "^[1][34578]\\d{9}$"; String ph = "^[1][34578]\\d{9}$";
// 如果是手机验证 // 如果是手机验证
if (username.matches(username)) { if (username.matches(ph)) {
CustomerDto mallCustomer = mallCustomerService.selectByPhone(username, request); CustomerDto mallCustomer = mallCustomerService.selectByPhone(username, request);
MallCustomerApiDto mallCustomerApiDto = (MallCustomerApiDto) request.getSession().getAttribute("mallCustomer"); request.getSession().getAttribute("mallCustomer");
System.out.print(mallCustomerApiDto.getAssetsId());
if (mallCustomer != null) { if (mallCustomer != null) {
if (mallCustomer.getCustomerPhone().equals(username) && mallCustomer.getPassword().equals(password)) { if (mallCustomer.getCustomerPhone().equals(username) && mallCustomer.getPassword().equals(password)) {
return new Result<>(true, "登录成功!", StatusCode.OK); return new Result<>(true, "登录成功!", StatusCode.OK);
...@@ -62,7 +61,7 @@ public class LoginController { ...@@ -62,7 +61,7 @@ public class LoginController {
return new Result<>(false, "用户名或密码错误!", StatusCode.ERROR); return new Result<>(false, "用户名或密码错误!", StatusCode.ERROR);
} }
} }
MallCustomer mallCustomer = mallCustomerService.selectByAccount(username, request); CustomerDto mallCustomer = mallCustomerService.selectByAccount(username, request);
if (mallCustomer != null) { if (mallCustomer != null) {
if (mallCustomer.getCustomerAccount().equals(username) && mallCustomer.getPassword().equals(password)) { if (mallCustomer.getCustomerAccount().equals(username) && mallCustomer.getPassword().equals(password)) {
return new Result<>(true, "登录成功!", StatusCode.OK); return new Result<>(true, "登录成功!", StatusCode.OK);
...@@ -139,7 +138,7 @@ public class LoginController { ...@@ -139,7 +138,7 @@ public class LoginController {
} }
} }
// 根据手机号查询用户信息 // 根据手机号查询用户信息
MallCustomer mallCustomer = mallCustomerService.selectByAccount(username, request); CustomerDto mallCustomer = mallCustomerService.selectByAccount(username, request);
if (mallCustomer != null) { if (mallCustomer != null) {
if (mallCustomer.getCustomerAccount().equals(username)) { if (mallCustomer.getCustomerAccount().equals(username)) {
return new Result(false, "用户名相同!"); return new Result(false, "用户名相同!");
......
...@@ -7,6 +7,7 @@ import com.jz.common.constant.RedisMessageConstant; ...@@ -7,6 +7,7 @@ import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultCode; import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.SessionUtils; import com.jz.common.utils.SessionUtils;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
...@@ -63,7 +64,7 @@ public class MallCustomerController extends BaseController { ...@@ -63,7 +64,7 @@ public class MallCustomerController extends BaseController {
} }
} }
// 根据手机号查询用户信息 // 根据手机号查询用户信息
MallCustomer mallCustomer = mallCustomerService.selectByAccount(username, request); CustomerDto mallCustomer = mallCustomerService.selectByAccount(username, request);
if (mallCustomer != null) { if (mallCustomer != null) {
if (mallCustomer.getCustomerAccount().equals(username)) { if (mallCustomer.getCustomerAccount().equals(username)) {
return new Result(false, "用户名相同"); return new Result(false, "用户名相同");
......
...@@ -5,8 +5,9 @@ import com.jz.common.bean.BaseBeanResponse; ...@@ -5,8 +5,9 @@ import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse; import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsListRequest;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest; import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods; import com.jz.dm.mall.moduls.entity.DataGoods;
import com.jz.dm.mall.moduls.service.DataGoodsService; import com.jz.dm.mall.moduls.service.DataGoodsService;
...@@ -15,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -15,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
...@@ -33,21 +33,23 @@ public class DataGoodsController extends BaseController { ...@@ -33,21 +33,23 @@ public class DataGoodsController extends BaseController {
@Autowired @Autowired
private DataGoodsService dataGoodsService; private DataGoodsService dataGoodsService;
/**列表查询数据商品 /**
* @param dataGoodsRequest * 列表查询商品数据
* @param dataGoodsListRequest
* @param httpRequest
* @return * @return
*/ */
@PostMapping(value = "/findList") @PostMapping(value = "/findList")
public PageInfoResponse<DataGoodsDto> findList(@RequestBody DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest){ @ApiOperation(value = "分页展示商品列表", notes = "首页点击分类展示商品列表")
PageInfoResponse<DataGoodsDto> pageInfo = new PageInfoResponse<DataGoodsDto>(); public PageInfoResponse<DataGoodsListDto> findByCategory(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest) {
PageInfoResponse<DataGoodsListDto> pageInfo = new PageInfoResponse<DataGoodsListDto>();
try { try {
pageInfo = dataGoodsService.findList(dataGoodsRequest, httpRequest); pageInfo = dataGoodsService.findList(dataGoodsListRequest, httpRequest);
} catch (Exception e) { } catch (Exception e) {
pageInfo.setMessage("查询失败"); pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE); pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace(); e.printStackTrace();
} }
return pageInfo; return pageInfo;
} }
......
...@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* 热门推荐商品(TMallHotRecommendGoods)表控制层 * 热门推荐商品(TMallHotRecommendGoods)表控制层
* *
...@@ -30,9 +32,10 @@ public class MallHotRecommendGoodsController extends BaseController { ...@@ -30,9 +32,10 @@ public class MallHotRecommendGoodsController extends BaseController {
@GetMapping(value = "/popularApi") @GetMapping(value = "/popularApi")
@ApiOperation(value = "热门商品api", notes = "热门商品api展示") @ApiOperation(value = "热门商品api", notes = "热门商品api展示")
public Result<MallHotRecommendGoodsDto> popularApi() { public Result<List<MallHotRecommendGoodsDto>> popularApi() {
MallHotRecommendGoodsDto popularApi = tMallHotRecommendGoodsService.selectByPopularApi(); List<MallHotRecommendGoodsDto> popularApiList = tMallHotRecommendGoodsService.selectByPopularApi();
return new Result<>(true, "查询热门api成功", StatusCode.OK, popularApi); return new Result<>(true, "查询热门api成功", StatusCode.OK, popularApiList);
} }
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; ...@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
...@@ -13,7 +14,7 @@ import java.util.Date; ...@@ -13,7 +14,7 @@ import java.util.Date;
* @Version: * @Version:
*/ */
@ApiModel(value = "商品详情--商品详情参数对象", description = "商品详情参数对象") @ApiModel(value = "商品详情--商品详情参数对象", description = "商品详情参数对象")
public class DataGoodsApiDto{ public class DataGoodsApiDto implements Serializable {
/** /**
* api商品id * api商品id
......
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
/**
* @ClassName: 商品列表返回对象
* @Author: Carl
* @Date: 2020/12/9
* @Version:
*/
@ApiModel(value = "商品列表", description = "商品列表参数对象")
public class DataGoodsListDto {
/**
* 数据商品id
*/
@ApiModelProperty(value = "数据商品id")
private Long dataGoodsId;
/**
* 商品分类id
*/
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 分类名称
*/
@ApiModelProperty(value = "分类名称")
private String categoryName;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型:01api,02数据包")
private String dataType;
/**
* 数据商品标签
*/
@ApiModelProperty(value = "数据商品标签")
private String dataLabel;
/**
* 数据商品图片
*/
@ApiModelProperty(value = "数据商品图片")
private String dataPicture;
/**
* 数据商品价格
*/
@ApiModelProperty(value = "数据商品价格")
private String dataPrice;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 年(元)
*/
@ApiModelProperty(value = "年(元)")
private BigDecimal yearType;
/**
* 季(元)
*/
@ApiModelProperty(value = "季(元)")
private BigDecimal seasonType;
/**
* 月(元)
*/
@ApiModelProperty(value = "月(元)")
private BigDecimal monthType;
/**
* 次(元)
*/
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataLabel() {
return dataLabel;
}
public void setDataLabel(String dataLabel) {
this.dataLabel = dataLabel;
}
public String getDataPicture() {
return dataPicture;
}
public void setDataPicture(String dataPicture) {
this.dataPicture = dataPicture;
}
public String getDataPrice() {
return dataPrice;
}
public void setDataPrice(String dataPrice) {
this.dataPrice = dataPrice;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public BigDecimal getYearType() {
return yearType;
}
public void setYearType(BigDecimal yearType) {
this.yearType = yearType;
}
public BigDecimal getSeasonType() {
return seasonType;
}
public void setSeasonType(BigDecimal seasonType) {
this.seasonType = seasonType;
}
public BigDecimal getMonthType() {
return monthType;
}
public void setMonthType(BigDecimal monthType) {
this.monthType = monthType;
}
public BigDecimal getSecondType() {
return secondType;
}
public void setSecondType(BigDecimal secondType) {
this.secondType = secondType;
}
}
...@@ -3,6 +3,8 @@ package com.jz.dm.mall.moduls.controller.goods.bean.dto; ...@@ -3,6 +3,8 @@ package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/** /**
* @ClassName: * @ClassName:
* @Author: Carl * @Author: Carl
...@@ -10,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -10,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty;
* @Version: * @Version:
*/ */
@ApiModel("热门商品api") @ApiModel("热门商品api")
public class MallHotRecommendGoodsDto { public class MallHotRecommendGoodsDto implements Serializable {
@ApiModelProperty(value = "数据商品id") @ApiModelProperty(value = "数据商品id")
private Long dataGoodsId; private Long dataGoodsId;
...@@ -34,7 +36,7 @@ public class MallHotRecommendGoodsDto { ...@@ -34,7 +36,7 @@ public class MallHotRecommendGoodsDto {
private String discountPrice; private String discountPrice;
@ApiModelProperty(value = "用户使用人数") @ApiModelProperty(value = "用户使用人数")
private Long customer; private Long usePerson;
public Long getDataGoodsId() { public Long getDataGoodsId() {
return dataGoodsId; return dataGoodsId;
...@@ -92,11 +94,11 @@ public class MallHotRecommendGoodsDto { ...@@ -92,11 +94,11 @@ public class MallHotRecommendGoodsDto {
this.discountPrice = discountPrice; this.discountPrice = discountPrice;
} }
public Long getCustomer() { public Long getUsePerson() {
return customer; return usePerson;
} }
public void setCustomer(Long customer) { public void setUsePerson(Long usePerson) {
this.customer = customer; this.usePerson = usePerson;
} }
} }
package com.jz.dm.mall.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/9
* @Version:
*/
@ApiModel(value = "数据集市--数据商品列表参数对象", description = "数据商品列表参数对象")
public class DataGoodsListRequest extends BasePageBean {
/**
* 商品分类id
*/
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 综合排序
*/
@ApiModelProperty(value = "综合排序")
private String synthesizeRank;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private Date uptTime;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 使用人数
*/
@ApiModelProperty(value = "使用人数")
private Long usePerson;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型:01api,02数据包")
private String dataType;
public Long getUsePerson() {
return usePerson;
}
public void setUsePerson(Long usePerson) {
this.usePerson = usePerson;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getSynthesizeRank() {
return synthesizeRank;
}
public void setSynthesizeRank(String synthesizeRank) {
this.synthesizeRank = synthesizeRank;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
}
...@@ -6,6 +6,7 @@ import java.util.Map; ...@@ -6,6 +6,7 @@ import java.util.Map;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.dm.mall.moduls.entity.DataGoods; import com.jz.dm.mall.moduls.entity.DataGoods;
...@@ -57,7 +58,7 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> { ...@@ -57,7 +58,7 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public List<DataGoodsDto> findList(Map<String, Object> param)throws Exception; public List<DataGoodsListDto> findList(Map<String, Object> param)throws Exception;
/**主键查询数据商品 /**主键查询数据商品
* @param DataGoodsId * @param DataGoodsId
......
...@@ -20,7 +20,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> { ...@@ -20,7 +20,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* @param username * @param username
* @return * @return
*/ */
MallCustomer selectByAccount(String username); CustomerDto selectByAccount(String username);
/** /**
......
...@@ -4,6 +4,8 @@ import com.jz.common.base.BaseMapper; ...@@ -4,6 +4,8 @@ import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto;
import com.jz.dm.mall.moduls.entity.MallHotRecommendGoods; import com.jz.dm.mall.moduls.entity.MallHotRecommendGoods;
import java.util.List;
/** /**
* 热门推荐商品(TMallHotRecommendGoods)表数据库访问层 * 热门推荐商品(TMallHotRecommendGoods)表数据库访问层
* *
...@@ -13,5 +15,5 @@ import com.jz.dm.mall.moduls.entity.MallHotRecommendGoods; ...@@ -13,5 +15,5 @@ import com.jz.dm.mall.moduls.entity.MallHotRecommendGoods;
public interface MallHotRecommendGoodsDao extends BaseMapper<MallHotRecommendGoods> { public interface MallHotRecommendGoodsDao extends BaseMapper<MallHotRecommendGoods> {
MallHotRecommendGoodsDto selectByPopularApi(); List<MallHotRecommendGoodsDto> selectByPopularApi();
} }
\ No newline at end of file
...@@ -5,6 +5,8 @@ import com.jz.common.bean.BaseResponse; ...@@ -5,6 +5,8 @@ import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsListRequest;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest; import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods; import com.jz.dm.mall.moduls.entity.DataGoods;
...@@ -21,12 +23,12 @@ public interface DataGoodsService { ...@@ -21,12 +23,12 @@ public interface DataGoodsService {
/**条件查询所有数据商品 /**条件查询所有数据商品
* @param DataGoodsRequest * @param dataGoodsListRequest
* @param httpRequest * @param httpRequest
* @return * @return
* @throws Exception * @throws Exception
*/ */
public PageInfoResponse<DataGoodsDto> findList(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception; public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)throws Exception;
/**新增数据商品 /**新增数据商品
...@@ -61,6 +63,4 @@ public interface DataGoodsService { ...@@ -61,6 +63,4 @@ public interface DataGoodsService {
*/ */
public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception; public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ public interface MallCustomerService { ...@@ -19,7 +19,7 @@ public interface MallCustomerService {
* @param username * @param username
* @return * @return
*/ */
MallCustomer selectByAccount(String username,HttpServletRequest request); CustomerDto selectByAccount(String username,HttpServletRequest request);
/** /**
* 通过手机号进行查询 * 通过手机号进行查询
......
...@@ -2,6 +2,8 @@ package com.jz.dm.mall.moduls.service; ...@@ -2,6 +2,8 @@ package com.jz.dm.mall.moduls.service;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto;
import java.util.List;
/** /**
* 热门推荐商品(TMallHotRecommendGoods)表服务接口 * 热门推荐商品(TMallHotRecommendGoods)表服务接口
* *
...@@ -15,5 +17,5 @@ public interface MallHotRecommendGoodsService { ...@@ -15,5 +17,5 @@ public interface MallHotRecommendGoodsService {
* 查询热门api数据 * 查询热门api数据
* @return * @return
*/ */
MallHotRecommendGoodsDto selectByPopularApi(); List<MallHotRecommendGoodsDto> selectByPopularApi();
} }
\ No newline at end of file
...@@ -8,6 +8,8 @@ import com.jz.common.bean.PageInfoResponse; ...@@ -8,6 +8,8 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsListRequest;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest; import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods; import com.jz.dm.mall.moduls.entity.DataGoods;
import com.jz.dm.mall.moduls.mapper.DataGoodsDao; import com.jz.dm.mall.moduls.mapper.DataGoodsDao;
...@@ -35,131 +37,44 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -35,131 +37,44 @@ public class DataGoodsServiceImpl implements DataGoodsService {
private DataGoodsDao dataGoodsDao; private DataGoodsDao dataGoodsDao;
@Override @Override
public PageInfoResponse<DataGoodsDto> findList(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest) public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)
throws Exception { throws Exception {
PageInfoResponse<DataGoodsDto> pageInfoResponse = new PageInfoResponse<>(); PageInfoResponse<DataGoodsListDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
//数据商品id
if (dataGoodsRequest.getDataGoodsId() != null) {
param.put("dataGoodsId", dataGoodsRequest.getDataGoodsId());
}
//商品分类id(行业) //商品分类id(行业)
if (dataGoodsRequest.getCategoryId() != null) { if (dataGoodsListRequest.getCategoryId() != null) {
param.put("categoryId", dataGoodsRequest.getCategoryId()); param.put("categoryId", dataGoodsListRequest.getCategoryId());
}
//数据商户id
if (dataGoodsRequest.getUserId() != null) {
param.put("userId", dataGoodsRequest.getUserId());
} }
//数据商品名称 //数据商品名称
if (!StringUtils.isEmpty(dataGoodsRequest.getDataName())) { if (!StringUtils.isEmpty(dataGoodsListRequest.getDataName())) {
param.put("dataName", dataGoodsRequest.getDataName()); param.put("dataName", dataGoodsListRequest.getDataName());
} }
//数据类型:01api,02数据包 //数据类型:01api,02数据包
if (!StringUtils.isEmpty(dataGoodsRequest.getDataType())) { if (!StringUtils.isEmpty(dataGoodsListRequest.getDataType())) {
param.put("dataType", dataGoodsRequest.getDataType()); param.put("dataType", dataGoodsListRequest.getDataType());
}
//数据商品标签
if (!StringUtils.isEmpty(dataGoodsRequest.getDataLabel())) {
param.put("dataLabel", dataGoodsRequest.getDataLabel());
}
//数据商品图片
if (!StringUtils.isEmpty(dataGoodsRequest.getDataPicture())) {
param.put("dataPicture", dataGoodsRequest.getDataPicture());
}
//数据商品价格
if (dataGoodsRequest.getDataPrice() != null) {
param.put("dataPrice", dataGoodsRequest.getDataPrice());
}
//优惠价格
if (dataGoodsRequest.getDiscountPrice() != null) {
param.put("discountPrice", dataGoodsRequest.getDiscountPrice());
} }
//价格类型:01免费,02收费 //价格类型:01免费,02收费
if (!StringUtils.isEmpty(dataGoodsRequest.getPriceType())) { if (!StringUtils.isEmpty(dataGoodsListRequest.getPriceType())) {
param.put("priceType", dataGoodsRequest.getPriceType()); param.put("priceType", dataGoodsListRequest.getPriceType());
}
//商品规格
if (!StringUtils.isEmpty(dataGoodsRequest.getGoodsStandards())) {
param.put("goodsStandards", dataGoodsRequest.getGoodsStandards());
}
//数据状态:01预售,02在售中,03下架,04上架
if (!StringUtils.isEmpty(dataGoodsRequest.getDataStatus())) {
param.put("dataStatus", dataGoodsRequest.getDataStatus());
}
//审核状态:01待审核,02已审核,03未通过
if (!StringUtils.isEmpty(dataGoodsRequest.getAuditStatus())) {
param.put("auditStatus", dataGoodsRequest.getAuditStatus());
}
//清洗规则(脱敏校验)
if (!StringUtils.isEmpty(dataGoodsRequest.getCleanRule())) {
param.put("cleanRule", dataGoodsRequest.getCleanRule());
}
//驳回原因
if (!StringUtils.isEmpty(dataGoodsRequest.getRejectReason())) {
param.put("rejectReason", dataGoodsRequest.getRejectReason());
}
//审核人
if (!StringUtils.isEmpty(dataGoodsRequest.getAuditPerson())) {
param.put("auditPerson", dataGoodsRequest.getAuditPerson());
} }
//审核时间起
if (dataGoodsRequest.getAuditTimeStart() != null) { //更新时间排序
param.put("auditTimeStart", dataGoodsRequest.getAuditTimeStart()); if (dataGoodsListRequest.getUptTime() != null) {
} param.put("uptTime", dataGoodsListRequest.getUptTime());
//审核时间止
if (dataGoodsRequest.getAuditTimeEnd() != null) {
param.put("auditTimeEnd", dataGoodsRequest.getAuditTimeEnd());
}
//创建时间起
if (dataGoodsRequest.getCreTimeStart() != null) {
param.put("creTimeStart", dataGoodsRequest.getCreTimeStart());
}
//创建时间止
if (dataGoodsRequest.getCreTimeEnd() != null) {
param.put("creTimeEnd", dataGoodsRequest.getCreTimeEnd());
}
//创建人
if (!StringUtils.isEmpty(dataGoodsRequest.getCrePerson())) {
param.put("crePerson", dataGoodsRequest.getCrePerson());
}
//更新时间起
if (dataGoodsRequest.getUptTimeStart() != null) {
param.put("uptTimeStart", dataGoodsRequest.getUptTimeStart());
}
//更新时间止
if (dataGoodsRequest.getUptTimeEnd() != null) {
param.put("uptTimeEnd", dataGoodsRequest.getUptTimeEnd());
}
//更新人
if (!StringUtils.isEmpty(dataGoodsRequest.getUptPerson())) {
param.put("uptPerson", dataGoodsRequest.getUptPerson());
}
//删除标识
if (!StringUtils.isEmpty(dataGoodsRequest.getDelFlag())) {
param.put("delFlag", dataGoodsRequest.getDelFlag());
}
//年(元)
if (dataGoodsRequest.getYearType() != null) {
param.put("yearType", dataGoodsRequest.getYearType());
}
//季(元)
if (dataGoodsRequest.getSeasonType() != null) {
param.put("seasonType", dataGoodsRequest.getSeasonType());
} }
//月(元) // 使用人数
if (dataGoodsRequest.getMonthType() != null) { if (dataGoodsListRequest.getUsePerson() != null) {
param.put("monthType", dataGoodsRequest.getMonthType()); param.put("usePerson", dataGoodsListRequest.getUsePerson());
} }
//次(元) // 综合排序
if (dataGoodsRequest.getSecondType() != null) { if (dataGoodsListRequest.getSynthesizeRank() != null) {
param.put("secondType", dataGoodsRequest.getSecondType()); param.put("synthesizeRank", dataGoodsListRequest.getSynthesizeRank());
} }
PageHelper.startPage(dataGoodsRequest.getPageNum(), dataGoodsRequest.getPageSize()); PageHelper.startPage(dataGoodsListRequest.getPageNum(), dataGoodsListRequest.getPageSize());
List<DataGoodsDto> list = dataGoodsDao.findList(param); List<DataGoodsListDto> list = dataGoodsDao.findList(param);
PageInfo<DataGoodsDto> pageInfo = new PageInfo<>(list); PageInfo<DataGoodsListDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE); pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功"); pageInfoResponse.setMessage("查询成功");
...@@ -247,4 +162,5 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -247,4 +162,5 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return baseResponse; return baseResponse;
} }
} }
\ No newline at end of file
...@@ -40,8 +40,8 @@ public class MallCustomerServiceImpl implements MallCustomerService { ...@@ -40,8 +40,8 @@ public class MallCustomerServiceImpl implements MallCustomerService {
* @return * @return
*/ */
@Override @Override
public MallCustomer selectByAccount(String username, HttpServletRequest request) { public CustomerDto selectByAccount(String username, HttpServletRequest request) {
MallCustomer mallCustomer = tMallCustomerDao.selectByAccount(username); CustomerDto mallCustomer = tMallCustomerDao.selectByAccount(username);
// String customer = JSON.toJSONString(mallCustomer); // String customer = JSON.toJSONString(mallCustomer);
if (mallCustomer != null) { if (mallCustomer != null) {
...@@ -55,7 +55,7 @@ public class MallCustomerServiceImpl implements MallCustomerService { ...@@ -55,7 +55,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
// 存入到session // 存入到session
request.getSession().setAttribute("mallCustomer", mallCustomerApiDto); request.getSession().setAttribute("mallCustomer", mallCustomerApiDto);
// 存入到redis // 存入到redis
redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS); // redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
} }
return mallCustomer; return mallCustomer;
} }
......
...@@ -7,6 +7,8 @@ import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService; ...@@ -7,6 +7,8 @@ import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService;
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 java.util.List;
/** /**
* 热门推荐商品(TMallHotRecommendGoods)表服务实现类 * 热门推荐商品(TMallHotRecommendGoods)表服务实现类
* *
...@@ -24,9 +26,9 @@ public class MallHotRecommendGoodsServiceImpl implements MallHotRecommendGoodsSe ...@@ -24,9 +26,9 @@ public class MallHotRecommendGoodsServiceImpl implements MallHotRecommendGoodsSe
* @return * @return
*/ */
@Override @Override
public MallHotRecommendGoodsDto selectByPopularApi() { public List<MallHotRecommendGoodsDto> selectByPopularApi() {
MallHotRecommendGoodsDto popularApi = tMallHotRecommendGoodsDao.selectByPopularApi(); List<MallHotRecommendGoodsDto> popularApiList = tMallHotRecommendGoodsDao.selectByPopularApi();
return popularApi; return popularApiList;
} }
} }
\ No newline at end of file
...@@ -47,95 +47,6 @@ ...@@ -47,95 +47,6 @@
limit #{offset}, #{limit} limit #{offset}, #{limit}
</select> </select>
<!--通过实体作为筛选条件查询-->
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto" parameterType="map">
select
data_goods_id, category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price,
price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time,
cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type
from t_data_goods
<where>
<if test="dataGoodsId != null">
and data_goods_id = #{dataGoodsId}
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="dataName != null and dataName != ''">
and data_name = #{dataName}
</if>
<if test="dataType != null and dataType != ''">
and data_type = #{dataType}
</if>
<if test="dataLabel != null and dataLabel != ''">
and data_label = #{dataLabel}
</if>
<if test="dataPicture != null and dataPicture != ''">
and data_picture = #{dataPicture}
</if>
<if test="dataPrice != null">
and data_price = #{dataPrice}
</if>
<if test="discountPrice != null">
and discount_price = #{discountPrice}
</if>
<if test="priceType != null and priceType != ''">
and price_type = #{priceType}
</if>
<if test="goodsStandards != null and goodsStandards != ''">
and goods_standards = #{goodsStandards}
</if>
<if test="dataStatus != null and dataStatus != ''">
and data_status = #{dataStatus}
</if>
<if test="auditStatus != null and auditStatus != ''">
and audit_status = #{auditStatus}
</if>
<if test="cleanRule != null and cleanRule != ''">
and clean_rule = #{cleanRule}
</if>
<if test="rejectReason != null and rejectReason != ''">
and reject_reason = #{rejectReason}
</if>
<if test="auditPerson != null and auditPerson != ''">
and audit_person = #{auditPerson}
</if>
<if test="auditTime != null">
and audit_time = #{auditTime}
</if>
<if test="creTime != null">
and cre_time = #{creTime}
</if>
<if test="crePerson != null and crePerson != ''">
and cre_person = #{crePerson}
</if>
<if test="uptTime != null">
and upt_time = #{uptTime}
</if>
<if test="uptPerson != null and uptPerson != ''">
and upt_person = #{uptPerson}
</if>
<if test="delFlag != null and delFlag != ''">
and del_flag = #{delFlag}
</if>
<if test="yearType != null">
and year_type = #{yearType}
</if>
<if test="seasonType != null">
and season_type = #{seasonType}
</if>
<if test="monthType != null">
and month_type = #{monthType}
</if>
<if test="secondType != null">
and second_type = #{secondType}
</if>
</where>
</select>
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="dataGoodsId" useGeneratedKeys="true"> <insert id="insert" keyProperty="dataGoodsId" useGeneratedKeys="true">
insert into t_data_goods(category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price, price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time, cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type) insert into t_data_goods(category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price, price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time, cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type)
...@@ -246,4 +157,77 @@ ...@@ -246,4 +157,77 @@
delete from t_data_goods where data_goods_id = #{dataGoodsId} delete from t_data_goods where data_goods_id = #{dataGoodsId}
</delete> </delete>
<select id="findByCategoryId" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="list">
SELECT
t1.data_goods_id,
t1.category_id,
t2.category_name,
t1.data_name,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end) dataTYpe,
t1.data_label,
t1.data_picture,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.discount_price,
t1.data_price,
t1.price_type,
t2.if_child,
t2.parent_id
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id
</select>
<!--通过实体作为筛选条件查询-->
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="map">
SELECT
t1.data_goods_id as dataGoods,
t1.category_id as categoryId,
t2.category_name as categoryName,
t1.data_name as dataName,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end) dataTYpe,
t1.data_label as dataLabel,
t1.data_picture as dataPicture,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.discount_price as discountPrice,
t1.data_price as dataPrice,
t1.price_type as pariceType,
t2.parent_id as parentId,
t1.year_type as yearType,
t1.season_type as seasonType,
t1.month_type as monthType,
t1.second_type as secondType
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id
where
1= 1 and
t1.del_flag = 'N' and
t1.data_status = '02'
<if test="categoryId != null">
and t1.category_id = #{categoryId}
</if>
<if test="dataName != null and dataName != ''">
and data_name = #{dataName}
</if>
<if test="dataType != null and dataType != ''">
and data_type = #{dataType}
</if>
<if test="priceType != null and priceType != ''">
and price_type = #{priceType}
</if>
<if test="uptTime != null">
ORDER BY
#{uptTime} desc
</if>
<if test="usePerson != null">
ORDER BY
#{usePerson} desc
</if>
<if test="synthesizeRank != null">
ORDER BY
#{synthesizeRank} desc
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -165,11 +165,19 @@ ...@@ -165,11 +165,19 @@
delete from t_mall_customer where customer_id = #{customerId} delete from t_mall_customer where customer_id = #{customerId}
</delete> </delete>
<select id="selectByAccount" resultMap="TMallCustomerMap"> <select id="selectByAccount" resultType="com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto">
select select
customer_id, department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag t1.customer_id as customerId,
from t_mall_customer t1.department_id as departmentId,
where customer_account = #{username}; t1.password,
t1.customer_account as customerAccount,
t1.customer_name as customerName,
t1.customer_phone as customerPhone,
t3.assets_id as assetsId
from t_mall_customer t1
left join t_department t2 on t1.department_id=t2.department_id
left join t_finance_customer_assets t3 on t3.department_id=t2.department_id
where 1=1 and t1.del_flag='N' and customer_account = #{username};
</select> </select>
<select id="selectByPhone" resultType="com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto"> <select id="selectByPhone" resultType="com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto">
......
...@@ -90,17 +90,17 @@ ...@@ -90,17 +90,17 @@
</delete> </delete>
<select id="selectByPopularApi" parameterType="map" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto"> <select id="selectByPopularApi" parameterType="list" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto">
SELECT SELECT
t1.data_goods_id as dataGoodsId , t1.data_goods_id as dataGoodsId ,
t1.data_name as dataName, t1.data_name as dataName,
t1.data_type as dataTYpe, (CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end) dataTYpe,
t1.data_label as dataLabel, t1.data_label as dataLabel,
t1.data_picture as dataPicture, t1.data_picture as dataPicture,
t1.data_price as dataPrice, t1.data_price as dataPrice,
t1.discount_price as discountPrice, t1.discount_price as discountPrice,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType, (CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
count(customer_id) as customer t1.use_person AS usePerson
FROM FROM
t_data_goods t1 t_data_goods t1
INNER JOIN t_mall_hot_recommend_goods t2 ON t1.data_goods_id = t2.data_goods_id INNER JOIN t_mall_hot_recommend_goods t2 ON t1.data_goods_id = t2.data_goods_id
...@@ -109,6 +109,6 @@ ...@@ -109,6 +109,6 @@
t1.del_flag = 'N' and t1.del_flag = 'N' and
t1.data_status = '02' t1.data_status = '02'
group by t1.data_goods_id group by t1.data_goods_id
order by customer desc order by usePerson desc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment