CreateDzzz.java
3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package com.thinkgem.jeesite.modules.eci.task;
import com.thinkgem.jeesite.common.utils.IdGen;
import com.thinkgem.jeesite.common.utils.JsonUtil;
import com.thinkgem.jeesite.modules.eci.dao.ElecLicenseInfoDao;
import com.thinkgem.jeesite.modules.eci.entity.ElecLicenseInfo;
import com.thinkgem.jeesite.modules.reg.dao.bus.RegBusBdcqzsdjxxDao;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Lazy(false)
@Component
public class CreateDzzz {
@Autowired
ElecLicenseInfoDao licenseInfoDao;
@Autowired
private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
@Autowired
private RegBusBdcqzsdjxxDao regBusBdcqzsdjxxDao;
protected Logger logger = LoggerFactory.getLogger(super.getClass());
public synchronized void autoCreate() {
logger.info("数据汇总标志:");
System.out.println("566666666666666");
List<RegBusBdcqzsdjxx> reg = regBusBdcqzsdjxxService.selectDzzz("1", "0");
//setId(IdGen.uuid());
for(RegBusBdcqzsdjxx bdc : reg){
//todo 此处调用创建电子证照接口
ElecLicenseInfo eli = new ElecLicenseInfo();
eli.setBizId(IdGen.uuid());
eli.setYwh(bdc.getYwh());
eli.setZsbs(bdc.getId());
//模板参数入库
Map<String, String> map = new HashMap<String, String>();
if(bdc.getBdcqzh().contains("证明")){
map.put("ewm","imageBase64");
map.put("djsj",bdc.getDbsj());
map.put("bdczmh",bdc.getBdcqzh());
map.put("zmqlhsx","");
map.put("qlr",bdc.getQlrmc());
map.put("ywr","");
map.put("zl",bdc.getZl());
map.put("bdcdyh",bdc.getBdcdyh());
map.put("qt",bdc.getQlqtzk());
map.put("fj",bdc.getFj());
String param = JsonUtil.toJsonString(map);
eli.setDocumentParam(param);
eli.setHtlx("1");
}else{
map.put("ewm","imageBase64");
map.put("djsj",bdc.getDbsj());
map.put("bdczmh",bdc.getBdcqzh());
map.put("zmqlhsx","");
map.put("qlr",bdc.getQlrmc());
map.put("ywr","");
map.put("bdcdyh",bdc.getBdcdyh());
map.put("qt",bdc.getQlqtzk());
map.put("fj",bdc.getFj());
map.put("gyqk",bdc.getGyqk());
map.put("zl",bdc.getZl());
map.put("qllx",bdc.getQllx());
map.put("qlxz",bdc.getQlxz());
map.put("yt",bdc.getYt());
map.put("mj",bdc.getMj());
map.put("syqx",bdc.getSyqx());
String param = JsonUtil.toJsonString(map);
eli.setDocumentParam(param);
eli.setHtlx("2");
}
if(licenseInfoDao.selectZsbs(bdc.getId()).size() == 0 ){
licenseInfoDao.insert(eli);
}
bdc.setIscjdzzz("1");
regBusBdcqzsdjxxDao.update(bdc);
}
}
}