|
@@ -382,18 +382,16 @@ public class AuthProductServiceImpl implements AuthProductService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public ResponseJson saveProductAndRelaTion(Integer authId, List<String> snlist, Integer authType) throws IOException {
|
|
|
+ public ResponseJson saveProductAndRelaTion(Integer authId, List<String> snlist, Integer authType) {
|
|
|
//判断机构关联id是否有值(有则机构关联关联了其他机构属于新增操作,无则属于编辑操作)
|
|
|
String relaId = authProductMapper.getRelationId(authId);
|
|
|
List<Integer> listSnId = new ArrayList<>();
|
|
|
- if (null != relaId && !"".equals(relaId)) {
|
|
|
+ if (null != relaId) {
|
|
|
//根据sn码获取产品id
|
|
|
for (int i = 0; i < snlist.size(); i++) {
|
|
|
List<ProductPo> List = authProductMapper.getSnList(snlist.get(i));
|
|
|
//判断本身机构下的设备和关联机构下 设备有不有重复的
|
|
|
- if (!List.get(0).getAuthId().equals(authId)) {
|
|
|
- listSnId.add(List.get(0).getProductId());
|
|
|
- }
|
|
|
+ listSnId.add(List.get(0).getProductId());
|
|
|
}
|
|
|
//根据产品id插入机构设备关联关系
|
|
|
for (int i = 0; i < snlist.size(); i++) {
|
|
@@ -405,9 +403,7 @@ public class AuthProductServiceImpl implements AuthProductService {
|
|
|
for (int i = 0; i < snlist.size(); i++) {
|
|
|
List<ProductPo> List = authProductMapper.getSnList(snlist.get(i));
|
|
|
//判断本身机构下的设备和关联机构下 设备有不有重复的
|
|
|
- if (!List.get(0).getAuthId().equals(authId)) {
|
|
|
- listSnId.add(List.get(0).getProductId());
|
|
|
- }
|
|
|
+ listSnId.add(List.get(0).getProductId());
|
|
|
}
|
|
|
//根据产品id插入机构设备关联关系
|
|
|
for (int i = 0; i < snlist.size(); i++) {
|
|
@@ -645,7 +641,7 @@ public class AuthProductServiceImpl implements AuthProductService {
|
|
|
paramList = authProductMapper.getParamsByProductId(productForm.getProductId());
|
|
|
}
|
|
|
productForm.setParamList(paramList);
|
|
|
- if (null!=productForm.getAuthDates()) {
|
|
|
+ if (null != productForm.getAuthDates()) {
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String authDate = simpleDateFormat.format(productForm.getAuthDates());
|
|
|
productForm.setAuthDate(authDate);
|