| | |
| | | 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; |
| | |
| | | */ |
| | | @Service |
| | | public class HzHazmatBasicServiceImpl extends ServiceImpl<HzHazmatBasicMapper, HzHazmatBasic> implements HzHazmatBasicService { |
| | | |
| | | |
| | | @Autowired |
| | | private HzSecientificMapper secientificMapper; |
| | | |
| | | @Override |
| | | public CommonPage selectHazmatBasicList(HzHazmatBasic hazmatBasic) { |
| | |
| | | throw new ApiException("产品编号已存在"); |
| | | } |
| | | checkUserAllowed(null,currentUser); |
| | | |
| | | HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(hazmatBasic.getName()); |
| | | hazmatBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : null); |
| | | hazmatBasic.setPeculiarityNumber(hzSecientificVo!=null? hzSecientificVo.getPeculiarityNumber() : 0); |
| | | |
| | | int row = baseMapper.insert(hazmatBasic); |
| | | if (row < 1) { |
| | |
| | | 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.setKind(kind); |
| | | hazmatBasic.setMinPackage(minPackage); |
| | | hazmatBasic.setCompanyId(currentUser.getCompanyId()); |