Commit f92e0cc4 authored by 廖鑫's avatar 廖鑫

厅局办件推送一体化,接口记录功能,分表已添加,

parent 029a6a7b
...@@ -9,9 +9,14 @@ ...@@ -9,9 +9,14 @@
package com.mortals.xhx.base.system.table.service; package com.mortals.xhx.base.system.table.service;
import com.mortals.framework.dao.ICRUDSubmeterDao;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.TableParam;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.base.system.table.model.TableIndexEntity; import com.mortals.xhx.base.system.table.model.TableIndexEntity;
import java.util.Set;
/** /**
* <p>Title: 分表索引信息</p> * <p>Title: 分表索引信息</p>
* <p>Description: TableIndexService service接口 </p> * <p>Description: TableIndexService service接口 </p>
...@@ -22,5 +27,18 @@ import com.mortals.xhx.base.system.table.model.TableIndexEntity; ...@@ -22,5 +27,18 @@ import com.mortals.xhx.base.system.table.model.TableIndexEntity;
*/ */
public interface TableIndexService extends ICRUDService<TableIndexEntity,Long> { public interface TableIndexService extends ICRUDService<TableIndexEntity,Long> {
/**
* 创建表
* @param submeterDao
* @param param
* @return
* @throws AppException
*/
@SuppressWarnings("rawtypes")
public boolean createTable(ICRUDSubmeterDao submeterDao, TableParam param) throws AppException;
/**
* 查询最近1个月创建的表集合
* @return
*/
public Set<String> findLastMonthTables();
} }
\ No newline at end of file
...@@ -8,13 +8,22 @@ ...@@ -8,13 +8,22 @@
package com.mortals.xhx.base.system.table.service.impl; package com.mortals.xhx.base.system.table.service.impl;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.dao.ICRUDSubmeterDao;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.TableParam;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.table.dao.TableIndexDao; import com.mortals.xhx.base.system.table.dao.TableIndexDao;
import com.mortals.xhx.base.system.table.model.TableIndexEntity; import com.mortals.xhx.base.system.table.model.TableIndexEntity;
import com.mortals.xhx.base.system.table.model.TableIndexQuery;
import com.mortals.xhx.base.system.table.service.TableIndexService; import com.mortals.xhx.base.system.table.service.TableIndexService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*;
/** /**
* <p>Title: 分表索引信息</p> * <p>Title: 分表索引信息</p>
* <p>Description: TableIndexServiceImpl service接口 </p> * <p>Description: TableIndexServiceImpl service接口 </p>
...@@ -27,5 +36,56 @@ import org.springframework.stereotype.Service; ...@@ -27,5 +36,56 @@ import org.springframework.stereotype.Service;
public class TableIndexServiceImpl extends AbstractCRUDServiceImpl<TableIndexDao,TableIndexEntity,Long> implements TableIndexService { public class TableIndexServiceImpl extends AbstractCRUDServiceImpl<TableIndexDao,TableIndexEntity,Long> implements TableIndexService {
@SuppressWarnings("rawtypes")
public boolean createTable(ICRUDSubmeterDao submeterDao, TableParam param) {
boolean ret = false;
TableParam retParam = null;
try {
retParam = submeterDao.createTable(param);
if (retParam != null && retParam.tableMap != null && retParam.tableMap.size() > 0) {
log.info("创建表-->" + retParam.tableMap.keySet());
}
} catch (Exception e) {
log.error("执行创建表任务异常-->" + submeterDao, e);
}
if (retParam != null && retParam.tableMap != null && retParam.tableMap.size() > 0) {
Date currDate = new Date();
for (Map.Entry<String, String> ee : retParam.tableMap.entrySet()) {
String tableName = ee.getKey();
String tableMark = ee.getValue();
try {
TableIndexEntity table = new TableIndexEntity();
table.setTableName(tableName);
table.setTableMark(tableMark);
table.setCreateTime(currDate);
dao.insert(table);
ret = true;
} catch (Exception e) {
log.error("保存分表索引数据异常,原因:" + e.getMessage());
}
}
}
return ret;
}
/**
* 查询最近1个月创建的表集合
* @return
*/
public Set<String> findLastMonthTables() {
Set<String> retList = new HashSet<String>();
try {
TableIndexQuery params = new TableIndexQuery();
params.setCreateTimeStart(DateUtils.addMonth(new Date(), -1, "yyyy-MM-dd"));
List<TableIndexEntity> list = dao.getList(params);
for (TableIndexEntity entity : list) {
if (StringUtils.isNotEmpty(entity.getTableName())) {
retList.add(entity.getTableName());
}
}
} catch (Exception e) {
log.error("查询分表索引异常-->" + e.getMessage());
}
return retList;
}
} }
\ No newline at end of file
...@@ -14,24 +14,24 @@ public enum ApplicantTypeEnums { ...@@ -14,24 +14,24 @@ public enum ApplicantTypeEnums {
* "申请人属性 1.法人 2.自然人" * "申请人属性 1.法人 2.自然人"
* */ * */
LEGAL("1", "法人"), LEGAL(1, "法人"),
PERSON("2", "自然人"); PERSON(2, "自然人");
private String code; private int code;
private String value; private String value;
ApplicantTypeEnums(String code, String value) { ApplicantTypeEnums(int code, String value) {
this.value = value; this.value = value;
this.code = code; this.code = code;
} }
public String getCode() { public int getCode() {
return code; return code;
} }
public void setCode(String code) { public void setCode(int code) {
this.code = code; this.code = code;
} }
......
...@@ -34,10 +34,10 @@ public class ExcelConvertApplication implements Converter<String> { ...@@ -34,10 +34,10 @@ public class ExcelConvertApplication implements Converter<String> {
// "申请人属性 1.法人 2.自然人" // "申请人属性 1.法人 2.自然人"
if (cellData.getStringValue() == null) { if (cellData.getStringValue() == null) {
return null; return null;
} else if (ApplicantTypeEnums.LEGAL.getValue().equals(cellData.getStringValue())) { } else if (ApplicantTypeEnums.LEGAL.getValue() == cellData.getStringValue()) {
return ApplicantTypeEnums.LEGAL.getCode(); return String.valueOf(ApplicantTypeEnums.LEGAL.getCode());
} else { } else {
return ApplicantTypeEnums.PERSON.getCode(); return String.valueOf(ApplicantTypeEnums.PERSON.getCode());
} }
} }
......
...@@ -63,7 +63,7 @@ public class FilterSuppDataUtils { ...@@ -63,7 +63,7 @@ public class FilterSuppDataUtils {
flag = false; flag = false;
resonMsg.append("Err6:申请人姓名为空 "); resonMsg.append("Err6:申请人姓名为空 ");
} }
if (ApplicantTypeEnums.LEGAL.getCode().equals(supplement.getApplicationType())) { if (String.valueOf(ApplicantTypeEnums.LEGAL.getCode()).equals(supplement.getApplicationType())) {
//如果是法人,还需要在校验下 //如果是法人,还需要在校验下
//机构名称* 机构地址 机构性质* 证件类型* 机构编码* 法人姓名* //机构名称* 机构地址 机构性质* 证件类型* 机构编码* 法人姓名*
if (StringUtils.isEmpty(supplement.getMechanismName())) { if (StringUtils.isEmpty(supplement.getMechanismName())) {
......
...@@ -7,7 +7,9 @@ import org.springframework.stereotype.Repository; ...@@ -7,7 +7,9 @@ import org.springframework.stereotype.Repository;
import com.mortals.framework.dao.ibatis.SubmeterDaoImpl; import com.mortals.framework.dao.ibatis.SubmeterDaoImpl;
import com.mortals.framework.model.TableParam; import com.mortals.framework.model.TableParam;
import com.mortals.framework.model.TableStrategy; import com.mortals.framework.model.TableStrategy;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -27,6 +29,12 @@ public class InformationDaoImpl extends SubmeterDaoImpl<InformationEntity, Long> ...@@ -27,6 +29,12 @@ public class InformationDaoImpl extends SubmeterDaoImpl<InformationEntity, Long>
@Override @Override
public TableParam getTableParam(InformationEntity entity) { public TableParam getTableParam(InformationEntity entity) {
TableParam param = new TableParam(); TableParam param = new TableParam();
if (!ObjectUtils.isEmpty(entity.getCreateTime())){
param.unionTime = entity.getCreateTime();
}
if (ObjectUtils.isEmpty(param.unionTime)) {
param.unionTime = new Date();
}
return param; return param;
} }
......
package com.mortals.xhx.modules.information.model;
import lombok.Data;
/**
* @author Wz
* @Date: 2021-08-2021/8/3-16:50
* @Description:省能力平台接口调用返回统一格式
*/
@Data
public class EgIfResult {
private String ifResult;
private String ifResultInfo;
private String code;
}
package com.mortals.xhx.modules.information.task;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.dao.ICRUDSubmeterDao;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.TableParam;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.base.system.table.service.TableIndexService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* @author Wz
* @Date: 2021-08-2021/8/4-16:19
* @Description:
*/
@Component("createTableTaskImpl")
@Slf4j
public class CreateTableTaskImpl implements ITaskExcuteService {
@Autowired
private TableIndexService tableIndexService;
@Override
public void excuteTask(ITask task) throws AppException {
Map<String, ICRUDSubmeterDao> map = GlobalSysInfo.getBeansByType(ICRUDSubmeterDao.class);
if (map == null || map.isEmpty()) {
return;
}
Date currDate = new Date();
Set<String> existsTables = tableIndexService.findLastMonthTables();
TableParam param = new TableParam();
param.unionTime = currDate;
param.filterTables = existsTables;
param.isCreateTable = true;
for (Map.Entry<String, ICRUDSubmeterDao> entry : map.entrySet()) {
tableIndexService.createTable(entry.getValue(), param);
}
log.info("表创建完成!");
}
@Override
public void stopTask(ITask task) throws AppException {
}
}
package com.mortals.xhx.modules.information.task; package com.mortals.xhx.modules.information.task;
import cn.hutool.core.date.DateTime;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.common.code.NodeTypeEnum; import com.mortals.xhx.common.code.NodeTypeEnum;
import com.mortals.xhx.modules.information.model.EgIfResult; import com.mortals.xhx.common.utils.SnowFlakeUtil;
import com.mortals.xhx.modules.information.model.InformationEntity; import com.mortals.xhx.modules.information.model.InformationEntity;
import com.mortals.xhx.modules.information.service.InformationService; import com.mortals.xhx.modules.information.service.InformationService;
import com.mortals.xhx.modules.records.model.RecordEntity;
import com.mortals.xhx.modules.records.service.RecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.HashMap;
...@@ -29,6 +32,13 @@ import java.util.Map; ...@@ -29,6 +32,13 @@ import java.util.Map;
public class DecideInformationTaskImpl implements ITaskExcuteService { public class DecideInformationTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private InformationService informationService; private InformationService informationService;
@Autowired
private RecordService recordService;
@Value("${egov.decideNode-url}")
private String url;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
//组装决定数据推送一体化平台 //组装决定数据推送一体化平台
...@@ -40,17 +50,17 @@ public class DecideInformationTaskImpl implements ITaskExcuteService { ...@@ -40,17 +50,17 @@ public class DecideInformationTaskImpl implements ITaskExcuteService {
} }
private void decideData(){ private void decideData() {
InformationEntity informationEntity = new InformationEntity(); InformationEntity informationEntity = new InformationEntity();
informationEntity.setNodeType(NodeTypeEnum.决定.getCode()); informationEntity.setNodeType(NodeTypeEnum.决定.getCode());
//查询转化表的数据 //查询转化表的数据
List<InformationEntity> informationEntities = informationService.find(informationEntity, null); List<InformationEntity> informationEntities = informationService.find(informationEntity, null);
if (informationEntities.size() > 0){ if (informationEntities.size() > 0) {
informationEntities.forEach(e->{ informationEntities.forEach(e -> {
HashMap<String, Object> dataMap = new HashMap<>(16); HashMap<String, Object> dataMap = new HashMap<>(16);
dataMap.put("operateType", "1"); dataMap.put("operateType", "1");
HashMap<String, Object> targetConditionDefMap = new HashMap<>(16); HashMap<String, Object> targetConditionDefMap = new HashMap<>(16);
targetConditionDefMap.put("provinceAreaCode", "510000000000"); targetConditionDefMap.put("provinceAreaCode", e.getAreaCode());
targetConditionDefMap.put("deptCode", e.getDeptCode()); targetConditionDefMap.put("deptCode", e.getDeptCode());
targetConditionDefMap.put("areaCode", e.getAreaCode()); targetConditionDefMap.put("areaCode", e.getAreaCode());
dataMap.put("targetConditionDef", targetConditionDefMap); dataMap.put("targetConditionDef", targetConditionDefMap);
...@@ -58,44 +68,79 @@ public class DecideInformationTaskImpl implements ITaskExcuteService { ...@@ -58,44 +68,79 @@ public class DecideInformationTaskImpl implements ITaskExcuteService {
HashMap<String, Object> baseInfoMap = new HashMap<>(16); HashMap<String, Object> baseInfoMap = new HashMap<>(16);
baseInfoMap.put("reCode", e.getEventCode()); baseInfoMap.put("reCode", e.getEventCode());
baseInfoMap.put("code", e.getOfficeCode()); baseInfoMap.put("code", e.getOfficeCode());
baseInfoMap.put("sysCode", "000L"); baseInfoMap.put("applyCode", "");
baseInfoMap.put("sysCode", e.getSystemCode());
baseInfoMap.put("bizStatus", e.getBizStatus()); baseInfoMap.put("bizStatus", e.getBizStatus());
dataMap.put("baseInfo", baseInfoMap); dataMap.put("baseInfo", baseInfoMap);
HashMap<String, Object> valueMap = new HashMap<>(16); HashMap<String, Object> valueMap = new HashMap<>(16);
HashMap<String, Object> rlogisticsinfoMap = new HashMap<>(16); HashMap<String, Object> rlogisticsinfoMap = new HashMap<>(16);
rlogisticsinfoMap.put("nodeType", e.getNodeType()); rlogisticsinfoMap.put("nodeType", e.getNodeType());
rlogisticsinfoMap.put("addUserId", "-1"); /*
rlogisticsinfoMap.put("curHandlerName", e.getCurHandlerName()); * 测试数据--start
* */
rlogisticsinfoMap.put("addUserId", "HCPSH_ZSJ");
rlogisticsinfoMap.put("curHandlerName", "郑世杰");
rlogisticsinfoMap.put("nodeIdCard", "51372319980502619x");
rlogisticsinfoMap.put("nodePhone", "17158320000");
rlogisticsinfoMap.put("nodeRegionId", e.getAreaCode());
rlogisticsinfoMap.put("nodeOrganId", "513723199805026192");
rlogisticsinfoMap.put("addOrganId", e.getDeptCode());
rlogisticsinfoMap.put("addOrganName", "测试单位名称,正式上线后改动");
/*
* 测试数据-finsh
* */
rlogisticsinfoMap.put("auditAdvice", "1"); rlogisticsinfoMap.put("auditAdvice", "1");
rlogisticsinfoMap.put("auditRemark", "同意"); rlogisticsinfoMap.put("auditRemark", "同意");
rlogisticsinfoMap.put("genTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getGenTime())); rlogisticsinfoMap.put("genTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getGenTime()));
rlogisticsinfoMap.put("completeTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getCompleteTime())); rlogisticsinfoMap.put("completeTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getCompleteTime()));
valueMap.put("rprojectruntask", rlogisticsinfoMap); valueMap.put("rprojectruntask", rlogisticsinfoMap);
dataMap.put("value", valueMap); dataMap.put("value", valueMap);
String post = "";
JSONObject ifResultInfo = null;
try { try {
String post = HttpUtil.post("", dataMap); post = HttpUtil.post(url, JSONObject.toJSONString(dataMap));
EgIfResult egIfResult = JSON.parseObject(post, EgIfResult.class); ifResultInfo = JSONObject.parseObject(post).getJSONObject("ifResultInfo");
if ("200".equals(egIfResult.getCode())){ if ("200".equals(ifResultInfo.getString("code"))) {
e.setBizStatus(NodeTypeEnum.办结.getDesc()); e.setBizStatus(NodeTypeEnum.办结.getDesc());
e.setNodeType(NodeTypeEnum.办结.getCode()); e.setNodeType(NodeTypeEnum.办结.getCode());
e.setProcessStatusName("办结"); e.setProcessStatusName("办结");
informationService.update(e,null); informationService.update(e, null);
log.info("推送一体化成功,办件编码:"+egIfResult.getIfResultInfo()); log.info("推送一体化决定数据成功,办件编码:" + ifResultInfo.getJSONObject("data").getString("code"));
}else { //记录接口交换记录
recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
} else {
e.setFailTimes(e.getFailTimes() + 1); e.setFailTimes(e.getFailTimes() + 1);
e.setFailReason(egIfResult.getIfResultInfo()); e.setFailReason(ifResultInfo.getString("message"));
informationService.update(e,null); informationService.update(e, null);
log.info("省一体化数据推送失败:" + egIfResult.getIfResultInfo()); log.info("省一体化申请并受理数据推送失败:" + ifResultInfo.getString("message"));
//记录接口交换记录
recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
} }
}catch (Exception ex){ } catch (Exception ex) {
log.info("省一体化数据推送失败:连接异常"); log.error("省一体化决定数据推送失败:连接异常" + post);
//记录接口交换记录
recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
} }
}); });
}else { } else {
log.info("没有从办件表中获取到特定数据"); log.info("没有从办件表中获取到决定数据");
}
} }
private void recordInterfaceExchangeRecord(String post, JSONObject ifResultInfo, InformationEntity e, Map<String, Object> dataMap) {
RecordEntity recordEntity = new RecordEntity();
recordEntity.setId(SnowFlakeUtil.get().nextId());
recordEntity.setPieceId(e.getId());
recordEntity.setCurrentStepName("审查");
recordEntity.setCurrentStepCode(NodeTypeEnum.审查.getCode());
recordEntity.setIncomingMessage(JSONObject.toJSONString(dataMap));
recordEntity.setReturnMessage(JSONObject.toJSONString(post));
recordEntity.setInterfaceCallTime(DateTime.now());
recordEntity.setInterfaceCallStatus(ifResultInfo.getString("code"));
recordEntity.setSystemCode(e.getSystemCode());
recordService.save(recordEntity, null);
} }
} }
package com.mortals.xhx.modules.information.task; package com.mortals.xhx.modules.information.task;
import cn.hutool.core.date.DateTime;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.common.code.NodeTypeEnum; import com.mortals.xhx.common.code.NodeTypeEnum;
import com.mortals.xhx.modules.information.model.EgIfResult; import com.mortals.xhx.common.utils.SnowFlakeUtil;
import com.mortals.xhx.modules.information.model.InformationEntity; import com.mortals.xhx.modules.information.model.InformationEntity;
import com.mortals.xhx.modules.information.service.InformationService; import com.mortals.xhx.modules.information.service.InformationService;
import com.mortals.xhx.modules.records.model.RecordEntity;
import com.mortals.xhx.modules.records.service.RecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.HashMap;
...@@ -29,6 +32,13 @@ import java.util.Map; ...@@ -29,6 +32,13 @@ import java.util.Map;
public class ReviewInformationTaskImpl implements ITaskExcuteService { public class ReviewInformationTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private InformationService informationService; private InformationService informationService;
@Autowired
private RecordService recordService;
@Value("${egov.examineNode-url}")
private String url;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
//组装申请并受理数据推送一体化平台 //组装申请并受理数据推送一体化平台
...@@ -40,17 +50,17 @@ public class ReviewInformationTaskImpl implements ITaskExcuteService { ...@@ -40,17 +50,17 @@ public class ReviewInformationTaskImpl implements ITaskExcuteService {
} }
private void reviewData(){ private void reviewData() {
InformationEntity informationEntity = new InformationEntity(); InformationEntity informationEntity = new InformationEntity();
informationEntity.setNodeType(NodeTypeEnum.审查.getCode()); informationEntity.setNodeType(NodeTypeEnum.审查.getCode());
//查询转化表的数据 //查询转化表的数据
List<InformationEntity> informationEntities = informationService.find(informationEntity, null); List<InformationEntity> informationEntities = informationService.find(informationEntity, null);
if (informationEntities.size() > 0){ if (informationEntities.size() > 0) {
informationEntities.forEach(e->{ informationEntities.forEach(e -> {
HashMap<String, Object> dataMap = new HashMap<>(16); HashMap<String, Object> dataMap = new HashMap<>(16);
dataMap.put("operateType", "1"); dataMap.put("operateType", "1");
HashMap<String, Object> targetConditionDefMap = new HashMap<>(16); HashMap<String, Object> targetConditionDefMap = new HashMap<>(16);
targetConditionDefMap.put("provinceAreaCode", "510000000000"); targetConditionDefMap.put("provinceAreaCode", e.getAreaCode());
targetConditionDefMap.put("deptCode", e.getDeptCode()); targetConditionDefMap.put("deptCode", e.getDeptCode());
targetConditionDefMap.put("areaCode", e.getAreaCode()); targetConditionDefMap.put("areaCode", e.getAreaCode());
dataMap.put("targetConditionDef", targetConditionDefMap); dataMap.put("targetConditionDef", targetConditionDefMap);
...@@ -58,43 +68,78 @@ public class ReviewInformationTaskImpl implements ITaskExcuteService { ...@@ -58,43 +68,78 @@ public class ReviewInformationTaskImpl implements ITaskExcuteService {
HashMap<String, Object> baseInfoMap = new HashMap<>(16); HashMap<String, Object> baseInfoMap = new HashMap<>(16);
baseInfoMap.put("reCode", e.getEventCode()); baseInfoMap.put("reCode", e.getEventCode());
baseInfoMap.put("code", e.getOfficeCode()); baseInfoMap.put("code", e.getOfficeCode());
baseInfoMap.put("sysCode", "000L"); baseInfoMap.put("applyCode", "");
baseInfoMap.put("sysCode", e.getSystemCode());
baseInfoMap.put("bizStatus", e.getBizStatus()); baseInfoMap.put("bizStatus", e.getBizStatus());
dataMap.put("baseInfo", baseInfoMap); dataMap.put("baseInfo", baseInfoMap);
HashMap<String, Object> valueMap = new HashMap<>(16); HashMap<String, Object> valueMap = new HashMap<>(16);
HashMap<String, Object> rlogisticsinfoMap = new HashMap<>(16); HashMap<String, Object> rlogisticsinfoMap = new HashMap<>(16);
rlogisticsinfoMap.put("nodeType", e.getNodeType()); rlogisticsinfoMap.put("nodeType", e.getNodeType());
rlogisticsinfoMap.put("addUserId", "-1"); /*
rlogisticsinfoMap.put("curHandlerName", e.getCurHandlerName()); * 测试数据--start
* */
rlogisticsinfoMap.put("addUserId", "HCPSH_ZSJ");
rlogisticsinfoMap.put("curHandlerName", "郑世杰");
rlogisticsinfoMap.put("nodeIdCard", "51372319980502619x");
rlogisticsinfoMap.put("nodePhone", "17158320000");
rlogisticsinfoMap.put("nodeRegionId", e.getAreaCode());
rlogisticsinfoMap.put("nodeOrganId", "513723199805026192");
rlogisticsinfoMap.put("addOrganId", e.getDeptCode());
rlogisticsinfoMap.put("addOrganName", "测试单位名称,正式上线后改动");
/*
* 测试数据-finsh
* */
rlogisticsinfoMap.put("auditAdvice", "1"); rlogisticsinfoMap.put("auditAdvice", "1");
rlogisticsinfoMap.put("auditRemark", "同意"); rlogisticsinfoMap.put("auditRemark", "同意");
rlogisticsinfoMap.put("genTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getGenTime())); rlogisticsinfoMap.put("genTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getGenTime()));
rlogisticsinfoMap.put("completeTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getCompleteTime())); rlogisticsinfoMap.put("completeTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getCompleteTime()));
valueMap.put("rprojectruntask", rlogisticsinfoMap); valueMap.put("rprojectruntask", rlogisticsinfoMap);
dataMap.put("value", valueMap); dataMap.put("value", valueMap);
String post = "";
JSONObject ifResultInfo = null;
try { try {
String post = HttpUtil.post("", dataMap); post = HttpUtil.post(url, JSONObject.toJSONString(dataMap));
EgIfResult egIfResult = JSON.parseObject(post, EgIfResult.class); ifResultInfo = JSONObject.parseObject(post).getJSONObject("ifResultInfo");
if ("200".equals(egIfResult.getCode())){ if ("200".equals(ifResultInfo.getString("code"))) {
e.setBizStatus(NodeTypeEnum.决定.getDesc()); e.setBizStatus(NodeTypeEnum.决定.getDesc());
e.setNodeType(NodeTypeEnum.决定.getCode()); e.setNodeType(NodeTypeEnum.决定.getCode());
e.setProcessStatusName("决定"); e.setProcessStatusName("决定");
informationService.update(e,null); informationService.update(e, null);
log.info("推送一体化成功,办件编码:"+egIfResult.getIfResultInfo()); log.info("推送一体化审查数据成功,");
}else { //记录接口交换记录
recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
} else {
e.setFailTimes(e.getFailTimes() + 1); e.setFailTimes(e.getFailTimes() + 1);
e.setFailReason(egIfResult.getIfResultInfo()); e.setFailReason(ifResultInfo.getString("message"));
informationService.update(e,null); informationService.update(e, null);
log.info("省一体化数据推送失败:" + egIfResult.getIfResultInfo()); log.info("省一体化申请并受理数据推送失败:" + ifResultInfo.getString("message"));
//记录接口交换记录
recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
} }
}catch (Exception ex){ } catch (Exception ex) {
log.info("省一体化数据推送失败:连接异常"); log.error("省一体化审查数据推送失败:连接异常" + post);
//记录接口交换记录
recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
} }
}); });
}else { } else {
log.info("没有从办件表中获取到特定数据"); log.info("没有从办件表中获取到审查数据");
}
} }
private void recordInterfaceExchangeRecord(String post, JSONObject ifResultInfo, InformationEntity e, Map<String, Object> dataMap) {
RecordEntity recordEntity = new RecordEntity();
recordEntity.setId(SnowFlakeUtil.get().nextId());
recordEntity.setPieceId(e.getId());
recordEntity.setCurrentStepName("决定");
recordEntity.setCurrentStepCode(NodeTypeEnum.决定.getCode());
recordEntity.setIncomingMessage(JSONObject.toJSONString(dataMap));
recordEntity.setReturnMessage(JSONObject.toJSONString(post));
recordEntity.setInterfaceCallTime(DateTime.now());
recordEntity.setInterfaceCallStatus(ifResultInfo.getString("code"));
recordEntity.setSystemCode(e.getSystemCode());
recordService.save(recordEntity, null);
} }
} }
...@@ -3,25 +3,12 @@ package com.mortals.xhx.modules.information.web; ...@@ -3,25 +3,12 @@ package com.mortals.xhx.modules.information.web;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.excel.EasyExcel;
import com.mortals.framework.web.BaseCRUDJsonController; import com.mortals.framework.web.BaseCRUDJsonController;
import com.mortals.xhx.common.pdu.ApiRespPdu;
import com.mortals.xhx.modules.information.listener.InformationDataConversionListener;
import com.mortals.xhx.modules.information.model.InformationEntity; import com.mortals.xhx.modules.information.model.InformationEntity;
import com.mortals.xhx.modules.information.service.InformationService; import com.mortals.xhx.modules.information.service.InformationService;
import com.mortals.xhx.modules.supplement.dao.SupplementDao;
import com.mortals.xhx.modules.supplement.model.Supplement;
import com.mortals.xhx.modules.supplement.model.SupplementEntity;
import com.mortals.xhx.modules.supplement.service.SupplementService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PostMapping;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/** /**
...@@ -33,10 +20,10 @@ import java.util.List; ...@@ -33,10 +20,10 @@ import java.util.List;
* @version 1.0.0 * @version 1.0.0
*/ */
@RestController @RestController
@RequestMapping("information") @RequestMapping("/information")
public class InformationController extends BaseCRUDJsonController<InformationService, InformationForm, InformationEntity,Long> { public class InformationController extends BaseCRUDJsonController<InformationService, InformationForm, InformationEntity,Long> {
@Autowired @Autowired
private SupplementDao supplementDao; private InformationService informationService;
public InformationController(){ public InformationController(){
super.setFormClass(InformationForm.class); super.setFormClass(InformationForm.class);
...@@ -134,27 +121,7 @@ public class InformationController extends BaseCRUDJsonController<InformationSer ...@@ -134,27 +121,7 @@ public class InformationController extends BaseCRUDJsonController<InformationSer
} }
} }
/**
* 导入办件信息,一阶段通过excel表格导入
*/
@PostMapping(value="importOfficeInformation")
public ApiRespPdu importOfficeInformation(@RequestPart("file") MultipartFile file) throws Exception{
ApiRespPdu<Object> objectApiRespPdu = new ApiRespPdu<>();
try{
EasyExcel.read(file.getInputStream(), SupplementEntity.class, new InformationDataConversionListener(supplementDao))
.sheet(0)
.headRowNumber(3)
.doRead();
objectApiRespPdu.setCode(200);
objectApiRespPdu.setMsg("数据上传成功");
return objectApiRespPdu;
}catch(Exception e){
e.printStackTrace();
objectApiRespPdu.setCode(500);
objectApiRespPdu.setMsg("数据上传失败,失败原因:"+e.getMessage());
return objectApiRespPdu;
}
}
......
...@@ -6,6 +6,9 @@ import org.springframework.stereotype.Repository; ...@@ -6,6 +6,9 @@ import org.springframework.stereotype.Repository;
import com.mortals.framework.dao.ibatis.SubmeterDaoImpl; import com.mortals.framework.dao.ibatis.SubmeterDaoImpl;
import com.mortals.framework.model.TableParam; import com.mortals.framework.model.TableParam;
import com.mortals.framework.model.TableStrategy; import com.mortals.framework.model.TableStrategy;
import org.springframework.util.ObjectUtils;
import java.util.Date;
/** /**
* <p>Title: 接口调用记录</p> * <p>Title: 接口调用记录</p>
...@@ -25,6 +28,12 @@ public class RecordDaoImpl extends SubmeterDaoImpl<RecordEntity,Long> implements ...@@ -25,6 +28,12 @@ public class RecordDaoImpl extends SubmeterDaoImpl<RecordEntity,Long> implements
public TableParam getTableParam(RecordEntity entity) public TableParam getTableParam(RecordEntity entity)
{ {
TableParam param = new TableParam(); TableParam param = new TableParam();
if (!ObjectUtils.isEmpty(entity.getCreateTime())){
param.unionTime = entity.getCreateTime();
}
if (ObjectUtils.isEmpty(param.unionTime)) {
param.unionTime = new Date();
}
return param; return param;
} }
} }
package com.mortals.xhx.modules.information.listener; package com.mortals.xhx.modules.supplement.listener;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.event.AnalysisEventListener;
......
package com.mortals.xhx.modules.supplement.model;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.mortals.xhx.common.utils.ExcelConvertApplication;
import com.mortals.xhx.common.utils.ExcelConvertCardType;
import com.mortals.xhx.common.utils.ExcelConvertDateProperty;
import com.mortals.xhx.common.utils.ExcelConvertMainProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 办件补录表
* </p>
*
* @author coder wxy
* @since 2021-04-09
*/
@Data
public class Supplement {
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("实施清单名称*")
private String implName;
@ExcelProperty("实施清单编码*")
private String implCode;
@ExcelProperty(value = "申请人属性*", converter = ExcelConvertApplication.class)
private String applicationType;
@ExcelProperty(value = "申请人证件类型*", converter = ExcelConvertCardType.class)
private String applicationCardType;
@ExcelProperty("申请人姓名*")
private String applicationName;
@ExcelProperty("申请人证件号码*")
private String applicationId;
@ExcelProperty("申请人手机号码*")
private String applicationPhone;
@ExcelProperty("机构名称*")
private String mechanismName;
@ExcelProperty("机构地址")
private String mechanismAddress;
@ExcelProperty(value = "机构性质*", converter = ExcelConvertMainProperty.class)
private String mechanismType;
@ExcelProperty(value = "证件类型*", converter = ExcelConvertCardType.class)
private String mechanismIdType;
@ExcelProperty("机构编码*")
private String mechanismId;
@ExcelProperty("法人姓名*")
private String legalPerson;
@ExcelProperty(value = "办件申请日期", converter = ExcelConvertDateProperty.class)
private Date applyTime;
@ExcelProperty("受理人姓名")
private String acceptName;
@ExcelProperty("受理人身份证号码")
private String acceptId;
@ExcelProperty("受理人手机号")
private String acceptPhone;
@ExcelIgnore
private String sysCode;
@ExcelIgnore
private String is_execute;
@ExcelIgnore
private String isSuccess;
@ExcelIgnore
private String failReason;
}
...@@ -17,7 +17,6 @@ import com.mortals.xhx.modules.information.dao.InformationDao; ...@@ -17,7 +17,6 @@ import com.mortals.xhx.modules.information.dao.InformationDao;
import com.mortals.xhx.modules.information.model.InformationQuery; import com.mortals.xhx.modules.information.model.InformationQuery;
import com.mortals.xhx.modules.supplement.dao.SupplementDao; import com.mortals.xhx.modules.supplement.dao.SupplementDao;
import com.mortals.xhx.modules.supplement.model.SupplementEntity; import com.mortals.xhx.modules.supplement.model.SupplementEntity;
import com.mortals.xhx.modules.supplement.model.SupplementQuery;
import com.mortals.xhx.modules.supplement.service.SupplementService; import com.mortals.xhx.modules.supplement.service.SupplementService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -94,7 +93,7 @@ public class SupplementTaskImpl implements ITaskExcuteService { ...@@ -94,7 +93,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
} }
}); });
}else { }else {
log.info("没有从临时表中获取到数据"); log.info("没有从临时表中获取到需要清洗的数据");
} }
} }
...@@ -124,11 +123,14 @@ public class SupplementTaskImpl implements ITaskExcuteService { ...@@ -124,11 +123,14 @@ public class SupplementTaskImpl implements ITaskExcuteService {
//TODO 时间这里可以修改下,最好在一段区间范围内 //TODO 时间这里可以修改下,最好在一段区间范围内
informationQuery.setGenTime(randomDate); informationQuery.setGenTime(randomDate);
informationQuery.setCompleteTime(DateByAffairUtils.getTimeByAddRandom(randomDate,6)); informationQuery.setCompleteTime(DateByAffairUtils.getTimeByAddRandom(randomDate,6));
if(supplementEntity.getApplicationType().equals(ApplicantTypeEnums.LEGAL.getCode())){ if(String.valueOf(supplementEntity.getApplicationType()).equals(ApplicantTypeEnums.LEGAL.getCode())){
//法人 //设置法人
informationQuery.setLegalPerson(supplementEntity.getLegalPerson());
informationQuery.setOrganizationCardNumber(supplementEntity.getMechanismId());
//设置联系人
informationQuery.setContactName(supplementEntity.getLegalPerson().trim()); informationQuery.setContactName(supplementEntity.getLegalPerson().trim());
informationQuery.setContactIdCard(supplementEntity.getMechanismId().trim()); informationQuery.setContactIdCard(supplementEntity.getApplicationCardType().trim());
informationQuery.setContactCardType(supplementEntity.getMechanismIdType()); informationQuery.setContactCardType(supplementEntity.getApplicationId());
informationQuery.setContactPhone(supplementEntity.getApplicationPhone().trim()); informationQuery.setContactPhone(supplementEntity.getApplicationPhone().trim());
informationQuery.setApplyNum(supplementEntity.getMechanismType()); //临时征用 机构性质 informationQuery.setApplyNum(supplementEntity.getMechanismType()); //临时征用 机构性质
} }
...@@ -140,10 +142,13 @@ public class SupplementTaskImpl implements ITaskExcuteService { ...@@ -140,10 +142,13 @@ public class SupplementTaskImpl implements ITaskExcuteService {
informationQuery.setIsReport("0"); informationQuery.setIsReport("0");
informationQuery.setIsCharge("0"); informationQuery.setIsCharge("0");
//测试暂时写死 //测试暂时写死
informationQuery.setSystemCode("0000"); informationQuery.setSystemCode("000L");
informationQuery.setNodeType(NodeTypeEnum.受理.getCode()); informationQuery.setNodeType(NodeTypeEnum.受理.getCode());
informationQuery.setBizStatus(NodeTypeEnum.受理.getDesc()); informationQuery.setBizStatus(NodeTypeEnum.受理.getDesc());
informationQuery.setProcessStatusName("申请并受理"); informationQuery.setProcessStatusName("申请并受理");
informationQuery.setDoThingProperty("0");
informationQuery.setApplyNum("1");
informationQuery.setPickupType("3");
informationQuery.setCreateTime(DateTime.now()); informationQuery.setCreateTime(DateTime.now());
informationQuery.setUpdateTime(informationQuery.getCreateTime()); informationQuery.setUpdateTime(informationQuery.getCreateTime());
......
package com.mortals.xhx.modules.supplement.web; package com.mortals.xhx.modules.supplement.web;
import com.alibaba.excel.EasyExcel;
import com.mortals.xhx.common.pdu.ApiRespPdu;
import com.mortals.xhx.modules.information.service.InformationService;
import com.mortals.xhx.modules.supplement.dao.SupplementDao;
import com.mortals.xhx.modules.supplement.model.SupplementEntity; import com.mortals.xhx.modules.supplement.model.SupplementEntity;
import com.mortals.xhx.modules.supplement.listener.*;
import com.mortals.xhx.modules.supplement.service.SupplementService; import com.mortals.xhx.modules.supplement.service.SupplementService;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.web.BaseCRUDJsonMappingController; import com.mortals.framework.web.BaseCRUDJsonMappingController;
import org.springframework.web.multipart.MultipartFile;
/** /**
...@@ -19,6 +27,39 @@ import com.mortals.framework.web.BaseCRUDJsonMappingController; ...@@ -19,6 +27,39 @@ import com.mortals.framework.web.BaseCRUDJsonMappingController;
@RequestMapping("supplement") @RequestMapping("supplement")
public class SupplementController extends BaseCRUDJsonMappingController<SupplementService,SupplementForm, SupplementEntity,Long> { public class SupplementController extends BaseCRUDJsonMappingController<SupplementService,SupplementForm, SupplementEntity,Long> {
@Autowired
private SupplementDao supplementDao;
@Autowired
private InformationService informationService;
@Value("${egov.applyAndAcceptNode-url}")
private String url;
/**
* 导入办件信息,一阶段通过excel表格导入
*/
@PostMapping(value="importOfficeInformation")
public ApiRespPdu importOfficeInformation(@RequestPart("file") MultipartFile file) throws Exception{
ApiRespPdu<Object> objectApiRespPdu = new ApiRespPdu<>();
try{
EasyExcel.read(file.getInputStream(), SupplementEntity.class, new InformationDataConversionListener(supplementDao))
.sheet(0)
.headRowNumber(3)
.doRead();
objectApiRespPdu.setCode(200);
objectApiRespPdu.setMsg("数据上传成功");
return objectApiRespPdu;
}catch(Exception e){
e.printStackTrace();
objectApiRespPdu.setCode(500);
objectApiRespPdu.setMsg("数据上传失败,失败原因:"+e.getMessage());
return objectApiRespPdu;
}
}
public SupplementController(){ public SupplementController(){
super.setFormClass(SupplementForm.class); super.setFormClass(SupplementForm.class);
super.setModuleDesc("办件补录表"); super.setModuleDesc("办件补录表");
......
...@@ -37,3 +37,8 @@ application: ...@@ -37,3 +37,8 @@ application:
unloginUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/test*,/api/asset/*,/api/*,/swagger-ui* unloginUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/test*,/api/asset/*,/api/*,/swagger-ui*
uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/test*,/api/asset/*,/api/*,/swagger-ui* uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/test*,/api/asset/*,/api/*,/swagger-ui*
egov:
applyAndAcceptNode-url: http://59.225.209.134:8080/api/interface-admin-service/commonAcceptDataOpenRest/commonAcceptDatas/000L/21111Q01DR/V2.10/uakhAdee9sHyKriiRyTgjg8dvdVehrHp/1
examineNode-url: http://59.225.209.134:8080/api/interface-admin-service/commonAcceptDataOpenRest/commonAcceptDatas/000L/21111Q01DS/V2.10/uakhAdee9sHyKriiRyTgjg8dvdVehrHp/1
decideNode-url: http://59.225.209.134:8080/api/interface-admin-service/commonAcceptDataOpenRest/commonAcceptDatas/000L/21111Q01DT/V2.10/uakhAdee9sHyKriiRyTgjg8dvdVehrHp/1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment