提交 095806d2 作者: zhenjie

Merge branch 'develop'

FROM openjdk:8-jdk-alpine
#VOLUME ["/tmp","/files","/var/logs/"]
VOLUME ["/var/log/app/"]
ARG JAVA_OPTS
ENV JAVA_OPTS=$JAVA_OPTS
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
......
package com.mmc.csf.release.flyer.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @author: zj
* @Date: 2023/6/10 20:34
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AllCategoryDTO implements Serializable {
private static final long serialVersionUID = 1171841063641249397L;
private Integer directoryId;
private String name;
private List<CategoriesInfoListDTO> categoriesInfoListDTO;
}
/** Copyright 2023 bejson.com */
package com.mmc.csf.release.flyer.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* Auto-generated: 2023-06-08 16:2:43
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CategoriesInfoListDTO implements Serializable {
private static final long serialVersionUID = -8381856228953745772L;
private Integer id;
private Integer directoryId;
private String name;
private String icon;
}
......@@ -20,12 +20,17 @@ import java.io.Serializable;
@NoArgsConstructor
@AllArgsConstructor
public class CurriculumQo implements Serializable {
@ApiModelProperty(value = "地域id")
private Integer regionId;
private static final long serialVersionUID = 3124398495152234751L;
@ApiModelProperty(value = "课程名称")
private String curriculumName;
@ApiModelProperty(value = "省份编码")
private Integer provinceCode;
@ApiModelProperty(value = "执照id")
private Integer licenseId;
@ApiModelProperty(value = "技能id")
private Integer flightSkillsId;
@ApiModelProperty(value = "课程类型id")
private Integer categoriesId;
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = { Page.class })
@Min(value = 1, groups = Page.class)
......
package com.mmc.csf.release.flyer.vo;
import com.mmc.csf.release.model.group.Insert;
import com.mmc.csf.release.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
......@@ -19,7 +23,9 @@ import java.math.BigDecimal;
@AllArgsConstructor
@Builder
public class CurriculumInfoVO implements Serializable {
private static final long serialVersionUID = -7343885960160805850L;
@ApiModelProperty(value = "课程id")
@NotNull(message = "课程id不能为空" ,groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "价格")
......@@ -28,15 +34,36 @@ public class CurriculumInfoVO implements Serializable {
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@ApiModelProperty(value = "课程名称")
@ApiModelProperty(value = "课程名称,长度30")
@Length(max = 30)
private String curriculumName;
@ApiModelProperty(value = "课程是否免费 0:免费 1:付费")
private Integer free;
@ApiModelProperty(value = "课程介绍")
@ApiModelProperty(value = "课程类型,二级id")
@NotNull(message = "课程类型id不能为空" ,groups = {Insert.class})
private Integer categoriesId;
@ApiModelProperty(value = "目录名称", example = "技能")
private String directoryName;
@ApiModelProperty(value = "课程类型名称", example = "通用巡检")
private String categoriesName;
@ApiModelProperty(value = "课程技能类型,二级id")
private Integer flightSkills;
@ApiModelProperty(value = "课程介绍(简介), 长度255")
@Length(max = 255)
private String curriculumDesc;
@ApiModelProperty(value = "课程封面")
private String surfaceUrl;
@ApiModelProperty(value = "课程视频")
private String videoUrl;
@ApiModelProperty(value = "课程详情")
private String detailContent;
}
......@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author LW
......@@ -23,4 +24,6 @@ public class FlightSkillsVO implements Serializable {
private Integer id;
@ApiModelProperty(value = "行业认证名称")
private String skillsName;
@ApiModelProperty(value = "课程技能")
private List<FlightSkillsVO> flightSkills;
}
package com.mmc.csf.web.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* Date: 2022/5/24 15:18
* @author 23214
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MaintainDTO implements Serializable {
private String address;
private String name;
private Double lon;
private Double lat;
private Double distance;
}
package com.mmc.csf.web.dto;
import com.mmc.csf.web.vo.LocationVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author LW
......@@ -20,12 +17,9 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
public class WebsiteRangeDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "省编码")
private String adCode;
@ApiModelProperty(value = "省")
private String province;
@ApiModelProperty(value = "地址经纬度")
private List<LocationVO> locationList;
private String address;
private String name;
private Double lon;
private Double lat;
private Double distance;
}
......@@ -18,6 +18,9 @@ spec:
containers:
- name: ims
image: REGISTRY/NAMESPACE/IMAGE:TAG
volumeMounts:
- name: log-of-app
mountPath: /var/log/app
resources:
limits:
memory: 1024Mi
......@@ -29,4 +32,8 @@ spec:
valueFrom:
configMapKeyRef:
name: ims-map
key: SPRING_PROFILES_ACTIVE
\ No newline at end of file
key: SPRING_PROFILES_ACTIVE
volumes:
- name: log-of-app
hostPath:
path: /var/log/app
\ No newline at end of file
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/ims
newTag: 97f99e63e08fa6cbe292cec793f623d7cd8765d1
newTag: 614d4cd45ce2d0d352b2d900d6d24dbf1dc24e7b
package com.mmc.csf.release.controller;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.feign.PmsAppApi;
import com.mmc.csf.release.flyer.qo.CurriculumQo;
import com.mmc.csf.release.flyer.vo.CurriculumInfoVO;
import com.mmc.csf.release.model.group.Insert;
import com.mmc.csf.release.model.group.Update;
import com.mmc.csf.release.service.FlyerTrainingService;
import com.mmc.csf.release.flyer.vo.DronePilotLicenseVO;
import com.mmc.csf.release.flyer.vo.FlightSkillsVO;
import com.mmc.csf.release.flyer.vo.RegistrationVO;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -42,20 +47,13 @@ public class FlyerTrainingController extends BaseController{
return flyerTrainingService.getDronePilotLicense();
}
@ApiOperation(value = "行业应用认证-下拉列表")
@ApiOperation(value = "行业应用认证-下拉列表(课程技能列表)")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = FlightSkillsVO.class)})
@GetMapping("/getIndustryFlightSkills")
public ResultBody getIndustryFlightSkills() {
return flyerTrainingService.getIndustryFlightSkills();
}
@ApiOperation(value = "课程视频列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CurriculumInfoVO.class)})
@PostMapping("/queryCurriculumInfoList")
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")
......@@ -63,10 +61,55 @@ public class FlyerTrainingController extends BaseController{
return flyerTrainingService.licenseOrSkillQueryCurriculum(type);
}
@ApiOperation(value = "课程视频详情")
@ApiOperation(value = "飞手技能列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = FlightSkillsVO.class)})
@GetMapping("treeCurriculumSkill")
public ResultBody treeCurriculumSkill() {
return flyerTrainingService.treeCurriculumSkill();
}
@ApiOperation(value = "V1.0.1课程视频列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CurriculumInfoVO.class)})
@PostMapping("/queryCurriculumInfoList")
public ResultBody queryCurriculumInfoList(@RequestBody CurriculumQo curriculumQo) {
return ResultBody.success(flyerTrainingService.queryCurriculumInfoList(curriculumQo));
}
@ApiOperation(value = "V1.0.1课程视频详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CurriculumInfoVO.class)})
@GetMapping("/curriculumDetails")
public ResultBody curriculumDetails(@ApiParam(value = "课程id") @RequestParam(value = "id") Integer id) {
return flyerTrainingService.curriculumDetails(id);
}
@ApiOperation(value = "V1.0.1新增课程")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CurriculumInfoVO.class)})
@PostMapping("addCurriculum")
public ResultBody addCurriculum(@Validated(Insert.class)@RequestBody CurriculumInfoVO curriculumInfoVO) {
return ResultBody.success(flyerTrainingService.addCurriculum(curriculumInfoVO));
}
@ApiOperation(value = "V1.0.1修改课程")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CurriculumInfoVO.class)})
@PostMapping("updateCurriculum")
public ResultBody updateCurriculum(@Validated(Update.class) @RequestBody CurriculumInfoVO curriculumInfoVO) {
return ResultBody.success(flyerTrainingService.updateCurriculum(curriculumInfoVO));
}
@ApiOperation(value = "V1.0.1删除课程")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("removeCurriculum")
public ResultBody removeCurriculum(@RequestParam Integer id) {
return ResultBody.success(flyerTrainingService.removeCurriculum(id));
}
@Autowired
private PmsAppApi pmsAppApi;
@ApiOperation(value = "V1.0.1test")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("test")
public ResultBody test() {
return ResultBody.success(pmsAppApi.feignQqueryCategoryInfoByType(3));
}
}
......@@ -4,12 +4,13 @@ import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.service.FlyerDummyService;
import com.mmc.csf.release.service.UavDummyService;
import com.mmc.csf.release.service.WebsiteService;
import com.mmc.csf.web.dto.WebsiteDTO;
import com.mmc.csf.web.dto.WebsiteRangeDTO;
import com.mmc.csf.web.vo.WebsiteVO;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author LW
......@@ -30,31 +31,13 @@ public class WebsiteController {
@Autowired
private UavDummyService uavDummyService;
@ApiOperation(value = "小程序--获取本省网点")
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = WebsiteDTO.class)})
@GetMapping("getWebsiteByAdCode")
public ResultBody getWebsiteByAdCode(@ApiParam(value = "省编码")
@RequestParam(value = "code") String adCode) {
return websiteService.getWebsiteByAdCode(adCode);
}
@ApiOperation(value = "获取全国网点")
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = WebsiteRangeDTO.class)})
@GetMapping("getWebsiteList")
public ResultBody getWebsiteList(@ApiParam(value = "用户当前经度", required = true) @RequestParam(value = "lon") Double lon,
@ApiParam(value = "用户当前纬度", required = true) @RequestParam(value = "lat") Double lat) {
return websiteService.getWebsiteList(lon,lat);
}
@ApiOperation(value = "获取当前省份距离最近的网点")
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = WebsiteRangeDTO.class)})
@PostMapping("getProvinceWebsiteRange")
public ResultBody getProvinceWebsiteRange(@RequestBody WebsiteVO websiteVO) {
return websiteService.getProvinceWebsiteRange(websiteVO);
public ResultBody getWebsiteList(@RequestParam Integer pageNo, @RequestParam Integer pageSize, @RequestParam Double lon, @RequestParam Double lat) {
return ResultBody.success(websiteService.getWebsiteList(pageNo, pageSize, lon, lat));
}
@ApiOperation(value = "全国飞手-海点数据-fake")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/flyer/bitmap")
......@@ -68,4 +51,11 @@ public class WebsiteController {
public ResultBody listUavDummys(@RequestParam Integer pageNo, @RequestParam Integer pageSize, @RequestParam Double lon, @RequestParam Double lat) {
return ResultBody.success(uavDummyService.listDummyUav(pageNo, pageSize, lon, lat));
}
@ApiOperation(value = "全国维修-海点数据")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/maintain/bitmap")
public ResultBody listMaintainData(@RequestParam Integer pageNo, @RequestParam Integer pageSize, @RequestParam Double lon, @RequestParam Double lat) {
return ResultBody.success(websiteService.listMaintainData(pageNo, pageSize, lon, lat));
}
}
......@@ -27,7 +27,7 @@ public interface FlyerTrainingDao {
List<DronePilotLicenseVO> selectAllLicenses();
/**
* 行业飞行技能列表
* 课程技能列表
*
* @return {@link List}<{@link FlightSkillsDO}>
*/
......@@ -59,4 +59,28 @@ public interface FlyerTrainingDao {
List<CurriculumInfoDO> selectSkillCurriculum(Integer type);
CurriculumInfoDO curriculumDetails(Integer id);
/**
* 添加课程信息
* @param currInfoDO
*/
Integer addCurriculum(CurriculumInfoDO currInfoDO);
/**
* 修改课程信息
* @param currInfoDO
*/
Integer updateCurriculum(CurriculumInfoDO currInfoDO);
/**
* 删除课程
* @param id
*/
Integer removeCurriculum(Integer id);
/**
* 课程技能列表
* @return
*/
List<FlightSkillsDO> treeCurriculumSkill();
}
......@@ -3,6 +3,7 @@ package com.mmc.csf.release.dao;
import com.mmc.csf.release.entity.DummyFlyerDO;
import com.mmc.csf.release.entity.DummyUavDO;
import com.mmc.csf.release.entity.MaintainDO;
import com.mmc.csf.release.entity.WebsiteInfoDO;
import org.apache.ibatis.annotations.Mapper;
......@@ -15,10 +16,6 @@ import java.util.List;
*/
@Mapper
public interface WebsiteDao {
WebsiteInfoDO getWebsiteByAdCode(String adCode);
List<WebsiteInfoDO> getWebsiteList();
int countDummyFlyer();
List<DummyFlyerDO> listDummyFlyer(Double lon, Double lat, Integer pageNo, Integer pageSize);
......@@ -27,4 +24,12 @@ public interface WebsiteDao {
List<DummyUavDO> listDummyUav(Double lon, Double lat, Integer pageNo, Integer pageSize);
int countMaintain();
List<MaintainDO> listMaintain(Double lon, Double lat, Integer pageNo, Integer pageSize);
List<WebsiteInfoDO> getWebsiteList(Double lon, Double lat, Integer pageNo, Integer pageSize);
int countWebsiteList();
}
......@@ -65,10 +65,31 @@ public class CurriculumInfoDO implements Serializable {
private String videoUrl;
private String surfaceUrl;
private String detailContent;
/**
* 课程类型id
*/
private Integer categoriesId;
public CurriculumInfoDO(CurriculumInfoVO curriculumInfoVO) {
this.id = curriculumInfoVO.getId();
this.curriculumName = curriculumInfoVO.getCurriculumName();
this.curriculumDesc = curriculumInfoVO.getCurriculumDesc();
this.flightSkills = curriculumInfoVO.getFlightSkills();
this.surfaceUrl = curriculumInfoVO.getSurfaceUrl();
this.detailContent = curriculumInfoVO.getDetailContent();
this.videoUrl = curriculumInfoVO.getVideoUrl();
this.categoriesId = curriculumInfoVO.getCategoriesId();
}
public CurriculumInfoVO buildCurriculumInfoVO(){
return CurriculumInfoVO.builder().id(id).curriculumDesc(curriculumDesc).price(curriculumPrice)
.free(free).supplierName("浙江科比特创新科技有限公司").curriculumName(curriculumName)
.videoUrl(videoUrl).build();
.videoUrl(videoUrl).surfaceUrl(this.surfaceUrl).flightSkills(this.flightSkills).detailContent(this.detailContent)
.categoriesId(this.categoriesId).build();
}
}
......
......@@ -7,6 +7,8 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author LW
......@@ -20,10 +22,14 @@ public class FlightSkillsDO implements Serializable {
private static final long serialVersionUID = -6326079527453519916L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "pid")
private Integer pid;
@ApiModelProperty(value = "行业认证名称")
private String skillsName;
@ApiModelProperty(value = "子技能")
private List<FlightSkillsDO> childrenSkills;
public FlightSkillsVO buildFlightSkillsVO() {
return FlightSkillsVO.builder().id(id).skillsName(skillsName).build();
return FlightSkillsVO.builder().id(this.id).skillsName(this.skillsName).flightSkills(this.childrenSkills == null ? null : this.childrenSkills.stream().map(FlightSkillsDO::buildFlightSkillsVO).collect(Collectors.toList())).build();
}
}
package com.mmc.csf.release.entity;
import com.mmc.csf.web.dto.MaintainDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* (MaintainDO)实体类
*
* @author makejava
* @since 2023-06-10 21:42:42
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MaintainDO implements Serializable {
private static final long serialVersionUID = -53401640557659711L;
private Integer id;
private String name;
private String address;
private Double lon;
private Double lat;
private Double distance;
public MaintainDTO buildMaintainDTO() {
this.distance = this.distance == null ? 0 : (BigDecimal.valueOf(this.distance).setScale(2, BigDecimal.ROUND_HALF_DOWN)).doubleValue();
return MaintainDTO.builder().name(name).address(address).lon(this.lon).lat(this.lat).distance(this.distance / 1000).build();
}
}
package com.mmc.csf.release.entity;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mmc.csf.web.dto.WebsiteDTO;
import com.mmc.csf.web.dto.WebsiteRangeDTO;
import com.mmc.csf.web.vo.LocationVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.math.BigDecimal;
/**
* @Author LW
......@@ -23,31 +18,15 @@ import java.util.List;
@AllArgsConstructor
public class WebsiteInfoDO implements Serializable {
private Integer id;
private String adCode;
private String province;
private String location;
private Date createTime;
private Date updateTime;
private String name;
private String address;
private Double lat;
private Double lon;
private Double distance;
public WebsiteDTO buildWebsiteDTO() {
JSONArray json = (JSONArray)JSONObject.parse(this.location);
return WebsiteDTO.builder()
.id(this.id)
.adCode(this.adCode)
.province(this.province)
.location(json)
.createTime(this.createTime)
.build();
}
public WebsiteRangeDTO buildWebsiteRangeDTO() {
List<LocationVO> list = JSONArray.parseArray(this.location, LocationVO.class);
return WebsiteRangeDTO.builder()
.id(this.id)
.province(this.province)
.adCode(this.adCode)
.locationList(list)
.build();
this.distance = this.distance == null ? 0 : (BigDecimal.valueOf(this.distance).setScale(2, BigDecimal.ROUND_HALF_DOWN)).doubleValue();
return WebsiteRangeDTO.builder().name(name).address(address).lon(this.lon).lat(this.lat).distance(this.distance / 1000).build();
}
}
package com.mmc.csf.release.feign;
import com.mmc.csf.release.feign.hystrix.PmsAppApHystrix;
import com.mmc.csf.release.flyer.dto.AllCategoryDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author: zj
* @Date: 2023/6/10 20:23
*/
@FeignClient(url = "${iuav.pmsapp.url}", name = "pms-svc", fallback = PmsAppApHystrix.class)
public interface PmsAppApi {
@RequestMapping(value = "/pms/classify/feignQqueryCategoryInfoByType", method = RequestMethod.GET)
public List<AllCategoryDTO> feignQqueryCategoryInfoByType(@RequestParam Integer type);
}
package com.mmc.csf.release.feign.config;
import com.mmc.csf.release.feign.hystrix.PmsAppApHystrix;
import com.mmc.csf.release.feign.hystrix.UserAppApiHystrix;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
......@@ -18,4 +19,9 @@ public class FeignConfiguration {
public UserAppApiHystrix userAppApi(){
return new UserAppApiHystrix();
}
@Bean(name = "PmsAppApHystrix")
public PmsAppApHystrix pmsAppApi(){
return new PmsAppApHystrix();
}
}
package com.mmc.csf.release.feign.hystrix;
import com.mmc.csf.release.feign.PmsAppApi;
import com.mmc.csf.release.flyer.dto.AllCategoryDTO;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* @author: zj
* @Date: 2023/6/10 20:24
*/
@Slf4j
public class PmsAppApHystrix implements PmsAppApi {
@Override
public List<AllCategoryDTO> feignQqueryCategoryInfoByType(Integer type) {
log.info("熔断--feignQqueryCategoryInfoByType:" + type);
return null;
}
}
......@@ -3,7 +3,9 @@ package com.mmc.csf.release.service;
import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.flyer.qo.CurriculumQo;
import com.mmc.csf.release.flyer.vo.CurriculumInfoVO;
import com.mmc.csf.release.flyer.vo.RegistrationVO;
import io.swagger.models.auth.In;
/**
* @Author LW
......@@ -50,4 +52,28 @@ public interface FlyerTrainingService {
ResultBody licenseOrSkillQueryCurriculum(Integer type);
ResultBody curriculumDetails(Integer id);
/**
* 添加课程
* @param curriculumInfoVO
*/
Integer addCurriculum(CurriculumInfoVO curriculumInfoVO);
/**
* 修改课程
* @param curriculumInfoVO
*/
Integer updateCurriculum(CurriculumInfoVO curriculumInfoVO);
/**
* 删除课程
* @param id
*/
Integer removeCurriculum(Integer id);
/**
* 课程列表
* @return
*/
ResultBody treeCurriculumSkill();
}
package com.mmc.csf.release.service;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.web.vo.WebsiteVO;
import com.mmc.csf.common.util.page.PageResult;
/**
* @Author LW
......@@ -9,9 +8,8 @@ import com.mmc.csf.web.vo.WebsiteVO;
* 概要:
*/
public interface WebsiteService {
ResultBody getWebsiteByAdCode(String adCode);
ResultBody getWebsiteList(Double lon,Double lat);
PageResult listMaintainData(Integer pageNo, Integer pageSize, Double lon, Double lat);
ResultBody getProvinceWebsiteRange(WebsiteVO websiteVO);
PageResult getWebsiteList(Integer pageNo, Integer pageSize, Double lon, Double lat);
}
......@@ -6,12 +6,18 @@ import com.mmc.csf.release.dao.FlyerTrainingDao;
import com.mmc.csf.release.entity.CurriculumInfoDO;
import com.mmc.csf.release.entity.FlightSkillsDO;
import com.mmc.csf.release.entity.PilotRegistrationDO;
import com.mmc.csf.release.feign.PmsAppApi;
import com.mmc.csf.release.flyer.dto.AllCategoryDTO;
import com.mmc.csf.release.flyer.dto.CategoriesInfoListDTO;
import com.mmc.csf.release.flyer.qo.CurriculumQo;
import com.mmc.csf.release.flyer.vo.CurriculumInfoVO;
import com.mmc.csf.release.flyer.vo.DronePilotLicenseVO;
import com.mmc.csf.release.flyer.vo.FlightSkillsVO;
import com.mmc.csf.release.flyer.vo.RegistrationVO;
import com.mmc.csf.release.service.FlyerTrainingService;
import io.swagger.models.auth.In;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -32,6 +38,9 @@ public class FlyerTrainingServiceImpl implements FlyerTrainingService {
@Resource
private FlyerTrainingDao flyerTrainingDao;
@Autowired
private PmsAppApi pmsAppApi;
@Override
public ResultBody pilotRegistration(RegistrationVO registrationVO,Integer userAccountId) {
PilotRegistrationDO pilotRegistrationDO = new PilotRegistrationDO(registrationVO);
......@@ -79,7 +88,7 @@ public class FlyerTrainingServiceImpl implements FlyerTrainingService {
@Override
public PageResult queryCurriculumInfoList(CurriculumQo curriculumQo) {
Integer SZ = 440300;
if (curriculumQo.getRegionId() != null && !curriculumQo.getRegionId().equals(SZ)) {
if (curriculumQo.getProvinceCode() != null && !curriculumQo.getProvinceCode().equals(SZ)) {
return PageResult.buildPage(curriculumQo.getPageNo(), curriculumQo.getPageSize(), 0);
}
int count = flyerTrainingDao.countCurriculumInfoList(curriculumQo);
......@@ -89,7 +98,22 @@ public class FlyerTrainingServiceImpl implements FlyerTrainingService {
Integer pageNo = curriculumQo.getPageNo();
curriculumQo.buildCurrentPage();
List<CurriculumInfoDO> curriculumList = flyerTrainingDao.listPageCurriculumInfo(curriculumQo);
List<AllCategoryDTO> allCategoryDTOS = pmsAppApi.feignQqueryCategoryInfoByType(3);
List<CurriculumInfoVO> list = curriculumList.stream().map(CurriculumInfoDO::buildCurriculumInfoVO).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(allCategoryDTOS)){
list.stream().forEach(curriculumInfoVO -> {
allCategoryDTOS.stream().forEach(directory -> {
if (CollectionUtils.isNotEmpty(directory.getCategoriesInfoListDTO())){
directory.getCategoriesInfoListDTO().stream().forEach(category -> {
if (curriculumInfoVO.getCategoriesId().equals(category.getId())){
curriculumInfoVO.setDirectoryName(directory.getName());
curriculumInfoVO.setCategoriesName(category.getName());
}
});
}
});
});
}
return PageResult.buildPage(pageNo, curriculumQo.getPageSize(), count, list);
}
......@@ -113,7 +137,46 @@ public class FlyerTrainingServiceImpl implements FlyerTrainingService {
if (curriculumInfoDO == null) {
return ResultBody.error("课程不存在或已下架!");
}else {
return ResultBody.success(curriculumInfoDO.buildCurriculumInfoVO());
CurriculumInfoVO curriculumInfoVO = curriculumInfoDO.buildCurriculumInfoVO();
List<AllCategoryDTO> allCategoryDTOS = pmsAppApi.feignQqueryCategoryInfoByType(3);
for (AllCategoryDTO directory : allCategoryDTOS) {
if (CollectionUtils.isNotEmpty(directory.getCategoriesInfoListDTO())){
for (CategoriesInfoListDTO category : directory.getCategoriesInfoListDTO()) {
if (curriculumInfoVO.getCategoriesId().equals(category.getId())){
curriculumInfoVO.setDirectoryName(directory.getName());
curriculumInfoVO.setCategoriesName(category.getName());
break;
}
}
}
}
return ResultBody.success(curriculumInfoVO);
}
}
@Override
public Integer addCurriculum(CurriculumInfoVO curriculumInfoVO) {
CurriculumInfoDO currInfoDO = new CurriculumInfoDO(curriculumInfoVO);
// TODO Auto-generated method stub 暂时先设置科比特单位ID
currInfoDO.setSupplierId(1);
return flyerTrainingDao.addCurriculum(currInfoDO);
}
@Override
public Integer updateCurriculum(CurriculumInfoVO curriculumInfoVO) {
CurriculumInfoDO currInfoDO = new CurriculumInfoDO(curriculumInfoVO);
return flyerTrainingDao.updateCurriculum(currInfoDO);
}
@Override
public Integer removeCurriculum(Integer id) {
return flyerTrainingDao.removeCurriculum(id);
}
@Override
public ResultBody treeCurriculumSkill() {
List<FlightSkillsDO> flightSkillsList = flyerTrainingDao.treeCurriculumSkill();
List<FlightSkillsVO> collect = flightSkillsList.stream().map(FlightSkillsDO::buildFlightSkillsVO).collect(Collectors.toList());
return ResultBody.success(collect);
}
}
package com.mmc.csf.release.service.impl;
import com.mmc.csf.common.util.other.LocationUtils;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.release.dao.WebsiteDao;
import com.mmc.csf.release.entity.MaintainDO;
import com.mmc.csf.release.entity.WebsiteInfoDO;
import com.mmc.csf.release.service.WebsiteService;
import com.mmc.csf.web.dto.MaintainDTO;
import com.mmc.csf.web.dto.WebsiteRangeDTO;
import com.mmc.csf.web.vo.LocationVO;
import com.mmc.csf.web.vo.WebsiteVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
......@@ -25,45 +23,24 @@ public class WebsiteServiceImpl implements WebsiteService {
@Autowired
private WebsiteDao websiteDao;
@Override
public ResultBody getWebsiteByAdCode(String adCode) {
WebsiteInfoDO websiteInfoDO = websiteDao.getWebsiteByAdCode(adCode);
return ResultBody.success(websiteInfoDO.buildWebsiteDTO());
}
@Override
public ResultBody getWebsiteList(Double lon, Double lat) {
List<WebsiteInfoDO> list = websiteDao.getWebsiteList();
List<WebsiteRangeDTO> rangeList = list.stream()
.map(WebsiteInfoDO::buildWebsiteRangeDTO)
.collect(Collectors.toList());
for (WebsiteRangeDTO websiteRangeDTO : rangeList) {
for (LocationVO d : websiteRangeDTO.getLocationList()) {
double distance = 0;
if (d.getJd() != null && d.getJd() != 0 && d.getWd() != null && d.getWd() != 0) {
distance = LocationUtils.getDistance(d.getWd(), d.getJd(), lat, lon);
}
d.setRange(distance);
}
websiteRangeDTO.getLocationList().sort(Comparator.comparing(LocationVO::getRange));
public PageResult listMaintainData(Integer pageNo, Integer pageSize, Double lon, Double lat) {
int count = websiteDao.countMaintain();
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, count);
}
return ResultBody.success(rangeList);
List<MaintainDTO> list = websiteDao.listMaintain(lon, lat, (pageNo - 1) * pageSize, pageSize).stream().map(MaintainDO::buildMaintainDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, pageSize, count, list);
}
@Override
public ResultBody getProvinceWebsiteRange(WebsiteVO websiteVO) {
WebsiteInfoDO website = websiteDao.getWebsiteByAdCode(websiteVO.getAdCode());
WebsiteRangeDTO websiteRangeDTO = website.buildWebsiteRangeDTO();
// 获取位置信息
List<LocationVO> locationList = websiteRangeDTO.getLocationList();
for (LocationVO d : locationList) {
double distance = 0;
if (d.getJd() != null && d.getJd() != 0 && d.getWd() != null && d.getWd() != 0) {
distance = LocationUtils.getDistance(d.getWd(), d.getJd(), websiteVO.getLat(), websiteVO.getLon());
}
d.setRange(distance);
public PageResult getWebsiteList(Integer pageNo, Integer pageSize, Double lon, Double lat) {
int count = websiteDao.countWebsiteList();
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, count);
}
locationList.sort(Comparator.comparing(LocationVO::getRange));
return ResultBody.success(locationList);
List<WebsiteRangeDTO> list = websiteDao.getWebsiteList(lon, lat, (pageNo - 1) * pageSize, pageSize).stream().map(WebsiteInfoDO::buildWebsiteRangeDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, pageSize, count, list);
}
}
......@@ -10,7 +10,7 @@ spring:
#Database
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://mysql.default:3306/iuav_ims?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
url: jdbc:mysql://mysql.default:3306/iuav_ims_dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
username: tmj
password: MMC@2022&MYSQL
# Druid数据源配置
......@@ -144,6 +144,8 @@ ribbon:
iuav:
userapp:
url: http://cms-svc:35150
pmsapp:
url: http://pms-svc:8099
#mmc:
# appid: 80001
......
......@@ -10,7 +10,7 @@ spring:
#Database
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://rm-wz9dd796t4j1giz6t2o.mysql.rds.aliyuncs.com:3306/iuav_ims?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
url: jdbc:mysql://rm-wz9dd796t4j1giz6t2o.mysql.rds.aliyuncs.com:3306/iuav_ims_dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
username: tmj
password: MMC@2022&MYSQL
# Druid数据源配置
......@@ -118,6 +118,8 @@ mybatis:
iuav:
userapp:
url: http://cms-svc:35150
pmsapp:
url: http://127.0.0.1:8099
##feign
#feign:
......
......@@ -144,6 +144,8 @@ ribbon:
iuav:
userapp:
url: http://cms-svc:35150
pmsapp:
url: http://pms-svc:8099
#mmc:
# appid: 80001
......
spring:
profiles:
active: local
main:
banner-mode: off
logging:
file:
name: "/var/log/app/${spring.application.name}.log"
---
spring:
......
......@@ -4,6 +4,17 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.csf.release.dao.FlyerTrainingDao">
<resultMap id="flightSkillsResultMap" type="com.mmc.csf.release.entity.FlightSkillsDO">
<id column="id" property="id"/>
<result column="pid" property="pid"/>
<result column="skills_name" property="skillsName"/>
<collection property="childrenSkills" ofType="com.mmc.csf.release.entity.FlightSkillsDO" javaType="java.util.List">
<id column="childId" property="id"/>
<result column="childIdPid" property="pid"/>
<result column="childIdSkillsName" property="skillsName"/>
</collection>
</resultMap>
<insert id="insertPilotRegistrationInfo" parameterType="com.mmc.csf.release.entity.PilotRegistrationDO"
useGeneratedKeys="true" keyProperty="id">
INSERT INTO pilot_registration(apply_user_id, `name`, city, telephone, driving_license, province,
......@@ -12,6 +23,48 @@
VALUES (#{applyUserId}, #{name}, #{city}, #{telephone}, #{drivingLicense}, #{province}, #{uavLicenseLevelOne},
#{uavLicenseLevelTwo}, #{uavLicenseLevelThree}, #{industryAppAuth}, #{remark})
</insert>
<insert id="addCurriculum" keyProperty="id" useGeneratedKeys="true" parameterType="com.mmc.csf.release.entity.CurriculumInfoDO">
INSERT INTO `curriculum_info`(`curriculum_name`, `supplier_id`, `curriculum_desc`, `drone_pilot_license_id`, `flight_skills`, `categories_id`, `surface_url`, `video_url`, `detail_content`)
VALUES (#{curriculumName},#{supplierId},#{curriculumDesc},#{dronePilotLicenseId},#{flightSkills},#{categoriesId},#{surfaceUrl},#{videoUrl},#{detailContent});
</insert>
<update id="updateCurriculum" parameterType="com.mmc.csf.release.entity.CurriculumInfoDO">
UPDATE curriculum_info
<set>
<if test="curriculumName != null">
curriculum_name = #{curriculumName},
</if>
<if test="curriculumDesc != null">
curriculum_desc = #{curriculumDesc},
</if>
<if test="dronePilotLicenseId != null">
drone_pilot_license_id = #{dronePilotLicenseId},
</if>
<if test="flightSkills != null">
flight_skills = #{flightSkills},
</if>
<if test="categoriesId != null">
categories_id = #{categoriesId},
</if>
<if test="surfaceUrl != null">
surface_url = #{surfaceUrl},
</if>
<if test="videoUrl != null">
video_url = #{videoUrl},
</if>
<if test="detailContent ">
detail_content = #{detailContent},
</if>
</set>
<where>
id = #{id}
</where>
</update>
<update id="removeCurriculum">
update curriculum_info set is_deleted = 1 where id = #{id}
</update>
<select id="selectAllLicenses" resultType="com.mmc.csf.release.flyer.vo.DronePilotLicenseVO">
select id,
parent_id,
......@@ -23,6 +76,7 @@
</select>
<select id="listIndustryFlightSkills" resultType="com.mmc.csf.release.entity.FlightSkillsDO">
select id,
pid,
skills_name
from flight_skills
</select>
......@@ -30,9 +84,12 @@
SELECT
count(*)
FROM
curriculum_info ci INNER JOIN curriculum_video cv ON ci.id = cv.curriculum_info_id
curriculum_info ci
<where>
and ci.is_deleted = 0
<if test="curriculumName != null">
and ci.curriculum_name like CONCAT("%", #{curriculumName}, "%")
</if>
<if test="licenseId != null">
and ci.drone_pilot_license_id = #{licenseId}
</if>
......@@ -51,16 +108,25 @@
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
ci.detail_content,
ci.video_url,
ci.categories_id,
ci.surface_url
from curriculum_info ci
<where>
and ci.is_deleted = 0
<if test="curriculumName != null">
and ci.curriculum_name like CONCAT("%", #{curriculumName}, "%")
</if>
<if test="licenseId != null">
and drone_pilot_license_id = #{licenseId}
</if>
<if test="flightSkillsId != null">
and flight_skills = #{flightSkillsId}
</if>
<if test="categoriesId != null">
and categories_id = #{categoriesId}
</if>
</where>
order by ci.create_time desc
LIMIT #{pageNo},#{pageSize}
......@@ -102,10 +168,25 @@
ci.is_free free,
ci.drone_pilot_license_id,
ci.flight_skills,
cv.curriculum_url videoUrl
ci.detail_content,
ci.video_url,
ci.categories_id,
ci.surface_url
from curriculum_info ci
INNER JOIN curriculum_video cv ON ci.id = cv.curriculum_info_id
where ci.id = #{id}
and ci.is_deleted = 0
</select>
<select id="treeCurriculumSkill" resultMap="flightSkillsResultMap">
SELECT
fs0.id,
fs0.pid,
fs0.skills_name,
fs1.id as childId,
fs1.pid as childIdPid,
fs1.skills_name as childIdSkillsName
FROM
flight_skills fs0
INNER JOIN flight_skills fs1 ON fs0.id = fs1.pid
</select>
</mapper>
\ No newline at end of file
......@@ -28,10 +28,6 @@
from website_info
where ad_code = #{adCode}
</select>
<select id="getWebsiteList" resultType="com.mmc.csf.release.entity.WebsiteInfoDO">
select id, ad_code adCode, province, location, create_time createTime
from website_info
</select>
<select id="countDummyFlyer" resultType="Integer">
select count(*) from dummy_flyer
......@@ -56,4 +52,36 @@
ORDER BY distance ASC
LIMIT #{pageNo},#{pageSize}
</select>
<select id="countMaintain" resultType="java.lang.Integer">
select count(*) from maintain
</select>
<select id="listMaintain" resultType="com.mmc.csf.release.entity.MaintainDO">
SELECT
id,
`name`,
address,
lon,
lat, st_distance_sphere (point (lon,lat),point (${lon},${lat})) AS distance
FROM
maintain
ORDER BY
distance ASC
LIMIT #{pageNo},#{pageSize}
</select>
<select id="countWebsiteList" resultType="java.lang.Integer">
select count(*) from website_info
</select>
<select id="getWebsiteList" resultType="com.mmc.csf.release.entity.WebsiteInfoDO">
SELECT
id,
`name`,
address,
lon,
lat, st_distance_sphere (point (lon,lat),point (${lon},${lat})) AS distance
FROM
website_info
ORDER BY
distance ASC
LIMIT #{pageNo},#{pageSize}
</select>
</mapper>
\ No newline at end of file
......@@ -23,6 +23,8 @@ data-filter:
- /release/website/getWebsiteList
- /release/website/flyer/bitmap
- /release/website/uav/bitmap
- /release/website/maintain/bitmap
- /release/website/getProvinceWebsiteRange
- /release/curriculum/getIndustryFlightSkills
- /release/curriculum/getDronePilotLicense
\ No newline at end of file
- /release/curriculum/getDronePilotLicense
- /release/module/listBannerImg
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论