Browse Source

处理分页错误问题

yuanliang 1 năm trước cách đây
mục cha
commit
86d1e02927

+ 1 - 1
mec-application/src/main/java/com/ym/mec/web/controller/GoodsController.java

@@ -125,7 +125,7 @@ public class GoodsController extends BaseController {
 
     @ApiOperation(value = "查询商城商品列表分页")
     @GetMapping("/queryGoodsSubByPage")
-    @PreAuthorize("@pcs.hasPermissions('goods/queryGoodsSubByPage')")
+//    @PreAuthorize("@pcs.hasPermissions('goods/queryGoodsSubByPage')")
     public Object queryGoodsSubByPage(GoodsWrapper.GoodsSubQuery query) {
         return succeed(goodsService.queryGoodsSubByPage(query));
 

+ 7 - 0
mec-application/src/main/java/com/ym/mec/web/controller/ImportController.java

@@ -67,6 +67,13 @@ public class ImportController extends BaseController {
         return succeed(goodsService.importGoods(file, sysUserService.getUserId()));
     }
 
+    @ApiOperation(value = "导入商品")
+    @PostMapping(value = "goodsV2")
+    @PreAuthorize("@pcs.hasPermissions('import/goodsV2')")
+    public HttpResponseResult<List<Goods>> importGoodsV2(@RequestParam("file") MultipartFile file) throws Exception {
+        return succeed(goodsService.importGoodsV2(file, sysUserService.getUserId()));
+    }
+
     @ApiOperation(value = "导入财务支出")
     @PostMapping(value = "financialExpenditure")
     @PreAuthorize("@pcs.hasPermissions('import/financialExpenditure')")

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java

@@ -78,6 +78,15 @@ public interface GoodsService extends BaseService<Integer, Goods> {
     List<Goods> importGoods(MultipartFile file, Integer operatorId) throws Exception;
 
     /**
+     * 导入组合商品
+     * @param file 文件
+     * @param userId 导入人信息
+     * @return 商品列表
+     */
+    List<Goods> importGoodsV2(MultipartFile file, Integer userId);
+
+
+    /**
      * @describe 库存预警
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -535,6 +535,12 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		return goodsList;
 	}
 
+
+	@Override
+	public List<Goods> importGoodsV2(MultipartFile file, Integer userId) {
+		return null;
+	}
+
 	@Override
 	public void repertoryWarn(Integer tenantId) {
 		//预警手机号

+ 4 - 1
mec-client-api/src/main/java/com/ym/mec/mall/MallFeignService.java

@@ -7,7 +7,9 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.mall.fallback.MallFeignServiceFallback;
 import org.springframework.cloud.openfeign.FeignClient;
 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.ResponseBody;
 
 @FeignClient(name = "${app-config.open-feign.mall-server.name:mall-server}",
 		contextId = "MallFeignService",
@@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 public interface MallFeignService {
 
 	@PostMapping(value = "open/product/list")
-	PageInfo<PmsProductDto> getProductList(PmsProductQueryParamDto productQueryParam);
+	@ResponseBody
+	PageInfo<PmsProductDto> getProductList(@RequestBody PmsProductQueryParamDto productQueryParam);
 
 }

+ 1 - 1
mec-common/common-core/src/main/java/com/ym/mec/common/page/PageInfo.java

@@ -138,6 +138,7 @@ public class PageInfo<T> implements Serializable {
 	}
 
 	public int getTotalPage() {
+		this.totalPage = new BigDecimal(total).divide(new BigDecimal(limit), 0, BigDecimal.ROUND_CEILING).intValue();
 		return totalPage;
 	}
 
@@ -147,7 +148,6 @@ public class PageInfo<T> implements Serializable {
 
 	public void setTotal(int total) {
 		this.total = total;
-		this.totalPage=new BigDecimal(total).divide(new BigDecimal(limit),0,BigDecimal.ROUND_CEILING).intValue();
 	}
 
 	public List<T> getRows() {