| | |
| | | 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.springframework.web.multipart.MultipartHttpServletRequest;
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.exception.config.HelpCenterException;
|
| | | import com.yeshi.fanli.exception.config.HelpClassException;
|
| | | import com.yeshi.fanli.exception.homemodule.FloatADException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.help.HelpCenterService;
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, HelpCenter helpCenter, String acction, String content, String html,
|
| | | public void save(AdminAcceptData acceptData,String callback, HelpCenter helpCenter, String acction, String content, String html,
|
| | | PrintWriter out) {
|
| | | try {
|
| | | helpCenterService.save(helpCenter, content, html);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | helpCenterService.switchState(id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (HelpCenterException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @RequestMapping(value = "getInfo")
|
| | | public void getInfo(String callback, Long id, PrintWriter out) {
|
| | | public void getInfo(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | |
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确参数"));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Long cid, Integer orderMode,
|
| | | String version, String platform, Integer state,PrintWriter out) {
|
| | | public void query(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Long cid, Integer orderMode,
|
| | | String version, String platform, Integer state, PrintWriter out) {
|
| | | try {
|
| | | if (orderMode == null)
|
| | | orderMode = 1;
|
| | |
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | List<HelpCenter> list = helpCenterService.query(0, Integer.MAX_VALUE, key, cid, orderMode, state);
|
| | | List<HelpCenter> list = helpCenterService.query(0, Integer.MAX_VALUE, key, cid, orderMode, state,acceptData.getSystem());
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | |
| | | if (appVersion != null)
|
| | | versionList.add(appVersion);
|
| | | } else {
|
| | | List<AppVersionInfo> appVersionList = appVersionService.getAppVersionInfoListByPlatform(platform);
|
| | | List<AppVersionInfo> appVersionList = appVersionService.getAppVersionInfoListByPlatform(platform,acceptData.getSystem());
|
| | | if (appVersionList != null) {
|
| | | versionList.addAll(appVersionList);
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setCenterVersions")
|
| | | public void setCenterVersions(String callback, Long id, String versions, PrintWriter out) {
|
| | | public void setCenterVersions(AdminAcceptData acceptData,String callback, Long id, String versions, PrintWriter out) {
|
| | | JSONArray versionArray = JSONArray.fromObject(versions);
|
| | | List<Long> versionIds = new ArrayList<>();
|
| | | for (int i = 0; i < versionArray.size(); i++) {
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "getCenterVersions")
|
| | | public void getCenterVersions(String callback, Long id, PrintWriter out) {
|
| | | public void getCenterVersions(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | | List<AdActivityVersionControl> list = adActivityVersionControlService
|
| | | .listByTypeAndSourceId(AdActivityType.helpCenter, id);
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setWeight")
|
| | | public void setWeight(String callback, Long id, Integer weight, PrintWriter out) {
|
| | | public void setWeight(AdminAcceptData acceptData,String callback, Long id, Integer weight, PrintWriter out) {
|
| | | if (id == null || weight == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确参数"));
|
| | | return;
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteBatch")
|
| | | public void deleteBatch(String callback, String idArray, PrintWriter out) {
|
| | | public void deleteBatch(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未选择操作的数据"));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveClass")
|
| | | public void saveClass(String callback, HelpClass helpClass, HttpServletRequest request, PrintWriter out) {
|
| | | public void saveClass(AdminAcceptData acceptData,String callback, HelpClass helpClass, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | // 1. 先判断httpRequest 是否含有文件类型
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | |
| | | helpClassService.save(helpClass, null);
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (FloatADException e) {
|
| | | } catch (HelpClassException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchStateClass")
|
| | | public void switchStateClass(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | helpClassService.switchState(id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (HelpClassException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 修改排序
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updateSort")
|
| | | public void updateSort(String callback, Integer moveType, Long id, PrintWriter out) {
|
| | | public void updateSort(AdminAcceptData acceptData, String callback, Integer moveType, Long id, PrintWriter out) {
|
| | | try {
|
| | | helpClassService.updateSort(moveType, id);
|
| | | helpClassService.updateSort(moveType, id,acceptData.getSystem());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (HelpClassException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteClass")
|
| | | public void deleteClass(String callback, String idArray, PrintWriter out) {
|
| | | public void deleteClass(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
|
| | | return;
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryClass")
|
| | | public void queryClass(String callback, Integer pageIndex, Integer pageSize, String key, Integer showState,
|
| | | public void queryClass(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Integer showState,
|
| | | String version, String platform, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | |
| | |
|
| | | pageSize = Integer.MAX_VALUE;
|
| | | try {
|
| | | List<HelpClass> list = helpClassService.query(0, pageSize, key, showState);
|
| | | List<HelpClass> list = helpClassService.query(0, pageSize, key, showState,acceptData.getSystem());
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | |
| | | if (appVersion != null)
|
| | | versionList.add(appVersion);
|
| | | } else {
|
| | | List<AppVersionInfo> appVersionList = appVersionService.getAppVersionInfoListByPlatform(platform);
|
| | | List<AppVersionInfo> appVersionList = appVersionService.getAppVersionInfoListByPlatform(platform,acceptData.getSystem());
|
| | | if (appVersionList != null) {
|
| | | versionList.addAll(appVersionList);
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getProvidedClass")
|
| | | public void getAllClass(String callback, PrintWriter out) {
|
| | | public void getAllClass(AdminAcceptData acceptData, String callback, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | HelpClass helpClass = new HelpClass();
|
| | |
| | | List<HelpClass> reslut_list = new ArrayList<HelpClass>();
|
| | | reslut_list.add(helpClass);
|
| | |
|
| | | List<HelpClass> list = helpClassService.getProvidedClass();
|
| | | List<HelpClass> list = helpClassService.getProvidedClass(acceptData.getSystem());
|
| | | if (list != null && list.size() > 0) {
|
| | | reslut_list.addAll(list);
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setVersions")
|
| | | public void setVersions(String callback, Long id, String versions, PrintWriter out) {
|
| | | public void setVersions(AdminAcceptData acceptData,String callback, Long id, String versions, PrintWriter out) {
|
| | | JSONArray versionArray = JSONArray.fromObject(versions);
|
| | | List<Long> versionIds = new ArrayList<>();
|
| | | for (int i = 0; i < versionArray.size(); i++) {
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "getVersions")
|
| | | public void getVersions(String callback, Long id, PrintWriter out) {
|
| | | public void getVersions(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | | List<AdActivityVersionControl> list = adActivityVersionControlService
|
| | | .listByTypeAndSourceId(AdActivityType.helpClass, id);
|
| | |
|