Commit 3f683aac authored by yangtianyou's avatar yangtianyou

Merge remote-tracking branch 'origin/master'

parents 4043fe7e fa13d4bd
...@@ -43,6 +43,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -43,6 +43,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -117,104 +118,32 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -117,104 +118,32 @@ public class ChinaMobileRestApiController extends BaseController {
//用户登录是否被锁定 一小时 redisKey 前缀 //用户登录是否被锁定 一小时 redisKey 前缀
private static final String SHIRO_IS_LOCK = "shiro_is_lock_"; private static final String SHIRO_IS_LOCK = "shiro_is_lock_";
// /** /**
// * 管理员ajax登录请求 后端用户登录 * 机顶盒激活状态查询
// * *
// * @param username * @param
// * @param password * @return
// * @return */
// */ @ApiOperation(value = "机顶盒激活状态查询", notes = "机顶盒激活状态查询")
// @RequestMapping(value = "/user/webLogin", method = RequestMethod.POST) @GetMapping("/equitment/activity")
// public ResponseEntity<JSONObject> login(@RequestParam(value = "username") String username, @RequiresPermissions("/equitment/activity/")
// @RequestParam(value = "password") String password, public Map<String, Object> getActivity(@RequestParam(required = true) String mac) {
// @RequestParam(value = "boxNo") String boxNo) { List<TBoxOperation> list = new ArrayList<>();
// JSONObject resultMap = new JSONObject(true); try {
// Employee employee; UpdateWrapper<TBoxOperation> wrapper = new UpdateWrapper<>();
// if (StringUtils.isNoneBlank(username)) { wrapper.eq("mac", mac);
// //访问一次,计数一次 list = boxOperationService.list(wrapper);
// ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue(); HashMap<Object, Object> map = new HashMap<>();
// if ("LOCK".equals(opsForValue.get(SHIRO_IS_LOCK + username))) { map.put("activityStatus", false);
// resultMap.put("status", 400); if (list != null && list.get(0) != null && 2 == list.get(0).getStatus()) {
// resultMap.put("message", "由于密码输入错误次数大于5次,12小时内帐号已禁止登录!请您联系相关管理人员,联系电话:13924551212,邮箱:325346534@zh.com。"); map.put("activityStatus", true);
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap); }
// } return getResult(map);
// employee = employeeService.selectByUsername(username); } catch (Exception e) {
// if (employee == null) { e.printStackTrace();
// resultMap.put("status", 500); }
// resultMap.put("message", "用户名或密码不正确!"); return getFailResult();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap); }
// }
// try {
// byte[] salt = employee.getPasswordSalt();
// if (!new String(SHA256PasswordEncryptionService.createPasswordHash(password, salt)).equals(new String(employee.getPasswordHash()))) {
// opsForValue.increment(SHIRO_LOGIN_COUNT + username, 1);
// //计数大于5时,设置用户被锁定一小时
// String s = opsForValue.get(SHIRO_LOGIN_COUNT + username);
// if (StringUtils.isNotBlank(s)) {
// if (Integer.parseInt(s) >= 5) {
// opsForValue.set(SHIRO_IS_LOCK + username, "LOCK");
// stringRedisTemplate.expire(SHIRO_IS_LOCK + username, 12, TimeUnit.HOURS);
// }
// }
// throw new IncorrectCredentialsException("用户名或密码不正确!");
// }
// String token = JwtTokenUtil.sign(username, employee.getId());
// // 将token信息存入Redis
// stringRedisTemplate.opsForValue().set(SHIRO_JWT_TOKEN + token, employee.getId(), 240, TimeUnit.MINUTES);
//
// JSONObject jsonObject = new JSONObject(true);
// jsonObject.put("token", token);
// jsonObject.put("userId", employee.getId());
// jsonObject.put("userName", employee.getUsername());
// jsonObject.put("expire", TimeUtils.format(LocalDateTime.now().plusMinutes(240), TimeUtils.FORMAT_ONE));
// jsonObject.put("orgCode", "");
// jsonObject.put("orgName", "");
//
// resultMap.put("resultCode", 200);
// resultMap.put("message", "成功");
// resultMap.put("data", jsonObject);
// return ResponseEntity.status(HttpStatus.OK).body(resultMap);
// } catch (Exception e) {
// resultMap.put("status", 500);
// resultMap.put("message", e.getMessage());
// }
// }
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
// }
//
// @ApiOperation(value = "获取单个成员信息")
// @GetMapping(value = "/user/getUserInfo")
// public ResponseEntity<JSONObject> getById(String userId, @RequestHeader("token") String token) {
// try {
// Employee employee = employeeService.selectByEmpId(userId);
//
// if (null == employee) {
// return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
// }
//
// JSONObject jsonObject = new JSONObject(true);
// jsonObject.put("token", token);
// jsonObject.put("userId", employee.getId());
// jsonObject.put("userName", employee.getUsername());
// long expire = stringRedisTemplate.getExpire(SHIRO_JWT_TOKEN + token) == null ? 0L : stringRedisTemplate.getExpire(SHIRO_JWT_TOKEN + token);
// jsonObject.put("expire", TimeUtils.format(LocalDateTime.now().plusMinutes(expire), TimeUtils.FORMAT_ONE));
//// BankBranchInfo bankBranch = this.employeeService.getById(Id);
//// if (bankBranch != null) {
//// employee.setBankBranchName(bankBranch.getName());
//// }
// jsonObject.put("orgCode", "");
// jsonObject.put("orgName", "");
//
// JSONObject resultMap = new JSONObject(true);
// resultMap.put("resultCode", 200);
// resultMap.put("message", "成功");
// resultMap.put("data", jsonObject);
// return ResponseEntity.ok(resultMap);
// } catch (Exception e) {
// logger.error("查询成员信息错误!", e);
// }
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
// }
/** /**
...@@ -638,10 +567,10 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -638,10 +567,10 @@ public class ChinaMobileRestApiController extends BaseController {
current = currentList.get(0); current = currentList.get(0);
} }
Map map = new HashMap(); Map map = new HashMap();
map.put("isLatest",versionNo.equals(current.getAppVersion())); map.put("isLatest", versionNo.equals(current.getAppVersion()));
map.put("versionNo",current.getAppVersion()); map.put("versionNo", current.getAppVersion());
map.put("versionUrl",current.getApkUrl()); map.put("versionUrl", current.getApkUrl());
map.put("updateLog",current.getUpdateLog()); map.put("updateLog", current.getUpdateLog());
map.put("updateTime", current.getUpdateTime()); map.put("updateTime", current.getUpdateTime());
return getResult(map); return getResult(map);
} }
...@@ -670,8 +599,8 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -670,8 +599,8 @@ public class ChinaMobileRestApiController extends BaseController {
} }
Map map = new HashMap(); Map map = new HashMap();
map.put("dirImgUrl",currentDir != null? currentDir.getAppDirPic() : "未设置目录图片"); map.put("dirImgUrl", currentDir != null ? currentDir.getAppDirPic() : "未设置目录图片");
map.put("runImgUrl",currentRun != null ? currentRun.getAppRunPic() : "未设置运行图片"); map.put("runImgUrl", currentRun != null ? currentRun.getAppRunPic() : "未设置运行图片");
return getResult(map); return getResult(map);
} }
} }
...@@ -218,6 +218,8 @@ public class TBoxOperationController extends BaseController { ...@@ -218,6 +218,8 @@ public class TBoxOperationController extends BaseController {
return getFailResult(); return getFailResult();
} }
public String getAreaId(String areaId){ public String getAreaId(String areaId){
if ("00".equals(areaId.substring(4))) { if ("00".equals(areaId.substring(4))) {
areaId = areaId.substring(0, 4); areaId = areaId.substring(0, 4);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment