|
|
@@ -124,6 +124,8 @@ public class CmsAccountController {
|
|
|
|
|
|
private final OrderDonMapper orderDonMapper;
|
|
|
|
|
|
+ private final DelAccountRecordMapper delAccountRecordMapper;
|
|
|
+
|
|
|
@GetMapping("/get")
|
|
|
@SaCheckPermission("account:view")
|
|
|
public Result<SearchResult<AccountView>> get(String title, Long userId, String showId, String nickName, String submitAccount, String expiryStartTime, String expiryEndTime, Boolean expiredAll, Boolean existsExpired, Boolean existsExpiredToday, Integer noChangeMonths, Boolean isMjMirror, String orderNo, Boolean isEmpty) {
|
|
|
@@ -775,13 +777,23 @@ public class CmsAccountController {
|
|
|
@DeleteMapping("/delete/{id}")
|
|
|
@SaCheckPermission("account:delete")
|
|
|
@Log(module = "平台管理/删除账号", businessType = BusinessType.DELETE, isSaveRequestData = true)
|
|
|
- public Result<String> update(@PathVariable Long id){
|
|
|
- //是否关联了车队
|
|
|
+ public Result<String> update(@PathVariable Long id) throws Exception {
|
|
|
+ long adminId = StpUtil.getLoginIdAsLong();
|
|
|
+ //是否关联了车队
|
|
|
Integer count = groupsMapper.selectCount(Wrappers.lambdaQuery(GroupsTrips.class).eq(GroupsTrips::getAccountId, id));
|
|
|
if (count > 0) {
|
|
|
throw BusinessRuntimeException.getInstance("已经发布账号,必须先删除车队才可删除账号");
|
|
|
}
|
|
|
- accountService.removeById(id);
|
|
|
+ Account account = accountService.getById(id);
|
|
|
+ accountService.removeById(id);
|
|
|
+
|
|
|
+ DelAccountRecord delAccountRecord = new DelAccountRecord();
|
|
|
+ CmsUser cmsUser = cmsUserMapper.selectById(adminId);
|
|
|
+ if (cmsUser != null) {
|
|
|
+ delAccountRecord.setOperator(cmsUser.getNickname());
|
|
|
+ }
|
|
|
+ delAccountRecord.setAccountInfo(Jsons.toJson(account));
|
|
|
+ delAccountRecordMapper.insert(delAccountRecord);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -795,6 +807,16 @@ public class CmsAccountController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 导入账号 批量删除
|
|
|
+ */
|
|
|
+ @DeleteMapping("/batch/delete/goods/accountTrips")
|
|
|
+ public Result<List<String>> batchDelAccountTripsByGoodsAccount(@RequestBody DelAccountTripsReq delAccountTripsReq) throws Exception {
|
|
|
+ long adminId = StpUtil.getLoginIdAsLong();
|
|
|
+ List<String> fails = accountService.batchDelAccountTripsByGoodsAccount(delAccountTripsReq, adminId);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(fails);
|
|
|
+ }
|
|
|
+
|
|
|
@PutMapping("/update/expiryTime")
|
|
|
@SaCheckPermission("account:addExpiryTime")
|
|
|
public Result<String> updateExpiryTime(@RequestBody ReqAccountIncrExpiryTime incrExpiryTime){
|