|
|
@@ -4,27 +4,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.mokamrp.privates.constant.Constants;
|
|
|
import com.mokamrp.privates.constant.HttpMsg;
|
|
|
import com.mokamrp.privates.constant.HttpStatus;
|
|
|
+import com.mokamrp.privates.controller.BaseController;
|
|
|
import com.mokamrp.privates.entity.AddHandle;
|
|
|
import com.mokamrp.privates.entity.DelHandle;
|
|
|
import com.mokamrp.privates.entity.EditHandle;
|
|
|
-import com.mokamrp.privates.controller.BaseController;
|
|
|
-import com.mokamrp.privates.entity.PostBasePageHandle;
|
|
|
import com.mokamrp.privates.entity.pangu.GetForsterwxMobileHandle;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
import com.mokamrp.privates.interceptor.AuthUser;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobile;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobileWxfriend;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxStation;
|
|
|
+import com.mokamrp.privates.mapper.pojo.User;
|
|
|
+import com.mokamrp.privates.service.pangu.FosterwxMobileService;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxMobileWxfriendService;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxStationService;
|
|
|
-import com.mokamrp.privates.mapper.pojo.User;
|
|
|
-import com.mokamrp.privates.service.pangu.*;
|
|
|
+import com.mokamrp.privates.service.pangu.FosterwxTaskScheduleService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import com.mokamrp.privates.service.pangu.FosterwxMobileService;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
|
@@ -93,7 +91,7 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(addHandle.getRaw(), authUser, false);
|
|
|
}
|
|
|
|
|
|
- if (null == ajaxResult) return AjaxResult.success(HttpMsg.success,addHandle.getRaw().getId());
|
|
|
+ if (null == ajaxResult) return AjaxResult.success(HttpMsg.success, addHandle.getRaw().getId());
|
|
|
|
|
|
return ajaxResult;
|
|
|
}
|
|
|
@@ -101,15 +99,15 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
@PostMapping("/editPro")
|
|
|
public Object editPro(@Valid @RequestBody EditHandle<FosterwxMobile> editHandle, @AuthUser User authUser) {
|
|
|
String[] ids = editHandle.getIds().split(",");
|
|
|
- for (String id : ids){
|
|
|
+ for (String id : ids) {
|
|
|
FosterwxMobile fosterwxMobile = editHandle.getRaw();
|
|
|
FosterwxMobile oldVO = fosterwxMobileService.getById(id);
|
|
|
// 新增账号
|
|
|
- fosterwxMobileService.update(fosterwxMobile,new QueryWrapper<FosterwxMobile>().eq("id",id));
|
|
|
+ fosterwxMobileService.update(fosterwxMobile, new QueryWrapper<FosterwxMobile>().eq("id", id));
|
|
|
fosterwxMobile = fosterwxMobileService.getById(id);
|
|
|
// 判断开始做任务时间是否设置了
|
|
|
AjaxResult ajaxResult = null;
|
|
|
- if (null != fosterwxMobile.getTaskStartAt()) {
|
|
|
+ if (null != fosterwxMobile.getTaskStartAt() && oldVO.getTaskStartAt() == null) {
|
|
|
if (fosterwxMobile.getWxStatus() != 2) {
|
|
|
ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(fosterwxMobile, authUser, false);
|
|
|
}
|
|
|
@@ -122,8 +120,8 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
if (fosterwxMobile.getWxStatus() == 1 && oldVO.getWxStatus() == 2) {
|
|
|
ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(fosterwxMobile, authUser, true);
|
|
|
}
|
|
|
- if (ajaxResult != null){
|
|
|
- return AjaxResult.error(id+"账号批量操作中出现错误");
|
|
|
+ if (ajaxResult != null) {
|
|
|
+ return AjaxResult.error(id + "账号批量操作中出现错误");
|
|
|
}
|
|
|
}
|
|
|
return AjaxResult.success("更新账号成功");
|
|
|
@@ -143,10 +141,10 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
}
|
|
|
//.登录验证
|
|
|
FosterwxStation fosterwxStation = fosterwxStationService.getAuthInfo(token);
|
|
|
- if (fosterwxStation == null){
|
|
|
+ if (fosterwxStation == null) {
|
|
|
return AjaxResult.error(HttpStatus.LOGIN_ERROR, HttpMsg.needLogin);
|
|
|
}
|
|
|
- Map<String, Object> res = fosterwxMobileService.getListByStationId(getForsterwxMobileHandle,fosterwxStation.getId());
|
|
|
+ Map<String, Object> res = fosterwxMobileService.getListByStationId(getForsterwxMobileHandle, fosterwxStation.getId());
|
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
|
|
|
|
@@ -158,12 +156,12 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
}
|
|
|
//.登录验证
|
|
|
FosterwxStation fosterwxStation = fosterwxStationService.getAuthInfo(token);
|
|
|
- if (fosterwxStation == null){
|
|
|
+ if (fosterwxStation == null) {
|
|
|
return AjaxResult.error(HttpStatus.LOGIN_ERROR, HttpMsg.needLogin);
|
|
|
}
|
|
|
QueryWrapper<FosterwxMobile> QueryWrapper = new QueryWrapper<>();
|
|
|
String[] ids = delHandle.getIds().split(",");
|
|
|
- QueryWrapper.in("id", ids).eq("station_id",fosterwxStation.getId());
|
|
|
+ QueryWrapper.in("id", ids).eq("station_id", fosterwxStation.getId());
|
|
|
boolean res = service.remove(QueryWrapper);
|
|
|
if (!res) {
|
|
|
return AjaxResult.error(HttpMsg.error);
|
|
|
@@ -173,13 +171,13 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
|
|
|
@PostMapping("/addMobilePro")
|
|
|
public Object addMobile(@RequestParam(name = "token") String token,
|
|
|
- @Valid @RequestBody AddHandle<FosterwxMobile> addHandle, BindingResult bindingResult){
|
|
|
+ @Valid @RequestBody AddHandle<FosterwxMobile> addHandle, BindingResult bindingResult) {
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
//.登录验证
|
|
|
FosterwxStation fosterwxStation = fosterwxStationService.getAuthInfo(token);
|
|
|
- if (fosterwxStation == null){
|
|
|
+ if (fosterwxStation == null) {
|
|
|
return AjaxResult.error(HttpStatus.LOGIN_ERROR, HttpMsg.needLogin);
|
|
|
}
|
|
|
this.onInsert(addHandle.getRaw());
|
|
|
@@ -200,13 +198,13 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
}
|
|
|
//.登录验证
|
|
|
FosterwxStation fosterwxStation = fosterwxStationService.getAuthInfo(token);
|
|
|
- if (fosterwxStation == null){
|
|
|
+ if (fosterwxStation == null) {
|
|
|
return AjaxResult.error(HttpStatus.LOGIN_ERROR, HttpMsg.needLogin);
|
|
|
}
|
|
|
this.onUpdate(editHandle);
|
|
|
fosterwxMobileService.update(editHandle.getRaw(),
|
|
|
new QueryWrapper<FosterwxMobile>()
|
|
|
- .eq("station_id",fosterwxStation.getId())
|
|
|
+ .eq("station_id", fosterwxStation.getId())
|
|
|
.in("id", editHandle.getIds()));
|
|
|
return AjaxResult.success(Constants.SUCCESS, true);
|
|
|
}
|
|
|
@@ -216,7 +214,7 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
@RequestParam(name = "ids") String ids) {
|
|
|
//.登录验证
|
|
|
FosterwxStation fosterwxStation = fosterwxStationService.getAuthInfo(token);
|
|
|
- if (fosterwxStation == null){
|
|
|
+ if (fosterwxStation == null) {
|
|
|
return AjaxResult.error(HttpStatus.LOGIN_ERROR, HttpMsg.needLogin);
|
|
|
}
|
|
|
if (ids == null || ids.isEmpty()) {
|
|
|
@@ -224,7 +222,7 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
}
|
|
|
FosterwxMobile res = service.getOne(new QueryWrapper<FosterwxMobile>()
|
|
|
.eq("id", ids)
|
|
|
- .eq("station_id",fosterwxStation.getId()));
|
|
|
+ .eq("station_id", fosterwxStation.getId()));
|
|
|
List<FosterwxMobileWxfriend> friendList = fosterwxMobileWxfriendService.list(new QueryWrapper<FosterwxMobileWxfriend>()
|
|
|
.eq("mobile_id", res.getId())
|
|
|
.orderByAsc("seq"));
|