| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.exception.FloatADException;
|
| | | import com.yeshi.fanli.exception.GoodsClassException;
|
| | | import com.yeshi.fanli.exception.goods.GoodsClassException;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
|
| | |
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @RequestMapping(value = "queryAll")
|
| | | public void listquery(String callback, PrintWriter out) {
|
| | | public void listquery(String callback, Integer sex, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | List<GoodsClass> goodsClassList = goodsClassService.listquery();
|
| | | List<GoodsClass> goodsClassList = goodsClassService.listquery(sex);
|
| | |
|
| | | if (goodsClassList == null || goodsClassList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | |
| | | }
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (FloatADException e) {
|
| | | } catch (GoodsClassException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 修改状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | goodsClassService.switchState(id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (GoodsClassException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 修改排序
|
| | |
| | | */
|
| | | @RequestMapping(value = "deleteBatch")
|
| | | public void deleteBatch(String callback, String ids, PrintWriter out) {
|
| | |
|
| | | Gson gson = new Gson();
|
| | |
|
| | | try {
|
| | | List<String> recordIds = gson.fromJson(ids, new TypeToken<ArrayList<String>>() {
|
| | | }.getType());
|
| | |
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | @RequestMapping(value = "removePicture")
|
| | | public void removePicture(String callback, Long id, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | GoodsClass goodsClass = goodsClassService.getGoodsClass(id);
|
| | |
|
| | |
| | |
|
| | | @RequestMapping(value = "getClassOption")
|
| | | public void getClassOption(String callback, PrintWriter out) {
|
| | |
|
| | | List<GoodsClass> goodsClassList = goodsClassService.getGoodsClassAll();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | data.put("result_list", goodsClassList);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | }
|
| | | }
|