|
|
@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
import com.uas.erp.schedular.database.RestJdbcTemplate;
|
|
|
import com.uas.erp.schedular.entity.Master;
|
|
|
+import com.uas.erp.schedular.entity.MasterTaskConfigEntity;
|
|
|
+import com.uas.erp.schedular.entity.MasterTaskConfigId;
|
|
|
+import com.uas.erp.schedular.service.ScheduledTaskService;
|
|
|
import com.uas.erp.schedular.service.SettingService;
|
|
|
import com.uas.erp.schedular.util.ContextHolder;
|
|
|
import com.uas.erp.schedular.web.ResultListWrap;
|
|
|
@@ -33,6 +36,9 @@ import java.util.List;
|
|
|
@Component
|
|
|
public class ListenTask {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ScheduledTaskService scheduledTaskService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
@@ -114,11 +120,15 @@ public class ListenTask {
|
|
|
str.append("、" + (StringUtils.isEmpty(master.getMa_function()) ? master.getMa_name() : master.getMa_function()));
|
|
|
}
|
|
|
}
|
|
|
- ListenDomain listenDomain = new ListenDomain(MACADDRESS,
|
|
|
- str == null ? "" : str.toString());
|
|
|
- List<ListenDomain> listenDomains = new ArrayList<>();
|
|
|
- listenDomains.add(listenDomain);
|
|
|
- postForList(getApiDomain() + "/erp/listen", ListenDomain.class, dataWrap(listenDomains));
|
|
|
+ MasterTaskConfigId configId = new MasterTaskConfigId(null, null, masters.get(0).getMa_name());
|
|
|
+ List<MasterTaskConfigEntity> taskConfigs = scheduledTaskService.getTaskConfigs(configId, "b2b", "BUYER");
|
|
|
+ if (!CollectionUtils.isEmpty(taskConfigs)) {
|
|
|
+ ListenDomain listenDomain = new ListenDomain(MACADDRESS,
|
|
|
+ str == null ? "" : str.toString());
|
|
|
+ List<ListenDomain> listenDomains = new ArrayList<>();
|
|
|
+ listenDomains.add(listenDomain);
|
|
|
+ postForList(getApiDomain() + "/erp/listen", ListenDomain.class, dataWrap(listenDomains));
|
|
|
+ }
|
|
|
} else {
|
|
|
ListenDomain listenDomain = new ListenDomain(MACADDRESS, "" );
|
|
|
List<ListenDomain> listenDomains = new ArrayList<>();
|