فهرست منبع

产品列表增加省市区

zhijiezhao 1 سال پیش
والد
کامیت
6ef93d3907

+ 5 - 1
src/main/java/com/caimei/controller/wechat/WxAuthApi.java

@@ -125,6 +125,9 @@ public class WxAuthApi {
             @ApiImplicitParam(name = "authId", required = false, value = "机构id"),
             @ApiImplicitParam(name = "authParty", required = false, value = "机构名称"),
             @ApiImplicitParam(name = "productTypeId", required = false, value = "设备分类id"),
+            @ApiImplicitParam(name = "provinceId", required = false, value = "省id"),
+            @ApiImplicitParam(name = "cityId", required = false, value = "市id"),
+            @ApiImplicitParam(name = "townId", required = false, value = "区id"),
             @ApiImplicitParam(name = "snCode", required = false, value = "sn码"),
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
@@ -132,10 +135,11 @@ public class WxAuthApi {
     @IpSave(saveName = "认证商品列表",saveParams = true)
     @GetMapping("/product/list")
     public ResponseJson<PageInfo<WxProductListVo>> getWxProductList(Integer listType, Integer authId, Integer productTypeId,
+                                                                    Integer provinceId, Integer cityId, Integer townId,
                                                                     String authParty, String snCode,
                                                                     @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                                     @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        return authProductService.getWxProductList(listType, authId, authParty, productTypeId, snCode, pageNum, pageSize);
+        return authProductService.getWxProductList(listType, authId, authParty, productTypeId, provinceId, cityId, townId,snCode, pageNum, pageSize);
     }
 
     /**

+ 5 - 2
src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java

@@ -49,11 +49,12 @@ public interface AuthProductMapper {
 
     void updateProductAuditStatus(@Param("productId") Integer productId, @Param("productTypeId") Integer productTypeId, @Param("status") Integer status, @Param("auditStatus") Integer auditStatus, @Param("invalidReason") String invalidReason, @Param("auditBy") Integer auditBy, @Param("auditTime") Date auditTime);
 
-    List<WxProductListVo> getWxProductList(@Param("listType") Integer listType, @Param("authId") Integer authId, @Param("authParty") String authParty, @Param("productTypeId") Integer productTypeId, @Param("snCode") String snCode);
+    List<WxProductListVo> getWxProductList(@Param("listType") Integer listType, @Param("authId") Integer authId, @Param("authParty") String authParty, @Param("productTypeId") Integer productTypeId, @Param("provinceId") Integer provinceId, @Param("cityId") Integer cityId, @Param("townId") Integer townId, @Param("snCode") String snCode);
 
     List<ProductFormVo> getAuthProductList(Integer authId);
 
     void updateCertificateImage(ProductPo product);
+
     void updateAuthImageLogo(ProductPo product);
 
 
@@ -117,10 +118,12 @@ public interface AuthProductMapper {
     void addScanCount(Integer productId);
 
     void checkProductType(Integer productTypeId);
+
     //获取关联机构
     String getRelationId(Integer authId);
+
     //根据sn码产品id
-    List<ProductPo> getSnList( @Param("sn") String sn);
+    List<ProductPo> getSnList(@Param("sn") String sn);
 
     List<ProductListVo> getPronductInfo(Integer authId, Integer authUserId);
 

+ 2 - 1
src/main/java/com/caimei/service/auth/AuthProductService.java

@@ -122,7 +122,8 @@ public interface AuthProductService {
      * @param pageSize      一页多少条
      * @return
      */
-    ResponseJson<PageInfo<WxProductListVo>> getWxProductList(Integer listType, Integer authId, String authParty, Integer productTypeId, String snCode, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<WxProductListVo>> getWxProductList(Integer listType, Integer authId, String authParty, Integer productTypeId, Integer provinceId,
+                                                             Integer cityId,Integer townId,String snCode, Integer pageNum, Integer pageSize);
 
     /**
      * 认证商品详情

+ 5 - 3
src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java

@@ -766,7 +766,9 @@ public class AuthProductServiceImpl implements AuthProductService {
     }
 
     @Override
-    public ResponseJson<PageInfo<WxProductListVo>> getWxProductList(Integer listType, Integer authId, String authParty, Integer productTypeId, String snCode, Integer pageNum, Integer pageSize) {
+    public ResponseJson<PageInfo<WxProductListVo>> getWxProductList(Integer listType, Integer authId, String authParty,
+                                                                    Integer productTypeId, Integer provinceId, Integer cityId, Integer townId,
+                                                                    String snCode, Integer pageNum, Integer pageSize) {
         listType = null == listType ? 1 : listType;
         if (1 == listType) {
             if (null == productTypeId) {
@@ -776,7 +778,7 @@ public class AuthProductServiceImpl implements AuthProductService {
             }
         }
         PageHelper.startPage(pageNum, pageSize);
-        List<WxProductListVo> productList = authProductMapper.getWxProductList(listType, authId, authParty, productTypeId, snCode);
+        List<WxProductListVo> productList = authProductMapper.getWxProductList(listType, authId, authParty, productTypeId, provinceId, cityId, townId,snCode);
         productList.forEach(product -> {
             List<WxClubListVo> clubList = authProductMapper.getProductClubList(product.getProductId());
             product.setClubList(clubList);
@@ -791,7 +793,7 @@ public class AuthProductServiceImpl implements AuthProductService {
         if (productId.startsWith("HC")) {
             String substring = productId.substring(2);
             pid = authProductMapper.findProductByQr(substring);
-        }else{
+        } else {
             pid = Integer.valueOf(productId);
         }
         AuthProductVo authProduct = authProductMapper.getAuthProductByProductId(pid);

+ 9 - 0
src/main/resources/mapper/AuthProductMapper.xml

@@ -299,6 +299,15 @@
         left join cm_brand_auth_user au on a.authUserId = au.authUserId
         <where>
             a.delFlag = 0
+            <if test="provinceId != null">
+                and a.provinceId = #{provinceId}
+            </if>
+            <if test="cityId != null">
+                and a.cityId = #{cityId}
+            </if>
+            <if test="townId != null">
+                and a.townId = #{townId}
+            </if>
             <if test="listType == 1">
                 and p.productTypeId = #{productTypeId}
                 and au.status = 1