|
@@ -8,6 +8,7 @@ import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -631,6 +632,30 @@ public class TAdminController {
|
|
|
return R.ok(userDetailBO);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "切换自动登录")
|
|
|
+ @GetMapping("/autoLogin")
|
|
|
+ @Audit(type = AuditEnum.LOGIN, content = "切换登录'")
|
|
|
+ public ResponseModel<UserDetailBO> autoLogin(@RequestParam String id) {
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ return R.fail(ResponseCodesEnum.A0001, "参数有空");
|
|
|
+ }
|
|
|
+
|
|
|
+ //验证用户名登录
|
|
|
+ Integer adminId = Integer.valueOf(id);
|
|
|
+ TAdmin admin = tAdminService.getById(adminId);
|
|
|
+ TAdmin tAdmin = Optional.ofNullable(admin)
|
|
|
+ .orElseThrow(() -> new BizException(ResponseCodesEnum.L0002));
|
|
|
+
|
|
|
+ // 添加系统id
|
|
|
+ if (StringUtils.isEmpty(tAdmin.getManagerId())) {
|
|
|
+ String managerId = AdminUtils.encrypt(false, tAdmin.getId());
|
|
|
+ tAdmin.setManagerId(managerId);
|
|
|
+ tAdminService.getById(tAdmin);
|
|
|
+ }
|
|
|
+ UserDetailBO userDetailBO = tAdminService.getUserDetailBO(tAdmin);
|
|
|
+ return R.ok(userDetailBO);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "修改密码")
|
|
|
@PostMapping("/updatePassword")
|
|
|
public ResponseModel<?> updatePassword(String username, String password) {
|
|
@@ -931,5 +956,23 @@ public class TAdminController {
|
|
|
}
|
|
|
return R.ok();
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "批量修改支付平台")
|
|
|
+ @GetMapping("/updatePayPlatform")
|
|
|
+ public ResponseModel<?> updatePayPlatform(@RequestParam String id, @RequestParam String payPlatform) {
|
|
|
+ Integer adminId = Integer.valueOf(id);
|
|
|
+ UpdateWrapper<TAdmin> updateWrapper = new UpdateWrapper<>();
|
|
|
+ // 申泽管理员
|
|
|
+ if (adminId == 2738) {
|
|
|
+ updateWrapper.isNull("company_type").or().eq("company_type", 0);
|
|
|
+ }
|
|
|
+ // 七云管理员
|
|
|
+ if (adminId == 2739) {
|
|
|
+ updateWrapper.eq("company_type", 1);
|
|
|
+ }
|
|
|
+ updateWrapper.set("pay_platform",payPlatform);
|
|
|
+ tAdminService.update(null, updateWrapper);
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
}
|
|
|
|