| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.exception.banner.SwiperBannerException;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | /**
|
| | | * 轮播图管理
|
| | |
| | | }
|
| | |
|
| | | Integer state = resultObj.getState();
|
| | | if (state != null && state.equals(0)) {
|
| | | resultObj.setState(1);
|
| | | } else {
|
| | | if (state == null || state.equals(1) || state == 1) {
|
| | | resultObj.setState(0);
|
| | | } else {
|
| | | resultObj.setState(1);
|
| | | }
|
| | |
|
| | | swiperBannerService.updateByPrimaryKeySelective(resultObj);
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPicture")
|
| | | public void uploadPicture(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | SwiperPicture record, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | SwiperPicture record, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | |
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | |
|
| | | int maxOrder = swiperPictureService.getMaxOrderByBannerID(bannerId);
|
| | | record.setOrder(maxOrder + 1);
|
| | | |
| | | // 默认停用
|
| | | record.setState(1);
|
| | | record.setCreatetime(new Date());
|
| | | record.setUpdatetime(new Date());
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "changePicture")
|
| | | public void changePicture(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | Long id, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | |
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | public void changePicture(@RequestParam("file") CommonsMultipartFile file, Long uid, Long id,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | | * @param record
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "changePicInfo")
|
| | | public void changePicInfo(String callback, SwiperPicture record, String jumpType,
|
| | | PrintWriter out) {
|
| | |
| | | }
|
| | |
|
| | | Integer state = resultObj.getState();
|
| | | if (state != null && state.equals(0)) {
|
| | | resultObj.setState(1);
|
| | | } else {
|
| | | if (state == null || state.equals(1) || state == 1) {
|
| | | resultObj.setState(0);
|
| | | } else {
|
| | | resultObj.setState(1);
|
| | | }
|
| | |
|
| | | swiperPictureService.updateByPrimaryKeySelective(resultObj);
|