Commit fcad38cc authored by wzp's avatar wzp

修改bug

parent 641ae44d
......@@ -113,6 +113,7 @@ public class TBoxOperationController extends BaseController {
@ApiOperation(value = "修改机顶盒运维信息", notes = "修改机顶盒运维信息")
@MethodLog(operModule = OperModule.STBOPERATION,operType = OperType.ACTIVATION)
public Map<String, Object> updateTBoxOperation(TBoxOperation tBoxOperation) {
Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
try {
if (tBoxOperation != null && StringUtils.isNotBlank(tBoxOperation.getMac())) {
tBoxOperation.setMac(tBoxOperation.getMac().toUpperCase());
......@@ -120,11 +121,19 @@ public class TBoxOperationController extends BaseController {
if (2==tBoxOperation.getStatus()) {
TBoxOperation byId = tBoxOperationService.getById(tBoxOperation.getId());
if (byId.getMac()!=null&&!"".equals(byId.getMac())&&!byId.getMac().equals(tBoxOperation.getMac())){
Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
resultMap.put("resultCode", "500");
resultMap.put("message", "此账号已绑定机顶盒!");
return resultMap;
}
UpdateWrapper<TBoxOperation> wrapper = new UpdateWrapper<>();
wrapper.eq("mac",tBoxOperation.getMac());
TBoxOperation one = tBoxOperationService.getOne(wrapper);
if (one!=null){
TUser u = userService.getOne(new UpdateWrapper<TUser>().eq("org_id", one.getOrganId()).eq("type", 3).eq("is_deleted", false));
resultMap.put("resultCode", "500");
resultMap.put("message", "此mac地址已绑定"+u.getUserName()+"账号!");
return resultMap;
}
final ArrayList<String> rsaKeys = RSAUtils.createRSAKeys();
tBoxOperation.setPublicKey(rsaKeys.get(0));
tBoxOperation.setPrivateKey(rsaKeys.get(1));
......@@ -227,7 +236,7 @@ public class TBoxOperationController extends BaseController {
@GetMapping("/getById")
@RequiresAuthentication //@RequiresPermissions("/boxOperation/getById")
@MethodLog(operModule = OperModule.STBOPERATION,operType = OperType.SELECT)
public Map<String, Object> getById(@PathVariable("id") String id) {
public Map<String, Object> getById(String id) {
TBoxOperation tBoxOperation = null;
try {
tBoxOperation = tBoxOperationService.getById(id);
......
......@@ -89,7 +89,7 @@ public class TInteractionController extends BaseController {
resultMap.put("message", "用户不是单位管理员");
return resultMap;
}
if (user.getOrgId()!=null&&user.getOrgId()!=tInteraction.getOrganId()){
if (user.getOrgId()!=null&&!user.getOrgId().equals(tInteraction.getOrganId())){
resultMap.put("resultCode", "500");
resultMap.put("message", "管理员账号不是本机构的单位管理员");
return resultMap;
......
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