| | |
| | | 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.HzBasicVo; |
| | | import com.gkhy.hazmat.system.domain.vo.HzSecientificVo; |
| | | import com.gkhy.hazmat.system.mapper.HzHazmatBasicMapper; |
| | | import com.gkhy.hazmat.system.mapper.HzSecientificMapper; |
| | |
| | | @Override |
| | | public CommonPage selectHazmatBasicList(HzHazmatBasic hazmatBasic) { |
| | | SysUser currentUser = SecurityUtils.getLoginUser().getUser(); |
| | | if (!currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())) { |
| | | if (!currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode()) && !currentUser.getUserType().equals(UserTypeEnum.CHECK_USER.getCode())) { |
| | | hazmatBasic.setCompanyId(currentUser.getCompanyId()); |
| | | } |
| | | PageUtils.startPage(); |
| | |
| | | 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) { |
| | |
| | | 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("更新危化品基础信息失败"); |
| | |
| | | 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); |
| | |
| | | return hazmatBasicList.size(); |
| | | } |
| | | |
| | | @Override |
| | | public List<HzBasicVo> basicCount() { |
| | | return baseMapper.basicCount(); |
| | | } |
| | | |
| | | |
| | | public void validateData(HazmatBasicExcelData hazmatBasicExcelData){ |
| | | if(StringUtils.isBlank(hazmatBasicExcelData.getName())){ |