Просмотр исходного кода

处理销售停用后继续发送问题

yjwang 1 месяц назад
Родитель
Сommit
7ddfe87daf

+ 11 - 9
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -340,18 +340,20 @@ public class CompanyServiceImpl implements ICompanyService
                 deptConfig.setPadNumSub(subNum);
                 deptConfig.setUpdateBy(company.getCreateBy());
                 deptConfig.setUpdateTime(new Date());
-                //加入ipad停用逻辑
-                Long[] companyIds = {company.getCompanyId()};
-                String key = IPAD_DEACTIVATE + companyInfo.getCompanyId();
-                Integer cacheValue = redisCache.getCacheObject(key);
-                if(company.getStatus() != null && company.getStatus() == 1 && (cacheValue == null || cacheValue == 1)){//启用
-                    oneClickEnable(companyIds,null);
-                }else if(company.getStatus() != null && companyInfo.getIpadDeactivate() == 1 && (cacheValue == null || cacheValue == 0)){//停用
-                    oneClickDisable(companyIds,null);
-                }
                 sysDeptConfigLogService.addLog(deptConfig.getDeptId(), 0, 1, changeNum + "", first + "", subNum + "", deptConfig.getUpdateBy(), "修改公司PAD");
                 sysDeptConfigService.updateById(deptConfig);
             }
+            //加入ipad停用逻辑
+            Long[] companyIds = {company.getCompanyId()};
+            String key = IPAD_DEACTIVATE + companyInfo.getCompanyId();
+            Integer cacheValue = redisCache.getCacheObject(key);
+            if(company.getStatus() != null && company.getStatus() == 1 && (cacheValue == null || cacheValue == 1)){//启用
+                company.setIpadDeactivate(0);
+                oneClickEnable(companyIds,null);
+            }else if(company.getStatus() != null  && (cacheValue == null || cacheValue == 0)){//停用
+                company.setIpadDeactivate(1);
+                oneClickDisable(companyIds,null);
+            }
         }
         return companyMapper.updateCompany(company);
     }