diff --git a/adc-da-main/src/main/resources/application-dev.properties b/adc-da-main/src/main/resources/application-dev.properties index ccba8463..50d13982 100644 --- a/adc-da-main/src/main/resources/application-dev.properties +++ b/adc-da-main/src/main/resources/application-dev.properties @@ -2,24 +2,26 @@ #============================================= # 数据库配置 #============================================= +# dev config +#============================================= +# 数据库配置 +#============================================= spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver -spring.datasource.url = jdbc:mysql://39.100.23.127:3306/foton_slrs_test2?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false -#spring.datasource.url = jdbc:mysql://10.96.10.171/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false +#spring.datasource.url = jdbc:mysql://39.100.23.127:3306/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false +spring.datasource.url = jdbc:mysql://10.96.10.171/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false spring.datasource.username = root spring.datasource.password = root - - #============================================== # 应用设置 -spring.application.name=FotonLAWSSystem +spring.application.name=FotonLAWSSystem-zyh application.code=20200101 application.center=1 #============================================== #Eruept eureka.client.allow-redirects=true eureka.client.register-with-eureka=true -eureka.client.service-url.defaultZone=http://62.234.136.153:8761/eureka/ +eureka.client.service-url.defaultZone=http://10.96.10.171:8761/eureka/ #============================================== # 邮箱配置1 @@ -44,10 +46,16 @@ spring.mail.port=587 #spring.rabbitmq.username=uat_pcms #spring.rabbitmq.password=VxsBLL5bJruwzXfS # spring.rabbitmq.publisher-confirms=true -spring.rabbitmq.host=62.234.118.181 + +#spring.rabbitmq.host=192.168.10.248 +#spring.rabbitmq.port=5672 +#spring.rabbitmq.username=ca +#spring.rabbitmq.password=cs986432 +spring.rabbitmq.host=localhost spring.rabbitmq.port=5672 -spring.rabbitmq.username=admin -spring.rabbitmq.password=admin +spring.rabbitmq.virtual-host=/ +spring.rabbitmq.username=guest +spring.rabbitmq.password=guest # ============================================== # 文档存储路径指向 # ============================================== diff --git a/adc-da-main/src/main/resources/application.properties b/adc-da-main/src/main/resources/application.properties index d39b475a..9bea6fa9 100644 --- a/adc-da-main/src/main/resources/application.properties +++ b/adc-da-main/src/main/resources/application.properties @@ -1,6 +1,3 @@ -############################################## -# 项目启动模式 -############################################## spring.profiles.active=dev ############################################## @@ -39,7 +36,7 @@ eureka.client.fetch-registry=true #eureka.client.service-url.defaultZone=http://127.0.0.1:8671/eureka/ #eureka.client.service-url.defaultZone=http://10.5.116.172:8672/eureka/ -eureka.client.service-url.defaultZone=http://62.234.136.153:8761/eureka/ +eureka.client.service-url.defaultZone=http://10.96.10.171:8761/eureka/ # 请求连接的超时时间 默认的时间为 1 秒 ribbon.ConnectTimeout=500000 @@ -137,13 +134,13 @@ file.path=D:/uploadfile/bus # 文件下载地址参数 file.downloadUrl=http://39.98.140.126:10001/uploadPath #上传文件白名单-以,分隔 -upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt +upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg # ============================================================================= # elasticsearch 配置 # ============================================================================= elasticsearch.clustername=elasticsearch -elasticsearch.ip=172.17.0.1 +elasticsearch.ip=192.168.10.47 elasticsearch.port=9300 elasticsearch.poolSize=5 elas.flag=true diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/controller/SarStandPartCodeApplyController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/controller/SarStandPartCodeApplyController.java index bc26ef9c..32fb0284 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/controller/SarStandPartCodeApplyController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/controller/SarStandPartCodeApplyController.java @@ -1,56 +1,109 @@ -//package com.adc.da.slrs.sarStandPartCodeApply.controller; -// -//import com.adc.da.base.web.BaseController; -//import com.adc.da.http.ResponseMessage; -//import com.adc.da.http.Result; -//import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApply; -//import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApplyPage; -//import com.adc.da.slrs.sarStandPartCodeApply.service.ISarStandPartCodeApplyService; -//import com.adc.da.slrs.sarStandardsInfo.controller.SarStandardsInfoController; -//import com.baomidou.mybatisplus.core.metadata.IPage; -//import io.swagger.annotations.Api; -//import io.swagger.annotations.ApiOperation; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.beans.factory.annotation.Autowired; -//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; -// -//import java.util.Date; -//import java.util.List; -// -//@RestController -//@Api(tags = "零部件编号申请") -//@RequestMapping("/api/sarStandPartCodeApply")//前端和后端对的接口 -//public class SarStandPartCodeApplyController extends BaseController { -// -// //创建日志实例 -// private static final Logger logger = LoggerFactory.getLogger(SarStandardsInfoController.class); -// -// @Autowired -// private ISarStandPartCodeApplyService sarStandPartCodeApplyService; -// -// @ApiOperation("零部件编号申请新增") -// @PostMapping("/add") -// public ResponseMessage add(@RequestBody List sarStandPartCodeApply){ -// sarStandPartCodeApply.forEach(sarStandPartCodeApply1 -> sarStandPartCodeApply1.setCreateTime(new Date())); -// if (sarStandPartCodeApplyService.saveBatch(sarStandPartCodeApply)){ -// return Result.success("新增成功"); -// } -// else { -// return Result.error("新增失败"); -// } -// } -// -// /** -// * 分页查询零部件 -// * @param sarStandPartCodeApplyPage: 筛选、分页信息 -// * @return IPage -// */ -// public ResponseMessage> getSarStandPartCodeApplyPage(SarStandPartCodeApplyPage sarStandPartCodeApplyPage){ -// IPage sarStandPartCodeApplyIPage = sarStandPartCodeApplyService.getSarStandPartCodeApplyPage(sarStandPartCodeApplyPage); -// return Result.success(sarStandPartCodeApplyIPage); -// } -//} +package com.adc.da.slrs.sarStandPartCodeApply.controller; + +import com.adc.da.base.web.BaseController; +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; +import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApply; +import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApplyPage; +import com.adc.da.slrs.sarStandPartCodeApply.entity.StandPartCodeExcelVO; +import com.adc.da.slrs.sarStandPartCodeApply.service.ISarStandPartCodeApplyService; +import com.adc.da.slrs.sarStandardsInfo.controller.SarStandardsInfoController; +import com.alibaba.excel.EasyExcel; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +@RestController +@Api(tags = "零部件编号申请", value = "SarStandPartCodeApplyController", description = "零部件编号申请控制类") +@RequestMapping("/api/sarStandPartCodeApply")//前端和后端对的接口 +public class SarStandPartCodeApplyController extends BaseController { + + //创建日志实例 + private static final Logger logger = LoggerFactory.getLogger(SarStandardsInfoController.class); + + @Autowired + private ISarStandPartCodeApplyService sarStandPartCodeApplyService; + + @ApiOperation("零部件编号申请新增") + @PostMapping("/add") + public ResponseMessage add(@RequestBody List sarStandPartCodeApply) { + sarStandPartCodeApply.forEach(sarStandPartCodeApply1 -> sarStandPartCodeApply1.setCreateTime(new Date())); + if (sarStandPartCodeApplyService.saveBatch(sarStandPartCodeApply)) { + return Result.success("新增成功"); + } else { + return Result.error("新增失败"); + } + } + + /** + * 分页查询零部件 + * + * @param sarStandPartCodeApplyPage: 筛选、分页信息 + * @return IPage + */ + @ApiOperation("分页查询零部件") + @GetMapping + public ResponseMessage> getSarStandPartCodeApplyPage(SarStandPartCodeApplyPage sarStandPartCodeApplyPage) { + IPage sarStandPartCodeApplyIPage = sarStandPartCodeApplyService.getSarStandPartCodeApplyPage(sarStandPartCodeApplyPage); + return Result.success(sarStandPartCodeApplyIPage); + } + + /** + * 批量删除零部件 + * + * @param idList + * @return + */ + @ApiOperation(value = "批量删除零部件") + @PostMapping("/deleteListAll") + public ResponseMessage deleteListAll(String[] idList) { + if (idList == null || idList.length == 0) { + return Result.success("200", "要删除的数据为空"); + } else { + List list = new ArrayList<>(Arrays.asList(idList)); + String src = sarStandPartCodeApplyService.del(list); + return Result.success("200", src); + } + } + + @ApiOperation("导出Excel表") + @GetMapping(value = "exportPartInfoExcel") + public void exportPartInfoExcel(StandPartCodeExcelVO standPartCodeExcelVO, HttpServletResponse response) throws Exception { + // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman + try { + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 + if (standPartCodeExcelVO.getExportName() == null) { + standPartCodeExcelVO.setExportName("零部件申请信息"); + } + String fileName = URLEncoder.encode(standPartCodeExcelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + List data = sarStandPartCodeApplyService.getPartInfoExcelData(standPartCodeExcelVO); + //这里需要设置不关闭流 + EasyExcel.write(response.getOutputStream(), SarStandPartCodeApply.class).autoCloseStream(Boolean.FALSE) + .sheet("sheet1").doWrite(data); + } catch (Exception e) { + System.out.println(e); + //重置response + response.reset(); + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + response.getWriter().println(JSON.toJSONString(Result.error())); + } + } + + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/dao/SarStandPartCodeApplyDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/dao/SarStandPartCodeApplyDao.java index 76921954..a51ef362 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/dao/SarStandPartCodeApplyDao.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/dao/SarStandPartCodeApplyDao.java @@ -1,15 +1,15 @@ -//package com.adc.da.slrs.sarStandPartCodeApply.dao; -// -//import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApply; -//import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApplyPage; -//import com.baomidou.mybatisplus.core.mapper.BaseMapper; -//import com.baomidou.mybatisplus.core.metadata.IPage; -//import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -//import org.apache.ibatis.annotations.Mapper; -//import org.apache.ibatis.annotations.Param; -// -//@Mapper -//public interface SarStandPartCodeApplyDao extends BaseMapper { -// IPage getAllDatasByPage(Page page, @Param("sar")SarStandPartCodeApplyPage sarStandPartCodeApply); -// -//} +package com.adc.da.slrs.sarStandPartCodeApply.dao; + +import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApply; +import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApplyPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface SarStandPartCodeApplyDao extends BaseMapper { + IPage getAllDatasByPage(Page page, @Param("sar")SarStandPartCodeApplyPage sarStandPartCodeApply); + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/SarStandPartCodeApply.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/SarStandPartCodeApply.java index 46a2cf72..a8b93259 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/SarStandPartCodeApply.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/SarStandPartCodeApply.java @@ -1,84 +1,84 @@ -//package com.adc.da.slrs.sarStandPartCodeApply.entity; -// -//import com.adc.da.base.entity.BaseEntity; -//import com.alibaba.excel.annotation.ExcelIgnore; -//import com.alibaba.excel.annotation.ExcelProperty; -//import com.baomidou.mybatisplus.annotation.IdType; -//import com.baomidou.mybatisplus.annotation.TableField; -//import com.baomidou.mybatisplus.annotation.TableId; -//import com.fasterxml.jackson.annotation.JsonFormat; -//import io.swagger.annotations.ApiModel; -//import io.swagger.annotations.ApiModelProperty; -//import lombok.Data; -//import lombok.EqualsAndHashCode; -//import lombok.experimental.Accessors; -//import org.springframework.format.annotation.DateTimeFormat; -// -//import java.util.Date; -// -//@Data -//@EqualsAndHashCode(callSuper = true) -//@Accessors(chain = true) -//@ApiModel(value = "SarStandPartCodeApply对象",description = "SarStandPartCodeApply基础表里的所有属性") -//public class SarStandPartCodeApply extends BaseEntity { -// -// //版本号 -// private static final long serialVersionUID = 1L; -// -// @ExcelIgnore//这个字段在导出Excel的时候不显示在Excel表头里 -// @ApiModelProperty(value = "主键")//接口标志 -// @TableId(type = IdType.UUID)//数据库表里的主键 -// private String id; -// -// @ExcelProperty("子组号")//Excel里的表头显示的是什么 -// @ApiModelProperty(value = "子组号")//接口标志 -// @TableField("SUBGROUP_NUMBER")//数据库表里的字段 -// private String subgroupNumber; -// -// @ExcelProperty("子组结构号")//Excel里的表头显示的是什么 -// @ApiModelProperty(value = "子组结构号")//接口标志 -// @TableField("SUBGROUP_STRUCTURE_NUMBER")//数据库表里的字段 -// private String subgroupStructureNumber; -// -// @ExcelProperty("子组结构名称")//Excel里的表头显示的是什么 -// @ApiModelProperty(value = "子组结构名称")//接口标志 -// @TableField("SUBGROUP_STRUCTURE_NAME")//数据库表里的字段 -// private String subgroupStructureName; -// -// @ExcelProperty("分组代号")//Excel里的表头显示的是什么 -// @ApiModelProperty(value = "分组代号")//接口标志 -// @TableField("GROUP_CODE")//数据库表里的字段 -// private String groupCode; -// -// @ExcelProperty("零部件分类名称")//Excel里的表头显示的是什么 -// @ApiModelProperty(value = "零部件分类名称")//接口标志 -// @TableField("PART_CATEGORY_NAME")//数据库表里的字段 -// private String partCategoryName; -// -// @ExcelProperty("零部件分类代号")//Excel里的表头显示的是什么 -// @ApiModelProperty(value = "零部件分类代号")//接口标志 -// @TableField("PART_CATEGORY_CODE")//数据库表里的字段 -// private String partCategoryCode; -// -// @ExcelProperty("备注")//Excel里的表头显示的是什么 -// @ApiModelProperty(value = "备注")//接口标志 -// @TableField("REMARKS")//数据库表里的字段 -// private String remarks; -// -// @ExcelIgnore//这个字段在导出Excel的时候不显示在Excel表头里 -// @ApiModelProperty(value = "创建部门")//接口标志 -// @TableField("CREATE_DEPT_ID")//数据库表里的字段 -// private String createDeptId; -// -// @ExcelIgnore//这个字段在导出Excel的时候不显示在Excel表头里 -// @ApiModelProperty(value = "创建人")//接口标志 -// @TableField("CREATE_BY_ID")//数据库表里的字段 -// private String createById; -// -// @ExcelIgnore//这个字段在导出Excel的时候不显示在Excel表头里 -// @ApiModelProperty(value = "创建时间")//接口标志 -// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//时间格式化 -// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//时间格式化 -// @TableField("CREATE_TIME")//数据库表里的字段 -// private Date createTime; -//} +package com.adc.da.slrs.sarStandPartCodeApply.entity; + +import com.adc.da.base.entity.BaseEntity; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@ApiModel(value = "SarStandPartCodeApply对象",description = "SarStandPartCodeApply基础表里的所有属性") +public class SarStandPartCodeApply extends BaseEntity { + + //版本号 + private static final long serialVersionUID = 1L; + + @ExcelIgnore//这个字段在导出Excel的时候不显示在Excel表头里 + @ApiModelProperty(value = "主键")//接口标志 + @TableId(type = IdType.UUID)//数据库表里的主键 + private String id; + + @ExcelProperty("子组号")//Excel里的表头显示的是什么 + @ApiModelProperty(value = "子组号")//接口标志 + @TableField("SUBGROUP_NUMBER")//数据库表里的字段 + private String subgroupNumber; + + @ExcelProperty("子组结构号")//Excel里的表头显示的是什么 + @ApiModelProperty(value = "子组结构号")//接口标志 + @TableField("SUBGROUP_STRUCTURE_NUMBER")//数据库表里的字段 + private String subgroupStructureNumber; + + @ExcelProperty("子组结构名称")//Excel里的表头显示的是什么 + @ApiModelProperty(value = "子组结构名称")//接口标志 + @TableField("SUBGROUP_STRUCTURE_NAME")//数据库表里的字段 + private String subgroupStructureName; + + @ExcelProperty("分组代号")//Excel里的表头显示的是什么 + @ApiModelProperty(value = "分组代号")//接口标志 + @TableField("GROUP_CODE")//数据库表里的字段 + private String groupCode; + + @ExcelProperty("零部件分类名称")//Excel里的表头显示的是什么 + @ApiModelProperty(value = "零部件分类名称")//接口标志 + @TableField("PART_CATEGORY_NAME")//数据库表里的字段 + private String partCategoryName; + + @ExcelProperty("零部件分类代号")//Excel里的表头显示的是什么 + @ApiModelProperty(value = "零部件分类代号")//接口标志 + @TableField("PART_CATEGORY_CODE")//数据库表里的字段 + private String partCategoryCode; + + @ExcelProperty("备注")//Excel里的表头显示的是什么 + @ApiModelProperty(value = "备注")//接口标志 + @TableField("REMARKS")//数据库表里的字段 + private String remarks; + + @ExcelIgnore//这个字段在导出Excel的时候不显示在Excel表头里 + @ApiModelProperty(value = "创建部门")//接口标志 + @TableField("CREATE_DEPT_ID")//数据库表里的字段 + private String createDeptId; + + @ExcelIgnore//这个字段在导出Excel的时候不显示在Excel表头里 + @ApiModelProperty(value = "创建人")//接口标志 + @TableField("CREATE_BY_ID")//数据库表里的字段 + private String createById; + + @ExcelIgnore//这个字段在导出Excel的时候不显示在Excel表头里 + @ApiModelProperty(value = "创建时间")//接口标志 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//时间格式化 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//时间格式化 + @TableField("CREATE_TIME")//数据库表里的字段 + private Date createTime; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/SarStandPartCodeApplyPage.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/SarStandPartCodeApplyPage.java index c1f53510..2c5d819f 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/SarStandPartCodeApplyPage.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/SarStandPartCodeApplyPage.java @@ -1,51 +1,51 @@ -//package com.adc.da.slrs.sarStandPartCodeApply.entity; -// -//import io.swagger.annotations.ApiModel; -//import io.swagger.annotations.ApiModelProperty; -//import lombok.Data; -// -//import java.sql.Timestamp; -// -//@Data -//@ApiModel(value = "SarStandPartCodeApply分页",description = "SarStandPartCodeApply对象分页信息") -//public class SarStandPartCodeApplyPage { -// -// @ApiModelProperty(value = "主键") -// private String id; -// -// @ApiModelProperty(value = "子组号") -// private String subgroupNumber; -// -// @ApiModelProperty(value = "子组结构号") -// private String subgroupStructureNumber; -// -// @ApiModelProperty(value = "子组结构名称") -// private String subgroupStructureName; -// -// @ApiModelProperty(value = "分组代号") -// private String groupCode; -// -// @ApiModelProperty(value = "零部件分类名称") -// private String partCategoryName; -// -// @ApiModelProperty(value = "零部件分类代号") -// private String partCategoryCode; -// -// @ApiModelProperty(value = "备注") -// private String remarks; -// -// @ApiModelProperty(value = "创建部门") -// private String createDeptId; -// -// @ApiModelProperty(value = "创建人") -// private String createById; -// -// @ApiModelProperty(value = "创建时间") -// private Timestamp createTime; -// -// @ApiModelProperty("当前页") -// private Integer current; -// -// @ApiModelProperty("每页条数") -// private Integer size; -//} +package com.adc.da.slrs.sarStandPartCodeApply.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.sql.Timestamp; + +@Data +@ApiModel(value = "SarStandPartCodeApply分页",description = "SarStandPartCodeApply对象分页信息") +public class SarStandPartCodeApplyPage { + + @ApiModelProperty(value = "主键") + private String id; + + @ApiModelProperty(value = "子组号") + private String subgroupNumber; + + @ApiModelProperty(value = "子组结构号") + private String subgroupStructureNumber; + + @ApiModelProperty(value = "子组结构名称") + private String subgroupStructureName; + + @ApiModelProperty(value = "分组代号") + private String groupCode; + + @ApiModelProperty(value = "零部件分类名称") + private String partCategoryName; + + @ApiModelProperty(value = "零部件分类代号") + private String partCategoryCode; + + @ApiModelProperty(value = "备注") + private String remarks; + + @ApiModelProperty(value = "创建部门") + private String createDeptId; + + @ApiModelProperty(value = "创建人") + private String createById; + + @ApiModelProperty(value = "创建时间") + private Timestamp createTime; + + @ApiModelProperty("当前页") + private Integer current; + + @ApiModelProperty("每页条数") + private Integer size; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/StandPartCodeExcelVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/StandPartCodeExcelVO.java new file mode 100644 index 00000000..03bb1163 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/entity/StandPartCodeExcelVO.java @@ -0,0 +1,16 @@ +package com.adc.da.slrs.sarStandPartCodeApply.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +@ApiModel(description = "零部件申请ExcelVO类") +public class StandPartCodeExcelVO { + @ApiModelProperty("文件名") + String exportName; + @ApiModelProperty("导出的零部件ID列表") + List ids; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/service/ISarStandPartCodeApplyService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/service/ISarStandPartCodeApplyService.java index b16a1563..d2a1b4dc 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/service/ISarStandPartCodeApplyService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/service/ISarStandPartCodeApplyService.java @@ -1,16 +1,33 @@ -//package com.adc.da.slrs.sarStandPartCodeApply.service; -// -//import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApply; -//import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApplyPage; -//import com.baomidou.mybatisplus.core.metadata.IPage; -//import com.baomidou.mybatisplus.extension.service.IService; -// -//public interface ISarStandPartCodeApplyService extends IService { -// -// /** -// * 分页查询零部件 -// * @param sarStandPartCodeApplyPage: 筛选、分页信息 -// * @return: IPage -// */ -// IPage getSarStandPartCodeApplyPage(SarStandPartCodeApplyPage sarStandPartCodeApplyPage); -//} +package com.adc.da.slrs.sarStandPartCodeApply.service; + +import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApply; +import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApplyPage; +import com.adc.da.slrs.sarStandPartCodeApply.entity.StandPartCodeExcelVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +public interface ISarStandPartCodeApplyService extends IService { + + /** + * 分页查询零部件 + * @param sarStandPartCodeApplyPage: 筛选、分页信息 + * @return: IPage + */ + IPage getSarStandPartCodeApplyPage(SarStandPartCodeApplyPage sarStandPartCodeApplyPage); + + /** + * 批量删除零件申请信息 + * @param idList + * @return + */ + String del(List idList); + + /** + * 获取导出Excel的数据 + * @param standPartCodeExcelVO: ids + * @return List + */ + List getPartInfoExcelData(StandPartCodeExcelVO standPartCodeExcelVO); +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/service/impl/SarStandPartCodeApplyServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/service/impl/SarStandPartCodeApplyServiceImpl.java index d9c54026..e25edf6a 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/service/impl/SarStandPartCodeApplyServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandPartCodeApply/service/impl/SarStandPartCodeApplyServiceImpl.java @@ -1,35 +1,91 @@ -//package com.adc.da.slrs.sarStandPartCodeApply.service.impl; -// -//import com.adc.da.slrs.sarStandPartCodeApply.dao.SarStandPartCodeApplyDao; -//import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApply; -//import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApplyPage; -//import com.adc.da.slrs.sarStandPartCodeApply.service.ISarStandPartCodeApplyService; -//import com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified; -//import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao; -//import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; -//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -//import com.baomidou.mybatisplus.core.metadata.IPage; -//import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Service; -// -//import javax.annotation.Resource; -//import java.util.List; -// -//@Service -//public class SarStandPartCodeApplyServiceImpl extends ServiceImpl implements ISarStandPartCodeApplyService { -// -// @Autowired -// private SarStandPartCodeApplyDao sarStandPartCodeApplyDao; -// -// @Resource -// private SarStandardsInfoDao sarStandardsInfoDao; -// -// public IPage getSarStandPartCodeApplyPage(SarStandPartCodeApplyPage sarStandPartCodeApplyPage){ -// QueryWrapper sarStandPartCodeApplyQueryWrapper = new QueryWrapper<>(); -// if (sarStandPartCodeApplyQueryWrapper.) -// } -// -// -//} +package com.adc.da.slrs.sarStandPartCodeApply.service.impl; + +import com.adc.da.slrs.sarStandPartCodeApply.dao.SarStandPartCodeApplyDao; +import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApply; +import com.adc.da.slrs.sarStandPartCodeApply.entity.SarStandPartCodeApplyPage; +import com.adc.da.slrs.sarStandPartCodeApply.entity.StandPartCodeExcelVO; +import com.adc.da.slrs.sarStandPartCodeApply.service.ISarStandPartCodeApplyService; +import com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified; +import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao; +import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class SarStandPartCodeApplyServiceImpl extends ServiceImpl implements ISarStandPartCodeApplyService { + + @Autowired + private SarStandPartCodeApplyDao sarStandPartCodeApplyDao; + + @Resource + private SarStandardsInfoDao sarStandardsInfoDao; + + /** + * 分页查询零部件信息 + * @param sarStandPartCodeApplyPage: 筛选、分页信息 + * @return :IPage + */ + @Override + public IPage getSarStandPartCodeApplyPage(SarStandPartCodeApplyPage sarStandPartCodeApplyPage){ + QueryWrapper sarStandPartCodeApplyQueryWrapper = new QueryWrapper<>(); + //根据子组号查询 + if (sarStandPartCodeApplyPage.getSubgroupNumber() != null){ + sarStandPartCodeApplyQueryWrapper.like("SUBGROUP_NUMBER",sarStandPartCodeApplyPage.getSubgroupNumber()); + } + //根据分组代号查询 + if (sarStandPartCodeApplyPage.getGroupCode() != null){ + sarStandPartCodeApplyQueryWrapper.like("GROUP_CODE",sarStandPartCodeApplyPage.getGroupCode()); + } + //根据零件分类代号查询 + if (sarStandPartCodeApplyPage.getPartCategoryCode() != null){ + sarStandPartCodeApplyQueryWrapper.like("PART_CATEGORY_CODE",sarStandPartCodeApplyPage.getPartCategoryCode()); + } + Page standPartCodeApplyPage=new Page<>(); + //判断前端是否提供页码和每页条数 + if (sarStandPartCodeApplyPage.getCurrent()!=null && sarStandPartCodeApplyPage.getSize()!=null){ + standPartCodeApplyPage = new Page<>(sarStandPartCodeApplyPage.getCurrent(),sarStandPartCodeApplyPage.getSize()); + } + return sarStandPartCodeApplyDao.selectPage(standPartCodeApplyPage,sarStandPartCodeApplyQueryWrapper); + } + + /** + * 批量删除零部件信息 + * @param idList: 批量删除的id数组 + * @return + */ + @Override + public String del(List idList){ + QueryWrapper wrapper = new QueryWrapper<>(); + for (String id: idList) { + wrapper.eq("ID",id); + sarStandPartCodeApplyDao.delete(wrapper); + } + sarStandPartCodeApplyDao.deleteBatchIds(idList); + return "删除成功"; + } + + /** + * 获取导出excel的数据 + * @param standPartCodeExcelVO: ids + * @return List + */ + @Override + public List getPartInfoExcelData(StandPartCodeExcelVO standPartCodeExcelVO){ + QueryWrapper sarStandPartCodeApplyQueryWrapper = new QueryWrapper<>(); + if (standPartCodeExcelVO.getIds()!=null && standPartCodeExcelVO.getIds().size()>0){ + sarStandPartCodeApplyQueryWrapper.in("id",standPartCodeExcelVO.getIds()); + } + List stand = sarStandPartCodeApplyDao.selectList(sarStandPartCodeApplyQueryWrapper); + List a = stand; + return a; + } + + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardComplianceAssessResult/entity/SarStandardComplianceProductAssess.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardComplianceAssessResult/entity/SarStandardComplianceProductAssess.java index 4601161e..0fff5ae4 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardComplianceAssessResult/entity/SarStandardComplianceProductAssess.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardComplianceAssessResult/entity/SarStandardComplianceProductAssess.java @@ -91,6 +91,10 @@ public class SarStandardComplianceProductAssess extends BaseEntity { @ApiModelProperty(value = "在产产品合规信息") private String productionCompliance; + @ApiModelProperty(value = "在产产品不合规信息") + @TableField("production_non_compliance") + private String productionNonCompliance; + @ApiModelProperty(value = "在产产品不合规应对措施") private String productionCountermeasures; diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/SarStandItems/SarStandItemsMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/SarStandItems/SarStandItemsMapper.xml index 2f4b9196..45984bb7 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/SarStandItems/SarStandItemsMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/SarStandItems/SarStandItemsMapper.xml @@ -73,17 +73,17 @@ - SAR_STAND_ITEMS.modify_time, SAR_STAND_ITEMS.creation_time, SAR_STAND_ITEMS.creation_user, SAR_STAND_ITEMS.valid_flag, SAR_STAND_ITEMS.remarks, SAR_STAND_ITEMS.responsible_unit, SAR_STAND_ITEMS.energy_kind, SAR_STAND_ITEMS.apply_arctic, tack_time, parts, SAR_STAND_ITEMS.items_name, SAR_STAND_ITEMS.items_num, SAR_STAND_ITEMS.stand_id, SAR_STAND_ITEMS.id + SAR_STAND_ITEMS.modify_time, SAR_STAND_ITEMS.creation_time, SAR_STAND_ITEMS.creation_user, SAR_STAND_ITEMS.valid_flag, SAR_STAND_ITEMS.remarks, SAR_STAND_ITEMS.responsible_unit, SAR_STAND_ITEMS.energy_kind, SAR_STAND_ITEMS.apply_arctic, tack_time, parts, SAR_STAND_ITEMS.items_name, SAR_STAND_ITEMS.items_num, SAR_STAND_ITEMS.stand_id, SAR_STAND_ITEMS.id ,TS_ORG.org_name as responsibleUnitShow,SAR_STAND_ITEMS.MAINPOINTS_IMPEMENTATION,SAR_STAND_ITEMS.TERMS_CONDITIONS,tsFo.UNAME as foShow,SAR_STAND_ITEMS.duty_engineer,SAR_STAND_ITEMS.svpps, SAR_STAND_ITEMS.claim_type,SAR_STAND_ITEMS.bus_stand_cover,SAR_STAND_ITEMS.file_type,dicClaimType.DIC_TYPE_NAME as claimTypeShow,tsdutyEngineer.UNAME as dutyEngineerShow,SAR_STAND_ITEMS.fo - + - SAR_STAND_ITEMS.modify_time, SAR_STAND_ITEMS.creation_time, SAR_STAND_ITEMS.creation_user, SAR_STAND_ITEMS.valid_flag, SAR_STAND_ITEMS.remarks, SAR_STAND_ITEMS.responsible_unit, + SAR_STAND_ITEMS.modify_time, SAR_STAND_ITEMS.creation_time, SAR_STAND_ITEMS.creation_user, SAR_STAND_ITEMS.valid_flag, SAR_STAND_ITEMS.remarks, SAR_STAND_ITEMS.responsible_unit, SAR_STAND_ITEMS.energy_kind, SAR_STAND_ITEMS.apply_arctic, tack_time, parts, SAR_STAND_ITEMS.items_name, SAR_STAND_ITEMS.items_num, SAR_STAND_ITEMS.stand_id, SAR_STAND_ITEMS.id ,SAR_STAND_ITEMS.MAINPOINTS_IMPEMENTATION,SAR_STAND_ITEMS.TERMS_CONDITIONS,SAR_STAND_ITEMS.duty_engineer,SAR_STAND_ITEMS.svpps, SAR_STAND_ITEMS.claim_type,SAR_STAND_ITEMS.bus_stand_cover,SAR_STAND_ITEMS.file_type,SAR_STAND_ITEMS.fo - + @@ -194,11 +194,11 @@ - - - - - + + + + + @@ -262,22 +262,22 @@ - update SAR_STAND_ITEMS - set modify_time = #{modifyTime}, - creation_time = #{creationTime}, - creation_user = #{creationUser}, - valid_flag = #{validFlag}, - remarks = #{remarks}, - responsible_unit = #{responsibleUnit}, - energy_kind = #{energyKind}, - apply_arctic = #{applyArctic}, - tack_time = #{tackTime}, - parts = #{parts}, - items_name = #{itemsName}, - items_num = #{itemsNum}, - stand_id = #{standId} - where id = #{id} - + update SAR_STAND_ITEMS + set modify_time = #{modifyTime}, + creation_time = #{creationTime}, + creation_user = #{creationUser}, + valid_flag = #{validFlag}, + remarks = #{remarks}, + responsible_unit = #{responsibleUnit}, + energy_kind = #{energyKind}, + apply_arctic = #{applyArctic}, + tack_time = #{tackTime}, + parts = #{parts}, + items_name = #{itemsName}, + items_num = #{itemsNum}, + stand_id = #{standId} + where id = #{id} + @@ -362,10 +362,10 @@ - delete from SAR_STAND_ITEMS - where id = #{value} + delete from SAR_STAND_ITEMS + where id = #{value} - + - SELECT - * - FROM - sar_stand_items AS a + SELECT + * + FROM + sar_stand_items AS a @@ -386,7 +386,7 @@ - and a.file_type=#{fileType} + and a.file_type=#{fileType} @@ -741,10 +741,10 @@ a.STAND_ID FROM sar_stand_items a - LEFT JOIN sar_standards_info b - on a.STAND_ID=b.ID + LEFT JOIN sar_standards_info b + on a.STAND_ID=b.ID WHERE b.VALID_FLAG = 0 - and a.FILE_TYPE ='FBGBJBD' + and a.FILE_TYPE ='FBGBJBD' GROUP BY a.STAND_ID limit #{page},#{size}