|
|
@@ -22,6 +22,7 @@ import com.cyksj.model.excel.ExcelManageAccountData;
|
|
|
import com.cyksj.model.manage.request.ReqAccountIncrExpiryTime;
|
|
|
import com.cyksj.model.manage.views.AccountView;
|
|
|
import com.cyksj.service.mange.CmsAccountService;
|
|
|
+import com.cyksj.service.mange.CmsGroupService;
|
|
|
import com.cyksj.service.template.TemplateCommonService;
|
|
|
import com.cyksj.web.util.EasyExcelUtils;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
@@ -33,6 +34,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
@@ -62,6 +64,8 @@ public class CmsAccountController {
|
|
|
|
|
|
private final TemplateCommonService templateCommonService;
|
|
|
|
|
|
+ private final CmsGroupService cmsGroupService;
|
|
|
+
|
|
|
@GetMapping("/get")
|
|
|
public Result<SearchResult<AccountView>> get(Long userId ,String nickName ,String submitAccount ,String expiryStartTime, String expiryEndTime) {
|
|
|
MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
@@ -166,6 +170,7 @@ public class CmsAccountController {
|
|
|
|
|
|
@PostMapping("/post")
|
|
|
@NoSubmit
|
|
|
+ @Transactional(rollbackFor = Throwable.class)
|
|
|
public Result<String> add(@RequestBody Account account){
|
|
|
account.setAccount(account.getAccount().trim());
|
|
|
account.setPassword(account.getPassword().trim());
|
|
|
@@ -179,6 +184,11 @@ public class CmsAccountController {
|
|
|
}
|
|
|
}
|
|
|
accountService.save(account);
|
|
|
+ //自动配置车队
|
|
|
+ GroupsTrips groupsTrips = new GroupsTrips();
|
|
|
+ groupsTrips.setSkuId(account.getSkuId());
|
|
|
+ groupsTrips.setAccountId(account.getId());
|
|
|
+ cmsGroupService.issuance(groupsTrips);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|