|
@@ -14,6 +14,7 @@ import com.diagbot.entity.LantoneProduct;
|
|
|
import com.diagbot.entity.OpenedProducts;
|
|
|
import com.diagbot.entity.OpenedProductsIndex;
|
|
|
import com.diagbot.entity.ServiceInfo;
|
|
|
+import com.diagbot.entity.User;
|
|
|
import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
|
import com.diagbot.entity.wrapper.ServiceInfoWrapper;
|
|
|
import com.diagbot.enums.AccessTypeEnum;
|
|
@@ -65,7 +66,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
* @return Boolean true
|
|
|
*/
|
|
|
public Boolean addProducts(AddProductsVO addProductsVO) {
|
|
|
- if(addProductsVO.getName().equals(this.selectProductByName(addProductsVO.getName()).getName())){
|
|
|
+ LantoneProduct lantoneProductInfos = this.selectProductByName(addProductsVO.getName());
|
|
|
+ if(lantoneProductInfos != null && addProductsVO.getName().equals(lantoneProductInfos.getName())){
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
"产品名称重复");
|
|
|
}
|
|
@@ -88,7 +90,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
* @return Boolean true
|
|
|
*/
|
|
|
public Boolean updateProduct(UpdateProductVO updateProductVO) {
|
|
|
- if(updateProductVO.getName().equals(this.selectProductByName(updateProductVO.getName()).getName())){
|
|
|
+ LantoneProduct lantoneProductInfo = this.selectProductByName(updateProductVO.getName());
|
|
|
+ if(updateProductVO.getName().equals(lantoneProductInfo.getName()) && updateProductVO.getId() != lantoneProductInfo.getId()){
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
"产品名称重复");
|
|
|
}
|
|
@@ -96,7 +99,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
BeanUtil.copyProperties(updateProductVO, lantoneProduct);
|
|
|
lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
lantoneProduct.setGmtModified(DateUtil.now());
|
|
|
- if(updateProductVO.getServiceStatus()==StatusEnum.Disable.getKey()){
|
|
|
+ if(null != updateProductVO.getServiceStatus() && updateProductVO.getServiceStatus()==StatusEnum.Disable.getKey()){
|
|
|
Page page =new Page();
|
|
|
OpenedProductsIndex openedProductsIndex =new OpenedProductsIndex();
|
|
|
openedProductsIndex.setProductId(updateProductVO.getId());
|
|
@@ -250,19 +253,13 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
productLineDTO.setProductAudit(ProductAuditEnum.NotOpend.getKey());
|
|
|
}
|
|
|
}
|
|
|
- RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(userIdList);
|
|
|
+ RespDTO<User> mapRespDTO = userServiceClient.getUserAuthStatus(userId);
|
|
|
if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
"获取用户机构信息失败");
|
|
|
}
|
|
|
- Map<Long, UserOrgDTO> dataMap =mapRespDTO.data;
|
|
|
- UserOrgDTO uo =dataMap.get(userId);
|
|
|
Map map =new HashMap();
|
|
|
- if(uo.getAuStatus() == null){
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "账号信息不完善");
|
|
|
- }
|
|
|
- map.put("userAuStatus",uo.getAuStatus());
|
|
|
+ map.put("userAuStatus",mapRespDTO.data.getAuthStatus());
|
|
|
List list =new ArrayList();
|
|
|
list.add(productLineDTOList);
|
|
|
list.add(map);
|