040fbf90 by 夏齐

首次提交

1 parent 4e277aa8
......@@ -140,7 +140,7 @@ public class EciHttpUtil {
* @param documentId 合同文档ID
* @return
*/
public String download(String documentId,String bh) {
public String download(String documentId,String bh,String htlx,String areacode) {
String url = hostUrl + "/document/download" + "?documentId=" + documentId;
InputStream in = null;
String absolutePath = "";
......@@ -170,7 +170,7 @@ public class EciHttpUtil {
in =conn.getInputStream();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
String dateDir = simpleDateFormat.format(new Date());
File savePath = new File("D:\\ECI\\" + dateDir+bh);
File savePath = new File("E:\\ECI\\"+areacode+"\\"+ htlx+dateDir+bh);
if (!savePath.exists()) {
savePath.mkdirs();
}
......
......@@ -12,7 +12,7 @@ public class QysTask {
@Autowired
private EciService eciService;
@Scheduled(cron="0 0/5 * * * ?")
@Scheduled(cron="0 0/1 * * * ?")
public void accessCreateContract() {
System.out.println("===========创建合同定时任务进来了=========");
eciService.accessCreateContract();
......
......@@ -16,14 +16,14 @@ public class ZhjTask {
private ZhjDatasSynService zhjDatasSynService;
//@Scheduled(cron="0 0 21 * * ? ")
@Scheduled(cron="0 0 21 * * ? ")
public void execute() {
System.out.println("===========每天晚上九点定时任务进来了=========");
zhjDatasSynService.send_bdcYwInfo();
System.out.println("===========每天晚上九点定时任务走了=========");
}
//@Scheduled(cron="0 0 21 ? * 2")
@Scheduled(cron="0 0 20 15 * ? ")
public void executeQyInfo() {
System.out.println("===========每天晚上九点定时任务进来了=========");
zhjDatasSynService.synQyInfo();
......
......@@ -2,6 +2,7 @@ package com.pashanhoo.qys.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.zxing.EncodeHintType;
import com.pashanhoo.common.EciHttpUtil;
import com.pashanhoo.common.Result;
import com.pashanhoo.qys.entity.ElecLicenseInfoDo;
......@@ -25,6 +26,7 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.file.Path;
import java.nio.file.Paths;
......@@ -44,6 +46,8 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
@Value("${app.bdcqzslc}")
private String bdcqzslc;
@Value("${app.areacode}")
private String areacode;
@Autowired
private RegBusBdcqzsdjxxMapper regBusBdcqzsdjxxMapper;
......@@ -150,7 +154,11 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
//合同ID入库
elecLicenseInfoDo.setContractId(contractId);
elecLicenseInfoDo.setErr_state("0");
if("207".equals(jbxxmap.get("DJLX"))){
regBusBdcqzsdjxxMapper.updateBdcqzsjbxxInfoByYwh((String) jbxxmap.get("YWH"));
}else{
regBusBdcqzsdjxxMapper.updateBdcqzsjbxxInfo((String) jbxxmap.get("ID"));
}
}else{
elecLicenseInfoDo.setErr_state("1");
}
......@@ -214,7 +222,7 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
try{
String imageurl="https://www.hzbdcdj.com/api?scene="+jbxxId+"&qlr="+ URLEncoder.encode(qlr,"UTF-8")+"&zjh="+zjh;
logger.info("55555555============"+imageurl);
ByteArrayOutputStream out= QRCode.from(imageurl).to(ImageType.PNG).stream();
ByteArrayOutputStream out= QRCode.from(imageurl).withHint(EncodeHintType.MARGIN, 0).to(ImageType.PNG).withSize(240, 240).stream();
data = out.toByteArray();
}catch (Exception ex){
ex.printStackTrace();
......@@ -271,7 +279,7 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
documentMap.put("qllx", map.get("QLLX")==null ? "": (String) map.get("QLLX"));
documentMap.put("qlxz", map.get("QLXZ")==null ? "": (String) map.get("QLXZ"));
documentMap.put("yt", map.get("YT")==null ? "": (String) map.get("YT"));
documentMap.put("mj", map.get("MJ")==null ? "": (String) map.get("MJ"));
documentMap.put("mj", map.get("MJ")==null ? "0"+"㎡": map.get("MJ")+"㎡");
documentMap.put("syqx", map.get("SYQX")==null ? "": (String) map.get("SYQX"));
documentMap.put("qlqtzk", map.get("QLQTZK")==null ? "": (String) map.get("QLQTZK"));
}
......@@ -300,9 +308,12 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
documentMap.put("qlr", map.get("QLRMC")==null ? "":(String) map.get("QLRMC"));
documentMap.put("zl", map.get("ZL")==null ? "":(String) map.get("ZL"));
documentMap.put("bdcdyh", map.get("BDCDYH")==null ? "":(String) map.get("BDCDYH"));
if(map.get("ZTS")!=null){
documentMap.put("fj", "业务号:"+ywh+";"+map.get("ZTS"));
}else{
documentMap.put("fj", "业务号:"+ywh);
}
documentMap.put("qx", "汉台区");
String base64ewm =getBase64ewm((String) map.get("ID"),(String) map.get("QLRMC"),(String) map.get("ZJH"));
Map ewmMap = new HashMap();
......@@ -388,7 +399,8 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
try{
String documentId = waitForDownload.getDocumentId();
String bh=waitForDownload.getZsbh();
String ofdPath = eciHttpUtil.download(documentId,bh);
String htlx=waitForDownload.getHtlx();
String ofdPath = eciHttpUtil.download(documentId,bh,htlx,areacode);
if (StringUtils.isNotBlank(ofdPath)) {
//入库ofd文件地址
waitForDownload.setSfxz("1");
......@@ -412,9 +424,10 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
String ofdPath = waitForConvert.getOfdWjdz();
String id=waitForConvert.getDocumentId();
String bh=waitForConvert.getZsbh();
String htlx=waitForConvert.getHtlx();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
String dateDir = simpleDateFormat.format(new Date());
String url=ofdToImg(ofdPath,"D:\\ECI\\"+ dateDir+bh+"\\",id);
String url=ofdToImg(ofdPath,"E:\\ECI\\"+areacode+"\\"+ htlx+dateDir+bh+"\\",id);
if(StringUtils.isNotBlank(url)){
waitForConvert.setSfzh("1");
waitForConvert.setJpgWjdz(url);
......@@ -468,37 +481,47 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
public List<Map> assemblyInfo(){
List<Map> oldlist=regBusBdcqzsdjxxMapper.getBdcqzsjbxxInfo();
List<Map> list=new ArrayList<Map>();
if(oldlist!=null && oldlist.size()>0){
if(oldlist!=null && oldlist.size()>0) {
for (int i = 0; i < oldlist.size(); i++) {
Map map=oldlist.get(i);
String bh= (String)map.get("BH");
String zsbh[]=bh.split(",");
if(zsbh!=null && zsbh.length>0){
String qlqtzk=(String)map.get("QLQTZK");
Map qrlInfoMap=regBusBdcqzsdjxxMapper.getQlrInfoByYwh((String) map.get("YWH"));
if(qrlInfoMap!=null){
String allQlrmc=(String)qrlInfoMap.get("QLRMC");
String allZjh=(String)qrlInfoMap.get("ZJH");
if(StringUtils.isNotBlank(allQlrmc)){
Map map = oldlist.get(i);
if ("207".equals(map.get("DJLX"))) {
Map firstmap = AssemblyFirstRegist(map);
list.add(firstmap);
continue;
}
String bh = (String) map.get("BH");
String zsbh[] = bh.split(",");
if (zsbh != null && zsbh.length > 0) {
String qlqtzk = (String) map.get("QLQTZK");
Map qrlInfoMap = regBusBdcqzsdjxxMapper.getQlrInfoByYwh((String) map.get("YWH"));
if (qrlInfoMap != null) {
String allQlrmc = (String) qrlInfoMap.get("QLRMC");
String allZjh = (String) qrlInfoMap.get("ZJH");
if (StringUtils.isNotBlank(allQlrmc)) {
for (int k = 0; k < zsbh.length; k++) {
String qlr[]=allQlrmc.split(",");
String zjh[]=allZjh.split(",");
Map hashMap=new HashMap(map);
hashMap.put("QLRMC",qlr[k]);
hashMap.put("BH",zsbh[k]);
hashMap.put("ZJH",zjh[k]);
List list1= Arrays.asList(qlr);
String qlr[] = allQlrmc.split(",");
String zjh[] = allZjh.split(",");
Map hashMap = new HashMap(map);
hashMap.put("QLRMC", qlr[k]);
hashMap.put("BH", zsbh[k]);
hashMap.put("ZJH", zjh[k]);
List list1 = Arrays.asList(qlr);
List arrList = new ArrayList(list1);
arrList.remove(qlr[k]);
String gyr=StringUtils.join(arrList.toArray(),",");
if(StringUtils.isNotBlank(qlqtzk)){
qlqtzk=qlqtzk.substring(0, qlqtzk.length() - 1);
if(arrList!=null && arrList.size()>0){
hashMap.put("QLQTZK",qlqtzk+hashMap.get("GYQK")+";共有人:"+gyr);
}else{
hashMap.put("QLQTZK",qlqtzk+hashMap.get("GYQK"));
String gyr = StringUtils.join(arrList.toArray(), ",");
if (StringUtils.isNotBlank(qlqtzk)) {
String[] qlzkInfo = qlqtzk.split(";");
for (int j = 0; j < qlzkInfo.length; j++) {
if (qlzkInfo[j].contains("共有情况")) {
qlzkInfo[j] = "共有情况: " + hashMap.get("GYQK");
}
}
qlqtzk=StringUtils.join(qlzkInfo, ";");
if (arrList != null && arrList.size() > 0) {
hashMap.put("QLQTZK", qlqtzk + ";共有人:" + gyr);
} else {
hashMap.put("QLQTZK", qlqtzk);
}
}
list.add(hashMap);
}
......@@ -518,6 +541,11 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
List<Map> list=new ArrayList<Map>();
Map map=regBusBdcqzsdjxxMapper.getBdcqzsJbxxById(zsbs);
if(map!=null){
if("207".equals(map.get("DJLX"))){
Map firstmap=AssemblyFirstRegist(map);
list.add(firstmap);
return list;
}
Map qrlInfoMap=regBusBdcqzsdjxxMapper.getQlrInfoByYwh((String) map.get("YWH"));
String allQlrmc=(String)qrlInfoMap.get("QLRMC");
if(StringUtils.isNotBlank(allQlrmc)){
......@@ -537,8 +565,18 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
arrList.remove(qlr[k]);
String gyr=StringUtils.join(arrList.toArray(),",");
if(StringUtils.isNotBlank(qlqtzk)){
qlqtzk=qlqtzk.substring(0, qlqtzk.length() - 1);
hashMap.put("QLQTZK",qlqtzk+hashMap.get("GYQK")+";共有人:"+gyr);
String[] qlzkInfo = qlqtzk.split(";");
for (int j = 0; j < qlzkInfo.length; j++) {
if (qlzkInfo[j].contains("共有情况")) {
qlzkInfo[j] = "共有情况: " + hashMap.get("GYQK");
}
}
qlqtzk=StringUtils.join(qlzkInfo, ";");
if (arrList != null && arrList.size() > 0) {
hashMap.put("QLQTZK", qlqtzk + ";共有人:" + gyr);
} else {
hashMap.put("QLQTZK", qlqtzk);
}
}
list.add(hashMap);
}
......@@ -588,5 +626,50 @@ public class EciServiceImpl extends ServiceImpl<ElecLicenseInfoMapper, ElecLicen
return "";
}
/**
* 组装首次登记业务
*/
public Map AssemblyFirstRegist(Map map){
List<Map> list=regBusBdcqzsdjxxMapper.getBdcqzsjbxxInfoByYwh((String) map.get("YWH"));
//获取所有的面积集合
Double mjs = 0.0;
if(list!=null && list.size()>0){
for(int i = 0; i<list.size(); i++){
if(list.get(i).get("MJ") != null){
mjs += Double.parseDouble((String) list.get(i).get("MJ"));
}
}
BigDecimal bmj = new BigDecimal(mjs);
mjs = bmj.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
}
Map zdjbxxMap=regBusBdcqzsdjxxMapper.getZdjbxxByZddm(((String) map.get("BDCDYH")).substring(0, 19));
String zdmj ="0";
if(zdjbxxMap!=null){
zdmj = zdjbxxMap.get("ZDMJ").toString();
}
Map zrzmap=regBusBdcqzsdjxxMapper.getZrzInfo(((String) map.get("BDCDYH")).substring(0, 24)+"0000");
if(zrzmap!=null){
if("2".equals(zrzmap.get("ZDFTFS"))){
map.put("MJ", "独用宗地面积"+zdmj+"㎡/房屋建筑面积"+mjs+"㎡");
}else {
map.put("MJ", "共用宗地面积"+zdmj+"㎡/房屋建筑面积"+mjs+"㎡");
}
}
String qtzk = (String) map.get("QLQTZK");
if(qtzk != null){
String[] str = qtzk.split(";");
qtzk= str[1]+";"+str[4]+"层"+";"+str[6].substring(0, 15)+";";
map.put("QLQTZK",qtzk);
}
String zl = zdjbxxMap.get("ZL")+(String)zrzmap.get("XMMC")+zrzmap.get("GZWMC");
map.put("ZL", zl);
map.put("BDCDYH",zrzmap.get("BDCDYH"));
map.put("ZTS", "本次登记包含"+list.size()+"(套、间)");
Map qrlInfoMap=regBusBdcqzsdjxxMapper.getQlrInfoByYwh((String) map.get("YWH"));
if(qrlInfoMap!=null){
map.put("ZJH",qrlInfoMap.get("ZJH"));
}
return map;
}
}
......
......@@ -59,6 +59,8 @@ public interface RegBusBdcqzsdjxxMapper extends BaseMapper<RegBusBdcqzsdjxxDo> {
public void updateBdcqzsjbxxInfo(String id);
public void updateBdcqzsjbxxInfoByYwh(String ywh);
public Map getQlrInfoByYwh(String ywh);
public String getQlrInfoByYwhAndqlr(@Param("ywh") String ywh, @Param("qlrmc") String qlrmc);
......
......@@ -20,6 +20,7 @@ spring:
primary: master
datasource:
master:
#url: jdbc:oracle:thin:@172.16.56.4:1521:ODM
url: jdbc:oracle:thin:@172.16.56.21:1521:orcl
driver-class-name: oracle.jdbc.driver.OracleDriver
username: regs
......@@ -54,11 +55,12 @@ mybatis-plus:
call-setters-on-nulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
app:
hostUrl: http://172.16.56.41:9182
bdcdjzmlc: 2890537670326468622
bdcqzslc: 2890537800123400234
AppToken: OAduCx5qJD
AppSecret: DifsZNwDnamuRh9jS0gSOTJFvmmKtT
hostUrl: http://172.16.56.60:9182
bdcdjzmlc: 2905681381004489569
bdcqzslc: 2905684509636506505
AppToken: lv2M681jcM
AppSecret: mZWAKA2p7vvnTZMNuUKRHaCL3LTgHA
areacode: 610702
management:
......
......@@ -4,6 +4,9 @@
<update id="updateBdcqzsjbxxInfo">
update reg_bus_bdcqzsdjxx set ISCJDZZZ='1' where ID=#{id}
</update>
<update id="updateBdcqzsjbxxInfoByYwh">
update reg_bus_bdcqzsdjxx set ISCJDZZZ='1' where ywh=#{ywh}
</update>
<select id="getZsdjInfoList" resultType="com.pashanhoo.zhj.entity.RegBusBdcqzsdjxxDo" parameterType="com.pashanhoo.zhj.entity.SynZhjInfoDo">
select * from reg_bus_bdcqzsdjxx where
......@@ -94,6 +97,7 @@
from dual
</select>
<select id="getBdcqzsjbxxInfo" resultType="java.util.Map">
select * from (
select c.id,
c.ywh,
c.bdcdyh,
......@@ -116,12 +120,12 @@
to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'YYYY') as y,
to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'MM') as m,
to_char(to_date(c.dbsj, 'yyyy-mm-dd'),'dd') as d,
c.bdcqzbh as bh
c.bdcqzbh as bh,row_number() over (partition by ywh,bdcqzbh order by ywh desc) rn
from reg_bus_bdcqzsdjxx c
where c.del_flag = '0'
and c.isxydzzz = '1'
and c.iscjdzzz = '0'
and dbsj is not null
and dbsj is not null ) where rn=1
</select>
<select id="getBdcqzsjbxxInfoByYwh" resultType="java.util.Map">
......@@ -152,8 +156,8 @@
where c.del_flag = '0'
and c.isxydzzz = '1'
and c.iscjdzzz = '0'
and c.ywh=#{ywh}
and dbsj is not null
and c.ywh =#{ywh}
and c.dbsj is not null
</select>
<select id="getQlrInfoByYwh" resultType="java.util.Map">
select wm_concat(qlrmc) as qlrmc,wm_concat(zjh) as zjh from reg_bus_qlr c where ywh =#{ywh} and del_flag='0' and qszt='1' order by sxh
......