Commit 332008a1 authored by liqin's avatar liqin 💬

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

parents 19693eb2 33fd0559
......@@ -2,6 +2,8 @@ package cn.wisenergy.chnmuseum.party.common.log;
import cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil;
import cn.wisenergy.chnmuseum.party.common.enums.RESPONSE_CODE_ENUM;
import cn.wisenergy.chnmuseum.party.common.enums.RESULT_INFO_ENUM;
import cn.wisenergy.chnmuseum.party.common.util.DateUtil80;
import cn.wisenergy.chnmuseum.party.core.annotations.OperationLog;
import cn.wisenergy.chnmuseum.party.mapper.SysLogMapper;
......@@ -34,6 +36,7 @@ import java.net.InetAddress;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
......@@ -96,20 +99,20 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
try {
packages = packages.substring(0, packages.indexOf("$$"));
} catch (Exception ex) {
ex.printStackTrace();
return getFailResult();
}
}
String operatingcontent = "";
Object[] method_param = null;
Object object;
Object object = null;
try {
method_param = point.getArgs(); //获取方法参数
// String param=(String) point.proceed(point.getArgs());
object = point.proceed();
} catch (Exception e) {
// 异常处理记录日志..log.error(e);
throw e;
return getFailResult();
}
if (methodLog.operModule().getMsg().contains("运维")) {
TOperationLog operationLog = new TOperationLog();
......@@ -165,6 +168,13 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
return null;
}
protected Map<String, Object> getFailResult() {
Map<String, Object> map = new HashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getCode());
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getMsg());
return map;
}
/**
* 方法异常时调用
*
......
......@@ -43,10 +43,10 @@ import com.baomidou.mybatisplus.annotation.TableField;
@ApiModel(value = "用户", description = "用户")
public class TOrgan implements Serializable {
// private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@ApiModelProperty("机构ID")
@TableId(value = "id")
@TableId(value = "id", type = IdType.ASSIGN_ID)
@NotNull(message = "机构IDID不能为空", groups = {Update.class})
private String id;
......
......@@ -38,10 +38,5 @@ public class TBoxOperationServiceImpl extends ServiceImpl<TBoxOperationMapper, T
public Page<TBoxOperation> selectBoxPage(Page<TBoxOperation> page, TUser user) {
return page.setRecords(tBoxOperationMapper.selectBoxPage(page, user));
}
public static void main(String[] args) {
System.out.println("110101".substring(0, 2));
}
}
......@@ -134,9 +134,9 @@ public class TBoxOperationController extends BaseController {
@RequiresPermissions("/boxOperation/delete")
@ApiOperation(value = "根据ID删除机顶盒运维信息", notes = "根据ID删除机顶盒运维信息")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "query", dataType = "String")
})
public Map<String, Object> deleteTBoxOperation(@PathVariable("id") String id) {
public Map<String, Object> deleteTBoxOperation(String id) {
boolean result = false;
try {
result = tBoxOperationService.removeById(id);
......
......@@ -69,26 +69,26 @@ public class TInteractionController extends BaseController {
try {
Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
if (StringUtils.isBlank(tInteraction.getName())||StringUtils.isBlank(tInteraction.getPassword())) {
resultMap.put("code", "400");
resultMap.put("msg", "请输入用户名和密码");
resultMap.put("resultCode", "400");
resultMap.put("message", "请输入用户名和密码");
return resultMap;
}
TUser user = userService.selectByUsername(tInteraction.getName());
if (user == null) {
resultMap.put("code", "500");
resultMap.put("msg", "用户名错误");
resultMap.put("resultCode", "500");
resultMap.put("message", "用户名错误");
return resultMap;
}
if ("2".equals(user.getType())) {
resultMap.put("code", "500");
resultMap.put("msg", "用户不是单位管理员");
resultMap.put("resultCode", "500");
resultMap.put("message", "用户不是单位管理员");
return resultMap;
}
byte[] salt = user.getPasswordSalt();
if (!new String(SHA256PasswordEncryptionService.createPasswordHash(tInteraction.getPassword(), salt))
.equals(new String(user.getPasswordHash()))) {
resultMap.put("code", "500");
resultMap.put("msg", "密码错误");
resultMap.put("resultCode", "500");
resultMap.put("message", "密码错误");
return resultMap;
}
......
......@@ -75,7 +75,6 @@ public class TOrganController extends BaseController {
String organCode = getOrganCode(organ.getParentId());
organ.setLevel(organCode.length()/3);
organ.setCode(organCode);
organ.setId(organCode);
// 保存业务节点信息
boolean result = tOrganService.save(organ);
// 返回操作结果
......@@ -124,19 +123,17 @@ public class TOrganController extends BaseController {
@DeleteMapping("/delete")
@RequiresPermissions("/organ/delete")
@ApiOperation(value = "根据ID删除机构", notes = "根据ID删除机构")
@MethodLog(operModule = OperModule.ORG,operType = OperType.DELETE)
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "query", dataType = "String")
})
public Map<String, Object> deleteTOrgan(@PathVariable("id") String id) {
// @MethodLog(operModule = OperModule.ORG,operType = OperType.DELETE)
public Map<String, Object> deleteTOrgan(String id) {
boolean result = false;
try {
UpdateWrapper<TOrgan> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id);
updateWrapper.eq("is_deleted", 1);
updateWrapper.eq("update_time", DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
result = tOrganService.update(updateWrapper);
TOrgan tOrgan = tOrganService.getById(id);
tOrgan.setIsDeleted(true);
tOrgan.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
result = tOrganService.updateById(tOrgan);
if (!result) {
return getFailResult();
}
......@@ -144,7 +141,6 @@ public class TOrganController extends BaseController {
} catch (Exception e) {
e.printStackTrace();
}
return getFailResult();
}
......@@ -197,6 +193,7 @@ public class TOrganController extends BaseController {
}
//设置用户数据权限
queryWrapper.likeRight(TOrgan::getCode,user.getOrgCode());
queryWrapper.eq(TOrgan::getIsDeleted,false);
// 设置排序规则
queryWrapper.orderByDesc(TOrgan::getCreateTime);
page = this.tOrganService.page(getPage(), queryWrapper);
......
......@@ -46,6 +46,7 @@ where 1=1
<if test=" org.code != null and org.code != '' ">
and o.code LIKE concat(#{org.code},'%')
</if>
and o.is_deleted = false
order by o.create_time desc
</select>
......
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