|
|
@@ -8,9 +8,12 @@ import com.mokamrp.privates.entity.JobRedis;
|
|
|
import com.mokamrp.privates.entity.JobRoomJobRedis;
|
|
|
import com.mokamrp.privates.entity.WorkRoomBandTagHandle;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
+import com.mokamrp.privates.interceptor.AuthUser;
|
|
|
import com.mokamrp.privates.mapper.pojo.Downfile;
|
|
|
+import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.mapper.pojo.WorkRoom;
|
|
|
import com.mokamrp.privates.service.DownfileService;
|
|
|
+import com.mokamrp.privates.service.UserCorpService;
|
|
|
import com.mokamrp.privates.service.WorkContactEmployeeService;
|
|
|
import com.mokamrp.privates.service.WorkRoomService;
|
|
|
import com.mokamrp.privates.utils.RedisUtil;
|
|
|
@@ -45,16 +48,27 @@ public class WorkRoomController extends BaseController<WorkRoom> {
|
|
|
@Autowired
|
|
|
private DownfileService downfileService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserCorpService userCorpService;
|
|
|
+
|
|
|
@Resource
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
@ResponseBody
|
|
|
- public Object getList(@Valid @RequestBody GetWorkRoomHandle handle, BindingResult bindingResult) {
|
|
|
+ public Object getList(
|
|
|
+ @AuthUser User authUser,
|
|
|
+ @Valid @RequestBody GetWorkRoomHandle handle, BindingResult bindingResult) {
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
|
|
|
+ List<Integer> corpIds = userCorpService.getAuthUserCorpIds(authUser.getId());
|
|
|
+ if(corpIds.size() <=0){
|
|
|
+ return AjaxResult.error(HttpStatus.ERROR, UserCorpService.USER_MSG);
|
|
|
+ }
|
|
|
+ handle.setAuthCorpIds(corpIds);
|
|
|
+
|
|
|
Map<String, Object> resMap = workRoomService.getPageList(handle);//所有
|
|
|
|
|
|
return AjaxResult.success(resMap);
|
|
|
@@ -62,11 +76,19 @@ public class WorkRoomController extends BaseController<WorkRoom> {
|
|
|
|
|
|
@PostMapping("/export")
|
|
|
@ResponseBody
|
|
|
- public Object export(@Valid @RequestBody GetWorkRoomHandle handle, BindingResult bindingResult) {
|
|
|
+ public Object export(
|
|
|
+ @AuthUser User authUser,
|
|
|
+ @Valid @RequestBody GetWorkRoomHandle handle, BindingResult bindingResult) {
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
|
|
|
+ List<Integer> corpIds = userCorpService.getAuthUserCorpIds(authUser.getId());
|
|
|
+ if(corpIds.size() <=0){
|
|
|
+ return AjaxResult.error(HttpStatus.ERROR, UserCorpService.USER_MSG);
|
|
|
+ }
|
|
|
+ handle.setAuthCorpIds(corpIds);
|
|
|
+
|
|
|
JobRedis realJob = new JobRedis();
|
|
|
JobRoomJobRedis job = new JobRoomJobRedis();
|
|
|
Downfile downObj = new Downfile();
|
|
|
@@ -74,6 +96,8 @@ public class WorkRoomController extends BaseController<WorkRoom> {
|
|
|
/*先生成下载记录*/
|
|
|
downObj.setMsg(Downfile.DEFAULT_MSG);
|
|
|
downObj.setTitle(Downfile.WORM_ROOM);
|
|
|
+ downObj.setAuthId(authUser.getId());
|
|
|
+ downObj.setAuthName(authUser.getName());
|
|
|
downfileService.insert(downObj);
|
|
|
|
|
|
/*推送简单任务*/
|