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