|
@@ -83,28 +83,28 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
|
|
|
|
|
@PostMapping("/addPro")
|
|
@PostMapping("/addPro")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Object addPro(@RequestBody FosterwxMobile fosterwxMobile, @AuthUser User authUser) {
|
|
|
|
|
|
|
+ public Object addPro(@Valid @RequestBody AddHandle<FosterwxMobile> addHandle, @AuthUser User authUser) {
|
|
|
// 新增账号
|
|
// 新增账号
|
|
|
- fosterwxMobileService.save(fosterwxMobile);
|
|
|
|
|
|
|
+ fosterwxMobileService.save(addHandle.getRaw());
|
|
|
// 判断开始做任务时间是否设置了
|
|
// 判断开始做任务时间是否设置了
|
|
|
AjaxResult ajaxResult = null;
|
|
AjaxResult ajaxResult = null;
|
|
|
- if (null != fosterwxMobile.getTaskStartAt() && fosterwxMobile.getWxStatus() != 2) {
|
|
|
|
|
- ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(fosterwxMobile, authUser, false);
|
|
|
|
|
|
|
+ if (null != addHandle.getRaw().getTaskStartAt() && addHandle.getRaw().getWxStatus() != 2) {
|
|
|
|
|
+ ajaxResult = fosterwxTaskScheduleService.insertByTaskDate(addHandle.getRaw(), authUser, false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (null == ajaxResult) return AjaxResult.success(HttpMsg.success,fosterwxMobile.getId());
|
|
|
|
|
|
|
+ if (null == ajaxResult) return AjaxResult.success(HttpMsg.success,addHandle.getRaw().getId());
|
|
|
|
|
|
|
|
return ajaxResult;
|
|
return ajaxResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PutMapping("/edit")
|
|
@PutMapping("/edit")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Object edit(@RequestBody FosterwxMobile fosterwxMobile, @AuthUser User authUser) {
|
|
|
|
|
- FosterwxMobile oldVO = fosterwxMobileService.getById(fosterwxMobile.getId());
|
|
|
|
|
|
|
+ public Object edit(@Valid @RequestBody EditHandle<FosterwxMobile> editHandle, @AuthUser User authUser) {
|
|
|
|
|
+ FosterwxMobile fosterwxMobile = editHandle.getRaw();
|
|
|
|
|
+ FosterwxMobile oldVO = fosterwxMobileService.getById(editHandle.getIds());
|
|
|
// 新增账号
|
|
// 新增账号
|
|
|
- fosterwxMobileService.updateById(fosterwxMobile);
|
|
|
|
|
- fosterwxMobile = fosterwxMobileService.getById(fosterwxMobile.getId());
|
|
|
|
|
-
|
|
|
|
|
|
|
+ fosterwxMobileService.update(fosterwxMobile,new QueryWrapper<FosterwxMobile>().eq("id",editHandle.getIds()));
|
|
|
|
|
+ fosterwxMobile = fosterwxMobileService.getById(editHandle.getIds());
|
|
|
// 判断开始做任务时间是否设置了
|
|
// 判断开始做任务时间是否设置了
|
|
|
AjaxResult ajaxResult = null;
|
|
AjaxResult ajaxResult = null;
|
|
|
if (null != fosterwxMobile.getTaskStartAt()) {
|
|
if (null != fosterwxMobile.getTaskStartAt()) {
|