|
@@ -670,4 +670,88 @@ public class ProductInfoHandler {
|
|
|
remsg.setData(map);
|
|
|
return remsg;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询正在使用的产品类型列表
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/listProductType")
|
|
|
+ @ResponseBody
|
|
|
+ public ResultMsg listProductType(){
|
|
|
+ ResultMsg rm=new ResultMsg();
|
|
|
+ List<ProductType> list=productInfoService.listProductType();
|
|
|
+ if(list.size()<0){
|
|
|
+ rm.setStatus(false);
|
|
|
+ rm.setResultCode(ResultInfo.ERRORCODE);
|
|
|
+ rm.setMessage(NameUtils.getConfig("ERRORINFO"));
|
|
|
+ return rm;
|
|
|
+ }
|
|
|
+ rm.setData(list);
|
|
|
+ rm.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
+ rm.setMessage(NameUtils.getConfig("SUCCESSINFO"));
|
|
|
+ rm.setStatus(true);
|
|
|
+ return rm;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据colorId查询产品信息
|
|
|
+ * @param colorId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/getProductByColorId")
|
|
|
+ @ResponseBody
|
|
|
+ public ResultMsg getProductByColorId(Integer colorId){
|
|
|
+ ResultMsg rm=new ResultMsg();
|
|
|
+ if(colorId<0){
|
|
|
+ rm.setStatus(false);
|
|
|
+ rm.setResultCode(ResultInfo.ERRORCODE);
|
|
|
+ rm.setMessage(NameUtils.getConfig("ERRORINFO"));
|
|
|
+ return rm ;
|
|
|
+ }
|
|
|
+ Product product=productInfoService.selectProductByColorId(colorId);
|
|
|
+
|
|
|
+ rm.setStatus(true);
|
|
|
+ rm.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
+ rm.setMessage(NameUtils.getConfig("SUCCESSINFO"));
|
|
|
+ rm.setData(product);
|
|
|
+ return rm ;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据产品类型id查询产品颜色信息
|
|
|
+ * @param typeId
|
|
|
+ * @param pageSize
|
|
|
+ * @param pageNO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping("/listProductColorByTypeId")
|
|
|
+ public ResultMsg listProductColorByTypeId(Integer typeId,
|
|
|
+ @RequestParam(value= "pageSize",defaultValue= "6" ,required=false) Integer pageSize,
|
|
|
+ @RequestParam(value = "pageNO", defaultValue = "1",required=false) Integer pageNO){
|
|
|
+ ResultMsg rm=new ResultMsg();
|
|
|
+ if(typeId<=0){
|
|
|
+ rm.setStatus(false);
|
|
|
+ rm.setResultCode(ResultInfo.ERRORCODE);
|
|
|
+ rm.setMessage(NameUtils.getConfig("ERRORINFO"));
|
|
|
+ return rm;
|
|
|
+ }
|
|
|
+ Product product=new Product();
|
|
|
+ product.getProductType().setTypeId(typeId);
|
|
|
+ product.getPage().setPageSize(pageSize);
|
|
|
+ product.getPage().setPageNumber(pageNO);
|
|
|
+ List<Product> list=productInfoService.listProductColorByTypeId(product);
|
|
|
+ if(list==null||list.size()<=0){
|
|
|
+ rm.setStatus(false);
|
|
|
+ rm.setResultCode(ResultInfo.ERRORCODE);
|
|
|
+ return rm;
|
|
|
+ }
|
|
|
+ Map<String,Object> map=new HashMap<String, Object>();
|
|
|
+ map.put("productColorList",list);
|
|
|
+ map.put("typeId",product.getProductType().getTypeId());
|
|
|
+ rm.setStatus(true);
|
|
|
+ rm.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
+ rm.setMessage(NameUtils.getConfig("SUCCESSINFO"));
|
|
|
+ rm.setData(map);
|
|
|
+ return rm ;
|
|
|
+ }
|
|
|
}
|