| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AdminAcceptData;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialLabelException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialLabelService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.common.entity.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, SpecialLabel specialLabel, PrintWriter out) {
|
| | | public void save(AdminAcceptData acceptData, String callback, SpecialLabel specialLabel, PrintWriter out) {
|
| | | try {
|
| | | specialLabelService.save(specialLabel);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 修改状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | specialLabelService.switchState(id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (SpecialLabelException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 查询
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
|
| | | public void query(AdminAcceptData acceptData,String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
|
| | | try {
|
| | | // 统计
|
| | | long count = specialLabelService.countQuery(key, state);
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "delete")
|
| | | public void delete(String callback, String idArray, PrintWriter out) {
|
| | | public void delete(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getBySpecialId")
|
| | | public void getBySpecialId(String callback, Long specialId, PrintWriter out) {
|
| | | public void getBySpecialId(AdminAcceptData acceptData,String callback, Long specialId, PrintWriter out) {
|
| | | try {
|
| | | List<SpecialLabel> list = specialLabelService.getLabelsBySpecialId(specialId);
|
| | | if (list == null) {
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "batchGoodsAddLables")
|
| | | public void batchGoodsAddLables(String callback, String labIds, String ids, HttpServletRequest request, PrintWriter out) {
|
| | | public void batchGoodsAddLables(AdminAcceptData acceptData,String callback, String labIds, String ids, HttpServletRequest request, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(ids)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择需操作的专题"));
|
| | | return;
|