739c76ab by 李希虎

定时任务创建电子证照

1 parent 93e0d54f
package com.thinkgem.jeesite.modules.eci.dao;
import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.eci.entity.ElecLicenseInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@MyBatisDao
public interface ElecLicenseInfoDao extends CrudDao<ElecLicenseInfo> {
/**
......@@ -62,4 +67,5 @@ public interface ElecLicenseInfoDao extends CrudDao<ElecLicenseInfo> {
List<ElecLicenseInfo> getWaitForConvert();
List<ElecLicenseInfo> selectZsbs(@Param("zsbs") String zsbs);
}
......
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());
//模板参数入库
if(bdc.getBdcqzh().contains("证明")){
Map<String, Object> map = new HashMap<String, Object>();
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);
}else{
Map<String, Object> map = new HashMap<String, Object>();
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);
}
if(licenseInfoDao.selectZsbs(bdc.getId()).size() == 0 ){
licenseInfoDao.insert(eli);
}
bdc.setIscjdzzz("1");
regBusBdcqzsdjxxDao.update(bdc);
}
}
}
......@@ -209,6 +209,8 @@ public interface RegBusBdcqzsdjxxDao extends CrudDao<RegBusBdcqzsdjxx> {
public List<RegBusBdcqzsdjxx> findhttpList(RegBusBdcqzsdjxx regBusBdcqzsdjxx);
//一窗受理接口系统查询最后一笔有效的房屋所有权查封信息
public List<RegBusBdcqzsdjxx> findhttpCfdjxxList(RegBusBdcqzsdjxx regBusBdcqzsdjxx);
//查询电子证照
public List<RegBusBdcqzsdjxx> selectDzzz(String isxydzzz, String iscjdzzz);
//查询农房入库数据
public Map<String, Object> selectNF(String cxrq, String cxrq2);
public Map<String, Object> selectFMJ1(String qsrq, String cxrq);
......
......@@ -65,6 +65,8 @@ public class RegBusBdcqzsdjxx extends DataEntity<RegBusBdcqzsdjxx> {
//private String yzbm; //邮政编码
//private String spbbh; //审批表编号
private String cfzt; //判断无效是否为查封引起
private String isxydzzz; //是否需要电子证照 0:否 1:是
private String iscjdzzz; //是否创建电子证照 0:否 1:是
public RegBusBdcqzsdjxx() {
super();
}
......@@ -434,5 +436,20 @@ public class RegBusBdcqzsdjxx extends DataEntity<RegBusBdcqzsdjxx> {
public void setCfzt(String cfzt) {
this.cfzt = cfzt;
}
public String getIsxydzzz() {
return isxydzzz;
}
public void setIsxydzzz(String isxydzzz) {
this.isxydzzz = isxydzzz;
}
public String getIscjdzzz() {
return iscjdzzz;
}
public void setIscjdzzz(String iscjdzzz) {
this.iscjdzzz = iscjdzzz;
}
}
\ No newline at end of file
......
......@@ -839,7 +839,11 @@ public class RegBusBdcqzsdjxxService extends CrudService<RegBusBdcqzsdjxxDao, Re
public List<RegBusBdcqzsdjxx> findhttpCfdjxxList(RegBusBdcqzsdjxx regBusBdcqzsdjxx) {
return dao.findhttpCfdjxxList(regBusBdcqzsdjxx);
}
//查询电子证照
public List<RegBusBdcqzsdjxx> selectDzzz(String isxydzzz, String iscjdzzz) {
// TODO Auto-generated method stub
return dao.selectDzzz(isxydzzz,iscjdzzz);
}
//查询农房入库数据
public Map<String, Object> selectNF(String qsrq, String cxrq) {
// TODO Auto-generated method stub
......
......@@ -40,6 +40,12 @@
and SFZH = '2'
</select>
<select id="selectZsbs" resultType="com.thinkgem.jeesite.modules.eci.entity.ElecLicenseInfo">
select *
from ELEC_LICENSE_INFO
where ZSBS = #{zsbs}
</select>
<update id="updateContractIdAndStatus">
update ELEC_LICENSE_INFO
set TJCS = #{waitForCreateContract.tjcs,jdbcType=VARCHAR},
......@@ -49,4 +55,16 @@
SFZH=#{waitForCreateContract.sfzh,jdbcType=VARCHAR}
where BIZ_ID = #{waitForCreateContract.bizId,jdbcType=VARCHAR}
</update>
<insert id="insert">
INSERT INTO ELEC_LICENSE_INFO(
BIZ_ID,YWH,HTLX,ZSBS,DOCUMENT_PARAM
) VALUES (
#{bizId},
#{ywh},
#{htlx},
#{zsbs},
#{documentParam}
)
</insert>
</mapper>
......
......@@ -4529,7 +4529,9 @@
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks},
del_flag = #{delFlag}
del_flag = #{delFlag},
iscjdzzz = #{iscjdzzz},
isxydzzz = #{isxydzzz}
WHERE id = #{id}
</update>
......@@ -4984,8 +4986,11 @@ AND replace(substr(djxx.fzsj,1,7),'-','') &lt;= replace(substr(#{1},1,7),'-','')
select ywh from reg_bus_slsq where ywh in (select ywh from reg_bus_bdcqzsdjxx djxx where djxx.bdcdyh like '%F%' and djxx.del_flag='0' and
exists(select 1 from reg_bus_bdcqzsdjxx xx where xx.zddm = djxx.zddm and xx.ywh like '%LZ%')) and del_flag='0' and slsj &gt;= to_date(#{0},'yyyy/MM') and slsj &lt; add_months(to_date(#{1},'yyyy/MM'),1)))
</select>
<select id="selectDzzz" resultType="com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx" parameterType="java.lang.String">
select * from reg_bus_bdcqzsdjxx djxx where djxx.isxydzzz = #{0} and djxx.iscjdzzz = #{1}
</select>
<select id="queryIdent" resultType="Map" parameterType="java.lang.String">
select djxx.bdcdyh,djxx.fzsj,djxx.ywh from reg_bus_bdcqzsdjxx djxx where djxx.bdcqzh like '%'||#{2}||'%'||#{3}||'%'||#{4}||'%' and substr(djxx.djlx,0,1) not in ('5','7','9') and djxx.del_flag='0'
</select>
......
......@@ -138,8 +138,14 @@
<!--这里表示的是每隔五秒(*/5 * * * * ?)做测试用 执行一次 如果有需要在下面依次添加task就可以 -->
<task:scheduled-tasks>
<task:scheduled ref="mainTask" method="autoCommitLog" cron="0 40 23 * * *" />
</task:scheduled-tasks>
</task:scheduled-tasks>
<!-- 创建电子证照 start -->
<bean id="mainTask2" class="com.thinkgem.jeesite.modules.eci.task.CreateDzzz"></bean>
<task:scheduled-tasks>
<task:scheduled ref="mainTask2" method="autoCreate" cron="*/5 * * * * ?" />
</task:scheduled-tasks>
<!-- <task:scheduled-tasks> -->
<!--这里表示的是每隔五秒(*/5 * * * * ?)做测试用 执行一次 如果有需要在下面依次添加task就可以-->
......