|
@@ -17,7 +17,9 @@ import com.jpsoft.bus.modules.bus.service.RouteInfoService;
|
|
import com.jpsoft.bus.modules.common.utils.OSSUtil;
|
|
import com.jpsoft.bus.modules.common.utils.OSSUtil;
|
|
import com.jpsoft.bus.modules.common.utils.POIUtils;
|
|
import com.jpsoft.bus.modules.common.utils.POIUtils;
|
|
import com.jpsoft.bus.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.bus.modules.common.utils.PojoUtils;
|
|
|
|
+import com.jpsoft.bus.modules.sys.entity.User;
|
|
import com.jpsoft.bus.modules.sys.service.DataDictionaryService;
|
|
import com.jpsoft.bus.modules.sys.service.DataDictionaryService;
|
|
|
|
+import com.jpsoft.bus.modules.sys.service.UserService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -63,6 +65,9 @@ public class RouteInfoController {
|
|
@Autowired
|
|
@Autowired
|
|
private DataDictionaryService dataDictionaryService;
|
|
private DataDictionaryService dataDictionaryService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserService userService;
|
|
|
|
+
|
|
@ApiOperation(value="创建空记录")
|
|
@ApiOperation(value="创建空记录")
|
|
@GetMapping("create")
|
|
@GetMapping("create")
|
|
public MessageResult<RouteInfoDTO> create(){
|
|
public MessageResult<RouteInfoDTO> create(){
|
|
@@ -554,4 +559,38 @@ public class RouteInfoController {
|
|
|
|
|
|
return msgResult;
|
|
return msgResult;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="路线")
|
|
|
|
+ @RequestMapping(value = "list",method = RequestMethod.POST)
|
|
|
|
+ public MessageResult<List<RouteInfo>> list(String companyId,@RequestAttribute String subject){
|
|
|
|
+
|
|
|
|
+ MessageResult<List<RouteInfo>> msgResult = new MessageResult<>();
|
|
|
|
+ User user = userService.get(subject);
|
|
|
|
+
|
|
|
|
+ CompanyInfo companyInfo = companyInfoService.get(companyId);
|
|
|
|
+
|
|
|
|
+ String queryCompanyId = "";
|
|
|
|
+ if(companyInfo != null){
|
|
|
|
+ if("1".equals(companyInfo.getType())){
|
|
|
|
+ //公司
|
|
|
|
+ queryCompanyId = companyId;
|
|
|
|
+ }else if("2".equals(companyInfo.getType())){
|
|
|
|
+ //车队 查上级
|
|
|
|
+ queryCompanyId = companyInfo.getParentId();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
+ searchParams.put("companyId",queryCompanyId);
|
|
|
|
+
|
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
|
+
|
|
|
|
+ Page<RouteInfo> page = routeInfoService.pageSearch(searchParams,0,1000,true,sortList);
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ msgResult.setData(page.getResult());
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
}
|
|
}
|