|
@@ -50,54 +50,6 @@ public class IndexController extends BaseController {
|
|
private AlarmRecordService alarmRecordService;
|
|
private AlarmRecordService alarmRecordService;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 检查用户名是否存在
|
|
|
|
- */
|
|
|
|
- @RequestMapping(value = "/check_username", method = RequestMethod.GET)
|
|
|
|
- public
|
|
|
|
- @ResponseBody
|
|
|
|
- boolean checkUsername(String username) {
|
|
|
|
-
|
|
|
|
- if(adminService.getCurrent().getType() == Admin.Type.merchant || adminService.getCurrent().getType() == Admin.Type.personage ){
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (StringUtils.isEmpty(username)) {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<Filter> fs = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- Admin.Type type = adminService.getCurrent().getType();
|
|
|
|
- switch (type) {
|
|
|
|
- case agency:
|
|
|
|
- fs.add(Filter.eq("type", Admin.Type.agency));
|
|
|
|
- fs.add(Filter.eq("agencyId", adminService.getCurrent().getAgencyId()));
|
|
|
|
- break;
|
|
|
|
- case merchant:
|
|
|
|
- fs.add(Filter.eq("type", Admin.Type.merchant));
|
|
|
|
- fs.add(Filter.eq("agencyId", adminService.getCurrent().getAgencyId()));
|
|
|
|
- fs.add(Filter.isNotNull("merchantId"));
|
|
|
|
- fs.add(Filter.eq("merchantId", adminService.getCurrent().getMerchantId()));
|
|
|
|
- break;
|
|
|
|
- case personage:
|
|
|
|
- fs.add(Filter.eq("type", Admin.Type.personage));
|
|
|
|
- fs.add(Filter.eq("personageId", adminService.getCurrent().getPersonageId()));
|
|
|
|
- break;
|
|
|
|
- case admin:
|
|
|
|
- fs.add(Filter.eq("type", Admin.Type.admin));
|
|
|
|
- }
|
|
|
|
- fs.add(Filter.eq("username" , username));
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- List<Admin> as = adminService.findList(1, fs , null);
|
|
|
|
- if(as!=null&&as.size()>0){
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- /**
|
|
|
|
*今日人流量
|
|
*今日人流量
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/peopleCounting", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/peopleCounting", method = RequestMethod.GET)
|
|
@@ -125,7 +77,7 @@ public class IndexController extends BaseController {
|
|
int on = 0;
|
|
int on = 0;
|
|
for(Equipment equipment:equipmentList){
|
|
for(Equipment equipment:equipmentList){
|
|
//开启的机器数量
|
|
//开启的机器数量
|
|
- if(equipment.getEqeStatus()==1){
|
|
|
|
|
|
+ if(equipment.getEqeStatus()!=null&&equipment.getEqeStatus()==1){
|
|
on++;
|
|
on++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -197,7 +149,7 @@ public class IndexController extends BaseController {
|
|
return equipmentList;
|
|
return equipmentList;
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
- *机器今日的报警记录
|
|
|
|
|
|
+ *机器今日的报警记录,故障处理
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/alarmRecordList", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/alarmRecordList", method = RequestMethod.GET)
|
|
public List<AlarmRecord> alarmRecordList(ModelMap model , RedirectAttributes redirectAttributes) {
|
|
public List<AlarmRecord> alarmRecordList(ModelMap model , RedirectAttributes redirectAttributes) {
|