|  |  | 
 |  |  |  | 
 |  |  | import com.zy.acs.framework.common.Cools; | 
 |  |  | import com.zy.acs.framework.common.R; | 
 |  |  | import com.zy.acs.manager.core.domain.TaskPosDto; | 
 |  |  | import com.zy.acs.manager.manager.entity.Action; | 
 |  |  | import com.zy.acs.manager.manager.entity.Segment; | 
 |  |  | import com.zy.acs.manager.manager.service.MissionService; | 
 |  |  | import com.zy.acs.manager.manager.service.SegmentService; | 
 |  |  | import com.zy.acs.manager.system.controller.BaseController; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
 |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
 |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RestController; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('manager:mission:list')") | 
 |  |  |     @PostMapping("/mission/page") | 
 |  |  |     public R page(@RequestBody Map<String, Object> map) { | 
 |  |  |         return R.ok().add(Cools.add("total", Integer.MAX_VALUE).add("records", missionService.getList())); | 
 |  |  |         Long agvId = null; | 
 |  |  |         if (null != map.get("agvId")) { | 
 |  |  |             agvId = Long.parseLong(String.valueOf(map.get("agvId"))); | 
 |  |  |         } | 
 |  |  |         String groupNo = null; | 
 |  |  |         if (!Cools.isEmpty(map.get("groupNo"))) { | 
 |  |  |             groupNo = String.valueOf(map.get("groupNo")); | 
 |  |  |         } | 
 |  |  |         return R.ok().add(Cools.add("total", Integer.MAX_VALUE).add("records", missionService.getList(agvId, groupNo))); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('manager:mission:list')") | 
 |  |  |     @PostMapping("/mission/posType/list") | 
 |  |  |     public R posTypeList() { | 
 |  |  |         List<String> list = new ArrayList<>(); | 
 |  |  |         for (TaskPosDto.PosType value : TaskPosDto.PosType.values()) { | 
 |  |  |             list.add(value.toString()); | 
 |  |  |         } | 
 |  |  |         return R.ok().add(list); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('manager:mission:list')") | 
 |  |  |     @GetMapping("/mission/{id}") | 
 |  |  |     public R get(@PathVariable("id") Long id) { | 
 |  |  |         Segment segment = segmentService.getById(id); | 
 |  |  |         return R.ok().add(missionService.generateVoMoreInfo(segment.getGroupId())); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('manager:mission:update')") | 
 |  |  |     @PostMapping("/mission/resend") | 
 |  |  |     public R resend(@RequestBody List<Action> actionList) { | 
 |  |  |         return missionService.resend(actionList) ? R.ok("Resend Success") : R.error("Resend Fail"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |