|
@@ -5,10 +5,10 @@ import com.zd.common.core.security.TokenService;
|
|
|
import com.zd.common.core.utils.StringUtils;
|
|
import com.zd.common.core.utils.StringUtils;
|
|
|
import com.zd.laboratory.domain.XxpCardInfo;
|
|
import com.zd.laboratory.domain.XxpCardInfo;
|
|
|
import com.zd.laboratory.domain.XxpInspection;
|
|
import com.zd.laboratory.domain.XxpInspection;
|
|
|
|
|
+import com.zd.laboratory.domain.XxpUserAuth;
|
|
|
import com.zd.laboratory.mapper.XxpCardInfoMapper;
|
|
import com.zd.laboratory.mapper.XxpCardInfoMapper;
|
|
|
-import com.zd.laboratory.mapper.XxpInspectionMapper;
|
|
|
|
|
|
|
+import com.zd.laboratory.mapper.XxpUserAuthMapper;
|
|
|
import com.zd.laboratory.service.IXxpCardInfoService;
|
|
import com.zd.laboratory.service.IXxpCardInfoService;
|
|
|
-import com.zd.laboratory.service.IXxpInspectionService;
|
|
|
|
|
import com.zd.model.entity.SysUser;
|
|
import com.zd.model.entity.SysUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -31,6 +31,8 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private XxpUserAuthMapper xxpUserAuthMapper;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询电子信息牌
|
|
* 查询电子信息牌
|
|
@@ -105,6 +107,15 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public int deleteXxpCardInfoByIds(Long[] ids) {
|
|
public int deleteXxpCardInfoByIds(Long[] ids) {
|
|
|
|
|
+ for (Long id:ids) {
|
|
|
|
|
+ XxpUserAuth auth = new XxpUserAuth();
|
|
|
|
|
+ auth.setHardwareId(id);
|
|
|
|
|
+ List<XxpUserAuth> list = xxpUserAuthMapper.selectXxpUserAuthList(auth);
|
|
|
|
|
+ if(list.size()>0){
|
|
|
|
|
+ XxpCardInfo info= xxpCardInfoMapper.selectXxpCardInfoById(id);
|
|
|
|
|
+ throw new ServiceException("信息牌编号:"+info.getCardName()+",下存在授权人员!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return xxpCardInfoMapper.deleteXxpCardInfoByIds(ids);
|
|
return xxpCardInfoMapper.deleteXxpCardInfoByIds(ids);
|
|
|
}
|
|
}
|
|
@@ -117,7 +128,12 @@ public class XxpCardInfoServiceImpl implements IXxpCardInfoService
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public int deleteXxpCardInfoById(Long id) {
|
|
public int deleteXxpCardInfoById(Long id) {
|
|
|
-
|
|
|
|
|
|
|
+ XxpUserAuth auth = new XxpUserAuth();
|
|
|
|
|
+ auth.setHardwareId(id);
|
|
|
|
|
+ List<XxpUserAuth> list = xxpUserAuthMapper.selectXxpUserAuthList(auth);
|
|
|
|
|
+ if(list.size()>0){
|
|
|
|
|
+ throw new ServiceException("信息牌下存在授权人员!");
|
|
|
|
|
+ }
|
|
|
return xxpCardInfoMapper.deleteXxpCardInfoById(id);
|
|
return xxpCardInfoMapper.deleteXxpCardInfoById(id);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|