diff --git a/src/main/java/com/bonus/gzgqj/business/bases/controller/PartApplyController.java b/src/main/java/com/bonus/gzgqj/business/bases/controller/PartApplyController.java index 86edb1c..6131731 100644 --- a/src/main/java/com/bonus/gzgqj/business/bases/controller/PartApplyController.java +++ b/src/main/java/com/bonus/gzgqj/business/bases/controller/PartApplyController.java @@ -18,6 +18,7 @@ import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -144,13 +145,20 @@ public class PartApplyController { + + /** * 出库-接口 - * @return + * // @PostMapping("partOutInfo") + * // public ServerResponse partOutInfo(HttpServletRequest request, @RequestParam(required = false,value = "file[]") MultipartFile[] files) { + * // return service.partOutInfo(request,files); + * // } */ - @PostMapping("partOutInfo") - public ServerResponse partOutInfo(HttpServletRequest request, @RequestParam("file[]") MultipartFile[] files) { - return service.partOutInfo(request,files); + @PostMapping(value = "partOutInfo") + public ServerResponse partOutInfo(HttpServletRequest request) { + return service.partOutInfo(request, null); } + + } diff --git a/src/main/java/com/bonus/gzgqj/business/bases/controller/PartScrapController.java b/src/main/java/com/bonus/gzgqj/business/bases/controller/PartScrapController.java index fb48847..0140317 100644 --- a/src/main/java/com/bonus/gzgqj/business/bases/controller/PartScrapController.java +++ b/src/main/java/com/bonus/gzgqj/business/bases/controller/PartScrapController.java @@ -21,7 +21,7 @@ import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import sun.dc.pr.PRError; +//import sun.dc.pr.PRError; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; diff --git a/src/main/java/com/bonus/gzgqj/business/bases/service/PartApplyServiceImpl.java b/src/main/java/com/bonus/gzgqj/business/bases/service/PartApplyServiceImpl.java index 0e28b9e..eaaf480 100644 --- a/src/main/java/com/bonus/gzgqj/business/bases/service/PartApplyServiceImpl.java +++ b/src/main/java/com/bonus/gzgqj/business/bases/service/PartApplyServiceImpl.java @@ -159,14 +159,17 @@ public class PartApplyServiceImpl implements PartApplyService{ if(StringHelper.isEmpty(id)){ return ServerResponse.createErroe("请选择出库记录"); } - if(files==null || files.length<=0){ - return ServerResponse.createErroe("请先上传文件"); - } - List fileList=uploadService.uploadImage(files,id,"t_part_apply","出库附件"); - if(fileList.size()!=files.length){ - return ServerResponse.createErroe("出库失败"); + if(files==null || files.length <= 0){ + System.out.println("本次未上传附件"); + //return ServerResponse.createErroe("请先上传文件"); + } else { + List fileList=uploadService.uploadImage(files,id,"t_part_apply","出库附件"); + if(fileList.size()!=files.length){ + return ServerResponse.createErroe("出库失败,附件上传缺失"); + } } + PartApplyAppVo vo=mapper.getAuditStatus(data); if(!"2".equals(vo.getStatus())){ return ServerResponse.createErroe("该数据状态已变更,请刷新数据重试"); diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000..b7129e8 --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,58 @@ +# 配置端口 +server: + port: 21999 + servlet: + context-path: + max-http-header-size: 10240 +spring: + # 配置数据源 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver +# url: jdbc:mysql://192.168.0.14:1109/gzimtcs?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false +# username: root +# password: zhzadmin@gzimtcs14! + url: jdbc:mysql://127.0.0.1:3306/gzimt250319?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false + username: ruanliang + password: ruanliang@MYSQL + type: com.alibaba.druid.pool.DruidDataSource + redis: + host: localhost + port: 6379 + password: + database: 7 +# redis: +# host: 127.0.0.1 +# port: 6379 +# database: 7 + servlet: + multipart: + max-file-size: -1 + max-request-size: -1 +#mapper配置 +mybatis: + mapper-locations: classpath:mappers/*/*Mapper.xml +#日志配置 +logging: + config: classpath:logback-boot.xml +log: + level: + root: info + my: debug + file: logs/sys-back.log + maxsize: 30MB +#是否开启安全模式 +zhly: + aq: + enable: false + +file: + upload_path: + windows: D://files/zg_gqj + linux: /home/zg_gqj/files + + + +jwt: + secret: your_secret_key + expiration: 86400 + diff --git a/src/main/resources/application-saas.yml b/src/main/resources/application-saas.yml new file mode 100644 index 0000000..c41b2c3 --- /dev/null +++ b/src/main/resources/application-saas.yml @@ -0,0 +1,58 @@ +# 配置端口 +server: + port: 21995 +# servlet: +# context-path: /aqd_screen + max-http-header-size: 10240 +spring: + # 配置数据源 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://10.1.0.141:13306/gzimt1.0?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false + username: root + password: gsyfq@09mysql! +# url: jdbc:mysql://127.0.0.1:3306/gzimtcs?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false +# username: mroot +# password: bonus@admin123 + type: com.alibaba.druid.pool.DruidDataSource + redis: + host: 10.1.0.141 + port: 6379 + password: Bonus@admin123! + database: 7 +# redis: +# host: 127.0.0.1 +# port: 6379 +# database: 7 + servlet: + multipart: + max-file-size: -1 + max-request-size: -1 +#mapper配置 +mybatis: + mapper-locations: classpath:mappers/*/*Mapper.xml +#日志配置 +logging: + config: classpath:logback-boot.xml +log: + level: + root: info + my: debug + file: logs/sys-back.log + maxsize: 30MB +#是否开启安全模式 +zhly: + aq: + enable: false + +file: + upload_path: + windows: D://files/zg_gqj + linux: /home/zg_gqj/files + + + +jwt: + secret: your_secret_key + expiration: 86400 + diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 0000000..6fec92e --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,50 @@ +# 配置端口 +server: + port: 21999 +# servlet: +# context-path: /gz-gqj + max-http-header-size: 10240 +spring: + # 配置数据源 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://192.168.0.16:4419/gzimtcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true + username: root + password: Bonus@admin123! + # url: jdbc:mysql://127.0.0.1:3306/gzimtcs?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + # username: mroot + # password: bonus@admin123 + # type: com.alibaba.druid.pool.DruidDataSource + redis: + host: 192.168.0.16 + port: 2001 + password: Zhzbns@Redis123! + database: 1 + servlet: + multipart: + max-file-size: -1 + max-request-size: -1 +#mapper配置 +mybatis: + mapper-locations: classpath:mappers/**/*Mapper.xml,mappers/**/**/*Mapper.xml +#日志配置 +logging: + config: classpath:logback-boot.xml +log: + level: + root: info + my: debug + file: logs/sys-back.log + maxsize: 30MB +#是否开启安全模式 +zhly: + aq: + enable: false + +file: + upload_path: + windows: D://files/gz_car + linux: /home/zg_gqj/files + + + diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index fddd7d2..060565a 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,58 +1,4 @@ -# 配置端口 -server: - port: 21520 -# servlet: -# context-path: /aqd_screen - max-http-header-size: 10240 +# 环境配置 spring: - # 配置数据源 - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.0.14:1109/gzimtcs?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false - username: root - password: zhzadmin@gzimtcs14! -# url: jdbc:mysql://127.0.0.1:3306/gzimtcs?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false -# username: mroot -# password: bonus@admin123 - type: com.alibaba.druid.pool.DruidDataSource - redis: - host: 192.168.0.14 - port: 2003 - password: Fyzbns@Redis123! - database: 7 -# redis: -# host: 127.0.0.1 -# port: 6379 -# database: 7 - servlet: - multipart: - max-file-size: -1 - max-request-size: -1 -#mapper配置 -mybatis: - mapper-locations: classpath:mappers/*/*Mapper.xml -#日志配置 -logging: - config: classpath:logback-boot.xml -log: - level: - root: info - my: debug - file: logs/sys-back.log - maxsize: 30MB -#是否开启安全模式 -zhly: - aq: - enable: false - -file: - upload_path: - windows: D://files/zg_gqj - linux: /home/zg_gqj/files - - - -jwt: - secret: your_secret_key - expiration: 86400 - + profiles: + active: saas \ No newline at end of file