|
|
|
@ -50,75 +50,7 @@ public class EnterpristQuartz {
|
|
|
|
|
@GetMapping("/getList")
|
|
|
|
|
@ApiOperation(value = "定时任务")
|
|
|
|
|
public AjaxResult updateInformationData() {
|
|
|
|
|
// 查询szs_enterprise_informa tion表中的数据
|
|
|
|
|
// List<SzsEnterpriseInformation> enterpriseInformationList = szsEnterpriseInformationMapper.selectSzsEnterpriseInformationList(null);
|
|
|
|
|
// // 遍历数据并更新到b_enterprise_new表中
|
|
|
|
|
// List<String> szsList = new ArrayList<>();
|
|
|
|
|
// for (SzsEnterpriseInformation enterpriseInformation : enterpriseInformationList) {
|
|
|
|
|
// BEnterpriseNew enterpriseNew = new BEnterpriseNew();
|
|
|
|
|
// enterpriseNew.setEnterpriseId(enterpriseInformation.getUuitNo());
|
|
|
|
|
// enterpriseNew.setEnterpriseName(enterpriseInformation.getEnterpriseName());
|
|
|
|
|
// enterpriseNew.setDistrict(enterpriseInformation.getSubdistrict());
|
|
|
|
|
// enterpriseNew.setSupervisionLarge(enterpriseInformation.getSupervisionLarge());
|
|
|
|
|
// // 根据enterpriseId判断数据是否已存在
|
|
|
|
|
// QueryWrapper<BEnterpriseNew> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
// queryWrapper.eq("enterprise_id", enterpriseInformation.getUuitNo());
|
|
|
|
|
// //获取enterpriseName
|
|
|
|
|
// szsList.add(enterpriseNew.getEnterpriseName());
|
|
|
|
|
// Long count = bEnterpriseNewMapper.selectCount(queryWrapper);
|
|
|
|
|
// if (count > 0) {
|
|
|
|
|
// // 更新数据
|
|
|
|
|
// bEnterpriseNewMapper.updateBEnterpriseNew(enterpriseNew);
|
|
|
|
|
// } else {
|
|
|
|
|
// // 插入数据
|
|
|
|
|
// bEnterpriseNewMapper.insertBEnterpriseNew(enterpriseNew);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// // 查询b_enterprise_new表中的所有企业名称
|
|
|
|
|
// List<BEnterpriseNew> enterpriseList = bEnterpriseNewMapper.selectBEnterpriseNewList(null);
|
|
|
|
|
// // 查询b_standardization表中的所有企业名称
|
|
|
|
|
// List<BStandardization> standardizationList = bStandardizationMapper.selectBStandardizationList(null);
|
|
|
|
|
// //更新b_enterprise_new表中匹配的企业的STAND_LEVEL字段
|
|
|
|
|
// for (BEnterpriseNew enterprise : enterpriseList) {
|
|
|
|
|
// for (BStandardization standardization : standardizationList) {
|
|
|
|
|
// if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) {
|
|
|
|
|
// // 执行更新操作,例如:
|
|
|
|
|
// enterprise.setStandLevel(standardization.getStandardizedGrade());
|
|
|
|
|
// bEnterpriseNewMapper.updateBEnterpriseNew(enterprise);
|
|
|
|
|
// } else {
|
|
|
|
|
// enterprise.setStandLevel("/");
|
|
|
|
|
// bEnterpriseNewMapper.updateBEnterpriseNew(enterprise);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// // 找出在b_standardization表中存在但在b_enterprise_new表中不存在的企业名称
|
|
|
|
|
// List<BStandardization> notInEnterpriseNew = new ArrayList<>();
|
|
|
|
|
// for (BStandardization standardization : standardizationList) {
|
|
|
|
|
// boolean found = false;
|
|
|
|
|
// for (BEnterpriseNew enterprise : enterpriseList) {
|
|
|
|
|
// if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) {
|
|
|
|
|
// found = true;
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (!found) {
|
|
|
|
|
// BStandardization b = new BStandardization();
|
|
|
|
|
// b.setStandardizedGrade(standardization.getStandardizedGrade());
|
|
|
|
|
// b.setEnterpriseName(standardization.getEnterpriseName());
|
|
|
|
|
// notInEnterpriseNew.add(b);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// // 查询b_enterprise_new表中的所有企业名称 更新检查时间
|
|
|
|
|
// for (BEnterpriseNew a : enterpriseList) {
|
|
|
|
|
// BEnterpriseNew bEnterpriseNew = new BEnterpriseNew();
|
|
|
|
|
// List<SzEnforExamine> szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId());
|
|
|
|
|
// for (SzEnforExamine b:szEnforExamineList) {
|
|
|
|
|
// bEnterpriseNew.setId(a.getId());
|
|
|
|
|
// bEnterpriseNew.setExamineEndTime(b.getExamineEndTime());
|
|
|
|
|
// bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
return AjaxResult.success(null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|