|
|
|
@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
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.RestController; |
|
|
|
|
|
|
|
@ -25,40 +26,41 @@ public class AdminGoodsClassifyController extends BaseController { |
|
|
|
private ClassifyService classifyService; |
|
|
|
|
|
|
|
@PostMapping("/list") |
|
|
|
public JSONObject clist(HttpServletRequest request){ |
|
|
|
public JSONObject clist(@RequestBody String jsonStr){ |
|
|
|
JSONObject request =JSONObject.parseObject(jsonStr); |
|
|
|
Map qmap = new HashMap<>();//组装查询条件
|
|
|
|
String topClass=request.getParameter("top_clas"); |
|
|
|
String topClass=request.getString("top_clas"); |
|
|
|
if(StringUtils.isNotBlank(topClass)){ |
|
|
|
qmap.put("top_class",topClass); |
|
|
|
} |
|
|
|
//
|
|
|
|
String sonClass=request.getParameter("son_class"); |
|
|
|
String sonClass=request.getString("son_class"); |
|
|
|
if (StringUtils.isNotBlank(sonClass)){ |
|
|
|
qmap.put("son_class",sonClass); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
|
String userId= request.getParameter("user_id"); |
|
|
|
String userId= request.getString("user_id"); |
|
|
|
if(StringUtils.isNotBlank(userId)){ |
|
|
|
qmap.put("user_id",userId); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
|
String usestatus=request.getParameter("usestatus"); |
|
|
|
String usestatus=request.getString("usestatus"); |
|
|
|
if(StringUtils.isNotBlank(usestatus)){ |
|
|
|
qmap.put("usestatus",usestatus); |
|
|
|
} |
|
|
|
|
|
|
|
//时间段
|
|
|
|
String createtime=request.getParameter("createtime"); |
|
|
|
String createtime=request.getString("createtime"); |
|
|
|
if(StringUtils.isNotBlank(createtime)){ |
|
|
|
// 拆分时间 并组装时间段
|
|
|
|
} |
|
|
|
// 分页大小
|
|
|
|
String limit=request.getParameter("limit"); |
|
|
|
String limit=request.getString("limit"); |
|
|
|
int ilimit = StringUtils.isBlank(limit)?10:Integer.valueOf(limit); |
|
|
|
// 分页
|
|
|
|
String page = request.getParameter("page"); |
|
|
|
String page = request.getString("page"); |
|
|
|
int ipage=StringUtils.isBlank(page)?1:Integer.valueOf(page); |
|
|
|
|
|
|
|
//
|
|
|
|
@ -69,10 +71,10 @@ public class AdminGoodsClassifyController extends BaseController { |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/getTop") |
|
|
|
@RequestMapping("/getTop") |
|
|
|
public JSONObject getTop(){ |
|
|
|
Map map = classifyService.getTop(); |
|
|
|
jsonObject.put("data",map); |
|
|
|
List<String> clist = classifyService.getTop(); |
|
|
|
jsonObject.put("data",clist); |
|
|
|
jsonObject.put("code",200); |
|
|
|
jsonObject.put("msg","成功"); |
|
|
|
return jsonObject; |
|
|
|
|