From 07a6e79342c381d4d8c98a92a216c41dc9502a09 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: Thu, 06 Mar 2025 08:40:40 +0800
Subject: [PATCH] git
---
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java b/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java
index 9d4e01f..6ff2ff0 100644
--- a/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java
+++ b/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java
@@ -16,9 +16,12 @@
import com.gkhy.hazmat.common.utils.SecurityUtils;
import com.gkhy.hazmat.common.utils.StringUtils;
import com.gkhy.hazmat.system.domain.HzHazmatBasic;
+import com.gkhy.hazmat.system.domain.vo.HzSecientificVo;
import com.gkhy.hazmat.system.mapper.HzHazmatBasicMapper;
+import com.gkhy.hazmat.system.mapper.HzSecientificMapper;
import com.gkhy.hazmat.system.service.HzHazmatBasicService;
import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@@ -39,6 +42,10 @@
*/
@Service
public class HzHazmatBasicServiceImpl extends ServiceImpl<HzHazmatBasicMapper, HzHazmatBasic> implements HzHazmatBasicService {
+
+
+ @Autowired
+ private HzSecientificMapper secientificMapper;
@Override
public CommonPage selectHazmatBasicList(HzHazmatBasic hazmatBasic) {
@@ -73,6 +80,11 @@
}
checkUserAllowed(null,currentUser);
+ HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(hazmatBasic.getName());
+ hazmatBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : null);
+ hazmatBasic.setPeculiarityNumber(hzSecientificVo!=null? hzSecientificVo.getPeculiarityNumber() : 0);
+ hazmatBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
+
int row = baseMapper.insert(hazmatBasic);
if (row < 1) {
throw new ApiException("新增危化品基础信息失败");
@@ -88,6 +100,10 @@
SysUser currentUser = SecurityUtils.getLoginUser().getUser();
checkUserAllowed(hazmatBasic,currentUser);
hazmatBasic.setUpdateBy(currentUser.getUsername());
+ HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(hazmatBasic.getName());
+ hazmatBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : null);
+ hazmatBasic.setPeculiarityNumber(hzSecientificVo!=null? hzSecientificVo.getPeculiarityNumber() : 0);
+ hazmatBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
int row=baseMapper.updateById(hazmatBasic);
if(row<1){
throw new ApiException("更新危化品基础信息失败");
@@ -155,6 +171,12 @@
if(minPackage==null){
throw new ApiException("序号"+hazmatBasicExcelData.getIndex()+"最小包装类型填写不正确");
}
+
+ HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(hazmatBasic.getName());
+ hazmatBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : "");
+ hazmatBasic.setPeculiarityNumber(hzSecientificVo!=null? hzSecientificVo.getPeculiarityNumber() : 0);
+ hazmatBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
+
hazmatBasic.setKind(kind);
hazmatBasic.setMinPackage(minPackage);
hazmatBasic.setCompanyId(currentUser.getCompanyId());
--
Gitblit v1.9.2