|
|
@@ -14,13 +14,11 @@ import com.mokamrp.privates.help.AjaxResult;
|
|
|
import com.mokamrp.privates.help.Analysis;
|
|
|
import com.mokamrp.privates.interceptor.AuthUser;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobile;
|
|
|
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobilePool;
|
|
|
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.service.pangu.FosterwxTaskScheduleService;
|
|
|
+import com.mokamrp.privates.service.pangu.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
@@ -29,6 +27,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -58,6 +57,9 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
@Autowired
|
|
|
private FosterwxTaskScheduleService fosterwxTaskScheduleService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FosterwxMobilePoolService fosterwxMobilePoolService;
|
|
|
+
|
|
|
/*
|
|
|
* @fast
|
|
|
* 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
|
|
|
@@ -207,10 +209,22 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
|
|
|
|
|
|
@PostMapping("/getTaskList")
|
|
|
public Object getTaskList(@Valid @RequestBody GetForsterwxMobileHandle getForsterwxMobileHandle) {
|
|
|
- Integer StationId = getForsterwxMobileHandle.getStationId();
|
|
|
+ Integer stationId = getForsterwxMobileHandle.getStationId();
|
|
|
Integer mobileCode = getForsterwxMobileHandle.getMobileCode();
|
|
|
|
|
|
- return AjaxResult.success(fosterwxTaskScheduleService.getTaskListByMobileCode(StationId, mobileCode));
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.set(Integer.valueOf(getForsterwxMobileHandle.getYear()), Integer.valueOf(getForsterwxMobileHandle.getMonth()), 0);
|
|
|
+ int dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
|
|
|
+
|
|
|
+ Map<String, Object> res = new HashMap<>();
|
|
|
+ for (int i = 1; i <= dayOfMonth; i++) {
|
|
|
+ String date = getForsterwxMobileHandle.getYear() + "-" + String.format("%02d", Integer.valueOf(getForsterwxMobileHandle.getMonth())) + "-" + String.format("%02d", i);
|
|
|
+
|
|
|
+ res.put(date, fosterwxTaskScheduleService.getTaskListByMobileCode(stationId, mobileCode, date));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return AjaxResult.success(res);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/editMobile")
|