|
|
|
@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import com.aucma.base.mapper.StationDefectRelationMapper;
|
|
|
|
|
import com.aucma.base.domain.StationDefectRelation;
|
|
|
|
|
import com.aucma.base.service.IStationDefectRelationService;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 质检工位/缺陷维护Service业务层处理
|
|
|
|
@ -17,8 +18,7 @@ import com.aucma.base.service.IStationDefectRelationService;
|
|
|
|
|
* @date 2023-11-27
|
|
|
|
|
*/
|
|
|
|
|
@Service
|
|
|
|
|
public class StationDefectRelationServiceImpl implements IStationDefectRelationService
|
|
|
|
|
{
|
|
|
|
|
public class StationDefectRelationServiceImpl implements IStationDefectRelationService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private StationDefectRelationMapper stationDefectRelationMapper;
|
|
|
|
|
|
|
|
|
@ -29,8 +29,7 @@ public class StationDefectRelationServiceImpl implements IStationDefectRelationS
|
|
|
|
|
* @return 质检工位/缺陷维护
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public StationDefectRelation selectStationDefectRelationByObjId(Long objId)
|
|
|
|
|
{
|
|
|
|
|
public StationDefectRelation selectStationDefectRelationByObjId(Long objId) {
|
|
|
|
|
return stationDefectRelationMapper.selectStationDefectRelationByObjId(objId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -41,8 +40,7 @@ public class StationDefectRelationServiceImpl implements IStationDefectRelationS
|
|
|
|
|
* @return 质检工位/缺陷维护
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<StationDefectRelation> selectStationDefectRelationList(StationDefectRelation stationDefectRelation)
|
|
|
|
|
{
|
|
|
|
|
public List<StationDefectRelation> selectStationDefectRelationList(StationDefectRelation stationDefectRelation) {
|
|
|
|
|
return stationDefectRelationMapper.selectStationDefectRelationList(stationDefectRelation);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -53,14 +51,20 @@ public class StationDefectRelationServiceImpl implements IStationDefectRelationS
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int insertStationDefectRelation(StationDefectRelation stationDefectRelation)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public int insertStationDefectRelation(StationDefectRelation stationDefectRelation) {
|
|
|
|
|
int i = 1;
|
|
|
|
|
if (!stationDefectRelation.getDefectCodeList().isEmpty()) {
|
|
|
|
|
List<String> defectCodeList = stationDefectRelation.getDefectCodeList();
|
|
|
|
|
for (String defectCode : defectCodeList) {
|
|
|
|
|
try {
|
|
|
|
|
i = stationDefectRelationMapper.insertStationDefectRelation(stationDefectRelation);
|
|
|
|
|
stationDefectRelation.setDefectCode(defectCode);
|
|
|
|
|
stationDefectRelationMapper.insertStationDefectRelation(stationDefectRelation);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new ServiceException("该工位已绑定此缺陷!");
|
|
|
|
|
throw new ServiceException("该工位已绑定" + stationDefectRelation.getDefectCode() + "缺陷编号!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
@ -72,8 +76,7 @@ public class StationDefectRelationServiceImpl implements IStationDefectRelationS
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int updateStationDefectRelation(StationDefectRelation stationDefectRelation)
|
|
|
|
|
{
|
|
|
|
|
public int updateStationDefectRelation(StationDefectRelation stationDefectRelation) {
|
|
|
|
|
int i = 0;
|
|
|
|
|
try {
|
|
|
|
|
i = stationDefectRelationMapper.updateStationDefectRelation(stationDefectRelation);
|
|
|
|
@ -90,8 +93,7 @@ public class StationDefectRelationServiceImpl implements IStationDefectRelationS
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteStationDefectRelationByObjIds(Long[] objIds)
|
|
|
|
|
{
|
|
|
|
|
public int deleteStationDefectRelationByObjIds(Long[] objIds) {
|
|
|
|
|
return stationDefectRelationMapper.deleteStationDefectRelationByObjIds(objIds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -102,8 +104,7 @@ public class StationDefectRelationServiceImpl implements IStationDefectRelationS
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteStationDefectRelationByObjId(Long objId)
|
|
|
|
|
{
|
|
|
|
|
public int deleteStationDefectRelationByObjId(Long objId) {
|
|
|
|
|
return stationDefectRelationMapper.deleteStationDefectRelationByObjId(objId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|