From f94dd99cdc57a753d0695e53532e89167578ab8c Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Thu, 16 Apr 2026 22:30:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:[=E8=B5=84=E6=BA=90=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E4=BE=9B=E8=AF=95=E5=93=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/controller/GspRkjlController.java | 6 + .../main/java/com/hxhq/business/domain/Gsp.java | 4 +- .../java/com/hxhq/business/form/gsp/GspBjForm.java | 3 +- .../java/com/hxhq/business/form/gsp/GspForm.java | 3 +- .../com/hxhq/business/mapper/GspFfjlMapper.java | 3 +- .../com/hxhq/business/mapper/GspRkjlMapper.java | 4 +- .../business/service/impl/GspFfjlServiceImpl.java | 151 +++++++++++---------- .../business/service/impl/GspRkjlServiceImpl.java | 106 +++++---------- .../java/com/hxhq/business/utils/UnitTools.java | 2 +- .../hxhq/business/utils/pdf/resource/GspPdf.java | 4 +- .../resources/mapper/business/GspFfjlMapper.xml | 21 +-- .../resources/mapper/business/GspRkjlMapper.xml | 1 + 12 files changed, 141 insertions(+), 167 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlController.java index 1476be6..dc5172d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspRkjlController.java @@ -105,6 +105,9 @@ public class GspRkjlController extends BaseController @RequiresPermissions("business:resource:gsp:rkxz") public AjaxResult save(@RequestBody GspRkjlForm form) { + if(StringUtils.isEmpty(form.getRkdw())) { + return error("请选择入库单位"); + } GspRkjl gspRkjl = gspRkjlService.queryInfo(form); if(gspRkjl != null) { return error("系统已有记录"); @@ -120,6 +123,9 @@ public class GspRkjlController extends BaseController @RequiresPermissions("business:resource:gsp:rkbj") public AjaxResult bj(@RequestBody GspRkjlForm form) { + if(StringUtils.isEmpty(form.getRkdw())) { + return error("请选择入库单位"); + } GspRkjl gspRkjl = gspRkjlService.queryInfo(form); if(gspRkjl != null && !form.getId().equals(gspRkjl.getId())) { return error("系统已有记录"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java index daabb34..93e4c1c 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gsp.java @@ -71,11 +71,11 @@ public class Gsp extends MpBaseEntity /** 有效期 */ @Compare(name = "有效期", nameEn = "Validity Period") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") private Date yxq; /** 接收日期 */ - @Compare(name = "接收日期", nameEn = "Date Received") + // @Compare(name = "接收日期", nameEn = "Date Received") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date jsrq; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspBjForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspBjForm.java index 433de35..6c37b16 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspBjForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspBjForm.java @@ -50,13 +50,12 @@ public class GspBjForm { private String kcdw; /** 有效期 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") @NotNull(message = "请选择有效期") private Date yxq; /** 接收日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @NotNull(message = "请选择接收日期") private Date jsrq; /** 存储条件 */ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspForm.java index 198b0bb..faa2bdc 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspForm.java @@ -50,13 +50,12 @@ public class GspForm { private String kcdw; /** 有效期 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") @NotNull(message = "请选择有效期") private Date yxq; /** 接收日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @NotNull(message = "请选择接收日期") private Date jsrq; /** 存储条件 */ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/GspFfjlMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/GspFfjlMapper.java index 7f266b1..e8d64b0 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/GspFfjlMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/GspFfjlMapper.java @@ -1,6 +1,7 @@ package com.hxhq.business.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hxhq.business.domain.GspFfjl; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hxhq.business.domain.GspRkjl; @@ -41,7 +42,7 @@ public interface GspFfjlMapper extends BaseMapper * @param queryWrapper * @return */ - Map getStatisticsUnit(@Param("ew") Wrapper queryWrapper); + Map getStatisticsUnit(@Param("ew") Wrapper queryWrapper1, @Param("ew2") Wrapper queryWrapper2, @Param("ew3") Wrapper queryWrapper3); Map getStatistics(@Param("ew") Wrapper queryWrapper, @Param("rkldw") String rkldw, @Param("ckldw") String ckldw, @Param("syldw") String syldw); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/GspRkjlMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/GspRkjlMapper.java index 746c494..5cc984a 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/GspRkjlMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/GspRkjlMapper.java @@ -1,6 +1,7 @@ package com.hxhq.business.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hxhq.business.domain.Gsp; import com.hxhq.business.domain.GspRkjl; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -18,8 +19,6 @@ import java.util.Map; public interface GspRkjlMapper extends BaseMapper { - - /** * 筛选项中出现频率最高的入库单位 * @param queryWrapper @@ -34,4 +33,5 @@ public interface GspRkjlMapper extends BaseMapper */ BigDecimal sumRkl(@Param("ew") Wrapper queryWrapper); + } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlServiceImpl.java index 86d521f..cd73e20 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlServiceImpl.java @@ -1,6 +1,7 @@ package com.hxhq.business.service.impl; import java.math.BigDecimal; +import java.text.DecimalFormat; import java.util.*; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -56,13 +57,7 @@ public class GspFfjlServiceImpl extends ServiceImpl impl @Autowired private IStudyGspService studyGspService; - /** - * 查询供试品发放记录列表 - * @return 供试品发放记录 - */ - @Override - public List queryList(GspSearchListForm form) - { + public QueryWrapper getListCondition(GspSearchListForm form) { QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.eq("t.del_flag", "0"); if (form.getJyzt() != null && form.getJyzt().intValue() > 0) { @@ -94,6 +89,17 @@ public class GspFfjlServiceImpl extends ServiceImpl impl .or().apply(" exists(select s.* from t_study s where find_in_set(s.id, t.`md_ids`) and s.name like CONCAT('%', {0}, '%'))",form.getMd()) ); } + return queryWrapper; + } + + /** + * 查询供试品发放记录列表 + * @return 供试品发放记录 + */ + @Override + public List queryList(GspSearchListForm form) + { + QueryWrapper queryWrapper = getListCondition(form); queryWrapper.orderByDesc("t.id"); return baseMapper.queryList(queryWrapper); } @@ -200,7 +206,7 @@ public class GspFfjlServiceImpl extends ServiceImpl impl gspFfjl.setGhzytj(form.getGhzytj()); // 入库量 gspFfjl.setRkl(form.getRkl()); - gspFfjl.setRkldw(form.getRkldw()); + gspFfjl.setRkldw(gspFfjl.getCkldw()); // 转换为基础单位的 入库量 BigDecimal basicRkl = UnitTools.convert2Basic(form.getRkl(), form.getRkldw()); gspFfjl.setBasicRkl(basicRkl); @@ -865,41 +871,27 @@ public class GspFfjlServiceImpl extends ServiceImpl impl @Override public Map getStatisticsUnit(GspSearchListForm form) { - QueryWrapper queryWrapper = Wrappers.query(); - queryWrapper.eq("del_flag", "0"); - if (form.getJyzt() != null && form.getJyzt().intValue() > 0) { - queryWrapper.eq("jyzt", form.getJyzt()); - } - if (form.getJlzt() != null && form.getJlzt().intValue() > 0) { - queryWrapper.eq("jlzt", form.getJlzt()); - } - if (StringUtils.isNoneBlank(form.getMc())) { - queryWrapper.and(p -> p.like("`mc`", form.getMc())); - } - if (StringUtils.isNoneBlank(form.getBh())) { - queryWrapper.and(p -> p.like("`bh`", form.getBh())); - } - if (StringUtils.isNoneBlank(form.getStartDateCk())) { - queryWrapper.and(p -> p.apply("ffrq>={0}", form.getStartDateCk())); - } - if (StringUtils.isNoneBlank(form.getEndDateCk())) { - queryWrapper.apply("ffrq>={0}", form.getStartDateCk()); - } - if (StringUtils.isNoneBlank(form.getStartDateRk())) { - queryWrapper.and(p -> p.apply("ghrq>={0}", form.getStartDateRk())); - } - if (StringUtils.isNoneBlank(form.getEndDateRk())) { - queryWrapper.apply("ghrq>={0}", form.getEndDateRk()); - } - return baseMapper.getStatisticsUnit(queryWrapper); + QueryWrapper queryWrapper1 = getListCondition(form); + queryWrapper1.isNotNull("ckldw") + .ne("ckldw", ""); + + QueryWrapper queryWrapper2 = getListCondition(form); + queryWrapper2.isNotNull("syldw") + .ne("syldw", ""); + + QueryWrapper queryWrapper3 = getListCondition(form); + queryWrapper3.isNotNull("rkldw") + .ne("rkldw", ""); + + return baseMapper.getStatisticsUnit(queryWrapper1, queryWrapper2, queryWrapper3); } @Override public Map getStatistics(GspSearchListForm form) { Map result = new HashMap<>(); - result.put("ckl", "0"); - result.put("rkl", "0"); - result.put("syl", "0"); + result.put("ckl", ""); + result.put("rkl", ""); + result.put("syl", ""); Map unitMap = getStatisticsUnit(form); if(unitMap == null || unitMap.size() == 0) { @@ -909,50 +901,61 @@ public class GspFfjlServiceImpl extends ServiceImpl impl String syldw = unitMap.get("syldw"); String rkldw = unitMap.get("rkldw"); - QueryWrapper queryWrapper = Wrappers.query(); - queryWrapper.eq("del_flag", 0); - if (form.getJyzt() != null && form.getJyzt().intValue() > 0) { - queryWrapper.eq("jyzt", form.getJyzt()); - } - if (form.getJlzt() != null && form.getJlzt().intValue() > 0) { - queryWrapper.eq("jlzt", form.getJlzt()); - } - if (StringUtils.isNoneBlank(form.getMc())) { - queryWrapper.and(p -> p.like("`mc`", form.getMc())); - } - if (StringUtils.isNoneBlank(form.getBh())) { - queryWrapper.and(p -> p.like("`bh`", form.getBh())); - } - if (StringUtils.isNoneBlank(form.getStartDateCk())) { - queryWrapper.and(p -> p.apply("ffrq>={0}", form.getStartDateCk())); - } - if (StringUtils.isNoneBlank(form.getEndDateCk())) { - queryWrapper.apply("ffrq>={0}", form.getStartDateCk()); - } - if (StringUtils.isNoneBlank(form.getStartDateRk())) { - queryWrapper.and(p -> p.apply("ghrq>={0}", form.getStartDateRk())); - } - if (StringUtils.isNoneBlank(form.getEndDateRk())) { - queryWrapper.apply("ghrq>={0}", form.getEndDateRk()); - } - Map map = baseMapper.getStatistics(queryWrapper, rkldw, ckldw, syldw); + if(StringUtils.isNotEmpty(rkldw)) { - Double rkl = map.get("rkl"); - BigDecimal rklTotal = UnitTools.convert(new BigDecimal(rkl), rkldw); - result.put("rkl", rklTotal.toString() + rkldw); + QueryWrapper queryWrapper = getListCondition(form); + if (Arrays.asList(UnitTools.VOLUME_UNIT_LIST).contains(rkldw)) { + queryWrapper.in("rkldw", UnitTools.VOLUME_UNIT_LIST); + } else if (Arrays.asList(UnitTools.WEIGHT_UNIT_LIST).contains(rkldw)) { + queryWrapper.in("rkldw", UnitTools.WEIGHT_UNIT_LIST); + } else { + queryWrapper.eq("rkldw", rkldw); + } + BigDecimal rkl = baseMapper.sumRkl(queryWrapper); + if(rkl != null) { + rkl = UnitTools.convert(rkl, rkldw); + DecimalFormat decimalFormat = new DecimalFormat("#,###.##"); // 定义格式 + String formatted = decimalFormat.format(rkl); + result.put("rkl", formatted + rkldw); + } + } if(StringUtils.isNotEmpty(ckldw)) { - Double ckl = map.get("ckl"); - BigDecimal cklTotal = UnitTools.convert(new BigDecimal(ckl), ckldw); - result.put("ckl", cklTotal.toString() + ckldw); + QueryWrapper queryWrapper = getListCondition(form); + if (Arrays.asList(UnitTools.VOLUME_UNIT_LIST).contains(ckldw)) { + queryWrapper.in("ckldw", UnitTools.VOLUME_UNIT_LIST); + } else if (Arrays.asList(UnitTools.WEIGHT_UNIT_LIST).contains(ckldw)) { + queryWrapper.in("ckldw", UnitTools.WEIGHT_UNIT_LIST); + } else { + queryWrapper.eq("ckldw", ckldw); + } + BigDecimal ckl = baseMapper.sumCkl(queryWrapper); + if(ckl != null) { + ckl = UnitTools.convert(ckl, ckldw); + DecimalFormat decimalFormat = new DecimalFormat("#,###.##"); // 定义格式 + String formatted = decimalFormat.format(ckl); + result.put("ckl", formatted + ckldw); + } } if(StringUtils.isNotEmpty(syldw)) { - Double syl = map.get("syl"); - BigDecimal sylTotal = UnitTools.convert(new BigDecimal(syl), syldw); - result.put("syl", sylTotal.toString() + syldw); + QueryWrapper queryWrapper = getListCondition(form); + if (Arrays.asList(UnitTools.VOLUME_UNIT_LIST).contains(syldw)) { + queryWrapper.in("syldw", UnitTools.VOLUME_UNIT_LIST); + } else if (Arrays.asList(UnitTools.WEIGHT_UNIT_LIST).contains(syldw)) { + queryWrapper.in("syldw", UnitTools.WEIGHT_UNIT_LIST); + } else { + queryWrapper.eq("syldw", syldw); + } + BigDecimal syl = baseMapper.sumSyl(queryWrapper); + if(syl != null) { + syl = UnitTools.convert(syl, syldw); + DecimalFormat decimalFormat = new DecimalFormat("#,###.##"); // 定义格式 + String formatted = decimalFormat.format(syl); + result.put("syl", formatted + syldw); + } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java index d79b1e1..18da345 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java @@ -1,6 +1,7 @@ package com.hxhq.business.service.impl; import java.math.BigDecimal; +import java.text.DecimalFormat; import java.util.*; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -45,14 +46,7 @@ public class GspRkjlServiceImpl extends ServiceImpl impl @Autowired private INoticeService noticeService; - /** - * 查询供试品入库记录列表 - * - * @return 供试品入库记录 - */ - @Override - public List queryList(GspSearchListForm form) - { + public QueryWrapper getListCondition(GspSearchListForm form) { QueryWrapper queryWrapper = new QueryWrapper<>(); if(StringUtils.isNotEmpty(form.getMc())) { queryWrapper.like("mc", form.getMc()); @@ -78,6 +72,18 @@ public class GspRkjlServiceImpl extends ServiceImpl impl if(form.getArchive() != null && form.getArchive() == DaztEnum.ygd.getValue()) { queryWrapper.in("jlzt", JlztEnum.dgd.getValue(), JlztEnum.gd.getValue(), JlztEnum.djd.getValue()); } + return queryWrapper; + } + + /** + * 查询供试品入库记录列表 + * + * @return 供试品入库记录 + */ + @Override + public List queryList(GspSearchListForm form) + { + QueryWrapper queryWrapper = getListCondition(form); queryWrapper.orderByDesc("id"); return this.list(queryWrapper); } @@ -657,33 +663,11 @@ public class GspRkjlServiceImpl extends ServiceImpl impl @Override public String getRklUnit(GspSearchListForm form) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.isNotNull("rkdw") - .eq("del_flag", 0); - if(StringUtils.isNotEmpty(form.getMc())) { - queryWrapper.like("mc", form.getMc()); - } - if(StringUtils.isNotEmpty(form.getPh())) { - queryWrapper.like("ph", form.getPh()); - } - if(StringUtils.isNotEmpty(form.getGg())) { - queryWrapper.and(p -> p.apply("CONCAT(gg, ggdw) LIKE {0}", form.getGg())); - } - if(StringUtils.isNotEmpty(form.getStartDate())) { - queryWrapper.ge("rksj", form.getStartDate()); - } - if(StringUtils.isNotEmpty(form.getEndDate())) { - queryWrapper.le("rksj", form.getEndDate()); - } - if(form.getJlzt() != null) { - queryWrapper.eq("jlzt", form.getJlzt()); - } - if(form.getJyzt() != null) { - queryWrapper.eq("jyzt", form.getJyzt()); - } - if(form.getArchive() != null && form.getArchive() == DaztEnum.ygd.getValue()) { - queryWrapper.in("jlzt", JlztEnum.dgd.getValue(), JlztEnum.gd.getValue(), JlztEnum.djd.getValue()); - } + QueryWrapper queryWrapper = getListCondition(form); + queryWrapper.isNotNull("rkl") + .isNotNull("rkdw") + .ne("rkl", "") + .ne("rkdw", ""); Map map = baseMapper.getRklUnit(queryWrapper); if(map == null) { return null; @@ -693,46 +677,26 @@ public class GspRkjlServiceImpl extends ServiceImpl impl @Override public String getRkl(GspSearchListForm form) { - String rkdw = getRklUnit(form); - if(StringUtils.isEmpty(rkdw)) { - return null; - } - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.isNotNull("rkdw") - .eq("rkdw", rkdw) - .eq("del_flag", 0); - if(StringUtils.isNotEmpty(form.getMc())) { - queryWrapper.like("mc", form.getMc()); - } - if(StringUtils.isNotEmpty(form.getPh())) { - queryWrapper.like("ph", form.getPh()); - } - if(StringUtils.isNotEmpty(form.getGg())) { - queryWrapper.and(p -> p.apply("CONCAT(gg, ggdw) LIKE {0}", form.getGg())); - } - if(StringUtils.isNotEmpty(form.getStartDate())) { - queryWrapper.ge("rksj", form.getStartDate()); - } - if(StringUtils.isNotEmpty(form.getEndDate())) { - queryWrapper.le("rksj", form.getEndDate()); - } - if(form.getJlzt() != null) { - queryWrapper.eq("jlzt", form.getJlzt()); - } - if(form.getJyzt() != null) { - queryWrapper.eq("jyzt", form.getJyzt()); - } - if(form.getArchive() != null && form.getArchive() == DaztEnum.ygd.getValue()) { - queryWrapper.in("jlzt", JlztEnum.dgd.getValue(), JlztEnum.gd.getValue(), JlztEnum.djd.getValue()); + String rklUnit = getRklUnit(form); + if(StringUtils.isEmpty(rklUnit)) { + return ""; + } + QueryWrapper queryWrapper = getListCondition(form); + if (Arrays.asList(UnitTools.VOLUME_UNIT_LIST).contains(rklUnit)) { + queryWrapper.in("rkdw", UnitTools.VOLUME_UNIT_LIST); + } else if (Arrays.asList(UnitTools.WEIGHT_UNIT_LIST).contains(rklUnit)) { + queryWrapper.in("rkdw", UnitTools.WEIGHT_UNIT_LIST); + } else { + queryWrapper.eq("rkdw", rklUnit); } BigDecimal rkl = baseMapper.sumRkl(queryWrapper); - - // 单位转换 - rkl = UnitTools.convert(rkl, rkdw); if(rkl == null) { - return null; + return ""; } - return rkl.toString() + rkdw; + rkl = UnitTools.convert(rkl, rklUnit); + DecimalFormat decimalFormat = new DecimalFormat("#,###.##"); // 定义格式 + String formatted = decimalFormat.format(rkl); + return formatted + rklUnit; } /** diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java index 163b0b4..c26fe4b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/UnitTools.java @@ -145,7 +145,7 @@ public class UnitTools { } // 验证单位是否支持 if (!UNIT_TO_LITER.containsKey(fromUnit)) { - return BigDecimal.ZERO; + return new BigDecimal(value); } String toUnit = ""; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java index 145ca05..ec4bd5d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java @@ -56,8 +56,8 @@ public class GspPdf { formData1.put(getName("名称"), gsp.getMc()); formData1.put(getName("编号"), gsp.getBh()); formData1.put(getName("批号"), gsp.getPh()); - formData1.put(getName("规格"), gsp.getGg() + gsp.getGgdw()); - formData1.put(getName("接收日期"), gsp.getGg() + gsp.getGgdw()); + formData1.put(getName("规格"), gsp.getGg()); + //formData1.put(getName("接收日期"), gsp.getGg() + gsp.getGgdw()); formData1.put(getName("库存量"), gsp.getKc() + gsp.getKcdw()); formData1.put(getName("有效期"), PdfExportUtil.parseDateToStr(gsp.getYxq())); formData1.put(getName("状态"), "en".equals(language) ? (GyzjJcnrUtil.getEn(ZjztEnum.getEnumByValue(gsp.getZjzt()).getText())) : ZjztEnum.getEnumByValue(gsp.getZjzt()).getText()); diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml index f36ffaf..5681472 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspFfjlMapper.xml @@ -21,7 +21,7 @@ SELECT SUM(basic_rkl + 0) AS total - FROM t_gsp_ffjl + FROM t_gsp_ffjl as t ${ew.sqlSegment} @@ -57,7 +57,7 @@ + \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspRkjlMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspRkjlMapper.xml index c5e9ccb..a034c9f 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspRkjlMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GspRkjlMapper.xml @@ -24,4 +24,5 @@ + \ No newline at end of file