|
|
@ -20,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取木渎新增企业定时任务
|
|
|
|
* 获取木渎新增企业定时任务
|
|
|
@ -30,6 +31,9 @@ import java.util.List;
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
@EnableScheduling
|
|
|
|
@EnableScheduling
|
|
|
|
|
|
|
|
//@RestController
|
|
|
|
|
|
|
|
//@RequestMapping("pharmaceuticals/ent")
|
|
|
|
|
|
|
|
//@Api(tags = "新增")
|
|
|
|
public class EntQuartz {
|
|
|
|
public class EntQuartz {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
@ -50,6 +54,12 @@ public class EntQuartz {
|
|
|
|
@Value("${findEntDelUrl}")
|
|
|
|
@Value("${findEntDelUrl}")
|
|
|
|
private String findEntDelUrl;
|
|
|
|
private String findEntDelUrl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${findAddEntByDate}")
|
|
|
|
|
|
|
|
private String findAddEntByDate;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${findCode}")
|
|
|
|
|
|
|
|
private String findCode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getToken() {
|
|
|
|
private String getToken() {
|
|
|
|
return "Bearer " + loginService.getToken();
|
|
|
|
return "Bearer " + loginService.getToken();
|
|
|
@ -87,7 +97,7 @@ public class EntQuartz {
|
|
|
|
qyjcxxService.save(x);
|
|
|
|
qyjcxxService.save(x);
|
|
|
|
// 添加新增日志
|
|
|
|
// 添加新增日志
|
|
|
|
ASafeQyjcxxMdLog qyjcxxMdLog = BeanUtil.copyProperties(x, ASafeQyjcxxMdLog.class);
|
|
|
|
ASafeQyjcxxMdLog qyjcxxMdLog = BeanUtil.copyProperties(x, ASafeQyjcxxMdLog.class);
|
|
|
|
qyjcxxMdLog.setGxorxz(0);
|
|
|
|
qyjcxxMdLog.setGxorxz(1);
|
|
|
|
qyjcxxMdLogService.save(qyjcxxMdLog);
|
|
|
|
qyjcxxMdLogService.save(qyjcxxMdLog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -118,4 +128,31 @@ public class EntQuartz {
|
|
|
|
qyjcxxService.updateByTyshxybm(tyshxybmList);
|
|
|
|
qyjcxxService.updateByTyshxybm(tyshxybmList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 删除不存在于木渎的吴中企业
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 40 00 * * ? ")
|
|
|
|
|
|
|
|
// @GetMapping("findCode")
|
|
|
|
|
|
|
|
public void findCode() {
|
|
|
|
|
|
|
|
// 获取token
|
|
|
|
|
|
|
|
String token = getToken();
|
|
|
|
|
|
|
|
// 获取所有信息
|
|
|
|
|
|
|
|
String res = HttpRequest.get(findCode)
|
|
|
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
|
|
|
.execute().body();
|
|
|
|
|
|
|
|
JSONObject resObj = JSON.parseObject(res);
|
|
|
|
|
|
|
|
String dataList = resObj.getString("data");
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(dataList)) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<String> muDuCodeList = JSON.parseArray(dataList, String.class);
|
|
|
|
|
|
|
|
List<String> wuZhongCodeList = qyjcxxService.findCode();
|
|
|
|
|
|
|
|
List<String> notInMuDuCodeList = wuZhongCodeList.stream()
|
|
|
|
|
|
|
|
.filter(code -> !muDuCodeList.contains(code))
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
qyjcxxService.updateByTyshxybm(notInMuDuCodeList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|