34 lines
1.2 KiB
Java
34 lines
1.2 KiB
Java
package com.example.sso.newschedule;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.example.sso.newdao.HuanKuanDanDels;
|
|
import com.example.sso.util.NcUtils;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@Slf4j
|
|
@Component
|
|
public class HuanKuanDanDel {
|
|
@Scheduled(fixedRate = 5000)
|
|
public void hkdel() {
|
|
JSONArray shenpi = HuanKuanDanDels.shenpi();
|
|
for (Object o : shenpi){
|
|
JSONObject test = (JSONObject) o;
|
|
String report_ncid = test.getString("report_ncid");
|
|
String id = test.getString("_id");
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("billid",report_ncid);
|
|
String jsonString = jsonObject.toJSONString();
|
|
String s = NcUtils.delHk(jsonString);
|
|
log.info("删除 " +s );
|
|
JSONObject jsonObject1 = JSON.parseObject(s);
|
|
String code = jsonObject1.getString("code");
|
|
String msg = jsonObject1.getString("msg");
|
|
HuanKuanDanDels.updata(id,code,msg);
|
|
}
|
|
}
|
|
}
|