|
|
@@ -1,14 +1,19 @@
|
|
|
package com.mokamrp.privates.controller.pangu;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.mokamrp.privates.constant.Constants;
|
|
|
import com.mokamrp.privates.constant.HttpStatus;
|
|
|
import com.mokamrp.privates.entity.DelHandle;
|
|
|
+import com.mokamrp.privates.entity.EditHandle;
|
|
|
import com.mokamrp.privates.entity.PostBasePageHandle;
|
|
|
import com.mokamrp.privates.entity.pangu.GetByIdHandle;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
import com.mokamrp.privates.entity.ResHandle;
|
|
|
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashOasBox;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
|
|
|
+import com.mokamrp.privates.service.CoralApiService;
|
|
|
+import com.mokamrp.privates.service.pangu.FosterwxCashOasBoxService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -44,6 +49,11 @@ public class FosterwxCashWorkwxTaskListController extends BaseController<Fosterw
|
|
|
@Autowired
|
|
|
public FosterwxCashWorkwxTaskListService fosterwxCashWorkwxTaskListService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public FosterwxCashOasBoxService fosterwxCashOasBoxService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public CoralApiService coralApiService;
|
|
|
/*
|
|
|
* @fast
|
|
|
* 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
|
|
|
@@ -69,7 +79,25 @@ public class FosterwxCashWorkwxTaskListController extends BaseController<Fosterw
|
|
|
.eq("catalog_id",getByIdHandle.getId()));
|
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
|
-
|
|
|
+ @PostMapping("/edit")
|
|
|
+ public Object edit(@Valid @RequestBody EditHandle<FosterwxCashWorkwxTaskList> editHandle, BindingResult bindingResult) {
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
+ }
|
|
|
+ this.onUpdate(editHandle);
|
|
|
+ Integer taskType = editHandle.getRaw().getTaskType();
|
|
|
+ if (taskType == 1 || taskType == 3) {
|
|
|
+ FosterwxCashOasBox boxOasInfo = fosterwxCashOasBoxService.getById(editHandle.getRaw().getBoxId());
|
|
|
+ Object info = coralApiService.getBoxInfo(boxOasInfo.getGhId());
|
|
|
+ JSONObject json = JSONObject.parseObject(info.toString());
|
|
|
+ editHandle.getRaw().setBoxType(boxOasInfo.getBoxType());
|
|
|
+ editHandle.getRaw().setBoxName(boxOasInfo.getName());
|
|
|
+ editHandle.getRaw().setBoxGhId(boxOasInfo.getGhId());
|
|
|
+ editHandle.getRaw().setBoxAppid(json.get("appid").toString());
|
|
|
+ }
|
|
|
+ service.update(editHandle.getRaw(), new QueryWrapper<FosterwxCashWorkwxTaskList>().in("id", editHandle.getIds()));
|
|
|
+ return AjaxResult.success(Constants.SUCCESS, true);
|
|
|
+ }
|
|
|
/**
|
|
|
* 软删除
|
|
|
* @param delHandle
|