|
@@ -44,6 +44,8 @@ public class MySQLSecondService {
|
|
private ProjectAccountMapper projectAccountMapper;
|
|
private ProjectAccountMapper projectAccountMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private BuildingAccountMapper buildingAccountMapper;
|
|
private BuildingAccountMapper buildingAccountMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ProjectMapper projectMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -98,15 +100,15 @@ public class MySQLSecondService {
|
|
if (item.getFLOWSTATE().equals("0")) {
|
|
if (item.getFLOWSTATE().equals("0")) {
|
|
refund.setBusinessState(3);
|
|
refund.setBusinessState(3);
|
|
}
|
|
}
|
|
- if (item.getFLOWSTATE().equals("1") ) {
|
|
|
|
|
|
+ if (item.getFLOWSTATE().equals("1")) {
|
|
refund.setBusinessState(2);
|
|
refund.setBusinessState(2);
|
|
}
|
|
}
|
|
refund.setFlowNumber(approvalFlow.getFlowNumber());
|
|
refund.setFlowNumber(approvalFlow.getFlowNumber());
|
|
refund.setFlowNodeId(endNode.getId());
|
|
refund.setFlowNodeId(endNode.getId());
|
|
refund.setFlowNodeName(endNode.getNodeName());
|
|
refund.setFlowNodeName(endNode.getNodeName());
|
|
- if(!StringUtils.isEmpty(item.getFWBH())){
|
|
|
|
- P_lpb_fw fw = fwMapper.getFwByMissid(item.getFWBH(),null);
|
|
|
|
- if(null != fw){
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(item.getFWBH())) {
|
|
|
|
+ P_lpb_fw fw = fwMapper.getFwByMissid(item.getFWBH(), null);
|
|
|
|
+ if (null != fw) {
|
|
refund.setHouseAddress(fw.getXxdz());
|
|
refund.setHouseAddress(fw.getXxdz());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -333,4 +335,129 @@ public class MySQLSecondService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ public void buildingRelieve() {
|
|
|
|
+ List<OracleRelieve> oracleRelieves = applyMapper.selectLDRelieves();
|
|
|
|
+
|
|
|
|
+ // 查询审批流程
|
|
|
|
+ ApprovalFlow approvalFlow = flowMapper.selectFlowByType(7); // 解除楼栋申请flowId = 7
|
|
|
|
+ List<ApprovalNode> nodes = flowMapper.selectNodeByFlowNumber(approvalFlow.getFlowNumber());
|
|
|
|
+ ApprovalNode endNode = new ApprovalNode();
|
|
|
|
+ for (ApprovalNode node : nodes) {
|
|
|
|
+ if (node.getNumber() == 3) {
|
|
|
|
+ endNode = node;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (OracleRelieve oracleRelieve : oracleRelieves) {
|
|
|
|
+
|
|
|
|
+ // 审核不通过的,不导入
|
|
|
|
+ if (oracleRelieve.getFlowState().equals(1) &&
|
|
|
|
+ oracleRelieve.getFlowNodeName().equals("解除楼幢初审不通过")) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Relieve relieve = new Relieve(oracleRelieve);
|
|
|
|
+
|
|
|
|
+ // 申请未审核的导入
|
|
|
|
+ if (oracleRelieve.getFlowState().equals(1) &&
|
|
|
|
+ oracleRelieve.getFlowNodeName().equals("解除楼幢申请上报")) {
|
|
|
|
+ relieve.setBusinessState(1);
|
|
|
|
+ } else if (oracleRelieve.getFlowState().equals(1) && oracleRelieve.getFlowNodeName().equals("保存")) {
|
|
|
|
+ relieve.setBusinessState(0);
|
|
|
|
+ } else if (oracleRelieve.getFlowState().equals(1)) {
|
|
|
|
+ throw new RuntimeException("解除项目异常:" + oracleRelieve.getFlowNodeName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 审核已完成
|
|
|
|
+ if (oracleRelieve.getFlowState().equals(0)) {
|
|
|
|
+ relieve.setBusinessState(3);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Org org = qyxxMapper.selectOrgByMisid(oracleRelieve.getOrgMisId());
|
|
|
|
+ relieve.setOrgId(org.getId());
|
|
|
|
+ relieve.setOrgName(org.getOrgName());
|
|
|
|
+
|
|
|
|
+ Project project = projectMapper.selectByProjectNumber(oracleRelieve.getProjectNumber());
|
|
|
|
+ relieve.setProjectId(project.getId());
|
|
|
|
+ relieve.setProjectNumber(project.getProjectNumber());
|
|
|
|
+ relieve.setProjectName(project.getProjectName());
|
|
|
|
+
|
|
|
|
+ relieve.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
|
+ relieve.setFlowNodeId(endNode.getId());
|
|
|
|
+ relieve.setFlowNodeName(endNode.getNodeName());
|
|
|
|
+
|
|
|
|
+ // 楼栋解除
|
|
|
|
+ /* List<Areg> list = applyMapper.selectIsRelieve(relieve.getProjectNumber());
|
|
|
|
+ if (list.size() == 1) {
|
|
|
|
+ relieve.setRelieveType(1); // 项目解除
|
|
|
|
+ // 如果是未审核通过的,改为解除中
|
|
|
|
+ if (oracleRelieve.getFlowState().equals(1)) {
|
|
|
|
+ projectMapper.updateRelieve(relieve.getProjectId(), 2);
|
|
|
|
+ } else {
|
|
|
|
+ projectMapper.updateRelieve(relieve.getProjectId(), 0);
|
|
|
|
+ }
|
|
|
|
+ } else {*/
|
|
|
|
+ relieve.setRelieveType(2);
|
|
|
|
+ /*}*/
|
|
|
|
+ mySqlMapper.insertRelieve(relieve);
|
|
|
|
+
|
|
|
|
+ // ------------------------------ 楼栋解除详情 ----------------------------------
|
|
|
|
+
|
|
|
|
+ List<RelieveDetail> relieveDetails = new ArrayList<>();
|
|
|
|
+ List<OracleRelieveDetail> oracleRelieveDetails = applyMapper.selectRelieveDetails(oracleRelieve.getAppId());
|
|
|
|
+ if (oracleRelieveDetails != null && oracleRelieveDetails.size() > 0
|
|
|
|
+ && oracleRelieveDetails.get(0) != null && !StringUtils.isEmpty(oracleRelieveDetails.get(0).getBuildingNumber())) {
|
|
|
|
+ StringBuilder relieveBuilding = new StringBuilder();
|
|
|
|
+ for (OracleRelieveDetail detail : oracleRelieveDetails) {
|
|
|
|
+ BuildingAccount building = buildingAccountMapper.selectByBuildingNumber(detail.getBuildingNumber());
|
|
|
|
+ RelieveDetail relieveDetail = new RelieveDetail(building);
|
|
|
|
+ relieveDetail.setRelieveId(relieve.getId());
|
|
|
|
+ relieveDetails.add(relieveDetail);
|
|
|
|
+ relieveBuilding.append(building.getBuildingName()).append(",");
|
|
|
|
+ }
|
|
|
|
+ String buildingNames = relieveBuilding.toString().substring(0, relieveBuilding.length() - 1);
|
|
|
|
+ mySqlMapper.updateRelieveBuilding(relieve.getId(), buildingNames);
|
|
|
|
+ mySqlMapper.insertRelieveDetail(relieveDetails);
|
|
|
|
+ buildingAccountMapper.updateRelieve(relieveDetails, relieve.getUpdateTime());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // ------------------------------ 楼栋解除审批记录 ----------------------------------
|
|
|
|
+
|
|
|
|
+ List<ApprovalRecord> approvalRecords = new ArrayList<>();
|
|
|
|
+ List<OracleApprovalRecord> oracleApprovalRecords = applyMapper.selecLDRelieveRecord(oracleRelieve.getAppId());
|
|
|
|
+ if (oracleApprovalRecords != null && oracleApprovalRecords.size() > 0
|
|
|
|
+ && oracleApprovalRecords.get(0) != null
|
|
|
|
+ && !StringUtils.isEmpty(oracleApprovalRecords.get(0).getNodeName())) {
|
|
|
|
+ for (OracleApprovalRecord approval : oracleApprovalRecords) {
|
|
|
|
+ ApprovalRecord record = new ApprovalRecord();
|
|
|
|
+ record.setBusinessNumber(relieve.getBusinessNumber());
|
|
|
|
+ record.setFlowNumber(relieve.getFlowNumber());
|
|
|
|
+ record.setTableId(relieve.getId());
|
|
|
|
+ record.setApprovalTime(approval.getApprovalTime());
|
|
|
|
+ record.setApprovalRemark(approval.getRemark());
|
|
|
|
+ record.setCreateTime(record.getApprovalTime());
|
|
|
|
+ record.setUpdateTime(record.getApprovalTime());
|
|
|
|
+ record.setDelFlag(1);
|
|
|
|
+ if (StringUtils.isEmpty(approval.getApprovalStatus())) {
|
|
|
|
+ record.setNodeName("申请节点");
|
|
|
|
+ record.setApprover(relieve.getOrgName() + "(" + approval.getApprover() + ")");
|
|
|
|
+ } else {
|
|
|
|
+ record.setNodeName(approval.getNodeName());
|
|
|
|
+ record.setApprover("监管部门(" + approval.getApprover() + ")");
|
|
|
|
+ if (approval.getApprovalStatus().equals("1")) {
|
|
|
|
+ record.setApprovalStatus(1);
|
|
|
|
+ } else {
|
|
|
|
+ record.setApprovalStatus(2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ approvalRecords.add(record);
|
|
|
|
+ }
|
|
|
|
+ flowMapper.insertRecordBatch(approvalRecords);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|