| | |
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification;
|
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification.AppPageNotificationTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.help.AppPageNotificationService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, AppPageNotification appPageNotification, PrintWriter out) {
|
| | | try {
|
| | | AppPageNotificationTypeEnum type = appPageNotification.getType();
|
| | | if (type == null) {
|
| | | if (appPageNotification.getId() == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | AppPageNotification old = appPageNotificationService.getAppPageNotificationByType(type.name());
|
| | | AppPageNotification old = appPageNotificationService.selectByPrimaryKey(appPageNotification.getId());
|
| | | if (old == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作对象已不存在"));
|
| | | return;
|
| | |
| | | appPageNotification.setEndTime(format.parse(endTimeVO.replaceAll("T", " ")));
|
| | | }
|
| | |
|
| | | appPageNotification.setMd5(StringUtil.Md5(type.name() + "#" + content + "#" + appPageNotification.getContentUrl()));
|
| | | appPageNotification.setMd5(StringUtil.Md5(appPageNotification.getType() + "#" + content + "#" + appPageNotification.getContentUrl()));
|
| | | appPageNotification.setUpdateTime(new Date());
|
| | |
|
| | | appPageNotification.setId(old.getId());
|
| | |
| | | for (AppPageNotification notification: list) {
|
| | | AppPageNotificationTypeEnum type = notification.getType();
|
| | | notification.setPageName(type.getDesc());
|
| | | |
| | |
|
| | | Date startTime = notification.getBeginTime();
|
| | | if (startTime == null) {
|
| | |
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updateCanCloseState")
|
| | | public void updateCanCloseState(String callback, String type, PrintWriter out) {
|
| | | @RequestMapping(value = "switchShutOff")
|
| | | public void switchShutOff(String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | if (type == null) {
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | AppPageNotification resultObj = appPageNotificationService.getAppPageNotificationByType(type);
|
| | | AppPageNotification resultObj = appPageNotificationService.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
|
| | | return;
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("state", newOBj.getCanClose());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updateShowState")
|
| | | public void updateShowState(String callback, String type, PrintWriter out) {
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (type == null) {
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | AppPageNotification resultObj = appPageNotificationService.getAppPageNotificationByType(type);
|
| | | AppPageNotification resultObj = appPageNotificationService.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
|
| | | return;
|
| | |
| | | newOBj.setId(resultObj.getId());
|
| | | newOBj.setShow(show);
|
| | | appPageNotificationService.updateByPrimaryKeySelective(newOBj);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("state", newOBj.getShow());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|