Commit be56aaef authored by liqin's avatar liqin 💬

Merge branch 'master' of http://111.203.232.171:8888/lee/chnmuseum-party into master

parents 84bf53fe 3f683aac
......@@ -43,6 +43,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -117,104 +118,32 @@ public class ChinaMobileRestApiController extends BaseController {
//用户登录是否被锁定 一小时 redisKey 前缀
private static final String SHIRO_IS_LOCK = "shiro_is_lock_";
// /**
// * 管理员ajax登录请求 后端用户登录
// *
// * @param username
// * @param password
// * @return
// */
// @RequestMapping(value = "/user/webLogin", method = RequestMethod.POST)
// public ResponseEntity<JSONObject> login(@RequestParam(value = "username") String username,
// @RequestParam(value = "password") String password,
// @RequestParam(value = "boxNo") String boxNo) {
// JSONObject resultMap = new JSONObject(true);
// Employee employee;
// if (StringUtils.isNoneBlank(username)) {
// //访问一次,计数一次
// ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue();
// if ("LOCK".equals(opsForValue.get(SHIRO_IS_LOCK + username))) {
// resultMap.put("status", 400);
// resultMap.put("message", "由于密码输入错误次数大于5次,12小时内帐号已禁止登录!请您联系相关管理人员,联系电话:13924551212,邮箱:325346534@zh.com。");
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
// }
// employee = employeeService.selectByUsername(username);
// if (employee == null) {
// resultMap.put("status", 500);
// resultMap.put("message", "用户名或密码不正确!");
// 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);
// }
/**
* 机顶盒激活状态查询
*
* @param
* @return
*/
@ApiOperation(value = "机顶盒激活状态查询", notes = "机顶盒激活状态查询")
@GetMapping("/equitment/activity")
@RequiresPermissions("/equitment/activity/")
public Map<String, Object> getActivity(@RequestParam(required = true) String mac) {
List<TBoxOperation> list = new ArrayList<>();
try {
UpdateWrapper<TBoxOperation> wrapper = new UpdateWrapper<>();
wrapper.eq("mac", mac);
list = boxOperationService.list(wrapper);
HashMap<Object, Object> map = new HashMap<>();
map.put("activityStatus", false);
if (list != null && list.get(0) != null && 2 == list.get(0).getStatus()) {
map.put("activityStatus", true);
}
return getResult(map);
} catch (Exception e) {
e.printStackTrace();
}
return getFailResult();
}
/**
......@@ -638,10 +567,10 @@ public class ChinaMobileRestApiController extends BaseController {
current = currentList.get(0);
}
Map map = new HashMap();
map.put("isLatest",versionNo.equals(current.getAppVersion()));
map.put("versionNo",current.getAppVersion());
map.put("versionUrl",current.getApkUrl());
map.put("updateLog",current.getUpdateLog());
map.put("isLatest", versionNo.equals(current.getAppVersion()));
map.put("versionNo", current.getAppVersion());
map.put("versionUrl", current.getApkUrl());
map.put("updateLog", current.getUpdateLog());
map.put("updateTime", current.getUpdateTime());
return getResult(map);
}
......@@ -670,8 +599,8 @@ public class ChinaMobileRestApiController extends BaseController {
}
Map map = new HashMap();
map.put("dirImgUrl",currentDir != null? currentDir.getAppDirPic() : "未设置目录图片");
map.put("runImgUrl",currentRun != null ? currentRun.getAppRunPic() : "未设置运行图片");
map.put("dirImgUrl", currentDir != null ? currentDir.getAppDirPic() : "未设置目录图片");
map.put("runImgUrl", currentRun != null ? currentRun.getAppRunPic() : "未设置运行图片");
return getResult(map);
}
}
......@@ -182,7 +182,7 @@ public class FileUploadController {
}
@PostMapping(value = "/file/upload/allType", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@PostMapping(value = "/upload/allType", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@RequiresPermissions("file:upload:allType")
@ApiOperation(value = "单文件上传(不限格式)", notes = "单文件上传(不限格式)")
public ResponseEntity<ImageUploadResult> uploadAllType(@RequestParam(value = "file") MultipartFile uploadFile) throws Exception {
......
......@@ -66,6 +66,21 @@ public class TAppDirPicController extends BaseController {
@RequiresPermissions("t:app:dir:pic:save")
@ApiOperation(value = "添加", notes = "添加")
public Map<String, Object> saveTAppDirPic(@Validated(value = {Add.class}) TAppDirPic tAppDirPic) {
// 默认不为当前版本
if (tAppDirPic.getIsCurrent() == null){
tAppDirPic.setIsCurrent(0);
}
// 如果有其他版本是当前版本状态,将其当前版本状态取消
QueryWrapper<TAppDirPic> qw = new QueryWrapper<>();
qw.eq("is_current",1);
List<TAppDirPic> currentList = tAppDirPicService.list(qw);
if (currentList != null && currentList.size() > 0 && tAppDirPic.getIsCurrent() == 1){
currentList.stream().forEach(c->{
c.setIsCurrent(0);
});
tAppDirPicService.updateBatchById(currentList);
}
// 保存业务节点信息
boolean result = tAppDirPicService.save(tAppDirPic);
// 返回操作结果
......@@ -141,8 +156,9 @@ public class TAppDirPicController extends BaseController {
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "isCurrent", value = "是否为当前界面 0:否 1:是", paramType = "query", dataType = "String")
})
public Map<String, Object> getTAppDirPicList(@RequestParam(value = "auditStatus", defaultValue = "APPROVED_FINAL", required = false) String isCurrent) {
List<TAppDirPic> tAppDirPicList = tAppDirPicService.list(Wrappers.<TAppDirPic>lambdaQuery().eq(TAppDirPic::getIsCurrent, isCurrent));
public Map<String, Object> getTAppDirPicList(Integer isCurrent) {
List<TAppDirPic> tAppDirPicList = tAppDirPicService.list(Wrappers.<TAppDirPic>lambdaQuery().eq(isCurrent != null,TAppDirPic::getIsCurrent, isCurrent));
return getResult(tAppDirPicList);
}
......
......@@ -70,6 +70,19 @@ public class TAppRunPicController extends BaseController {
if (tAppRunPic.getIsCurrent() == null){
tAppRunPic.setIsCurrent(0);
}
// 如果有其他版本是当前版本状态,将其当前版本状态取消
QueryWrapper<TAppRunPic> qw = new QueryWrapper<>();
qw.eq("is_current",1);
List<TAppRunPic> currentList = tAppRunPicService.list(qw);
if (currentList != null && currentList.size() > 0 && tAppRunPic.getIsCurrent() == 1){
currentList.stream().forEach(c->{
c.setIsCurrent(0);
});
tAppRunPicService.updateBatchById(currentList);
}
// 保存业务节点信息
boolean result = tAppRunPicService.save(tAppRunPic);
// 返回操作结果
......@@ -142,10 +155,10 @@ public class TAppRunPicController extends BaseController {
@RequiresPermissions("t:app:run:pic:list")
@ApiOperation(value = "获取全部列表(无分页)", notes = "获取全部列表(无分页)")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "isCurrent", value = "是否为当前界面 0:否 1:是", paramType = "query", dataType = "String")
@ApiImplicitParam(name = "isCurrent", value = "是否为当前界面 0:否 1:是", paramType = "query", dataType = "int")
})
public Map<String, Object> getTAppRunPicList(String isCurrent) {
List<TAppRunPic> tAppRunPicList = tAppRunPicService.list(Wrappers.<TAppRunPic>lambdaQuery().eq(TAppRunPic::getIsCurrent, isCurrent));
public Map<String, Object> getTAppRunPicList(Integer isCurrent) {
List<TAppRunPic> tAppRunPicList = tAppRunPicService.list(Wrappers.<TAppRunPic>lambdaQuery().eq(isCurrent!= null,TAppRunPic::getIsCurrent, isCurrent));
return getResult(tAppRunPicList);
}
......
......@@ -63,6 +63,16 @@ public class TAppVersionController extends BaseController {
if (tAppVersion.getIsCurrent() == null){
tAppVersion.setIsCurrent(0);
}
// 如果有其他版本是当前版本状态,将其当前版本状态取消
QueryWrapper<TAppVersion> qw = new QueryWrapper<>();
qw.eq("is_current",1);
List<TAppVersion> currentList = tAppVersionService.list(qw);
if (currentList != null && currentList.size() > 0 && tAppVersion.getIsCurrent() == 1){
currentList.stream().forEach(c->{
c.setIsCurrent(0);
});
tAppVersionService.updateBatchById(currentList);
}
// 保存业务节点信息
boolean result = tAppVersionService.save(tAppVersion);
// 返回操作结果
......
......@@ -218,6 +218,8 @@ public class TBoxOperationController extends BaseController {
return getFailResult();
}
public String getAreaId(String areaId){
if ("00".equals(areaId.substring(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