提交 17de01e1 作者: zhenjie

Merge branch 'develop'

...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: 689c742b34953b8aca245a80a0f9e66793ad5389 newTag: 77b2c8d55b316d0939f1ff0885084e77fce9e8be
package com.mmc.pms.controller.inspection; package com.mmc.pms.controller.inspection;
import com.mmc.pms.common.Page;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.inspection.dto.InspectionDTO; import com.mmc.pms.model.inspection.dto.InspectionDTO;
import com.mmc.pms.model.inspection.vo.InspectionVO; import com.mmc.pms.model.inspection.vo.InspectionVO;
import com.mmc.pms.model.qo.InspectionQO;
import com.mmc.pms.service.inspection.InspectionService; import com.mmc.pms.service.inspection.InspectionService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
...@@ -49,4 +52,11 @@ public class InspectionController { ...@@ -49,4 +52,11 @@ public class InspectionController {
public ResultBody<InspectionDTO> detail(@RequestParam Integer id){ public ResultBody<InspectionDTO> detail(@RequestParam Integer id){
return inspectionService.detail(id); return inspectionService.detail(id);
} }
@ApiOperation(value = "服务列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = InspectionDTO.class)})
@PostMapping("listInspectionPages")
public ResultBody<InspectionDTO> listInspectionPages(@Validated(Page.class) @RequestBody InspectionQO inspectionQO){
return inspectionService.listInspectionPages(inspectionQO);
}
} }
package com.mmc.pms.dao.inspection; package com.mmc.pms.dao.inspection;
import com.mmc.pms.entity.inspection.InspectionDO; import com.mmc.pms.entity.inspection.InspectionDO;
import com.mmc.pms.model.qo.InspectionQO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* @author: zj * @author: zj
* @Date: 2023/8/4 15:34 * @Date: 2023/8/4 15:34
...@@ -18,4 +21,8 @@ public interface InspectionDao { ...@@ -18,4 +21,8 @@ public interface InspectionDao {
void remove(Integer id); void remove(Integer id);
InspectionDO getInspectionById(Integer id); InspectionDO getInspectionById(Integer id);
int countListInspectionPages(InspectionQO inspectionQO);
List<InspectionDO> listInspectionPages(InspectionQO inspectionQO);
} }
...@@ -6,11 +6,13 @@ import com.mmc.pms.model.mall.UavCartDTO; ...@@ -6,11 +6,13 @@ import com.mmc.pms.model.mall.UavCartDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 商品基本信息(MallGoodsDO)实体类 * 商品基本信息(MallGoodsDO)实体类
...@@ -103,7 +105,6 @@ public class MallGoodsDO implements Serializable { ...@@ -103,7 +105,6 @@ public class MallGoodsDO implements Serializable {
this.priceShow = mallGoodsVO.getPriceShow(); this.priceShow = mallGoodsVO.getPriceShow();
this.recommend = mallGoodsVO.getRecommend() == null ? 0 : mallGoodsVO.getRecommend(); this.recommend = mallGoodsVO.getRecommend() == null ? 0 : mallGoodsVO.getRecommend();
this.goodsDetails = mallGoodsVO.getGoodsDetails(); this.goodsDetails = mallGoodsVO.getGoodsDetails();
this.hot = mallGoodsVO.getHot();
} }
public MallGoodsVO buildMallGoodsVO() { public MallGoodsVO buildMallGoodsVO() {
...@@ -122,7 +123,8 @@ public class MallGoodsDO implements Serializable { ...@@ -122,7 +123,8 @@ public class MallGoodsDO implements Serializable {
resourcesList.add(goodsResourcesVO); resourcesList.add(goodsResourcesVO);
return MallGoodsVO.builder().id(id).userAccountId(userAccountId).recommend(recommend).tradeName(tradeName).resourcesList(resourcesList) return MallGoodsVO.builder().id(id).userAccountId(userAccountId).recommend(recommend).tradeName(tradeName).resourcesList(resourcesList)
.categoryPrimaryId(categoryPrimaryId).labelShow(labelShow).goodsLabel(goodsLabel).categorySubId(categorySubId) .categoryPrimaryId(categoryPrimaryId).labelShow(labelShow).goodsLabel(goodsLabel).categorySubId(categorySubId)
.shelfStatus(shelfStatus).createTime(createTime).description(description).priceShow(priceShow).build(); .shelfStatus(shelfStatus).createTime(createTime).priceStock(CollectionUtils.isEmpty(priceStockDOS) ? null : priceStockDOS.stream()
.map(PriceStockDO::buildPriceStockVO).collect(Collectors.toList())).description(description).priceShow(priceShow).build();
} }
public UavCartDTO buildUavCartDTO() { public UavCartDTO buildUavCartDTO() {
......
...@@ -81,7 +81,4 @@ public class MallGoodsVO implements Serializable { ...@@ -81,7 +81,4 @@ public class MallGoodsVO implements Serializable {
@ApiModelProperty(value = "店铺id 小程序用") @ApiModelProperty(value = "店铺id 小程序用")
private Integer userAccountId; private Integer userAccountId;
@ApiModelProperty(value = "商品热度")
private Integer hot;
} }
package com.mmc.pms.model.qo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/10/18 14:42
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class InspectionQO implements Serializable {
private static final long serialVersionUID = 6272003703156261356L;
@ApiModelProperty(value = "关键字")
private String keyword;
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
...@@ -3,6 +3,7 @@ package com.mmc.pms.service.inspection; ...@@ -3,6 +3,7 @@ package com.mmc.pms.service.inspection;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.inspection.dto.InspectionDTO; import com.mmc.pms.model.inspection.dto.InspectionDTO;
import com.mmc.pms.model.inspection.vo.InspectionVO; import com.mmc.pms.model.inspection.vo.InspectionVO;
import com.mmc.pms.model.qo.InspectionQO;
/** /**
* @author: zj * @author: zj
...@@ -16,4 +17,6 @@ public interface InspectionService { ...@@ -16,4 +17,6 @@ public interface InspectionService {
ResultBody remove(Integer id); ResultBody remove(Integer id);
ResultBody<InspectionDTO> detail(Integer id); ResultBody<InspectionDTO> detail(Integer id);
ResultBody<InspectionDTO> listInspectionPages(InspectionQO inspectionQO);
} }
...@@ -8,11 +8,16 @@ import com.mmc.pms.entity.inspection.InspectionDO; ...@@ -8,11 +8,16 @@ import com.mmc.pms.entity.inspection.InspectionDO;
import com.mmc.pms.model.inspection.dto.InspectionDTO; import com.mmc.pms.model.inspection.dto.InspectionDTO;
import com.mmc.pms.model.inspection.vo.InspectionVO; import com.mmc.pms.model.inspection.vo.InspectionVO;
import com.mmc.pms.model.qo.CompanyInspectionQO; import com.mmc.pms.model.qo.CompanyInspectionQO;
import com.mmc.pms.model.qo.InspectionQO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.inspection.CompanyInspectionService; import com.mmc.pms.service.inspection.CompanyInspectionService;
import com.mmc.pms.service.inspection.InspectionService; import com.mmc.pms.service.inspection.InspectionService;
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;
import java.util.stream.Collectors;
/** /**
* @author: zj * @author: zj
* @Date: 2023/8/4 16:31 * @Date: 2023/8/4 16:31
...@@ -68,4 +73,17 @@ public class InspectionServiceImpl implements InspectionService { ...@@ -68,4 +73,17 @@ public class InspectionServiceImpl implements InspectionService {
} }
return ResultBody.success(inspectionDO.buildInspectionDTO()); return ResultBody.success(inspectionDO.buildInspectionDTO());
} }
@Override
public ResultBody<InspectionDTO> listInspectionPages(InspectionQO inspectionQO) {
int count = inspectionDao.countListInspectionPages(inspectionQO);
if (count == 0) {
return ResultBody.success(PageResult.buildPage(inspectionQO.getPageNo(), inspectionQO.getPageSize(), count));
}
int pageNo = inspectionQO.getPageNo();
inspectionQO.buildCurrentPage();
List<InspectionDO> inspectionDOS = inspectionDao.listInspectionPages(inspectionQO);
List<InspectionDTO> inspectionDTOS = inspectionDOS.stream().map(InspectionDO::buildInspectionDTO).collect(Collectors.toList());
return ResultBody.success(PageResult.buildPage(pageNo, inspectionQO.getPageSize(), count, inspectionDTOS));
}
} }
...@@ -7,20 +7,9 @@ spring: ...@@ -7,20 +7,9 @@ spring:
password: IUAV_DEV@2023&MYSQL password: IUAV_DEV@2023&MYSQL
redis: redis:
database: 1 database: 1
host: 127.0.0.1 host: r-wz9ke310fs684hacn1pd.redis.rds.aliyuncs.com
port: 6379 port: 6379
#连接池 password: MMC@2022&REDIS
lettuce:
shutdown-timeout: 1000 # 关闭超时时间-ms
pool:
#最大连接个数
max-active: 30
#等待时间-ms
max-wait: 1000ms
#最大空闲
max-idle: 8
#初始化最小
min-idle: 1
servlet: servlet:
multipart: multipart:
max-file-size: 512MB max-file-size: 512MB
......
...@@ -77,4 +77,36 @@ ...@@ -77,4 +77,36 @@
where ins.is_deleted = 0 where ins.is_deleted = 0
and ins.id = #{id} and ins.id = #{id}
</select> </select>
<select id="countListInspectionPages" resultType="java.lang.Integer" parameterType="com.mmc.pms.model.qo.InspectionQO">
select count(*) from inspection ins
where ins.is_deleted = 0
<if test="keyword != null">
and (ins.inspection_name like concat('%',#{keyword},'%') or
ins.inspection_no like concat('%',#{keyword},'%')
)
</if>
</select>
<select id="listInspectionPages" resultType="com.mmc.pms.entity.inspection.InspectionDO" parameterType="com.mmc.pms.model.qo.InspectionQO">
select ins.id,
ins.inspection_no,
ins.inspection_name,
ins.industry_type_id,
ins.inspection_img,
ins.inspection_description,
ins.sale_state,
ins.case_img,
ins.case_video,
ins.create_time
from inspection ins
where ins.is_deleted = 0
<if test="keyword != null">
and (ins.inspection_name like concat('%',#{keyword},'%') or
ins.inspection_no like concat('%',#{keyword},'%')
)
</if>
order by ins.id desc
limit #{pageNo}, #{pageSize}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -277,7 +277,29 @@ ...@@ -277,7 +277,29 @@
FROM mall_goods FROM mall_goods
WHERE is_deleted = 0 WHERE is_deleted = 0
</select> </select>
<select id="recommendMallGoods" resultType="com.mmc.pms.entity.mall.MallGoodsDO"> <resultMap id="resultMallGoodsMap" type="com.mmc.pms.entity.mall.MallGoodsDO">
<id column="id" property="id"/>
<result column="trade_name" property="tradeName"/>
<result column="create_time" property="createTime"/>
<result column="category_primary_id" property="categoryPrimaryId"/>
<result column="category_sub_id" property="categorySubId"/>
<result column="description" property="description"/>
<result column="recommend" property="recommend"/>
<result column="imgId" property="imgId"/>
<result column="price_show" property="priceShow"/>
<result column="user_account_id" property="userAccountId"/>
<result column="url" property="url"/>
<result column="is_deleted" property="deleted"/>
<result column="shelf_status" property="shelfStatus"/>
<collection property="priceStockDOS" ofType="com.mmc.pms.entity.mall.PriceStockDO">
<id column="productSpecId" property="id"/>
<result column="product_spec" property="productSpec"/>
<result column="sku_image" property="skuImage"/>
<result column="sale_price" property="salePrice"/>
<result column="sku_no" property="skuNo"/>
</collection>
</resultMap>
<select id="recommendMallGoods" resultMap="resultMallGoodsMap">
SELECT mg.id, SELECT mg.id,
mg.trade_name, mg.trade_name,
mg.shelf_status, mg.shelf_status,
...@@ -290,10 +312,16 @@ ...@@ -290,10 +312,16 @@
mg.recommend, mg.recommend,
img.id as imgId, img.id as imgId,
img.url, img.url,
img.type img.type,
ps.id as productSpecId,
ps.product_spec,
ps.sale_price,
ps.sku_image,
ps.sku_no
FROM mall_goods mg FROM mall_goods mg
INNER JOIN mall_goods_resources img ON mg.id = img.mall_goods_id INNER JOIN mall_goods_resources img ON mg.id = img.mall_goods_id
AND img.type = 0 AND img.type = 0
LEFT JOIN price_stock ps ON ps.mall_goods_id = mg.id
where mg.is_deleted = 0 where mg.is_deleted = 0
and mg.recommend = 1 and mg.recommend = 1
</select> </select>
......
...@@ -30,6 +30,7 @@ data-filter: ...@@ -30,6 +30,7 @@ data-filter:
- /pms/industry/listInspectionsByIndustryTypeId - /pms/industry/listInspectionsByIndustryTypeId
- /pms/industry/getIndustryTypeById - /pms/industry/getIndustryTypeById
- /pms/inspection/detail - /pms/inspection/detail
- /pms/inspection/listInspectionPages
- /pms/inspection-tag/listByInspectionId - /pms/inspection-tag/listByInspectionId
- /pms/company-inspection/listInspectionPriceUnit - /pms/company-inspection/listInspectionPriceUnit
- /pms/company-inspection/listAPPCompanyInspectionPage - /pms/company-inspection/listAPPCompanyInspectionPage
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论