| | |
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass;
|
| | | import com.yeshi.fanli.exception.FloatADException;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelClassService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | @Resource
|
| | | private LabelClassService labelClassService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private TaoBaoClassService taoBaoClassService;
|
| | |
|
| | | /**
|
| | | * 保存信息
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, GoodsSubClass goodsSubClass, Long pid, Integer type, HttpServletRequest request,PrintWriter out) {
|
| | | public void save(String callback, GoodsSubClass goodsSubClass, Long pid, Integer type, HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | | try {
|
| | | // 1. 先判断httpRequest 是否含有文件类型
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | | MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
|
| | | goodsSubClassService.saveObject(fileRequest.getFile("file"),fileRequest.getFile("file2"), goodsSubClass, type, pid);
|
| | | goodsSubClassService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"),
|
| | | goodsSubClass, type, pid);
|
| | | }else{
|
| | | goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid);
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 批量删除
|
| | |
| | | Gson gson = new Gson();
|
| | |
|
| | | try {
|
| | | List<String> recordIds = gson.fromJson(ids, new TypeToken<ArrayList<String>>() {}.getType());
|
| | | List<String> recordIds = gson.fromJson(ids, new TypeToken<ArrayList<String>>() {
|
| | | }.getType());
|
| | |
|
| | | if (recordIds == null || recordIds.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("请选择需删除数据")));
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 删除图片
|
| | |
| | | goodsSubClass.setSearchParam(searchJson);
|
| | | }
|
| | |
|
| | | |
| | | int countlabel = labelClassService.getCountQueryBySubClassId(goodsSubClass.getId());
|
| | | goodsSubClass.setCountlabel(countlabel);
|
| | |
|
| | | // 查询淘宝分类
|
| | | List<TaoBaoClass> listTB = taoBaoClassService.listBySystemSubCid(0, 10000, goodsSubClass.getId());
|
| | | if (listTB == null || listTB.size() == 0) {
|
| | | goodsSubClass.setTaobaoCids("");
|
| | | } else {
|
| | | String taobaoCids = "";
|
| | | for (TaoBaoClass taoBaoClass : listTB) {
|
| | | taobaoCids = taobaoCids + taoBaoClass.getCategoryName() + "-" + taoBaoClass.getCategoryId()
|
| | | + ",";
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(taobaoCids)) {
|
| | | taobaoCids = taobaoCids.substring(0, taobaoCids.length() - 1);
|
| | | }
|
| | | goodsSubClass.setTaobaoCids(taobaoCids);
|
| | | }
|
| | | }
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 查找二级下的其他级分类
|
| | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 修改排序
|