From 522982a07e1bf9d0affe7195ae8df83c0eb0afa3 Mon Sep 17 00:00:00 2001 From: "haiji.yang" Date: Sun, 5 Apr 2020 00:40:14 +0800 Subject: [PATCH] update --- .../controller/SysLogisticsController.java | 88 ++++++++++++++++++ .../syslogistics/dao/SysLogisticsMapper.java | 50 +++++++++++ .../api/syslogistics/pojo/SysLogistics.java | 89 ++++++++++++++++++ .../pojo/dto/SysLogisticsDTO.java | 90 +++++++++++++++++++ .../service/ISysLogisticsService.java | 47 ++++++++++ .../service/impl/SysLogisticsServiceImpl.java | 76 ++++++++++++++++ .../generator/config/GenerateConfig.java | 4 +- 7 files changed, 442 insertions(+), 2 deletions(-) create mode 100644 javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/controller/SysLogisticsController.java create mode 100644 javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/dao/SysLogisticsMapper.java create mode 100644 javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/pojo/SysLogistics.java create mode 100644 javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/pojo/dto/SysLogisticsDTO.java create mode 100644 javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/service/ISysLogisticsService.java create mode 100644 javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/service/impl/SysLogisticsServiceImpl.java diff --git a/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/controller/SysLogisticsController.java b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/controller/SysLogisticsController.java new file mode 100644 index 0000000..ada0d40 --- /dev/null +++ b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/controller/SysLogisticsController.java @@ -0,0 +1,88 @@ +/** + * 版权所属: Java有货 + * 作者:杨海吉 + * 版本:V1.0 + * 创建日期:2020-04-05 + * 修改日期:2020-04-05 + */ +package com.javayh.api.syslogistics.controller; + +import com.javayh.common.result.ResultData; +import com.javayh.common.page.PageQuery; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.beans.factory.annotation.Autowired; +import com.javayh.api.syslogistics.pojo.SysLogistics; +import com.javayh.api.syslogistics.pojo.dto.SysLogisticsDTO; +import com.javayh.api.syslogistics.service.ISysLogisticsService; + +/** + *

* Controller + *

* @author:Dylan + * @version:V1.0 + * @since:2020-04-05 + */ +@RestController +@Api(tags = "") +@RequestMapping("/sys/logistics") +public class SysLogisticsController { + + @Autowired + private ISysLogisticsService sysLogisticsServiceImpl; + + /** + * 根据条件查找-分页 + */ + @ApiOperation(value = "根据条件查找-分页") + @PostMapping(value = "/findByPage") + public ResultData findByPage (@RequestBody SysLogisticsDTO sysLogisticsDTO){ + return ResultData.success(sysLogisticsServiceImpl.findByPage(sysLogisticsDTO)); + } + + /** + * 根据id查询 + */ + @ApiOperation(value = "根据id查询") + @GetMapping(value = "/findById") + public ResultData findById(Integer id){ + return ResultData.success(sysLogisticsServiceImpl.findById(id)); + } + + /** + * 添加数据 + */ + @ApiOperation(value = "添加数据") + @PostMapping(value = "/insert") + public ResultData insert(@RequestBody SysLogistics sysLogistics){ + sysLogisticsServiceImpl.insert(sysLogistics); + return ResultData.success(); + } + + /** + * 修改数据 + */ + @ApiOperation(value = "修改数据") + @PutMapping(value = "/update") + public ResultData update(@RequestBody SysLogistics sysLogistics){ + sysLogisticsServiceImpl.update(sysLogistics); + return ResultData.success(); + } + + /** + * 根据id删除 + */ + @ApiOperation(value = "根据id删除") + @DeleteMapping(value = "/deleteById") + public ResultData deleteById(Integer id){ + sysLogisticsServiceImpl.deleteById(id); + return ResultData.success(); + } + +} diff --git a/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/dao/SysLogisticsMapper.java b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/dao/SysLogisticsMapper.java new file mode 100644 index 0000000..4261ae2 --- /dev/null +++ b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/dao/SysLogisticsMapper.java @@ -0,0 +1,50 @@ +/** + * 版权所属: Java有货 + * 作者:杨海吉 + * 版本:V1.0 + * 创建日期:2020-04-05 + * 修改日期:2020-04-05 + */ +package com.javayh.api.syslogistics.dao; + +import com.javayh.api.syslogistics.pojo.SysLogistics; +import com.javayh.api.syslogistics.pojo.dto.SysLogisticsDTO; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Mapper; +import java.util.List; + +/** + *

* iMapper + *

* @author:Dylan + * @version:V1.0 + * @since:2020-04-05 + */ +@Mapper +public interface SysLogisticsMapper{ + + /** + * 分页查询 + */ + List findByPage( SysLogisticsDTO sysLogisticsDTO); + + + /** + * 根据id查找 + */ + SysLogistics findById(@Param("id") Integer id); + + /** + * 新增 + */ + int insert(SysLogistics sysLogistics); + + /** + * 修改 + */ + int update(SysLogistics sysLogistics); + + /** + * 根据id删除 + */ + int deleteById(@Param("id") Integer id); +} diff --git a/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/pojo/SysLogistics.java b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/pojo/SysLogistics.java new file mode 100644 index 0000000..a7c360e --- /dev/null +++ b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/pojo/SysLogistics.java @@ -0,0 +1,89 @@ +/** + * 版权所属: Java有货 + * 作者:杨海吉 + * 版本:V1.0 + * 创建日期:2020-04-05 + * 修改日期:2020-04-05 + */ +package com.javayh.api.syslogistics.pojo; + +import lombok.*; + +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +/** + *

* Bean + *

* @author:Dylan + * @version:V1.0 + * @since:2020-04-05 + */ +@SuppressWarnings("serial") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ToString +public class SysLogistics implements java.io.Serializable{ + + /** + * + */ + @ApiModelProperty(hidden = true) + private Integer id; + /** + * 收件人 + */ + @ApiModelProperty(value = "收件人") + private String addresseeName; + /** + * 收件人地址 + */ + @ApiModelProperty(value = "收件人地址") + private String addressee; + /** + * + */ + @ApiModelProperty(hidden = true) + private Integer addresseePhone; + /** + * 寄件人 + */ + @ApiModelProperty(value = "寄件人") + private String senderName; + /** + * 寄件人地址 + */ + @ApiModelProperty(value = "寄件人地址") + private String senderAdd; + /** + * 0,已接单,1,已发货,2,已签收 + */ + @ApiModelProperty(value = "0,已接单,1,已发货,2,已签收") + private Integer emsStatus; + /** + * 0,为退货,1,退货中,2,已退货 + */ + @ApiModelProperty(value = "0,为退货,1,退货中,2,已退货") + private Integer retreatStatus; + /** + * 退货原因 + */ + @ApiModelProperty(value = "退货原因") + private String retreatInfo; + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Date createDate; + /** + * + */ + @ApiModelProperty(hidden = true) + private Date updateDate; + /** + * 操作人 + */ + @ApiModelProperty(value = "操作人") + private String createBy; + +} diff --git a/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/pojo/dto/SysLogisticsDTO.java b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/pojo/dto/SysLogisticsDTO.java new file mode 100644 index 0000000..bf3106f --- /dev/null +++ b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/pojo/dto/SysLogisticsDTO.java @@ -0,0 +1,90 @@ +/** + * 版权所属: Java有货 + * 作者:杨海吉 + * 版本:V1.0 + * 创建日期:2020-04-05 + * 修改日期:2020-04-05 + */ +package com.javayh.api.syslogistics.pojo.dto; + +import lombok.*; +import com.javayh.common.page.PageEntity; + +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +/** + *

* Bean + *

* @author:Dylan + * @version:V1.0 + * @since:2020-04-05 + */ +@SuppressWarnings("serial") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ToString +public class SysLogisticsDTO extends PageEntity implements java.io.Serializable{ + + /** + * + */ + @ApiModelProperty(hidden = true) + private Integer id; + /** + * 收件人 + */ + @ApiModelProperty(value = "收件人") + private String addresseeName; + /** + * 收件人地址 + */ + @ApiModelProperty(value = "收件人地址") + private String addressee; + /** + * + */ + @ApiModelProperty(hidden = true) + private Integer addresseePhone; + /** + * 寄件人 + */ + @ApiModelProperty(value = "寄件人") + private String senderName; + /** + * 寄件人地址 + */ + @ApiModelProperty(value = "寄件人地址") + private String senderAdd; + /** + * 0,已接单,1,已发货,2,已签收 + */ + @ApiModelProperty(value = "0,已接单,1,已发货,2,已签收") + private Integer emsStatus; + /** + * 0,为退货,1,退货中,2,已退货 + */ + @ApiModelProperty(value = "0,为退货,1,退货中,2,已退货") + private Integer retreatStatus; + /** + * 退货原因 + */ + @ApiModelProperty(value = "退货原因") + private String retreatInfo; + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Date createDate; + /** + * + */ + @ApiModelProperty(hidden = true) + private Date updateDate; + /** + * 操作人 + */ + @ApiModelProperty(value = "操作人") + private String createBy; + +} diff --git a/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/service/ISysLogisticsService.java b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/service/ISysLogisticsService.java new file mode 100644 index 0000000..2a2b262 --- /dev/null +++ b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/service/ISysLogisticsService.java @@ -0,0 +1,47 @@ +/** + * 版权所属: Java有货 + * 作者:杨海吉 + * 版本:V1.0 + * 创建日期:2020-04-05 + * 修改日期:2020-04-05 + */ +package com.javayh.api.syslogistics.service; + +import com.javayh.api.syslogistics.pojo.SysLogistics; +import com.javayh.api.syslogistics.pojo.dto.SysLogisticsDTO; +import com.javayh.common.page.PageQuery; + +/** + *

* iService + *

* @author:Dylan + * @version:V1.0 + * @since:2020-04-05 + */ +public interface ISysLogisticsService { + /** + * 根据条件查找-分页 + */ + PageQuery findByPage (SysLogisticsDTO sysLogisticsDTO); + + /** + * 根据id查询 + */ + SysLogistics findById(Integer id); + + + /** + * 添加数据 + */ + int insert(SysLogistics sysLogistics); + + /** + * 修改数据 + */ + int update(SysLogistics sysLogistics); + + /** + * 根据id删除 + */ + int deleteById(Integer id); + +} diff --git a/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/service/impl/SysLogisticsServiceImpl.java b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/service/impl/SysLogisticsServiceImpl.java new file mode 100644 index 0000000..bb249a8 --- /dev/null +++ b/javayh-demo/javayh-demo-api/src/main/java/com/javayh/api/syslogistics/service/impl/SysLogisticsServiceImpl.java @@ -0,0 +1,76 @@ +/** + * 版权所属: Java有货 + * 作者:杨海吉 + * 版本:V1.0 + * 创建日期:2020-04-05 + * 修改日期:2020-04-05 + */ +package com.javayh.api.syslogistics.service.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.javayh.common.page.PageQuery; +import com.github.pagehelper.PageHelper; +import java.util.List; + +import com.javayh.api.syslogistics.pojo.SysLogistics; +import com.javayh.api.syslogistics.pojo.dto.SysLogisticsDTO; +import com.javayh.api.syslogistics.dao.SysLogisticsMapper; +import com.javayh.api.syslogistics.service.ISysLogisticsService; + +/** + *

* ServiceImpl + *

* @author:Dylan + * @version:V1.0 + * @since:2020-04-05 + */ +@Service +public class SysLogisticsServiceImpl implements ISysLogisticsService { + + @Autowired + private SysLogisticsMapper sysLogisticsMapper; + + /** + * 根据条件查询-分页 + */ + @Override + public PageQuery findByPage (SysLogisticsDTO sysLogisticsDTO){ + PageHelper.startPage(sysLogisticsDTO.getPageNo(),sysLogisticsDTO.getPageSize()); + List sysLogisticsList = sysLogisticsMapper.findByPage(sysLogisticsDTO); + PageQuery page = PageQuery.ofPage(sysLogisticsList); + return page; + } + + /** + * 根据id查询 + */ + @Override + public SysLogistics findById(Integer id){ + return sysLogisticsMapper.findById(id); + } + + /** + * 添加数据 + */ + @Override + public int insert(SysLogistics sysLogistics){ + return sysLogisticsMapper.insert(sysLogistics); + } + + /** + * 修改数据 + */ + @Override + public int update(SysLogistics sysLogistics){ + return sysLogisticsMapper.update(sysLogistics); + } + + /** + * 根据id删除 + */ + @Override + public int deleteById(Integer id){ + return sysLogisticsMapper.deleteById(id); + } + +} diff --git a/javayh-plugins/javayh-generator/src/main/java/com/javayh/generator/config/GenerateConfig.java b/javayh-plugins/javayh-generator/src/main/java/com/javayh/generator/config/GenerateConfig.java index 6bb2fae..3409d2c 100644 --- a/javayh-plugins/javayh-generator/src/main/java/com/javayh/generator/config/GenerateConfig.java +++ b/javayh-plugins/javayh-generator/src/main/java/com/javayh/generator/config/GenerateConfig.java @@ -39,8 +39,8 @@ public class GenerateConfig { //数据信息 必填 public final static String jdbcDriverClassName="com.mysql.jdbc.Driver"; - public final static String jdbcUrl="jdbc:mysql://47.105.196.42:3306/db1?serverTimezone=CTT&characterEncoding=utf8&autoReconnect=true&useUnicode=true&useSSL=true";//数据库地址 + public final static String jdbcUrl="jdbc:mysql://localhost:3306/db1?serverTimezone=CTT&characterEncoding=utf8&autoReconnect=true&useUnicode=true&useSSL=true";//数据库地址 public final static String jdbcName="db1";//数据库名 public final static String jdbcUsername="root";//用户名 - public final static String jdbcPassword="Yhj1219320";//密码 + public final static String jdbcPassword="root";//密码 }