Commit 992eb144 by hewei

Merge branch 'dev/lanpingxiong' into 'master'

Dev/lanpingxiong

See merge request hewei/Jumeirah!7
parents b6c0aea8 1ac4cb82
package com.jumeirah.api.app.controller;
import cn.hutool.core.date.DateUtil;
import com.jumeirah.api.app.entity.vo.StrokeAddBackAndForthVo;
import com.jumeirah.api.app.entity.vo.StrokeAddFreightVo;
import com.jumeirah.api.app.entity.vo.StrokeAddMedicalTreatmentVo;
import com.jumeirah.api.app.entity.vo.StrokeAddOneWayVo;
import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.service.StrokeService;
import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import lombok.extern.slf4j.Slf4j;
import com.jumeirah.common.param.StrokePageParam;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import com.jumeirah.common.vo.StrokeQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.common.param.IdParam;
import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 行程表 控制器
*
* @author wei
* @since 2020-09-29
*/
@Slf4j
@RestController
@RequestMapping("/stroke")
@Module("${cfg.module}")
@Api(value = "行程表API", tags = {"行程表"})
public class StrokeController extends BaseController {
@Autowired
private StrokeService strokeService;
/**
* 添加单程行程表
*/
@PostMapping("/add/oneWay")
@OperationLog(name = "添加单程行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加单程行程表", response = ApiResult.class)
public ApiResult<Boolean> addOneWayStroke(@Validated @RequestBody StrokeAddOneWayVo strokeAddOneWayVo) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddOneWayVo, stroke);
stroke.setType(0)
.setCreateTime(System.currentTimeMillis());
boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag);
}
/**
* 添加往返行程表
*/
@PostMapping("/add/backAndForth")
@OperationLog(name = "添加往返行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加往返行程表", response = ApiResult.class)
public ApiResult<Boolean> addBackAndForthStroke(@Validated @RequestBody StrokeAddBackAndForthVo strokeAddBackAndForthVo) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddBackAndForthVo, stroke);
stroke.setType(1)
.setCreateTime(System.currentTimeMillis());
boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag);
}
/**
* 添加货运行程表
*/
@PostMapping("/add/freight")
@OperationLog(name = "添加货运行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加货运行程表", response = ApiResult.class)
public ApiResult<Boolean> addFreightStroke(@Validated @RequestBody StrokeAddFreightVo strokeAddFreightVo) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddFreightVo, stroke);
stroke.setType(2)
.setCreateTime(System.currentTimeMillis());
boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag);
}
/**
* 添加医疗行程表
*/
@PostMapping("/add/medicalTreatment")
@OperationLog(name = "添加医疗行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加医疗行程表", response = ApiResult.class)
public ApiResult<Boolean> addMedicalTreatmentStroke(
@Validated @RequestBody StrokeAddMedicalTreatmentVo strokeAddMedicalTreatmentVo) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddMedicalTreatmentVo, stroke);
stroke.setType(3)
.setCreateTime(System.currentTimeMillis());
boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag);
}
/**
* 修改行程表
*/
@PostMapping("/update")
@OperationLog(name = "修改行程表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改行程表", response = ApiResult.class)
public ApiResult<Boolean> updateStroke(@Validated(Update.class) @RequestBody Stroke stroke) throws Exception {
boolean flag = strokeService.updateStroke(stroke);
return ApiResult.result(flag);
}
/**
* 删除行程表
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除行程表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除行程表", response = ApiResult.class)
public ApiResult<Boolean> deleteStroke(@PathVariable("id") Long id) throws Exception {
boolean flag = strokeService.deleteStroke(id);
return ApiResult.result(flag);
}
/**
* 获取行程表详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "行程表详情", type = OperationLogType.INFO)
@ApiOperation(value = "行程表详情", response = StrokeQueryVo.class)
public ApiResult<StrokeQueryVo> getStroke(@PathVariable("id") Long id) throws Exception {
StrokeQueryVo strokeQueryVo = strokeService.getStrokeById(id);
return ApiResult.ok(strokeQueryVo);
}
/**
* 行程表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "行程表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "行程表分页列表", response = StrokeQueryVo.class)
public ApiResult<Paging<StrokeQueryVo>> getStrokePageList(@Validated @RequestBody StrokePageParam strokePageParam) throws Exception {
Paging<StrokeQueryVo> paging = strokeService.getStrokePageList(strokePageParam);
return ApiResult.ok(paging);
}
}
package com.jumeirah.api.app.entity.vo;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 行程表-返程
*
* @author wei
* @since 2020-09-29
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加返程行程入参对象")
public class StrokeAddBackAndForthVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空")
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "人数不能为空")
@ApiModelProperty("人数")
private Integer peopleMun;
@NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间")
private Long outsetTime;
@NotNull(message = "返程时间不能为空")
@ApiModelProperty("返程时间")
private Long returnTime;
}
package com.jumeirah.api.app.entity.vo;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 行程表
*
* @author wei
* @since 2020-09-29
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加货运行程入参对象")
public class StrokeAddFreightVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空")
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间")
private Long outsetTime;
@NotBlank(message = "货物名称不能为空")
@ApiModelProperty("货物名称")
private String goodsName;
@NotBlank(message = "货物体积不能为空")
@ApiModelProperty("货物体积(长*宽*高) 单位:CM,例如:100*102*120")
private String goodsSize;
@NotNull(message = "货物重量不能为空")
@ApiModelProperty("货物重量,单位:吨")
private Double goodsWeight;
}
package com.jumeirah.api.app.entity.vo;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 行程表
*
* @author wei
* @since 2020-09-29
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加医疗行程入参对象")
public class StrokeAddMedicalTreatmentVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空")
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间")
private Long outsetTime;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("病人疾病名称")
private String diseaseName;
@NotBlank(message = "病人病情诊断书不能为空")
@ApiModelProperty("病人病情诊断书")
private String medicalCertificateUrl;
@ApiModelProperty("配备器械(格式:1,2,3)逗号分隔")
private String instruments;
@ApiModelProperty("医护人员,0-医生,1-护士,2-护工(格式:0,1,2)逗号分隔")
private String medicalPersons;
@ApiModelProperty("备注")
private String remarks;
}
package com.jumeirah.api.app.entity.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 行程表
*
* @author wei
* @since 2020-09-29
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加单程行程入参对象")
public class StrokeAddOneWayVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空")
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "人数不能为空")
@ApiModelProperty("人数")
private Integer peopleMun;
@NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间")
private Long outsetTime;
}
package com.jumeirah.common.entity;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
/**
* 行程表
*
* @author wei
* @since 2020-09-29
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Stroke对象")
public class Stroke extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@NotNull(message = "出发城市id不能为空")
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "人数不能为空")
@ApiModelProperty("人数")
private Integer peopleMun;
@NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间")
private Long outsetTime;
@ApiModelProperty("返程时间")
private Long returnTime;
@NotNull(message = "行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空")
@ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗")
private Integer type;
@NotNull(message = "状态,0-审核中,1-进行中,2-已完成,99-取消不能为空")
@ApiModelProperty("状态,0-审核中,1-进行中,2-已完成,99-取消")
private Integer status;
@NotNull(message = "创建时间不能为空")
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("货物名称")
private String goodsName;
@ApiModelProperty("货物体积(长*宽*高) 单位:CM,例如:100*102*120")
private String goodsSize;
@ApiModelProperty("货物重量,单位:吨")
private Double goodsWeight;
@ApiModelProperty("病人疾病名称")
private String diseaseName;
@ApiModelProperty("病人病情诊断书")
private String medicalCertificateUrl;
@ApiModelProperty("配备器械(格式:1,2,3)逗号分隔")
private String instruments;
@ApiModelProperty("医护人员,0-医生,1-护士,2-护工(格式:0,1,2)逗号分隔")
private String medicalPersons;
@ApiModelProperty("备注")
private String remarks;
@ApiModelProperty("价格,单位:分")
private Long money;
@NotNull(message = "用户ID不能为空")
@ApiModelProperty("用户ID")
private Long userId;
@NotNull(message = "商家id不能为空")
@ApiModelProperty("商家id")
private Long mcId;
@NotNull(message = "用户选择机型不能为空")
@ApiModelProperty("用户选择机型")
private Long choosePlainType;
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.param.StrokePageParam;
import com.jumeirah.common.vo.StrokeQueryVo;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
/**
* 行程表 Mapper 接口
*
* @author wei
* @since 2020-09-29
*/
@Repository
public interface StrokeMapper extends BaseMapper<Stroke> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
StrokeQueryVo getStrokeById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param strokePageParam
* @return
*/
IPage<StrokeQueryVo> getStrokePageList(@Param("page") Page page,@Param("param") StrokePageParam strokePageParam);
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/**
* <pre>
* 行程表 分页参数对象
* </pre>
*
* @author wei
* @date 2020-09-29
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "行程表分页参数")
public class StrokePageParam extends BasePageOrderParam{
private static final long serialVersionUID=1L;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.param.StrokePageParam;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import com.jumeirah.common.vo.StrokeQueryVo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 行程表 服务类
*
* @author wei
* @since 2020-09-29
*/
public interface StrokeService extends BaseService<Stroke> {
/**
* 保存
*
* @param stroke
* @return
* @throws Exception
*/
boolean saveStroke(Stroke stroke) throws Exception;
/**
* 修改
*
* @param stroke
* @return
* @throws Exception
*/
boolean updateStroke(Stroke stroke) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteStroke(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
StrokeQueryVo getStrokeById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param strokePageParam
* @return
* @throws Exception
*/
Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam) throws Exception;
}
package com.jumeirah.common.service.impl;
import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.mapper.StrokeMapper;
import com.jumeirah.common.service.StrokeService;
import com.jumeirah.common.param.StrokePageParam;
import com.jumeirah.common.vo.StrokeQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 行程表 服务实现类
*
* @author wei
* @since 2020-09-29
*/
@Slf4j
@Service
public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> implements StrokeService {
@Autowired
private StrokeMapper strokeMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveStroke(Stroke stroke) throws Exception {
return super.save(stroke);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateStroke(Stroke stroke) throws Exception {
return super.updateById(stroke);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteStroke(Long id) throws Exception {
return super.removeById(id);
}
@Override
public StrokeQueryVo getStrokeById(Long id) throws Exception {
return strokeMapper.getStrokeById(id);
}
@Override
public Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam) throws Exception {
Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.desc(getLambdaColumn(Stroke::getCreateTime)));
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageList(page, strokePageParam);
return new Paging<StrokeQueryVo>(iPage);
}
}
package com.jumeirah.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <pre>
* 行程表 查询结果对象
* </pre>
*
* @author wei
* @date 2020-09-29
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "StrokeQueryVo对象")
public class StrokeQueryVo implements Serializable{
private static final long serialVersionUID=1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@ApiModelProperty("人数")
private Integer peopleMun;
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@ApiModelProperty("出发时间")
private Date outsetTime;
@ApiModelProperty("返程时间")
private Date returnTime;
@ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗")
private Integer type;
@ApiModelProperty("状态,0-审核中,1-进行中,2-已完成,99-取消")
private Integer status;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("货物名称")
private String goodsName;
@ApiModelProperty("货物体积(长*宽*高) 单位:CM,例如:100*102*120")
private String goodsSize;
@ApiModelProperty("货物重量,单位:吨")
private Double goodsWeight;
@ApiModelProperty("病人疾病名称")
private String diseaseName;
@ApiModelProperty("病人病情诊断书")
private String aegerUrl;
@ApiModelProperty("配备器械(格式:1,2,3)逗号分隔")
private String instruments;
@ApiModelProperty("医护人员,0-医生,1-护士,2-护工(格式:0,1,2)逗号分隔")
private String medicalPersons;
@ApiModelProperty("备注")
private String remarks;
@ApiModelProperty("价格,单位:分")
private Long money;
@ApiModelProperty("用户ID")
private Long userId;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jumeirah.common.mapper.StrokeMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, city_outset_id, city_outset_name, city_arrive_id, city_arrive_name, people_mun, plain_type_id, outset_time, return_time, type, status, create_time, update_time, goods_name, goods_size, goods_weight, disease_name, aeger_url, instruments, medical_persons, remarks, money, user_id
</sql>
<select id="getStrokeById" resultType="com.jumeirah.common.vo.StrokeQueryVo">
select
<include refid="Base_Column_List"/>
from stroke where id = #{id}
</select>
<select id="getStrokePageList" parameterType="com.jumeirah.common.param.StrokePageParam" resultType="com.jumeirah.common.vo.StrokeQueryVo">
select
<include refid="Base_Column_List"/>
from stroke
</select>
</mapper>
/target/
/classes
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
.DS_Store
*.log
logs
*.rdb
# distribution 项目打包模块
\ No newline at end of file
#! /bin/shell
# Copyright 2019-2029 geekidea(https://github.com/geekidea)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#======================================================================
# 项目重启shell脚本
# 先调用shutdown.sh停服
# 然后调用startup.sh启动服务
#
# author: geekidea
# date: 2020-3-28
#======================================================================
# 项目名称
# 停服
sh shutdown.sh
# 启动服务
sh startup.sh
\ No newline at end of file
#! /bin/shell
# Copyright 2019-2029 geekidea(https://github.com/geekidea)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#======================================================================
# 项目停服shell脚本
# 通过项目名称查找到PID
# 然后kill -9 pid
#
# author: geekidea
# date: 2020-3-28
#======================================================================
# 项目名称
APPLICATION="${admin.artifact.name}"
# 项目启动jar包名称
APPLICATION_JAR="${APPLICATION}.jar"
PID=$(ps -ef | grep ${APPLICATION_JAR} | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo ${APPLICATION} is already stopped
else
echo kill ${PID}
kill -9 ${PID}
echo ${APPLICATION} stopped successfully
fi
\ No newline at end of file
#! /bin/shell
# Copyright 2019-2029 geekidea(https://github.com/geekidea)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#======================================================================
# Admin项目启动shell脚本
# config目录: 配置文件目录
# logs目录: 项目运行日志目录
# logs/spring-boot-plus_startup.log: 记录启动日志
# logs/back目录: 项目运行日志备份目录
# nohup后台运行
#
# author: geekidea
# date: 2020-3-28
#======================================================================
# 项目名称
APPLICATION="${admin.artifact.name}"
# 项目启动jar包名称
APPLICATION_JAR="${APPLICATION}.jar"
echo ${APPLICATION_JAR}
# bin目录绝对路径
BIN_PATH=$(cd `dirname $0`; pwd)
# 进入bin目录
cd `dirname $0`
# 返回到上一级项目根目录路径
cd ..
# 打印项目根目录绝对路径
# `pwd` 执行系统命令并获得结果
BASE_PATH=`pwd`
# 外部配置文件绝对目录,如果是目录需要/结尾,也可以直接指定文件
# 如果指定的是目录,spring则会读取目录中的所有配置文件
CONFIG_DIR=${BASE_PATH}"/config/"
# 项目日志输出绝对路径
LOG_DIR=${BASE_PATH}"/logs"
LOG_FILE="${APPLICATION}.log"
LOG_PATH="${LOG_DIR}/${LOG_FILE}"
# 日志备份目录
LOG_BACK_DIR="${LOG_DIR}/back/"
# 项目启动日志输出绝对路径
LOG_STARTUP_PATH="${LOG_DIR}/${APPLICATION}_startup.log"
# 当前时间
NOW=$(date --date='0 days ago' "+%Y-%m-%d-%H-%M-%S")
NOW_PRETTY=$(date --date='0 days ago' "+%Y-%m-%d %H:%M:%S")
# 启动日志
STARTUP_LOG="================================================ ${NOW_PRETTY} ================================================\n"
# 如果logs文件夹不存在,则创建文件夹
if [ ! -d "${LOG_DIR}" ]; then
mkdir "${LOG_DIR}"
fi
# 如果logs/back文件夹不存在,则创建文件夹
if [ ! -d "${LOG_BACK_DIR}" ]; then
mkdir "${LOG_BACK_DIR}"
fi
# 如果项目运行日志存在,则重命名备份
if [ -f "${LOG_PATH}" ]; then
mv ${LOG_PATH} "${LOG_BACK_DIR}/${APPLICATION}_back_${NOW}.log"
fi
# 创建新的项目运行日志
echo "" > ${LOG_PATH}
# 如果项目启动日志不存在,则创建,否则追加
echo ${STARTUP_LOG} >> ${LOG_STARTUP_PATH}
#=======================================================
# 将命令启动相关日志追加到日志文件
#=======================================================
# 输出项目名称
STARTUP_LOG="${STARTUP_LOG}application name: ${APPLICATION}\n"
# 输出jar包名称
STARTUP_LOG="${STARTUP_LOG}application jar name: ${APPLICATION_JAR}\n"
# 输出项目bin路径
STARTUP_LOG="${STARTUP_LOG}application bin path: ${BIN_PATH}\n"
# 输出项目根目录
STARTUP_LOG="${STARTUP_LOG}application root path: ${BASE_PATH}\n"
# 打印日志路径
STARTUP_LOG="${STARTUP_LOG}application log path: ${LOG_PATH}\n"
# 打印启动命令
STARTUP_LOG="${STARTUP_LOG}application background startup command: nohup java -jar ${BASE_PATH}/lib/${APPLICATION_JAR} --spring.config.location=${CONFIG_DIR} > ${LOG_PATH} 2>&1 &\n"
#======================================================================
# 执行启动命令:后台启动项目,并将日志输出到项目根目录下的logs文件夹下
#======================================================================
nohup java -jar ${BASE_PATH}/lib/${APPLICATION_JAR} --spring.config.location=${CONFIG_DIR} > ${LOG_PATH} 2>&1 &
# 进程ID
PID=$(ps -ef | grep ${APPLICATION_JAR} | grep -v grep | awk '{ print $2 }')
STARTUP_LOG="${STARTUP_LOG}application pid: ${PID}\n"
# 启动日志追加到启动日志文件中
echo -e ${STARTUP_LOG} >> ${LOG_STARTUP_PATH}
# 打印启动日志
echo -e ${STARTUP_LOG}
# 打印项目日志
tail -f ${LOG_PATH}
\ No newline at end of file
#! /bin/shell
# Copyright 2019-2029 geekidea(https://github.com/geekidea)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#======================================================================
# 项目重启shell脚本
# 先调用shutdown.sh停服
# 然后调用startup.sh启动服务
#
# author: geekidea
# date: 2018-12-2
#======================================================================
# 项目名称
# 停服
sh shutdown.sh
# 启动服务
sh startup.sh
\ No newline at end of file
#! /bin/shell
# Copyright 2019-2029 geekidea(https://github.com/geekidea)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#======================================================================
# 项目停服shell脚本
# 通过项目名称查找到PID
# 然后kill -9 pid
#
# author: geekidea
# date: 2018-12-2
#======================================================================
# 项目名称
APPLICATION="${boot.artifact.name}"
# 项目启动jar包名称
APPLICATION_JAR="${APPLICATION}.jar"
PID=$(ps -ef | grep ${APPLICATION_JAR} | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo ${APPLICATION} is already stopped
else
echo kill ${PID}
kill -9 ${PID}
echo ${APPLICATION} stopped successfully
fi
\ No newline at end of file
#! /bin/shell
# Copyright 2019-2029 geekidea(https://github.com/geekidea)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#======================================================================
# 项目启动shell脚本
# config目录: 配置文件目录
# logs目录: 项目运行日志目录
# logs/spring-boot-plus_startup.log: 记录启动日志
# logs/back目录: 项目运行日志备份目录
# nohup后台运行
#
# author: geekidea
# date: 2018-12-2
#======================================================================
# 项目名称
APPLICATION="${boot.artifact.name}"
# 项目启动jar包名称
APPLICATION_JAR="${APPLICATION}.jar"
echo ${APPLICATION_JAR}
# bin目录绝对路径
BIN_PATH=$(cd `dirname $0`; pwd)
# 进入bin目录
cd `dirname $0`
# 返回到上一级项目根目录路径
cd ..
# 打印项目根目录绝对路径
# `pwd` 执行系统命令并获得结果
BASE_PATH=`pwd`
# 外部配置文件绝对目录,如果是目录需要/结尾,也可以直接指定文件
# 如果指定的是目录,spring则会读取目录中的所有配置文件
CONFIG_DIR=${BASE_PATH}"/config/"
# 项目日志输出绝对路径
LOG_DIR=${BASE_PATH}"/logs"
LOG_FILE="${APPLICATION}.log"
LOG_PATH="${LOG_DIR}/${LOG_FILE}"
# 日志备份目录
LOG_BACK_DIR="${LOG_DIR}/back/"
# 项目启动日志输出绝对路径
LOG_STARTUP_PATH="${LOG_DIR}/${APPLICATION}_startup.log"
# 当前时间
NOW=$(date --date='0 days ago' "+%Y-%m-%d-%H-%M-%S")
NOW_PRETTY=$(date --date='0 days ago' "+%Y-%m-%d %H:%M:%S")
# 启动日志
STARTUP_LOG="================================================ ${NOW_PRETTY} ================================================\n"
# 如果logs文件夹不存在,则创建文件夹
if [ ! -d "${LOG_DIR}" ]; then
mkdir "${LOG_DIR}"
fi
# 如果logs/back文件夹不存在,则创建文件夹
if [ ! -d "${LOG_BACK_DIR}" ]; then
mkdir "${LOG_BACK_DIR}"
fi
# 如果项目运行日志存在,则重命名备份
if [ -f "${LOG_PATH}" ]; then
mv ${LOG_PATH} "${LOG_BACK_DIR}/${APPLICATION}_back_${NOW}.log"
fi
# 创建新的项目运行日志
echo "" > ${LOG_PATH}
# 如果项目启动日志不存在,则创建,否则追加
echo ${STARTUP_LOG} >> ${LOG_STARTUP_PATH}
#==========================================================================================
# JVM Configuration
# -Xmx1g:设置JVM最大可用内存为1G。
# -Xms1g:设置JVM初始内存1g。此值可以设置与-Xmx相同,以避免每次垃圾回收完成后JVM重新分配内存
# -Xmn512m:设置年轻代大小为512m。整个JVM内存大小=年轻代大小 + 年老代大小 + 持久代大小。
# 持久代一般固定大小为64m,所以增大年轻代,将会减小年老代大小。此值对系统性能影响较大,Sun官方推荐配置为整个堆的3/8
# -XX:MetaspaceSize=64m:存储class的内存大小,该值越大触发Metaspace GC的时机就越晚
# -XX:MaxMetaspaceSize=256m:限制Metaspace增长的上限,防止因为某些情况导致Metaspace无限的使用本地内存,影响到其他程序
# -XX:-OmitStackTraceInFastThrow:解决重复异常不打印堆栈信息问题
#==========================================================================================
JAVA_OPT="-server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=256m"
JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow"
#=======================================================
# 将命令启动相关日志追加到日志文件
#=======================================================
# 输出项目名称
STARTUP_LOG="${STARTUP_LOG}application name: ${APPLICATION}\n"
# 输出jar包名称
STARTUP_LOG="${STARTUP_LOG}application jar name: ${APPLICATION_JAR}\n"
# 输出项目bin路径
STARTUP_LOG="${STARTUP_LOG}application bin path: ${BIN_PATH}\n"
# 输出项目根目录
STARTUP_LOG="${STARTUP_LOG}application root path: ${BASE_PATH}\n"
# 打印日志路径
STARTUP_LOG="${STARTUP_LOG}application log path: ${LOG_PATH}\n"
# 打印JVM配置
STARTUP_LOG="${STARTUP_LOG}application JAVA_OPT : ${JAVA_OPT}\n"
# 打印启动命令
STARTUP_LOG="${STARTUP_LOG}application background startup command: nohup java ${JAVA_OPT} -jar ${BASE_PATH}/lib/${APPLICATION_JAR} --spring.config.location=${CONFIG_DIR} --logging.config=${CONFIG_DIR}logback.xml > ${LOG_PATH} 2>&1 &\n"
#======================================================================
# 执行启动命令:后台启动项目,并将日志输出到项目根目录下的logs文件夹下
#======================================================================
nohup java ${JAVA_OPT} -jar ${BASE_PATH}/lib/${APPLICATION_JAR} --spring.config.location=${CONFIG_DIR} --logging.config=${CONFIG_DIR}logback.xml > ${LOG_PATH} 2>&1 &
# 进程ID
PID=$(ps -ef | grep ${APPLICATION_JAR} | grep -v grep | awk '{ print $2 }')
STARTUP_LOG="${STARTUP_LOG}application pid: ${PID}\n"
# 启动日志追加到启动日志文件中
echo -e ${STARTUP_LOG} >> ${LOG_STARTUP_PATH}
# 打印启动日志
echo -e ${STARTUP_LOG}
# 打印项目日志
tail -f ${LOG_PATH}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019-2029 geekidea(https://github.com/geekidea)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.geekidea.springbootplus</groupId>
<artifactId>parent</artifactId>
<version>2.0</version>
</parent>
<artifactId>distribution</artifactId>
<name>distribution</name>
<description>项目打包模块</description>
<profiles>
<profile>
<id>release</id>
<dependencies>
<dependency>
<groupId>io.geekidea.springbootplus</groupId>
<artifactId>bootstrap</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>bin</directory>
<filtering>true</filtering>
<targetPath>bin</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<configuration>
<finalName>${assembly.name}</finalName>
<descriptors>
<descriptor>release.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release-admin</id>
<build>
<resources>
<resource>
<directory>admin</directory>
<filtering>true</filtering>
<targetPath>admin</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<configuration>
<finalName>${assembly.name}-admin</finalName>
<descriptors>
<descriptor>release-admin.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019-2029 geekidea(https://github.com/geekidea)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly>
<id>admin</id>
<includeBaseDirectory>true</includeBaseDirectory>
<formats>
<format>dir</format>
<format>tar.gz</format>
<format>zip</format>
</formats>
<fileSets>
<!--
0755->即用户具有读/写/执行权限,组用户和其它用户具有读写权限;
0644->即用户具有读写权限,组用户和其它用户具有只读权限;
-->
<fileSet>
<directory>target/classes/admin/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>admin/config</directory>
<outputDirectory>config</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>admin/logs</directory>
<outputDirectory>logs</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>../admin/target/classes</directory>
<includes>
<include>application.yml</include>
</includes>
<outputDirectory>config</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>../admin/target</directory>
<includes>
<include>*.jar</include>
</includes>
<outputDirectory>lib</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>../</directory>
<includes>
<include>LICENSE</include>
<include>README.md</include>
</includes>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019-2029 geekidea(https://github.com/geekidea)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly>
<id>server</id>
<includeBaseDirectory>true</includeBaseDirectory>
<formats>
<format>dir</format>
<format>tar.gz</format>
<format>zip</format>
</formats>
<fileSets>
<!--
0755->即用户具有读/写/执行权限,组用户和其它用户具有读写权限;
0644->即用户具有读写权限,组用户和其它用户具有只读权限;
-->
<fileSet>
<directory>target/classes/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<includes>
<include>config/**</include>
</includes>
</fileSet>
<fileSet>
<includes>
<include>logs/**</include>
</includes>
</fileSet>
<fileSet>
<directory>../config/target/classes/config</directory>
<outputDirectory>config</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>../</directory>
<includes>
<include>LICENSE</include>
<include>README.md</include>
</includes>
</fileSet>
</fileSets>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>io.geekidea.springbootplus:bootstrap</include>
</includes>
<binaries>
<!-- 将依赖的jar包抽取到lib目录中 -->
<outputDirectory>lib/</outputDirectory>
<unpack>false</unpack>
<dependencySets>
<dependencySet>
<outputDirectory>lib/</outputDirectory>
</dependencySet>
</dependencySets>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment