|
@@ -6,16 +6,10 @@ import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
import com.diagbot.dto.WaitExamOrderCouDTO;
|
|
import com.diagbot.dto.WaitExamOrderCouDTO;
|
|
import com.diagbot.entity.LantoneProduct;
|
|
import com.diagbot.entity.LantoneProduct;
|
|
-import com.diagbot.entity.OpenedProducts;
|
|
|
|
import com.diagbot.entity.OrderDetails;
|
|
import com.diagbot.entity.OrderDetails;
|
|
-import com.diagbot.entity.OrderDetailsIndex;
|
|
|
|
import com.diagbot.entity.ProductOrder;
|
|
import com.diagbot.entity.ProductOrder;
|
|
import com.diagbot.entity.ProductOrderIndex;
|
|
import com.diagbot.entity.ProductOrderIndex;
|
|
-import com.diagbot.entity.ServiceInfo;
|
|
|
|
-import com.diagbot.entity.wrapper.OrderDetailsWapper;
|
|
|
|
import com.diagbot.entity.wrapper.ProductOrderWrapper;
|
|
import com.diagbot.entity.wrapper.ProductOrderWrapper;
|
|
-import com.diagbot.enums.AuditStatusEnum;
|
|
|
|
-import com.diagbot.enums.TokenTypeEnum;
|
|
|
|
import com.diagbot.enums.VisibleIdTypeEnum;
|
|
import com.diagbot.enums.VisibleIdTypeEnum;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -25,11 +19,7 @@ import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.vo.AddOrderVO;
|
|
import com.diagbot.vo.AddOrderVO;
|
|
-import com.diagbot.vo.AuditStatusVO;
|
|
|
|
-import com.diagbot.vo.OrderDetialsVO;
|
|
|
|
import com.diagbot.vo.ProductOrderVO;
|
|
import com.diagbot.vo.ProductOrderVO;
|
|
-import com.diagbot.vo.ProductServiceSaveVO;
|
|
|
|
-import com.diagbot.vo.ServiceSaveVO;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -135,52 +125,6 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
return waitExamOrderCouDTO;
|
|
return waitExamOrderCouDTO;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * @Description: 产品申请查询所有订单明细
|
|
|
|
- * @Author: wangyu
|
|
|
|
- * @Date: 16:19 2018/9/21
|
|
|
|
- */
|
|
|
|
- public List<OrderDetailsWapper> getAllOrderDetials(OrderDetialsVO orderDetialsVO){
|
|
|
|
- OrderDetailsIndex orderDetailsIndex =new OrderDetailsIndex();
|
|
|
|
- Long curren = orderDetialsVO.getCurrent();
|
|
|
|
- Long size =orderDetialsVO.getSize();
|
|
|
|
- if(curren==null){
|
|
|
|
- orderDetialsVO.setCurrent(1L);
|
|
|
|
- }
|
|
|
|
- if (size==null){
|
|
|
|
- orderDetialsVO.setSize(10L);
|
|
|
|
- }
|
|
|
|
- BeanUtil.copyProperties(orderDetialsVO, orderDetailsIndex);
|
|
|
|
- orderDetailsIndex.setIndex((orderDetialsVO.getCurrent().longValue()-1)*orderDetialsVO.getSize().longValue());
|
|
|
|
-
|
|
|
|
- orderDetailsIndex.setUserId(1L);
|
|
|
|
- List<OrderDetailsWapper> list =orderDetailsFacade.seleAllOrderDetials(orderDetailsIndex);
|
|
|
|
- List<Long> list1 =new ArrayList<>();
|
|
|
|
- for (OrderDetails orderDetails:list) {
|
|
|
|
- Long longs = orderDetails.getUserId();
|
|
|
|
- list1.add(longs);
|
|
|
|
- }
|
|
|
|
- RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(list1);
|
|
|
|
- if(mapRespDTO == null || !"0".equals(mapRespDTO.code) ) {
|
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
- "获取用户和机构信息失败");
|
|
|
|
- }
|
|
|
|
- Map<Long, UserOrgDTO> dataMap = mapRespDTO.data;
|
|
|
|
- for(OrderDetailsWapper bean : list) {
|
|
|
|
- UserOrgDTO uo = dataMap.get(bean.getUserId());
|
|
|
|
- if(uo != null) {
|
|
|
|
- bean.setUsername(uo.getUsername());
|
|
|
|
- bean.setLinkman(uo.getLinkman());
|
|
|
|
- bean.setEmail(uo.getEmail());
|
|
|
|
- bean.setOrgId(uo.getOrgId());
|
|
|
|
- bean.setOrgName(uo.getOrgName());
|
|
|
|
- bean.setIsReject(uo.getIsReject());
|
|
|
|
- bean.setAuStatus(uo.getAuStatus());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* @Description: 产品申请查询所有订单信息
|
|
* @Description: 产品申请查询所有订单信息
|
|
* @Author: wangyu
|
|
* @Author: wangyu
|
|
@@ -225,62 +169,6 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * @Description: 产品申请审核接口
|
|
|
|
- * @Author: wangyu
|
|
|
|
- * @Date: 21:39 2018/9/24
|
|
|
|
- */
|
|
|
|
- @Transactional
|
|
|
|
- public Boolean updateAuditStatus(AuditStatusVO auditStatusVO){
|
|
|
|
- OrderDetails orderDetails =orderDetailsFacade.getById(auditStatusVO.getId());
|
|
|
|
- if(orderDetails==null){
|
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
- "订单明细不存在");
|
|
|
|
- }
|
|
|
|
- orderDetails.setGmtModified(DateUtil.now());
|
|
|
|
- orderDetails.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
|
- orderDetails.setAuditStatus(auditStatusVO.getAuditStatus());
|
|
|
|
- //TODO 审核不通过
|
|
|
|
- if(auditStatusVO.getAuditStatus()== AuditStatusEnum.Veto.getKey()){
|
|
|
|
- if(!orderDetailsFacade.updateById(orderDetails)){
|
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
- "审核状态修改失败");
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- //TODO 审核通过 添加已开通产品 判断产品类型是否有online(添加服务 服务产品表 token表)
|
|
|
|
- if(!orderDetailsFacade.updateById(orderDetails)){
|
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
- "审核状态修改失败");
|
|
|
|
- }
|
|
|
|
- Long userId =Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
|
- OpenedProducts openedProducts =new OpenedProducts();
|
|
|
|
- openedProducts.setGmtCreate(DateUtil.now());
|
|
|
|
- openedProducts.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
|
- openedProducts.setProductId(1L);
|
|
|
|
- openedProducts.setUserId(userId);
|
|
|
|
- openedProducts.setStartTime(auditStatusVO.getStartTime());
|
|
|
|
- openedProducts.setEndTime(auditStatusVO.getEndTime());
|
|
|
|
- openedProducts.setOrderId(1L);
|
|
|
|
- openedProductsFacade.save(openedProducts);
|
|
|
|
- LantoneProduct lantoneProduct =new LantoneProduct();
|
|
|
|
- if(lantoneProductFacade.getById(lantoneProduct).getAccessType().indexOf(TokenTypeEnum.Online.getKey())==-1){
|
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
- "该产品没有线上模式");
|
|
|
|
- }
|
|
|
|
- ServiceSaveVO serviceSaveVO =new ServiceSaveVO();
|
|
|
|
- serviceSaveVO.setDescription(lantoneProduct.getDecription());
|
|
|
|
- serviceSaveVO.setName(lantoneProduct.getName());
|
|
|
|
- serviceSaveVO.setType(TokenTypeEnum.Online.getKey());
|
|
|
|
- ServiceInfo serviceInfo = serviceInfoFacade.createService(serviceSaveVO);
|
|
|
|
- ProductServiceSaveVO productServiceSaveVO =new ProductServiceSaveVO();
|
|
|
|
- productServiceSaveVO.setProductId(auditStatusVO.getId());
|
|
|
|
- productServiceSaveVO.setServiceId(serviceInfo.getId());
|
|
|
|
- productServiceSaveVO.setType(TokenTypeEnum.Online.getKey());
|
|
|
|
- productServiceFacade.genProductService(productServiceSaveVO);
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|