|
@@ -88,7 +88,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
lantoneProduct.setGmtCreate(DateUtil.now());
|
|
|
lantoneProduct.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
if (!save(lantoneProduct)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
|
|
|
"产品添加失败");
|
|
|
}
|
|
|
return true;
|
|
@@ -109,7 +109,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}
|
|
|
LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
|
|
|
if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
"该产品已删除");
|
|
|
}
|
|
|
BeanUtil.copyProperties(updateProductVO, lantoneProduct);
|
|
@@ -126,7 +126,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
if (!updateById(lantoneProduct)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
|
|
|
"产品修改失败");
|
|
|
}
|
|
|
return true;
|
|
@@ -141,7 +141,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
public Boolean stopProduct(UpdateProductVO updateProductVO) {
|
|
|
LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
|
|
|
if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
"该产品已删除");
|
|
|
}
|
|
|
if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Enable.getKey()){
|
|
@@ -184,7 +184,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
if (!updateById(lantoneProduct)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
|
|
|
"产品修改失败");
|
|
|
}
|
|
|
return true;
|
|
@@ -199,7 +199,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
public Boolean deleteProduct(UpdateProductVO updateProductVO) {
|
|
|
LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
|
|
|
if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
"该产品已删除");
|
|
|
}
|
|
|
if(lantoneProduct.getServiceStatus()==StatusEnum.Enable.getKey()){
|
|
@@ -217,11 +217,11 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
lantoneProduct.setGmtModified(DateUtil.now());
|
|
|
lantoneProduct.setIsDeleted(IsDeleteEnum.Y.getKey());
|
|
|
if (!updateById(lantoneProduct)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
|
|
|
"产品删除失败");
|
|
|
}
|
|
|
if(!productServiceFacade.deleteByProductId(updateProductVO.getId())){
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
|
|
|
"产品令牌删除失败");
|
|
|
}
|
|
|
return true;
|
|
@@ -239,7 +239,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
userIdList.add(userId);
|
|
|
RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(userIdList);
|
|
|
if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"获取用户机构信息失败");
|
|
|
}
|
|
|
|
|
@@ -309,7 +309,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}
|
|
|
RespDTO<User> mapRespDTO = userServiceClient.getUserAuthStatus(userId);
|
|
|
if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"获取用户机构信息失败");
|
|
|
}
|
|
|
Map map =new HashMap();
|
|
@@ -327,9 +327,11 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
* @return 当条产品线下所有订单信息
|
|
|
*/
|
|
|
public IPage<OpendProductDTO> opendedProduct(OppendedProductVO oppendedProductVO) {
|
|
|
- LantoneProduct lantoneProduct = this.getById(oppendedProductVO.getProductId());
|
|
|
- if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ LantoneProduct lantoneProduct = new LantoneProduct();
|
|
|
+ lantoneProduct.setId(oppendedProductVO.getProductId());
|
|
|
+ LantoneProduct lantoneProducts = this.getById(lantoneProduct.getId());
|
|
|
+ if(lantoneProducts.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
"该产品已删除");
|
|
|
}
|
|
|
Page page =new Page();
|
|
@@ -345,7 +347,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}else{
|
|
|
RespDTO<List<User>> userInfiList = userServiceClient.getUserAllInfo();
|
|
|
if(userInfiList == null || !"0".equals(userInfiList.code) ) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"获取用户和机构信息失败");
|
|
|
}
|
|
|
List<Long> userIds =new ArrayList<>();
|
|
@@ -362,7 +364,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}
|
|
|
RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(list1);
|
|
|
if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"获取用户和机构信息失败");
|
|
|
}
|
|
|
Map<Long, UserOrgDTO> dataMap = mapRespDTO.data;
|