|
@@ -20,7 +20,6 @@ import org.sky.scientific.excel.listener.CgJsbzImportListener;
|
|
|
import org.sky.scientific.mapper.CgJsbzMapper;
|
|
import org.sky.scientific.mapper.CgJsbzMapper;
|
|
|
import org.sky.scientific.mapper.XmMapper;
|
|
import org.sky.scientific.mapper.XmMapper;
|
|
|
import org.sky.scientific.pojo.entity.CgJsbzEntity;
|
|
import org.sky.scientific.pojo.entity.CgJsbzEntity;
|
|
|
-import org.sky.scientific.pojo.entity.XmEntity;
|
|
|
|
|
import org.sky.scientific.service.ICgJsbzService;
|
|
import org.sky.scientific.service.ICgJsbzService;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -79,7 +78,7 @@ public class CgJsbzServiceImpl extends BaseServiceImpl<CgJsbzMapper, CgJsbzEntit
|
|
|
if (isDuplicate(jsbzDTO)) {
|
|
if (isDuplicate(jsbzDTO)) {
|
|
|
throw new ServiceException("标准号/标准名称已存在");
|
|
throw new ServiceException("标准号/标准名称已存在");
|
|
|
}
|
|
}
|
|
|
- this.saveOrUpdate(jsbzDTO);
|
|
|
|
|
|
|
+ this.saveOrUpdate(jsbzDTO);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -96,12 +95,6 @@ public class CgJsbzServiceImpl extends BaseServiceImpl<CgJsbzMapper, CgJsbzEntit
|
|
|
if (isDuplicate(cgJsbz)) {
|
|
if (isDuplicate(cgJsbz)) {
|
|
|
throw new ServiceException("标准号/标准名称已存在");
|
|
throw new ServiceException("标准号/标准名称已存在");
|
|
|
}
|
|
}
|
|
|
- CgJsbzEntity dbJsbz = this.getById(cgJsbz.getId());
|
|
|
|
|
- if (!Objects.equals(dbJsbz.getXmbh(), cgJsbz.getXmbh())) {
|
|
|
|
|
- XmEntity dbXm = xmMapper.selectOne(Wrappers.<XmEntity>lambdaQuery().eq(XmEntity::getXmbh, cgJsbz.getXmbh()));
|
|
|
|
|
- cgJsbz.setXmId(dbXm != null ? dbXm.getId() : null);
|
|
|
|
|
- cgJsbz.setXmmc(dbXm != null ? dbXm.getXmmc() : null);
|
|
|
|
|
- }
|
|
|
|
|
return updateById(cgJsbz);
|
|
return updateById(cgJsbz);
|
|
|
}
|
|
}
|
|
|
|
|
|