提交 55393095 作者: xiaowang

首页无人机服务及无人机培训接口

上级 5f453cee
package com.mmc.csf.release.task.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author 作者 LW
* @version 创建时间:2023年5月19日 上午9:56:04
* @explain 行业-数据载体类
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IndustryVO implements Serializable{
private static final long serialVersionUID = -7659647039766377385L;
private Integer id;
private String industryIcon;
private String name;
private String shortName;
private Integer industryType;
private String propagate1;
private String propagate2;
private String image;
private String video;
}
......@@ -56,4 +56,11 @@ public class FlyerTrainingController {
public ResultBody queryCurriculumInfoList(@RequestBody CurriculumQo curriculumQo) {
return ResultBody.success(flyerTrainingService.queryCurriculumInfoList(curriculumQo));
}
@ApiOperation(value = "考证-技能")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CurriculumInfoVO.class)})
@GetMapping("/licenseOrSkillQueryCurriculum")
public ResultBody licenseOrSkillQueryCurriculum(@ApiParam(value = "考证/技能 0:考证 1:技能") @RequestParam(value = "type") Integer type) {
return flyerTrainingService.licenseOrSkillQueryCurriculum(type);
}
}
......@@ -2,9 +2,11 @@ package com.mmc.csf.release.controller;
import com.mmc.csf.common.util.group.Create;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.entity.AppTypeDO;
import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.service.TaskService;
import com.mmc.csf.release.task.qo.TaskServiceQo;
import com.mmc.csf.release.task.vo.IndustryVO;
import com.mmc.csf.release.task.vo.OrderTaskVO;
import com.mmc.csf.release.task.vo.TaskServiceDetailVO;
import com.mmc.csf.release.task.vo.TaskServiceVO;
......@@ -48,4 +50,25 @@ public class TaskController {
return taskService.reservationService(orderTaskVO);
}
@ApiOperation(value = "web-小程序-行业列表-全部")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = IndustryVO.class) })
@GetMapping("listAllIndustry")
public ResultBody listAllIndustry() {
return taskService.listAllIndustry();
}
@ApiOperation(value = "web-小程序-应用列表-全部")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = AppTypeDO.class) })
@GetMapping("listAllAppType")
public ResultBody listAllAppType() {
return taskService.listAllAppType();
}
@ApiOperation(value = "web-小程序-作业服务列表-全部")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = TaskServiceVO.class) })
@GetMapping("listAllTaskService")
public ResultBody listAllTaskService() {
return taskService.listAllTaskService();
}
}
......@@ -43,4 +43,19 @@ public interface FlyerTrainingDao {
* @return {@link List}<{@link CurriculumInfoDO}>
*/
List<CurriculumInfoDO> listPageCurriculumInfo(CurriculumQo curriculumQo);
/**
* 查询考证视频
*
* @return {@link List}<{@link CurriculumInfoDO}>
*/
List<CurriculumInfoDO> selectLicensesCurriculum();
/**
* 查询技能课程
*
* @param type 类型
* @return {@link List}<{@link CurriculumInfoDO}>
*/
List<CurriculumInfoDO> selectSkillCurriculum(Integer type);
}
package com.mmc.csf.release.dao;
import com.mmc.csf.release.entity.InspComtDO;
import com.mmc.csf.release.entity.InspectionDO;
import com.mmc.csf.release.entity.TaskOrderDO;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.entity.*;
import com.mmc.csf.release.task.qo.TaskServiceQo;
import org.apache.ibatis.annotations.Mapper;
......@@ -70,4 +69,23 @@ public interface TaskDao {
* @return {@link List}<{@link InspComtDO}>
*/
List<InspComtDO> getEvaluateInfoList(int size);
/**
* 获取所有行业信息
*/
List<IndustryDO> listAllIndustry();
/**
* 列出所有应用程序类型
*
* @return {@link List}<{@link AppTypeDO}>
*/
List<AppTypeDO> listAllAppType();
/**
* 列出所有任务服务
*
* @return {@link List}<{@link InspectionDO}>
*/
List<InspectionDO> listAllTaskService();
}
package com.mmc.csf.release.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.io.Serializable;
/**
* 应用类型表(AppTypeDO)实体类
*
* @author makejava
* @since 2023-05-19 10:01:54
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppTypeDO implements Serializable {
private static final long serialVersionUID = -33771594030748645L;
private Integer id;
/**
* 应用名称
*/
private String appName;
private Date createTime;
}
package com.mmc.csf.release.entity;
import com.mmc.csf.release.task.vo.IndustryVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.io.Serializable;
/**
* 行业管理(IndustryDO)实体类
*
* @author makejava
* @since 2023-05-19 09:51:16
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IndustryDO implements Serializable {
private static final long serialVersionUID = -43925052782251392L;
private Integer id;
/**
* 行业名称
*/
private String name;
/**
* 行业图标
*/
private String industryIcon;
/**
* 简称
*/
private String shortName;
/**
* 0飞行服务,1个人服务,2设备售卖,3设备租赁,4设备返祖
*/
private Integer industryType;
/**
* 行业宣传语1
*/
private String propagate1;
/**
* 行业宣传语2
*/
private String propagate2;
/**
* 图片地址
*/
private String image;
/**
* 视频地址
*/
private String video;
/**
* 是否删除 0 未删除 1 删除
*/
private Integer del;
private Date updateTime;
private Date addTime;
/**
* 行业编号
*/
private String number;
private Integer sort;
/**
* 是否上架 1上架 0下架
*/
private Integer shelf;
/**
* 是否是演示专用行业:0:否 1:是
*/
private Integer demons;
public IndustryVO buildIndustryVO(){
return IndustryVO.builder()
.id(this.id)
.industryIcon(this.industryIcon)
.name(this.name)
.shortName(this.shortName)
.industryType(this.industryType)
.propagate1(this.propagate1)
.propagate2(this.propagate2)
.image(this.image)
.video(this.video).build();
}
}
......@@ -41,4 +41,12 @@ public interface FlyerTrainingService {
* @return {@link Object}
*/
PageResult queryCurriculumInfoList(CurriculumQo taskServiceQo);
/**
* 许可证或技能查询课程
*
* @param type 类型
* @return {@link ResultBody}
*/
ResultBody licenseOrSkillQueryCurriculum(Integer type);
}
......@@ -5,6 +5,7 @@ import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.task.qo.TaskServiceQo;
import com.mmc.csf.release.task.vo.OrderTaskVO;
import com.mmc.csf.release.task.vo.TaskServiceDetailVO;
import com.sun.org.apache.regexp.internal.RE;
/**
* @Author LW
......@@ -35,4 +36,25 @@ public interface TaskService {
* @return {@link ResultBody}
*/
ResultBody reservationService(OrderTaskVO orderTaskVO);
/**
* 列出所有行业
*
* @return {@link ResultBody}
*/
ResultBody listAllIndustry();
/**
* 列出所有应用程序类型
*
* @return {@link ResultBody}
*/
ResultBody listAllAppType();
/**
* 列出所有任务服务
*
* @return {@link ResultBody}
*/
ResultBody listAllTaskService();
}
......@@ -93,4 +93,18 @@ public class FlyerTrainingServiceImpl implements FlyerTrainingService {
List<CurriculumInfoVO> list = curriculumList.stream().map(CurriculumInfoDO::buildCurriculumInfoVO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, curriculumQo.getPageSize(), count, list);
}
@Override
public ResultBody licenseOrSkillQueryCurriculum(Integer type) {
List<CurriculumInfoDO> curriculumInfoList;
if (type == 0) {
// 表示查询考证的
curriculumInfoList = flyerTrainingDao.selectLicensesCurriculum();
} else {
curriculumInfoList = flyerTrainingDao.selectSkillCurriculum(type);
}
return ResultBody.success(curriculumInfoList == null ? null : curriculumInfoList.stream()
.map(CurriculumInfoDO::buildCurriculumInfoVO).collect(Collectors.toList()));
}
}
......@@ -8,11 +8,13 @@ import com.mmc.csf.common.util.redis.RedisConstant;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.common.util.web.ResultEnum;
import com.mmc.csf.release.dao.TaskDao;
import com.mmc.csf.release.entity.IndustryDO;
import com.mmc.csf.release.entity.InspComtDO;
import com.mmc.csf.release.entity.InspectionDO;
import com.mmc.csf.release.entity.TaskOrderDO;
import com.mmc.csf.release.service.TaskService;
import com.mmc.csf.release.task.qo.TaskServiceQo;
import com.mmc.csf.release.task.vo.IndustryVO;
import com.mmc.csf.release.task.vo.OrderTaskVO;
import com.mmc.csf.release.task.vo.TaskServiceDetailVO;
import com.mmc.csf.release.task.vo.TaskServiceVO;
......@@ -37,6 +39,7 @@ public class TaskServiceImpl implements TaskService {
private TaskDao taskDao;
@Autowired
private RedisTemplate redisTemplate;
@Override
public PageResult queryTaskServiceList(TaskServiceQo taskServiceQo) {
Integer SZ = 440300;
......@@ -70,11 +73,11 @@ public class TaskServiceImpl implements TaskService {
int size = (int) (100 * Math.random() + 98);
List<InspComtDO> evaluateInfoList = taskDao.getEvaluateInfoList(size);
String toJSONString = JSONObject.toJSONString(evaluateInfoList);
redisTemplate.opsForValue().set(key,toJSONString ,2L, TimeUnit.DAYS);
redisTemplate.opsForValue().set(key, toJSONString, 2L, TimeUnit.DAYS);
taskServiceDetailVO.setEvaluateInfo(evaluateInfoList.stream().map(InspComtDO::buildEvaluateInfoVO).collect(Collectors.toList()));
taskServiceDetailVO.setItem(evaluateInfoList.size());
}else {
String listStr = (String) redisTemplate.opsForValue().get(key);
} else {
String listStr = (String) redisTemplate.opsForValue().get(key);
List<InspComtDO> array = JSONArray.parseArray(listStr, InspComtDO.class);
taskServiceDetailVO.setEvaluateInfo(array.stream().map(InspComtDO::buildEvaluateInfoVO).collect(Collectors.toList()));
taskServiceDetailVO.setItem(array.size());
......@@ -85,7 +88,7 @@ public class TaskServiceImpl implements TaskService {
@Override
public ResultBody reservationService(OrderTaskVO orderTaskVO) {
Integer count = taskDao.getIndustryAndInspect(orderTaskVO.getIndustryId(), orderTaskVO.getInspectionId());
if (count == 0 ) {
if (count == 0) {
return ResultBody.error(ResultEnum.INSPECTION_NOT_EXIST);
}
InspectionDO inspectionDO = taskDao.getInspectionById(orderTaskVO.getInspectionId());
......@@ -93,8 +96,8 @@ public class TaskServiceImpl implements TaskService {
return ResultBody.error(ResultEnum.INSPECTION_NOT_EXIST);
}
TaskOrderDO taskOrderDo = new TaskOrderDO(orderTaskVO);
if (CollectionUtils.isNotEmpty(orderTaskVO.getFilePath())){
taskOrderDo.setImageUrl(String.join(",",orderTaskVO.getFilePath()));
if (CollectionUtils.isNotEmpty(orderTaskVO.getFilePath())) {
taskOrderDo.setImageUrl(String.join(",", orderTaskVO.getFilePath()));
}
taskOrderDo.setUserAccountId(1);
taskOrderDo.defaultInfo();
......@@ -103,4 +106,26 @@ public class TaskServiceImpl implements TaskService {
taskDao.insertOrderTask(taskOrderDo);
return ResultBody.success();
}
@Override
public ResultBody listAllIndustry() {
//查找所有服务
List<IndustryVO> collect = taskDao.listAllIndustry()
.stream().map(IndustryDO::buildIndustryVO)
.collect(Collectors.toList());
return ResultBody.success(collect);
}
@Override
public ResultBody listAllAppType() {
return ResultBody.success(taskDao.listAllAppType());
}
@Override
public ResultBody listAllTaskService() {
List<InspectionDO> inspectionList = taskDao.listAllTaskService();
return ResultBody.success(inspectionList.stream().map(InspectionDO::buildTaskService).collect(Collectors.toList()));
}
}
......@@ -64,4 +64,32 @@
order by ci.create_time desc
LIMIT #{pageNo},#{pageSize}
</select>
<select id="selectLicensesCurriculum" resultType="com.mmc.csf.release.entity.CurriculumInfoDO">
SELECT ci.id,
ci.curriculum_name,
ci.supplier_id,
ci.curriculum_price,
ci.curriculum_desc,
ci.is_free free,
ci.drone_pilot_license_id,
ci.flight_skills,
cv.curriculum_url videoUrl
from curriculum_info ci
INNER JOIN curriculum_video cv ON ci.id = cv.curriculum_info_id
where ci.drone_pilot_license_id is not null
</select>
<select id="selectSkillCurriculum" resultType="com.mmc.csf.release.entity.CurriculumInfoDO">
SELECT ci.id,
ci.curriculum_name,
ci.supplier_id,
ci.curriculum_price,
ci.curriculum_desc,
ci.is_free free,
ci.drone_pilot_license_id,
ci.flight_skills,
cv.curriculum_url videoUrl
from curriculum_info ci
INNER JOIN curriculum_video cv ON ci.id = cv.curriculum_info_id
where ci.flight_skills is not null
</select>
</mapper>
\ No newline at end of file
......@@ -105,4 +105,41 @@
FROM insp_comt
ORDER BY RAND() LIMIT #{size}
</select>
<select id="listAllIndustry" resultType="com.mmc.csf.release.entity.IndustryDO">
select
i.id,i.name,i.short_name,i.industry_type,i.number,i.propagate1,i.propagate2,i.image,i.video,i.sort,i.is_shelf,i.industry_icon
from industry i
<where>
i.is_del = 0 and is_shelf = 1
</where>
order by i.sort ASC
</select>
<select id="listAllAppType" resultType="com.mmc.csf.release.entity.AppTypeDO">
select id,
app_name,
create_time
from app_type
</select>
<select id="listAllTaskService" resultType="com.mmc.csf.release.entity.InspectionDO">
select i.id,
i.name,
i.service_type,
i.limit_active,
i.work_type_id,
i.light_spot,
i.number,
i.video,
i.image,
i.sort,
i.is_shelf,
i.content,
i.order_num,
i.is_del,
i.fake_num,
i.card_img,
i.is_show_code
from inspection i
where i.is_del = 0 and i.is_shelf = 1
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论