Commit a3f6a428 authored by hanbing's avatar hanbing

系统管理-设备管理-厂商管理

parent f1afad27
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
<beanutils.version>1.9.4</beanutils.version> <beanutils.version>1.9.4</beanutils.version>
<httpclient.version>4.5.13</httpclient.version> <httpclient.version>4.5.13</httpclient.version>
<jedis.version>3.3.0</jedis.version> <jedis.version>3.3.0</jedis.version>
<pagehelper.boot.version>1.3.1</pagehelper.boot.version>
<jersey.version>2.23.2</jersey.version>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->
...@@ -148,6 +150,18 @@ ...@@ -148,6 +150,18 @@
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>${jedis.version}</version> <version>${jedis.version}</version>
</dependency> </dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- jersey -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${jersey.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
...@@ -134,6 +134,15 @@ ...@@ -134,6 +134,15 @@
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
</dependency> </dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package net.wanji.utc.controller;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
import org.springframework.beans.factory.annotation.Autowired;
import javax.ws.rs.core.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 系统管理-厂商管理
*
* @author Kent HAN
* @date 2022/11/24 8:32
*/
@Api(value = "系统管理-厂商管理", description = "系统管理-厂商管理")
@RequestMapping("/manufacturer")
@RestController
public class ManufacturerAdminController {
@Autowired
ManufacturerService manufacturerService;
@ApiOperation(value = "厂商列表", notes = "厂商列表", response = ManufacturerInfoPO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/list",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = ManufacturerInfoPO.class),
})
public ResponseEntity list(@RequestBody ManufacturerListInVO manufacturerListInVO) {
PageInfo<ManufacturerInfoPO> manufacturerInfoPOPageInfo = manufacturerService.list(manufacturerListInVO);
return ResponseEntity.ok(manufacturerInfoPOPageInfo);
}
//添加或修改
//删除
}
...@@ -17,4 +17,6 @@ public interface ManufacturerInfoMapper { ...@@ -17,4 +17,6 @@ public interface ManufacturerInfoMapper {
ManufacturerInfoPO selectById(@Param("manufacturerId") Integer manufacturerId); ManufacturerInfoPO selectById(@Param("manufacturerId") Integer manufacturerId);
List<ManufacturerInfoPO> selectAll(); List<ManufacturerInfoPO> selectAll();
List<ManufacturerInfoPO> selectByOptionalName(@Param("name") String name);
} }
package net.wanji.utc.po; package net.wanji.utc.po;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -10,29 +11,30 @@ import java.util.Date; ...@@ -10,29 +11,30 @@ import java.util.Date;
* @date 2022/11/15 16:47 * @date 2022/11/15 16:47
*/ */
@Data @Data
@ApiModel(value = "ManufacturerInfoPO", description = "查询厂商列表返回值")
public class ManufacturerInfoPO { public class ManufacturerInfoPO {
/** 厂商ID */ /** 厂商ID */
@ApiModelProperty(name = "厂商ID",notes = "") @ApiModelProperty(value = "厂商ID",notes = "")
private Integer id ; private Integer id ;
/** 厂商代码 */ /** 厂商代码 */
@ApiModelProperty(name = "厂商代码",notes = "") @ApiModelProperty(value = "厂商代码",notes = "")
private String code ; private String code ;
/** 厂商名称 */ /** 厂商名称 */
@ApiModelProperty(name = "厂商名称",notes = "") @ApiModelProperty(value = "厂商名称",notes = "")
private String name ; private String name ;
/** 厂商简称 */ /** 厂商简称 */
@ApiModelProperty(name = "厂商简称",notes = "") @ApiModelProperty(value = "厂商简称",notes = "")
private String nickName ; private String nickName ;
/** 平台地址 */ /** 平台地址 */
@ApiModelProperty(name = "平台地址",notes = "") @ApiModelProperty(value = "平台地址",notes = "")
private String address ; private String address ;
/** 维护单位 */ /** 维护单位 */
@ApiModelProperty(name = "维护单位",notes = "") @ApiModelProperty(value = "维护单位",notes = "")
private String maintenanceUnit ; private String maintenanceUnit ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(value = "创建时间",notes = "")
private Date gmtCreate ; private Date gmtCreate ;
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
} }
package net.wanji.utc.service.systemadmin;
import com.github.pagehelper.PageInfo;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
/**
* @author Kent HAN
* @date 2022/11/24 8:49
*/
public interface ManufacturerService {
PageInfo<ManufacturerInfoPO> list(ManufacturerListInVO manufacturerListInVO);
}
package net.wanji.utc.service.systemadmin.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Kent HAN
* @date 2022/11/24 8:50
*/
@Service
public class ManufacturerServiceImpl implements ManufacturerService {
@Autowired
ManufacturerInfoMapper manufacturerInfoMapper;
@Override
public PageInfo<ManufacturerInfoPO> list(ManufacturerListInVO manufacturerListInVO) {
Integer pageNum = manufacturerListInVO.getPageNum();
Integer pageSize = manufacturerListInVO.getPageSize();
String name = manufacturerListInVO.getName();
PageHelper.startPage(pageNum, pageSize);
List<ManufacturerInfoPO> manufacturerInfoPOList = manufacturerInfoMapper.selectByOptionalName(name);
PageInfo<ManufacturerInfoPO> borrowPOPageInfo = new PageInfo<>(manufacturerInfoPOList);
return borrowPOPageInfo;
}
}
package net.wanji.utc.vo.systemadmin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Kent HAN
* @date 2022/11/24 8:41
*/
@Data
@ApiModel(value = "ManufacturerListInVO", description = "查询厂商列表输入参数")
public class ManufacturerListInVO {
@ApiModelProperty(required = true, value = "页号")
Integer pageNum;
@ApiModelProperty(required = true, value = "每页记录数")
Integer pageSize;
@ApiModelProperty( value = "厂商名称")
String name;
}
...@@ -4,6 +4,9 @@ spring: ...@@ -4,6 +4,9 @@ spring:
mvc: mvc:
pathmatch: pathmatch:
matching-strategy: ant_path_matcher matching-strategy: ant_path_matcher
main:
allow-circular-references: true
server: server:
undertow: undertow:
url-charset: UTF-8 url-charset: UTF-8
...@@ -28,6 +31,7 @@ server: ...@@ -28,6 +31,7 @@ server:
enabled: true enabled: true
# 设置访问日志所在目录 # 设置访问日志所在目录
dir: logs dir: logs
mybatis-plus: mybatis-plus:
mapper-locations: classpath:mapper/*.xml mapper-locations: classpath:mapper/*.xml
typeAliasesPackage: net.wanji.utc.entity typeAliasesPackage: net.wanji.utc.entity
...@@ -44,3 +48,9 @@ mybatis-plus: ...@@ -44,3 +48,9 @@ mybatis-plus:
auto-mapping-unknown-column-behavior: warning auto-mapping-unknown-column-behavior: warning
#开启SQL打印 #开启SQL打印
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
...@@ -30,4 +30,15 @@ ...@@ -30,4 +30,15 @@
id,code,name,nick_name,address,maintenance_unit,gmt_create,gmt_modified id,code,name,nick_name,address,maintenance_unit,gmt_create,gmt_modified
from t_manufacturer_info from t_manufacturer_info
</select> </select>
<select id="selectByOptionalName" resultMap="BaseResultMap">
select id,code,name,nick_name,address,maintenance_unit,gmt_create,gmt_modified
from t_manufacturer_info
<where>
<if test="name != null and name != ''">
AND name LIKE CONCAT('%',#{name},'%')
</if>
</where>
order by id
</select>
</mapper> </mapper>
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