zouyu
2023-11-14 03ca4f4f48b3bd60cd07832dfe748f9f69167ac6
mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/CustomerOrderServiceImpl.java
@@ -187,6 +187,14 @@
   private Environment environment;
   private final static String OTC_MAIN_STATUS_CANCEL = "已取消";
   private final static String OTC_MAIN_STATUS_TRANSMIT = "已下达";
   private final static String AFFILIATED_CONTRACT = "中天注塑厂";
   @Override
   public void otcDownload(Long id, HttpServletResponse response) {
      customerOrderUtil.otcDownLoadFiles(id, response);
@@ -655,6 +663,7 @@
    * @return
    */
   @Override
   @Transactional(rollbackFor = Exception.class)
   public R otcCustomerOrderSync(String selectTime, String pathCode) {
      try {
         if (StringUtils.isBlank(selectTime)) {
@@ -705,7 +714,7 @@
               //所属工厂
               String affiliatedContract=customerJSONObject.getString("affiliatedContract");
               //只拉取所属公司为中天海洋系统有限公司的数据
               if (!"中天材料厂".equals(affiliatedContract)){
               if (!AFFILIATED_CONTRACT.equals(affiliatedContract)){
                  continue;
               }
               // 不在这几个状态中的数据就跳过
@@ -717,14 +726,14 @@
                  customer = new Customer();
               }
               //如果OTC中主表状态是取消那就跳过或者删除已经同步的数据
               if ("已取消".equals(otcMainStatus)) {
               if (OTC_MAIN_STATUS_CANCEL.equals(otcMainStatus)) {
                  if (customer.getId() != null) {
                     customerMapper.deleteById(customer.getId());
                     baseMapper.delete(Wrappers.<CustomerOrder>lambdaQuery().eq(CustomerOrder::getCustomerId, customer.getId()));
                  }
                  continue;
               }
               if (!"已下达".equals(otcMainStatus)) {//null == affiliatedCompany || !Arrays.asList("已下达").contains(otcMainStatus) /*|| affiliatedCompany.equals("江苏中天科技股份有限公司")*/) {
               if (!OTC_MAIN_STATUS_TRANSMIT.equals(otcMainStatus)) {//null == affiliatedCompany || !Arrays.asList("已下达").contains(otcMainStatus) /*|| affiliatedCompany.equals("江苏中天科技股份有限公司")*/) {
                  continue;//只获取OTC中已审核及已下达的订单,
               }
               //客户编号