|
|
@@ -6,6 +6,7 @@ import com.izouma.awesomeadmin.dto.Result;
|
|
|
import com.izouma.awesomeadmin.model.*;
|
|
|
import com.izouma.awesomeadmin.service.*;
|
|
|
import com.izouma.awesomeadmin.util.ExportExcelUtil;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
@@ -24,8 +25,8 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
-* controller类
|
|
|
-*/
|
|
|
+ * controller类
|
|
|
+ */
|
|
|
@Controller
|
|
|
@RequestMapping("/data")
|
|
|
public class DataController {
|
|
|
@@ -72,8 +73,8 @@ public class DataController {
|
|
|
private ClickHistoryService clickHistoryService;
|
|
|
|
|
|
/**
|
|
|
- * <p>获取全部记录。</p>
|
|
|
- */
|
|
|
+ * <p>获取全部记录。</p>
|
|
|
+ */
|
|
|
@RequiresAuthentication
|
|
|
@RequestMapping(value = "/all", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@@ -93,25 +94,19 @@ public class DataController {
|
|
|
Subject subject = SecurityUtils.getSubject();
|
|
|
UserInfo userInfo = (UserInfo) subject.getPrincipal();
|
|
|
int userStationId;
|
|
|
- if(userInfo != null)
|
|
|
- {
|
|
|
+ if (userInfo != null) {
|
|
|
userStationId = Integer.parseInt(userInfo.getDepartId());
|
|
|
|
|
|
- if(userStationId == 2)
|
|
|
- {
|
|
|
+ if (userStationId == 2) {
|
|
|
findPara.setStationId(null);
|
|
|
- }
|
|
|
- else {
|
|
|
- if(findPara.getStationId() == null)
|
|
|
- {
|
|
|
+ } else {
|
|
|
+ if (findPara.getStationId() == null) {
|
|
|
findPara.setStationId(userStationId);
|
|
|
- }
|
|
|
- else if(findPara.getStationId() != userStationId)
|
|
|
- {
|
|
|
- return "营业厅ID与账号不符";
|
|
|
+ } else if (findPara.getStationId() != userStationId) {
|
|
|
+ return "营业厅ID与账号不符";
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return "请先登录";
|
|
|
}
|
|
|
|
|
|
@@ -131,12 +126,10 @@ public class DataController {
|
|
|
|
|
|
MenuInfo menuinfo = new MenuInfo();
|
|
|
menuinfo.setStationInfo(findPara.getStationId());
|
|
|
- List<MenuInfo> menus =menuInfoService.getMenuInfoList(menuinfo);
|
|
|
- for(MenuInfo m:menus)
|
|
|
- {
|
|
|
+ List<MenuInfo> menus = menuInfoService.getMenuInfoList(menuinfo);
|
|
|
+ for (MenuInfo m : menus) {
|
|
|
|
|
|
- if("1".equals(m.getType()))
|
|
|
- {
|
|
|
+ if ("1".equals(m.getType())) {
|
|
|
SubItem s = new SubItem();
|
|
|
s.setMenuInfoId(m.getId());
|
|
|
List<SubItem> items = subItemService.getSubItemList(s);
|
|
|
@@ -167,24 +160,20 @@ public class DataController {
|
|
|
Subject subject = SecurityUtils.getSubject();
|
|
|
UserInfo userInfo = (UserInfo) subject.getPrincipal();
|
|
|
int userStationId;
|
|
|
- if(userInfo != null)
|
|
|
- {
|
|
|
+ if (userInfo != null) {
|
|
|
userStationId = Integer.parseInt(userInfo.getDepartId());
|
|
|
- if(findPara.getStationId() != userStationId)
|
|
|
- {
|
|
|
+ if (findPara.getStationId() != userStationId) {
|
|
|
return "营业厅ID与账号不符";
|
|
|
}
|
|
|
|
|
|
- if(findPara.getStationId() == null)
|
|
|
- {
|
|
|
+ if (findPara.getStationId() == null) {
|
|
|
findPara.setStationId(userStationId);
|
|
|
|
|
|
- if(findPara.getStationId() == 2)
|
|
|
- {
|
|
|
+ if (findPara.getStationId() == 2) {
|
|
|
findPara.setStationId(null);
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return "请先登录";
|
|
|
}
|
|
|
|
|
|
@@ -212,24 +201,20 @@ public class DataController {
|
|
|
Subject subject = SecurityUtils.getSubject();
|
|
|
UserInfo userInfo = (UserInfo) subject.getPrincipal();
|
|
|
int userStationId;
|
|
|
- if(userInfo != null)
|
|
|
- {
|
|
|
+ if (userInfo != null) {
|
|
|
userStationId = Integer.parseInt(userInfo.getDepartId());
|
|
|
- if(findPara.getStationId() != userStationId)
|
|
|
- {
|
|
|
+ if (findPara.getStationId() != userStationId) {
|
|
|
return "营业厅ID与账号不符";
|
|
|
}
|
|
|
|
|
|
- if(findPara.getStationId() == null)
|
|
|
- {
|
|
|
+ if (findPara.getStationId() == null) {
|
|
|
findPara.setStationId(userStationId);
|
|
|
|
|
|
- if(findPara.getStationId() == 2)
|
|
|
- {
|
|
|
+ if (findPara.getStationId() == 2) {
|
|
|
findPara.setStationId(null);
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return "请先登录";
|
|
|
}
|
|
|
|
|
|
@@ -244,7 +229,7 @@ public class DataController {
|
|
|
out.setVersion(ec.getVersion());
|
|
|
|
|
|
PlayInfo pi = new PlayInfo();
|
|
|
- pi.setFatherId(out.getId()+"");
|
|
|
+ pi.setFatherId(out.getId() + "");
|
|
|
pi.setType(0);
|
|
|
List<PlayInfo> pis = playInfoService.getPlayInfoList(pi);
|
|
|
out.setPlaylist(pis);
|
|
|
@@ -260,30 +245,24 @@ public class DataController {
|
|
|
@ResponseBody
|
|
|
public Object getPinpaimenmian(FindPara findPara) {
|
|
|
|
|
|
- Subject subject = SecurityUtils.getSubject();
|
|
|
- UserInfo userInfo = (UserInfo) subject.getPrincipal();
|
|
|
- int userStationId;
|
|
|
- if(userInfo != null)
|
|
|
- {
|
|
|
- userStationId = Integer.parseInt(userInfo.getDepartId());
|
|
|
+ Subject subject = SecurityUtils.getSubject();
|
|
|
+ UserInfo userInfo = (UserInfo) subject.getPrincipal();
|
|
|
+ int userStationId;
|
|
|
+ if (userInfo != null) {
|
|
|
+ userStationId = Integer.parseInt(userInfo.getDepartId());
|
|
|
|
|
|
- if(userStationId == 2)
|
|
|
- {
|
|
|
- findPara.setStationId(null);
|
|
|
- }
|
|
|
- else {
|
|
|
- if(findPara.getStationId() == null)
|
|
|
- {
|
|
|
- findPara.setStationId(userStationId);
|
|
|
- }
|
|
|
- else if(findPara.getStationId() != userStationId)
|
|
|
- {
|
|
|
- return "营业厅ID与账号不符";
|
|
|
- }
|
|
|
+ if (userStationId == 2) {
|
|
|
+ findPara.setStationId(null);
|
|
|
+ } else {
|
|
|
+ if (findPara.getStationId() == null) {
|
|
|
+ findPara.setStationId(userStationId);
|
|
|
+ } else if (findPara.getStationId() != userStationId) {
|
|
|
+ return "营业厅ID与账号不符";
|
|
|
}
|
|
|
- }else {
|
|
|
- return "请先登录";
|
|
|
}
|
|
|
+ } else {
|
|
|
+ return "请先登录";
|
|
|
+ }
|
|
|
|
|
|
ExhibitionContent ec = new ExhibitionContent();
|
|
|
ec.setStationId(findPara.getStationId());
|
|
|
@@ -296,7 +275,7 @@ public class DataController {
|
|
|
out.setVersion(ec.getVersion());
|
|
|
|
|
|
PlayInfo pi = new PlayInfo();
|
|
|
- pi.setFatherId(out.getId()+"");
|
|
|
+ pi.setFatherId(out.getId() + "");
|
|
|
pi.setType(1);
|
|
|
List<PlayInfo> pis = playInfoService.getPlayInfoList(pi);
|
|
|
out.setPlaylist_tm(pis);
|
|
|
@@ -306,6 +285,47 @@ public class DataController {
|
|
|
return out;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取展项信息
|
|
|
+ * 20181225添加
|
|
|
+ *
|
|
|
+ * @param findPara stationId exhibitionName
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequiresAuthentication
|
|
|
+ @RequestMapping(value = "/exhibitionInfo", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public Object getExhibitionInfo(FindPara findPara) {
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(findPara.getExhibitionName())) {
|
|
|
+ ExhibitionContent exhibitionContent = new ExhibitionContent();
|
|
|
+ exhibitionContent.setStationId(findPara.getStationId());
|
|
|
+ exhibitionContent.setName(findPara.getExhibitionName());
|
|
|
+
|
|
|
+ exhibitionContent = exhibitionContentService.getExhibitionContent(exhibitionContent);
|
|
|
+
|
|
|
+ if (exhibitionContent != null) {
|
|
|
+
|
|
|
+ findPara.setExhibitionId(exhibitionContent.getId());
|
|
|
+
|
|
|
+ if ("公示投教".equals(findPara.getExhibitionName())) {
|
|
|
+ return getGongShiTouJiao(findPara);
|
|
|
+ } else if ("金融大数据".equals(findPara.getExhibitionName())) {
|
|
|
+ return getFinancialData(findPara);
|
|
|
+ } else if ("品牌矩阵".equals(findPara.getExhibitionName())) {
|
|
|
+ return getPinpaijuzhen(findPara);
|
|
|
+ } else if ("品牌门面".equals(findPara.getExhibitionName())) {
|
|
|
+ return getPinpaimenmian(findPara);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return "展项名称不匹配";
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* <p>修改设备状态</p>
|
|
|
*/
|
|
|
@@ -313,40 +333,32 @@ public class DataController {
|
|
|
@ResponseBody
|
|
|
public Object editStatus(EquipmentInfo equipmentInfo) {
|
|
|
|
|
|
- Subject subject = SecurityUtils.getSubject();
|
|
|
- UserInfo userInfo = (UserInfo) subject.getPrincipal();
|
|
|
- int userStationId;
|
|
|
- if(userInfo != null)
|
|
|
- {
|
|
|
- userStationId = Integer.parseInt(userInfo.getDepartId());
|
|
|
+ Subject subject = SecurityUtils.getSubject();
|
|
|
+ UserInfo userInfo = (UserInfo) subject.getPrincipal();
|
|
|
+ int userStationId;
|
|
|
+ if (userInfo != null) {
|
|
|
+ userStationId = Integer.parseInt(userInfo.getDepartId());
|
|
|
|
|
|
- if(userStationId == 2)
|
|
|
- {
|
|
|
- }
|
|
|
- else {
|
|
|
- if(equipmentInfo.getStationId() == null)
|
|
|
- {
|
|
|
- equipmentInfo.setStationId(userStationId);
|
|
|
- }
|
|
|
- else if(equipmentInfo.getStationId() != userStationId)
|
|
|
- {
|
|
|
- return "营业厅ID与账号不符";
|
|
|
- }
|
|
|
+ if (userStationId == 2) {
|
|
|
+ } else {
|
|
|
+ if (equipmentInfo.getStationId() == null) {
|
|
|
+ equipmentInfo.setStationId(userStationId);
|
|
|
+ } else if (equipmentInfo.getStationId() != userStationId) {
|
|
|
+ return "营业厅ID与账号不符";
|
|
|
}
|
|
|
- }else {
|
|
|
- return "请先登录";
|
|
|
}
|
|
|
+ } else {
|
|
|
+ return "请先登录";
|
|
|
+ }
|
|
|
|
|
|
EquipmentInfo ei = new EquipmentInfo();
|
|
|
ei.setStationId(equipmentInfo.getStationId());
|
|
|
ei.setExhibitionId(equipmentInfo.getExhibitionId());
|
|
|
ei = equipmentInfoService.getEquipmentInfo(ei);
|
|
|
ei.setStatus(equipmentInfo.getStatus());
|
|
|
- if(equipmentInfoService.updateEquipmentInfo(ei))
|
|
|
- {
|
|
|
+ if (equipmentInfoService.updateEquipmentInfo(ei)) {
|
|
|
return new Result(true, ei);
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return new Result(false, ei);
|
|
|
}
|
|
|
}
|
|
|
@@ -361,39 +373,31 @@ public class DataController {
|
|
|
Subject subject = SecurityUtils.getSubject();
|
|
|
UserInfo userInfo = (UserInfo) subject.getPrincipal();
|
|
|
int userStationId;
|
|
|
- if(userInfo != null)
|
|
|
- {
|
|
|
+ if (userInfo != null) {
|
|
|
userStationId = Integer.parseInt(userInfo.getDepartId());
|
|
|
|
|
|
- if(userStationId == 2)
|
|
|
- {
|
|
|
- }
|
|
|
- else {
|
|
|
- if(clickHistory.getStationId() == null)
|
|
|
- {
|
|
|
+ if (userStationId == 2) {
|
|
|
+ } else {
|
|
|
+ if (clickHistory.getStationId() == null) {
|
|
|
clickHistory.setStationId(userStationId);
|
|
|
- }
|
|
|
- else if(clickHistory.getStationId() != userStationId)
|
|
|
- {
|
|
|
+ } else if (clickHistory.getStationId() != userStationId) {
|
|
|
return "营业厅ID与账号不符";
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return "请先登录";
|
|
|
}
|
|
|
|
|
|
- if(clickHistoryService.createClickHistory(clickHistory))
|
|
|
- {
|
|
|
+ if (clickHistoryService.createClickHistory(clickHistory)) {
|
|
|
return new Result(true, clickHistory);
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return new Result(false, "添加错误");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * <p>根据Id。</p>
|
|
|
- */
|
|
|
+ * <p>根据Id。</p>
|
|
|
+ */
|
|
|
@RequestMapping(value = "/getMenuInfo", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public Result getMenuInfo(@RequestParam(required = false, value = "id") String id) {
|
|
|
@@ -402,8 +406,8 @@ public class DataController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * <p>根据条件获取。</p>
|
|
|
- */
|
|
|
+ * <p>根据条件获取。</p>
|
|
|
+ */
|
|
|
@RequestMapping(value = "/getOne", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public Result getOne(MenuInfo record) {
|
|
|
@@ -413,14 +417,14 @@ public class DataController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * <p>分页查询。</p>
|
|
|
- */
|
|
|
+ * <p>分页查询。</p>
|
|
|
+ */
|
|
|
@RequestMapping(value = "/page", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public Result page(Page page, MenuInfo record) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
|
- List<MenuInfo> pp =menuInfoService.getMenuInfoByPage(page, record);
|
|
|
+ List<MenuInfo> pp = menuInfoService.getMenuInfoByPage(page, record);
|
|
|
|
|
|
result.put(AppConstant.PAGE, page);
|
|
|
result.put("pp", pp);
|
|
|
@@ -429,8 +433,8 @@ public class DataController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * <p>保存。</p>
|
|
|
- */
|
|
|
+ * <p>保存。</p>
|
|
|
+ */
|
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public Result save(MenuInfo record) {
|
|
|
@@ -442,14 +446,14 @@ public class DataController {
|
|
|
img.setType(0);
|
|
|
img.setUrl(record.getImgUrl());
|
|
|
imgInfoService.createImgInfo(img);
|
|
|
- return new Result(true, record.getId());
|
|
|
+ return new Result(true, record.getId());
|
|
|
}
|
|
|
return new Result(false, "保存异常");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * <p>更新信息。</p>
|
|
|
- */
|
|
|
+ * <p>更新信息。</p>
|
|
|
+ */
|
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public Result updateMenuInfo(MenuInfo record) {
|
|
|
@@ -461,66 +465,67 @@ public class DataController {
|
|
|
img.setType(0);
|
|
|
img.setUrl(record.getImgUrl());
|
|
|
imgInfoService.createImgInfo(img);
|
|
|
- return new Result(true, "保存成功");
|
|
|
+ return new Result(true, "保存成功");
|
|
|
}
|
|
|
return new Result(false, "保存异常");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * <p>删除。</p>
|
|
|
- */
|
|
|
+ * <p>删除。</p>
|
|
|
+ */
|
|
|
@RequestMapping(value = "/del", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public Result deleteMenuInfo(MenuInfo record) {
|
|
|
|
|
|
boolean num = menuInfoService.deleteMenuInfo(record);
|
|
|
if (num) {
|
|
|
- return new Result(true, "删除成功");
|
|
|
+ return new Result(true, "删除成功");
|
|
|
}
|
|
|
return new Result(false, "删除异常");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出Excel
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @param record
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
+ * 导出Excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @param record
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
@RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public void exportExcel(HttpServletRequest request, HttpServletResponse response, MenuInfo record) throws Exception {
|
|
|
|
|
|
- List<MenuInfo> menuInfos = menuInfoService.getMenuInfoList(record);
|
|
|
+ List<MenuInfo> menuInfos = menuInfoService.getMenuInfoList(record);
|
|
|
|
|
|
|
|
|
String sheetName = "menu_info";
|
|
|
String titleName = "栏目管理数据表";
|
|
|
String fileName = "栏目管理表";
|
|
|
int columnNumber = 10;
|
|
|
- int[] columnWidth = { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 };
|
|
|
- String[] columnName = { "" , "删除标识" , "更新时间" , "更新人" , "创建时间" , "创建人" , "栏目名称" , "公司介绍" , "栏目类型" , "营业厅ID" };
|
|
|
+ int[] columnWidth = {20, 20, 20, 20, 20, 20, 20, 20, 20, 20};
|
|
|
+ String[] columnName = {"", "删除标识", "更新时间", "更新人", "创建时间", "创建人", "栏目名称", "公司介绍", "栏目类型", "营业厅ID"};
|
|
|
String[][] dataList = new String[menuInfos.size()][10];
|
|
|
|
|
|
for (int i = 0; i < menuInfos.size(); i++) {
|
|
|
|
|
|
- dataList[i][0] = String.valueOf(menuInfos.get(i).getId());
|
|
|
- dataList[i][1] = String.valueOf(menuInfos.get(i).getDelFlag());
|
|
|
- dataList[i][2] = String.valueOf(menuInfos.get(i).getUpdateTime());
|
|
|
- dataList[i][3] = String.valueOf(menuInfos.get(i).getUpdateUser());
|
|
|
- dataList[i][4] = String.valueOf(menuInfos.get(i).getCreateTime());
|
|
|
- dataList[i][5] = String.valueOf(menuInfos.get(i).getCreateUser());
|
|
|
- dataList[i][6] = String.valueOf(menuInfos.get(i).getMenuName());
|
|
|
- dataList[i][7] = String.valueOf(menuInfos.get(i).getAbstractInfo());
|
|
|
- dataList[i][8] = String.valueOf(menuInfos.get(i).getType());
|
|
|
- dataList[i][9] = String.valueOf(menuInfos.get(i).getStationInfo());
|
|
|
- }
|
|
|
+ dataList[i][0] = String.valueOf(menuInfos.get(i).getId());
|
|
|
+ dataList[i][1] = String.valueOf(menuInfos.get(i).getDelFlag());
|
|
|
+ dataList[i][2] = String.valueOf(menuInfos.get(i).getUpdateTime());
|
|
|
+ dataList[i][3] = String.valueOf(menuInfos.get(i).getUpdateUser());
|
|
|
+ dataList[i][4] = String.valueOf(menuInfos.get(i).getCreateTime());
|
|
|
+ dataList[i][5] = String.valueOf(menuInfos.get(i).getCreateUser());
|
|
|
+ dataList[i][6] = String.valueOf(menuInfos.get(i).getMenuName());
|
|
|
+ dataList[i][7] = String.valueOf(menuInfos.get(i).getAbstractInfo());
|
|
|
+ dataList[i][8] = String.valueOf(menuInfos.get(i).getType());
|
|
|
+ dataList[i][9] = String.valueOf(menuInfos.get(i).getStationInfo());
|
|
|
+ }
|
|
|
|
|
|
|
|
|
ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
|
|
|
- columnNumber, columnWidth, columnName, dataList, response);
|
|
|
+ columnNumber, columnWidth, columnName, dataList, response);
|
|
|
|
|
|
|
|
|
- }
|
|
|
}
|
|
|
+}
|
|
|
|