| | |
| | | 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.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | |
| | | 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;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/specialcard")
|
| | |
| | | * @param record
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "modifySpecial")
|
| | | public void modifySpecial(String callback, Special record, String jumpType, PrintWriter out) {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | String params = record.getParams();
|
| | | if (params != null && params.trim().length() == 0) {
|
| | | params = null;
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(params)) {
|
| | |
|
| | | String jumpValue = systemConfigService.get("jump");
|
| | |
| | | }
|
| | |
|
| | | params = jumpValue.replace("#", params);
|
| | | record.setParams(params);
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(jumpType)) {
|
| | | List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
|
| | | if (listByType !=null && listByType.size() > 0) {
|
| | | record.setJumpDetail(listByType.get(0));
|
| | | resultObj.setJumpDetail(listByType.get(0));
|
| | | }
|
| | | }
|
| | |
|
| | | specialService.updateByPrimaryKeySelective(record);
|
| | | |
| | | String name = record.getName();
|
| | | if (name != null && name.trim().length() == 0) {
|
| | | name = null;
|
| | | }
|
| | | |
| | | String remark = record.getRemark();
|
| | | if (remark != null && remark.trim().length() == 0) {
|
| | | remark = null;
|
| | | }
|
| | | |
| | | resultObj.setName(name);
|
| | | resultObj.setParams(params);
|
| | | resultObj.setShowType(record.getShowType());
|
| | | resultObj.setRemark(remark);
|
| | | |
| | | specialService.updateByPrimaryKey(resultObj);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | |
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveSpecial")
|
| | | public void saveSpecial(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | Long id, Long cardId, 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 saveSpecial(@RequestParam("file") CommonsMultipartFile file, Long id, Long cardId,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|