diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/controller/inventory/InventoryCountController.java b/src/main/java/com/bonus/aqgqj/business/backstage/controller/inventory/InventoryCountController.java index 8b8a751..d7c45e9 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/controller/inventory/InventoryCountController.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/controller/inventory/InventoryCountController.java @@ -3,6 +3,7 @@ package com.bonus.aqgqj.business.backstage.controller.inventory; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger; import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo; import com.bonus.aqgqj.business.backstage.service.inventory.InventoryCountService; import com.bonus.aqgqj.manager.annotation.DecryptAndVerify; @@ -37,6 +38,44 @@ public class InventoryCountController { @Resource(name = "InventoryCountService") private InventoryCountService service; + /** + * 查询工程领退及差缺台账 + * @param dto query参数 + * @return PageInfo + */ + @GetMapping("queryLedgerListByProjectAndModel") + @DecryptAndVerify(decryptedClass = ProjectMaterialLedger.class) + public PageInfo queryLedgerListByProjectAndModel(EncryptedReq dto) { + List projectMaterialLedgers = service.queryLedgerListByProjectAndModel(dto.getData()); + return new PageInfo<>(projectMaterialLedgers); + } + + /** + * 工程领退及差缺台账导出方法 + */ + @GetMapping("exportLedgerListByProjectAndModel") + @DecryptAndVerify(decryptedClass = ProjectMaterialLedger.class) + public void exportLedgerListByProjectAndModel(HttpServletResponse response, EncryptedReq dto) { + try { + List list = service.queryLedgerListByProjectAndModel(dto.getData()); + final int[] num = {1}; + list.forEach(vo -> { + vo.setId(num[0]); + num[0]++; + }); + ExportParams exportParams = new ExportParams("工程领退及差缺台账", "工程领退及差缺台账", ExcelType.XSSF); + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, ProjectMaterialLedger.class, list); + response.setContentType("application/vnd.ms-excel"); + response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("工程领退及差缺台账" + ".xlsx", "UTF-8")); + ServletOutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + outputStream.close(); + workbook.close(); + } catch (Exception e) { + log.error(e.toString(), e); + } + } + /** * 库存统计列表 * diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/controller/plan/PlanApplyController.java b/src/main/java/com/bonus/aqgqj/business/backstage/controller/plan/PlanApplyController.java index 8f32165..bf513da 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/controller/plan/PlanApplyController.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/controller/plan/PlanApplyController.java @@ -195,6 +195,9 @@ public class PlanApplyController { num[0]++; }); ExportParams exportParams = new ExportParams("安全工器具明细", "安全工器具明细", ExcelType.XSSF); + if (!list.isEmpty()) { + exportParams = new ExportParams(list.get(0).getProjectName() + "--安全工器具明细", "安全工器具明细", ExcelType.XSSF); + } Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanDetailVo.class, list); response.setContentType("application/vnd.ms-excel"); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("安全工器具明细" + ".xlsx", "UTF-8")); diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/entity/ProjectMaterialLedger.java b/src/main/java/com/bonus/aqgqj/business/backstage/entity/ProjectMaterialLedger.java new file mode 100644 index 0000000..8dde246 --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/business/backstage/entity/ProjectMaterialLedger.java @@ -0,0 +1,102 @@ +package com.bonus.aqgqj.business.backstage.entity; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @author : 阮世耀 + * @version : 1.0 + * @PackagePath: com.bonus.aqgqj.business.backstage.entity + * @CreateTime: 2025-05-24 17:05 + * @Description: 工程物资台账 + */ +@Data +@Accessors(chain = true) +public class ProjectMaterialLedger { + + private Integer id; + + /** + * 工程id + */ + private Integer proId; + + /** + * 工程名称 + */ + @Excel(name = "工程名称", width = 70) + private String proName; + + /** + * 领用单位 + */ + private String leaseUnit; + + /** + * 物资类型、名称、规格型号 + */ + @Excel(name = "物资类型", width = 18) + private String type; + + @Excel(name = "物资名称", width = 18) + private String name; + + @Excel(name = "规格型号", width = 18) + private String model; + + @Excel(name = "单位") + private String unit; + + /** + * 物资规格型号id + */ + private Integer modelId; + + /** + * 需用数量 + */ + @Excel(name = "需用数量", width = 16) + private Double needNum = 0.00; + + /** + * 采购量--出库 + */ + @Excel(name = "采购量", width = 16) + private Double totalCg = 0.00; + + /** + * 利库量--出库 + */ + @Excel(name = "利库量", width = 16) + private Double totalLk = 0.00; + + /** + * 出库量--出库 + */ + @Excel(name = "出库量", width = 16) + private Double totalCk = 0.00; + + /** + * 退货量--退库 + */ + @Excel(name = "退货量", width = 16) + private Double totalBack = 0.00; + + /** + * 差缺量 + */ + @Excel(name = "差缺量", width = 16) + private Double totalDiff = 0.00; + + /** + * 差缺状态 1-缺货 2-不缺货 + */ + private Integer isShortage; + + /** + * 备注 + */ + @Excel(name = "备注", width = 16) + private String remark; +} diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/entity/plan/PlanApplyVo.java b/src/main/java/com/bonus/aqgqj/business/backstage/entity/plan/PlanApplyVo.java index 43a9a7f..7f1da50 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/entity/plan/PlanApplyVo.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/entity/plan/PlanApplyVo.java @@ -54,7 +54,7 @@ public class PlanApplyVo { /** * 施工地点 */ - @NotBlank(message = "施工地点不能为空", groups = {PlanApplyVo.addApplyPlan.class,PlanApplyVo.editApplyPlan.class}) +// @NotBlank(message = "施工地点不能为空", groups = {PlanApplyVo.addApplyPlan.class,PlanApplyVo.editApplyPlan.class}) @Length(max = 120, message = "施工地点字符长度不能超过120", groups = {PlanApplyVo.addApplyPlan.class,PlanApplyVo.editApplyPlan.class}) private String projectContent; /** diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/entity/plan/PlanDetailVo.java b/src/main/java/com/bonus/aqgqj/business/backstage/entity/plan/PlanDetailVo.java index 134d3a9..f78d69d 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/entity/plan/PlanDetailVo.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/entity/plan/PlanDetailVo.java @@ -82,6 +82,11 @@ public class PlanDetailVo { @Excel(name = "单位", width = 20.0, orderNum = "4") private String unit; + /** + * 工程名称 + */ + private String projectName; + /** * 新增条件限制 */ diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/entity/pro/BidProAddVo.java b/src/main/java/com/bonus/aqgqj/business/backstage/entity/pro/BidProAddVo.java index ade39d8..6e78111 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/entity/pro/BidProAddVo.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/entity/pro/BidProAddVo.java @@ -43,7 +43,7 @@ public class BidProAddVo { /** * 施工地点 */ - @NotBlank(message = "施工地点不能为空", groups = {addBidPro.class,editBidPro.class}) +// @NotBlank(message = "施工地点不能为空", groups = {addBidPro.class,editBidPro.class}) @Length(max = 128, message = "施工地点字符长度不能超过128",groups = {addBidPro.class,editBidPro.class}) private String constructionsite; /** diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/entity/pro/ProAddVo.java b/src/main/java/com/bonus/aqgqj/business/backstage/entity/pro/ProAddVo.java index 8b250ed..ff7f701 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/entity/pro/ProAddVo.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/entity/pro/ProAddVo.java @@ -39,7 +39,7 @@ public class ProAddVo { /** * 施工地点 */ - @NotBlank(message = "施工地点不能为空", groups = {addPro.class,editPro.class}) +// @NotBlank(message = "施工地点不能为空", groups = {addPro.class,editPro.class}) @Length(max = 128, message = "施工地点字符长度不能超过128",groups = {addPro.class,editPro.class}) private String constructionsite; /** diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/mapper/inventory/InventoryCountMapper.java b/src/main/java/com/bonus/aqgqj/business/backstage/mapper/inventory/InventoryCountMapper.java index d44dfa3..5075fd0 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/mapper/inventory/InventoryCountMapper.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/mapper/inventory/InventoryCountMapper.java @@ -1,5 +1,6 @@ package com.bonus.aqgqj.business.backstage.mapper.inventory; +import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger; import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo; import org.springframework.stereotype.Repository; @@ -15,6 +16,16 @@ import java.util.List; @Repository("InventoryCountMapper") public interface InventoryCountMapper { + /** + * 查询工程的物资出库数量,根据工程及物资型号分组 + */ + List getProjectOutListGroupModel(ProjectMaterialLedger vo); + + /** + * 查询工程的物资退货数量,根据工程及物资型号分组 + */ + List getProjectBackListGroupModel(ProjectMaterialLedger vo); + /** * 库存统计列表 * @return List diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/service/PurchaseServiceImpl.java b/src/main/java/com/bonus/aqgqj/business/backstage/service/PurchaseServiceImpl.java index 55aa2d4..beea581 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/service/PurchaseServiceImpl.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/service/PurchaseServiceImpl.java @@ -207,7 +207,8 @@ public class PurchaseServiceImpl implements PurchaseService { return ServerResponse.createErroe("请填写经办人"); } if(StringHelper.isEmpty(outPlanVo.getAddress())){ - return ServerResponse.createErroe("请填写收获日期"); + outPlanVo.setAddress("无"); +// return ServerResponse.createErroe("请填写收获地址"); } if(files==null || files.length<1){ return ServerResponse.createErroe("请上传附件"); @@ -351,7 +352,8 @@ public class PurchaseServiceImpl implements PurchaseService { return ServerResponse.createErroe("请填写经办人"); } if(StringHelper.isEmpty(outPlanVo.getAddress())){ - return ServerResponse.createErroe("请填写收获日期"); + outPlanVo.setAddress("无"); +// return ServerResponse.createErroe("请填写收获地址"); } List detailsList=outPlanVo.getDetailsList(); diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/service/inventory/InventoryCountService.java b/src/main/java/com/bonus/aqgqj/business/backstage/service/inventory/InventoryCountService.java index a203213..b15dbf1 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/service/inventory/InventoryCountService.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/service/inventory/InventoryCountService.java @@ -1,5 +1,7 @@ package com.bonus.aqgqj.business.backstage.service.inventory; +import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger; +import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryApplyVo; import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo; import com.bonus.aqgqj.manager.webResult.ServerResponse; @@ -14,6 +16,11 @@ import java.util.List; */ public interface InventoryCountService { + /** + * 工程领退及差缺台账 + */ + List queryLedgerListByProjectAndModel(ProjectMaterialLedger vo); + /** *库存统计列表 * @param data diff --git a/src/main/java/com/bonus/aqgqj/business/backstage/service/inventory/InventoryCountServiceImpl.java b/src/main/java/com/bonus/aqgqj/business/backstage/service/inventory/InventoryCountServiceImpl.java index 69db4b0..cc766b5 100644 --- a/src/main/java/com/bonus/aqgqj/business/backstage/service/inventory/InventoryCountServiceImpl.java +++ b/src/main/java/com/bonus/aqgqj/business/backstage/service/inventory/InventoryCountServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.aqgqj.business.backstage.service.inventory; +import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger; import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo; import com.bonus.aqgqj.business.backstage.mapper.inventory.InventoryCountMapper; import com.bonus.aqgqj.manager.webResult.ServerResponse; @@ -7,7 +8,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * @className:InventoryCountServiceImpl @@ -22,6 +24,112 @@ public class InventoryCountServiceImpl implements InventoryCountService{ @Resource(name = "InventoryCountMapper") private InventoryCountMapper mapper; + + /** + * 工程领退及差缺台账 + */ + @Override + public List queryLedgerListByProjectAndModel(ProjectMaterialLedger vo) { + // 1. 查询工程物资出库数据 + List outRecords = mapper.getProjectOutListGroupModel(vo); + + // 2. 查询工程物资退料数据 + List returnRecords = mapper.getProjectBackListGroupModel(vo); + + // 3. 按工程和modelId分组 + Map outMap = outRecords.stream() + .collect(Collectors.toMap( + record -> record.getProId() + "_" + record.getModelId(), + record -> record, + (existing, replacement) -> { + // 累加出库数量 + existing.setTotalCk(existing.getTotalCk() + replacement.getTotalCg() + replacement.getTotalLk()); + return existing; + } + )); + + Map returnMap = returnRecords.stream() + .collect(Collectors.toMap( + record -> record.getProId() + "_" + record.getModelId(), + record -> record, + (existing, replacement) -> { + // 累加退料数量 + existing.setTotalBack(existing.getTotalBack() + replacement.getTotalBack()); + return existing; + } + )); + + // 4. 计算差缺量 + List result = new ArrayList<>(); + Set allKeys = new HashSet<>(); + allKeys.addAll(outMap.keySet()); + allKeys.addAll(returnMap.keySet()); + + for (String key : allKeys) { + ProjectMaterialLedger outRecord = outMap.get(key); + ProjectMaterialLedger returnRecord = returnMap.get(key); + + ProjectMaterialLedger ledger = computeDiffData(outRecord, returnRecord); + + // 前端筛选,判断是否是差缺再进行返回 + if (vo.getIsShortage() == null || vo.getIsShortage() == 0) { + result.add(ledger); + } else if (vo.getIsShortage() == 1 && ledger.getTotalDiff() > 0) { + result.add(ledger); + } else if (vo.getIsShortage() == 2 && ledger.getTotalDiff() <= 0) { + result.add(ledger); + } + + } + + return result; + } + + /** + * 计算差缺量 + * @param outRecord 出库数量 + * @param returnRecord 退料数量 + * @return ProjectMaterialLedger + */ + private static ProjectMaterialLedger computeDiffData(ProjectMaterialLedger outRecord, ProjectMaterialLedger returnRecord) { + // 1.新建一个对象 + ProjectMaterialLedger ledger = new ProjectMaterialLedger(); + if (returnRecord == null) { returnRecord = new ProjectMaterialLedger();} + + // 2.设置数量 + ledger.setTotalCg(outRecord != null ? outRecord.getTotalCg() : 0.00); + ledger.setTotalLk(outRecord != null ? outRecord.getTotalLk() : 0.00); + ledger.setTotalBack(returnRecord.getTotalBack() != null ? returnRecord.getTotalBack() : 0.00); + ledger.setTotalCk(outRecord != null ? outRecord.getTotalCk() : 0.00); + ledger.setNeedNum(outRecord != null ? outRecord.getNeedNum() : 0.00); + + // 3.设置工程信息 + ledger.setProId(outRecord != null ? outRecord.getProId() : returnRecord.getProId()); + ledger.setProName(outRecord != null ? outRecord.getProName() : returnRecord.getProName()); + ledger.setLeaseUnit(outRecord != null ? outRecord.getLeaseUnit() : returnRecord.getLeaseUnit()); + + // 4.设置物料信息 + ledger.setType(outRecord != null ? outRecord.getType() : returnRecord.getType()); + ledger.setName(outRecord != null ? outRecord.getName() : returnRecord.getName()); + ledger.setModel(outRecord != null ? outRecord.getModel() : returnRecord.getModel()); + ledger.setUnit(outRecord != null ? outRecord.getUnit() : returnRecord.getUnit()); + ledger.setModelId(outRecord != null ? outRecord.getModelId() : returnRecord.getModelId()); + + // 计算差缺量 = 出库数量 - 退料数量 + ledger.setTotalDiff(ledger.getTotalCk() - ledger.getTotalBack()); + + // 5.设置差缺状态 + if (ledger.getTotalDiff() > 0) { + ledger.setIsShortage(1); + } else if (ledger.getTotalDiff() < 0) { + ledger.setIsShortage(0); + } else { + ledger.setIsShortage(2); + } + return ledger; + } + + @Override public List getInventoryCountList(InventoryCountVo data) { List list = null; diff --git a/src/main/java/com/bonus/aqgqj/manager/common/config/CustomRedisSerializer.java b/src/main/java/com/bonus/aqgqj/manager/common/config/CustomRedisSerializer.java new file mode 100644 index 0000000..3a6da2a --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/manager/common/config/CustomRedisSerializer.java @@ -0,0 +1,53 @@ +package com.bonus.aqgqj.manager.common.config; + +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationException; +import org.springframework.util.SerializationUtils; + +import java.io.*; + +/** + * 自定义 Redis 序列化器 + * @author 阮世耀 + */ +public class CustomRedisSerializer implements RedisSerializer { + + @Override + public byte[] serialize(Object object) throws SerializationException { + // 使用默认的序列化逻辑 + return SerializationUtils.serialize(object); + } + + @Override + public Object deserialize(byte[] bytes) throws SerializationException { + if (bytes == null) { + return null; + } + try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); + ObjectInputStream objectInputStream = new CustomObjectInputStream(byteArrayInputStream)) { + return objectInputStream.readObject(); + } catch (IOException | ClassNotFoundException e) { + throw new SerializationException("Failed to deserialize object", e); + } + } + + /** + * 自定义 ObjectInputStream,用于修复类路径 + */ + private static class CustomObjectInputStream extends ObjectInputStream { + public CustomObjectInputStream(InputStream in) throws IOException { + super(in); + } + + @Override + protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { + try { + // 默认尝试加载类 + return super.resolveClass(desc); + } catch (ClassNotFoundException e) { + // 如果类路径不对,手动指定正确的类路径 + return Class.forName("com.bonus.aqgqj.manager.security.entity.SelfUserEntity"); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/bonus/aqgqj/manager/common/util/RedisService.java b/src/main/java/com/bonus/aqgqj/manager/common/util/RedisService.java index b8c9ad1..b080f51 100644 --- a/src/main/java/com/bonus/aqgqj/manager/common/util/RedisService.java +++ b/src/main/java/com/bonus/aqgqj/manager/common/util/RedisService.java @@ -1,11 +1,13 @@ package com.bonus.aqgqj.manager.common.util; +import com.bonus.aqgqj.manager.common.config.CustomRedisSerializer; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.BoundSetOperations; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -104,8 +106,14 @@ public class RedisService */ public T getCacheObject(final String key) { + // 设置键的序列化器 + redisTemplate.setKeySerializer(new StringRedisSerializer()); + // 设置值的序列化器为自定义的序列化器 + redisTemplate.setValueSerializer(new CustomRedisSerializer()); + ValueOperations operation = redisTemplate.opsForValue(); - return operation.get(key); + T t = operation.get(key); + return t; } /** diff --git a/src/main/java/com/bonus/aqgqj/manager/constant/TokenConstants.java b/src/main/java/com/bonus/aqgqj/manager/constant/TokenConstants.java index 455ae42..cfd2168 100644 --- a/src/main/java/com/bonus/aqgqj/manager/constant/TokenConstants.java +++ b/src/main/java/com/bonus/aqgqj/manager/constant/TokenConstants.java @@ -11,9 +11,7 @@ public class TokenConstants * 令牌自定义标识 */ public static final String AUTHENTICATION = "Authorization"; - public static final String AUTHENTICATION_PARAM1= "auth"; - public static final String AUTHENTICATION_PARAM = "token"; /** diff --git a/src/main/java/com/bonus/aqgqj/manager/security/jwt/JwtAuthenticationTokenFilter.java b/src/main/java/com/bonus/aqgqj/manager/security/jwt/JwtAuthenticationTokenFilter.java index 3ad850c..cfc5b0e 100644 --- a/src/main/java/com/bonus/aqgqj/manager/security/jwt/JwtAuthenticationTokenFilter.java +++ b/src/main/java/com/bonus/aqgqj/manager/security/jwt/JwtAuthenticationTokenFilter.java @@ -46,9 +46,18 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { filterChain.doFilter(request, response); return; } + if (uri.contains(".jpg") || uri.contains(".png") || uri.contains(".jpeg") || uri.contains("onlinePreview")) { + filterChain.doFilter(request, response); + return; + } + if (uri.contains(".xlsx") || uri.contains(".pdf") || uri.contains(".xls") || uri.contains(".docx") || uri.contains(".doc")) { + filterChain.doFilter(request, response); + return; + } if(StringUtils.isEmpty(jwtToken)){ System.err.println("----------------->"); ResultUtil.responseJson(response,ResultUtil.resultCode(401,"登录过期,请先登录")); + System.err.println("异常401,token信息:" + jwtToken + ",地址" + uri); return; } //解析token diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000..1c8cd33 --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,50 @@ +# 配置端口 +server: + port: 21520 + 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:4417/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/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 + database: 7 + + 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/zg_gqj + linux: /home/zg_gqj/files + + + diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..4fda925 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,50 @@ +# 配置端口 +server: + port: 21520 + servlet: + context-path: /gz_aqgqj + 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=GMT%2B8&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true + username: root + password: gsyfq@09mysql! +# url: jdbc:mysql://127.0.0.1:3306/gzimt?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false +# username: zhz_root +# password: Zhz@12345 + type: com.alibaba.druid.pool.DruidDataSource + redis: + host: 10.1.0.141 + port: 6379 + password: Bonus@admin123! + database: 7 + 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/zg_gqj + linux: /home/zg_gqj/files + + + diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 0000000..1051ca4 --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,56 @@ +# 配置端口 +server: + port: 21520 + servlet: + context-path: /gz-aqgqj + 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://localhost:13306/gzimt250319?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false +# username: root +# password: liang971108@Sun + type: com.alibaba.druid.pool.DruidDataSource + redis: + host: 192.168.0.16 + port: 2001 + password: Zhzbns@Redis123! + database: 1 +# database: 7 +# host: 127.0.0.1 +# port: 6379 +# password: liang971108lu@L + + + 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/zg_gqj + linux: /home/zg_gqj/files + + + diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 4eb50db..90385b2 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,56 +1,3 @@ -# 配置端口 -server: - port: 21520 - servlet: - context-path: /gz-aqgqj - 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://localhost:13306/gzimt250319?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false -# username: root -# password: liang971108@Sun - type: com.alibaba.druid.pool.DruidDataSource - redis: - host: 192.168.0.16 - port: 2001 - password: Zhzbns@Redis123! - database: 1 -# database: 7 -# host: 127.0.0.1 -# port: 6379 -# password: liang971108lu@L - - - 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: e://files/zg_gqj - linux: /home/zg_gqj/files - - - + profiles: + active: prod \ No newline at end of file diff --git a/src/main/resources/mappers/business/backstage/InventoryCountMapper.xml b/src/main/resources/mappers/business/backstage/InventoryCountMapper.xml index b42f5d1..4523d4c 100644 --- a/src/main/resources/mappers/business/backstage/InventoryCountMapper.xml +++ b/src/main/resources/mappers/business/backstage/InventoryCountMapper.xml @@ -3,6 +3,52 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + + + + +