|
@@ -98,36 +98,38 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
return ajaxResult;
|
|
return ajaxResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PutMapping("/edit")
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
- public Object edit(@Valid @RequestBody EditHandle<FosterwxMobile> editHandle, @AuthUser User authUser) {
|
|
|
|
|
- FosterwxMobile fosterwxMobile = editHandle.getRaw();
|
|
|
|
|
- FosterwxMobile oldVO = fosterwxMobileService.getById(editHandle.getIds());
|
|
|
|
|
- // 新增账号
|
|
|
|
|
- fosterwxMobileService.update(fosterwxMobile,new QueryWrapper<FosterwxMobile>().eq("id",editHandle.getIds()));
|
|
|
|
|
- fosterwxMobile = fosterwxMobileService.getById(editHandle.getIds());
|
|
|
|
|
- // 判断开始做任务时间是否设置了
|
|
|
|
|
- AjaxResult ajaxResult = null;
|
|
|
|
|
- if (null != fosterwxMobile.getTaskStartAt()) {
|
|
|
|
|
- if (fosterwxMobile.getWxStatus() != 2) {
|
|
|
|
|
- ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(fosterwxMobile, authUser, false);
|
|
|
|
|
|
|
+ @PostMapping("/editPro")
|
|
|
|
|
+ public Object editPro(@Valid @RequestBody EditHandle<FosterwxMobile> editHandle, @AuthUser User authUser) {
|
|
|
|
|
+ String[] ids = editHandle.getIds().split(",");
|
|
|
|
|
+ for (String id : ids){
|
|
|
|
|
+ FosterwxMobile fosterwxMobile = editHandle.getRaw();
|
|
|
|
|
+ FosterwxMobile oldVO = fosterwxMobileService.getById(id);
|
|
|
|
|
+ // 新增账号
|
|
|
|
|
+ fosterwxMobileService.update(fosterwxMobile,new QueryWrapper<FosterwxMobile>().eq("id",id));
|
|
|
|
|
+ fosterwxMobile = fosterwxMobileService.getById(id);
|
|
|
|
|
+ // 判断开始做任务时间是否设置了
|
|
|
|
|
+ AjaxResult ajaxResult = null;
|
|
|
|
|
+ if (null != fosterwxMobile.getTaskStartAt()) {
|
|
|
|
|
+ if (fosterwxMobile.getWxStatus() != 2) {
|
|
|
|
|
+ ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(fosterwxMobile, authUser, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 判断微信状态是否更新为封禁
|
|
|
|
|
+ if (fosterwxMobile.getWxStatus() == 2 && oldVO.getWxStatus() == 1) {
|
|
|
|
|
+ ajaxResult = fosterwxTaskScheduleService.deleteByDate(fosterwxMobile, authUser);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 判断微信状态是否更新为正常
|
|
|
|
|
+ if (fosterwxMobile.getWxStatus() == 1 && oldVO.getWxStatus() == 2) {
|
|
|
|
|
+ ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(fosterwxMobile, authUser, true);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ajaxResult != null){
|
|
|
|
|
+ return AjaxResult.error(id+"账号批量操作中出现错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ return AjaxResult.success("更新账号成功");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // 判断微信状态是否更新为封禁
|
|
|
|
|
- if (fosterwxMobile.getWxStatus() == 2 && oldVO.getWxStatus() == 1) {
|
|
|
|
|
- ajaxResult = fosterwxTaskScheduleService.deleteByDate(fosterwxMobile, authUser);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 判断微信状态是否更新为正常
|
|
|
|
|
- if (fosterwxMobile.getWxStatus() == 1 && oldVO.getWxStatus() == 2) {
|
|
|
|
|
- ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(fosterwxMobile, authUser, true);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (null == ajaxResult) return AjaxResult.success("更新账号成功");
|
|
|
|
|
|
|
|
|
|
- return ajaxResult;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
*@Leon 以下接口为站点负责人后台页面接口,需要独立登陆才可访问
|
|
*@Leon 以下接口为站点负责人后台页面接口,需要独立登陆才可访问
|