|
@@ -6,10 +6,7 @@ import com.cool.bang.modules.mysql.domain.flowPo.ApprovalFlow;
|
|
|
import com.cool.bang.modules.mysql.domain.flowPo.ApprovalNode;
|
|
|
import com.cool.bang.modules.mysql.domain.flowPo.ApprovalRecord;
|
|
|
import com.cool.bang.modules.mysql.mapper.*;
|
|
|
-import com.cool.bang.modules.oracle.domain.Areg;
|
|
|
-import com.cool.bang.modules.oracle.domain.AregItem;
|
|
|
-import com.cool.bang.modules.oracle.domain.Bxmxy;
|
|
|
-import com.cool.bang.modules.oracle.domain.Trade;
|
|
|
+import com.cool.bang.modules.oracle.domain.*;
|
|
|
import com.cool.bang.modules.oracle.domain.po.*;
|
|
|
import com.cool.bang.modules.oracle.mapper.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -464,6 +461,7 @@ public class MySQLService {
|
|
|
}
|
|
|
}
|
|
|
mySqlMapper.insertSuperviseRelieve(superviseRelieveList);
|
|
|
+ recordList.forEach(item -> System.out.println(">>>>>> item ===" + item));
|
|
|
flowMapper.insertRecordBatch(recordList);
|
|
|
}
|
|
|
|
|
@@ -504,7 +502,7 @@ public class MySQLService {
|
|
|
*/
|
|
|
@Transactional
|
|
|
public void superviseTo() {
|
|
|
- System.out.println("===============fc_supervise_to、fc_supervise_to_detail数据匹配开始=================");
|
|
|
+ System.out.println("=============== 监管资金转托管 =================");
|
|
|
List<Jgztg> jgztgList = applyMapper.selectJgztg();
|
|
|
|
|
|
//查询流程信息
|
|
@@ -567,7 +565,6 @@ public class MySQLService {
|
|
|
tradeCz = t;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
//出账通知书
|
|
|
SuperviseToNotice superviseToNotice = new SuperviseToNotice();
|
|
|
superviseToNotice.initNotice(superviseTo);
|
|
@@ -617,6 +614,7 @@ public class MySQLService {
|
|
|
}
|
|
|
}
|
|
|
mySqlMapper.insertSuperviseToDetail(superviseToDetailList);
|
|
|
+ recordList.forEach(item -> System.out.println(">>>>>> item ===" + item));
|
|
|
flowMapper.insertRecordBatch(recordList);
|
|
|
mySqlMapper.insertSuperviseToPosting(superviseToPostingList);
|
|
|
mySqlMapper.insertSuperviseToOutgoing(superviseToOutgoingList);
|
|
@@ -734,6 +732,7 @@ public class MySQLService {
|
|
|
if (index == 200 || gcjdsq.getId().equals(lastGcjdsq.getId())) { //200条数据为1组
|
|
|
mySqlMapper.insertProgressDetail(progressDetailList);
|
|
|
progressDetailList.clear();
|
|
|
+ recordList.forEach(item -> System.out.println(">>>>>> item ===" + item));
|
|
|
flowMapper.insertRecordBatch(recordList);
|
|
|
recordList.clear();
|
|
|
index = 0;
|
|
@@ -744,352 +743,349 @@ public class MySQLService {
|
|
|
|
|
|
/**
|
|
|
* 拨付业务信息导入
|
|
|
+ *
|
|
|
+ * 监管拨付
|
|
|
+ * 额度内拨付(apptype=6 flowid=4)
|
|
|
+ * 业务表只存一条数据 监管出账通知书插入一条数据
|
|
|
+ * -----------------------------------------------------------------------------
|
|
|
+ * 额度外拨付(apptype=7 flowid=5)
|
|
|
+ * 业务表只存一条数据 监管出账通知书插入一条数据
|
|
|
+ * =============================================================================
|
|
|
+ * 托管拨付 (托管拨付中需要监管户过渡的时候,payitem表中gdaccountid不为空)
|
|
|
+ * 额度内拨付(apptype=18 flowid=18) 其中特批通道拨付【政府拨付】(apply表中zgflag=1)
|
|
|
+ * 政府拨付:托管户 -> 一般户 政府发起拨付业务时只可以从托管额度内资金申请
|
|
|
+ * 业务表只存一条数据 托管出账通知书插入一条数据
|
|
|
+ * -----------------------------------------------------------------------------
|
|
|
+ * 正常拨付:
|
|
|
+ * gdaccountid不为空时,即 托管户 -> 监管户 -> 一般户
|
|
|
+ * 业务表插入两条数据 1.托管户->监管户 2.监管户->一般户
|
|
|
+ * 托管出账通知书 监管入账通知书 监管出账通知书
|
|
|
+ *
|
|
|
+ * gdaccountid为空时, 即 托管户 -> 账户(这里填入的可能为监管户也可能为一般户,但是统一视为一般户处理)
|
|
|
+ * 业务表插入一条数据
|
|
|
+ * 托管出账通知书插入一条数据
|
|
|
+ * -----------------------------------------------------------------------------
|
|
|
+ * 额度外拨付(apptype=19 flowid=19)
|
|
|
+ * gdaccountid不为空时,即 托管户 -> 监管户 -> 一般户
|
|
|
+ * 业务表插入两条数据 1托管户->监管户 2监管户->一般户
|
|
|
+ * 托管出账通知书 监管入账通知书 监管出账通知书
|
|
|
+ *
|
|
|
+ * gdaccountid为空时, 即 托管户 -> 账户(这里填入的可能为监管户也可能为一般户,但是统一视为一般户处理)
|
|
|
+ * 业务表插入一条数据
|
|
|
+ * 托管出账通知书插入一条数据
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public void appropriation() {
|
|
|
- System.out.println("===============fc_appropriation、fc_appropriation_detail数据匹配开始=================");
|
|
|
-
|
|
|
- /**
|
|
|
- * 监管拨付
|
|
|
- * 额度内拨付(apptype=6 flowid=4)
|
|
|
- * 业务表只存一条数据 监管出账通知书插入一条数据
|
|
|
- * -----------------------------------------------------------------------------
|
|
|
- * 额度外拨付(apptype=7 flowid=5)
|
|
|
- * 业务表只存一条数据 监管出账通知书插入一条数据
|
|
|
- * =============================================================================
|
|
|
- * 托管拨付 (托管拨付中需要监管户过渡的时候,payitem表中gdaccountid不为空)
|
|
|
- * 额度内拨付(apptype=18 flowid=18) 其中特批通道拨付【政府拨付】(apply表中zgflag=1)
|
|
|
- * 政府拨付:托管户 -> 一般户 政府发起拨付业务时只可以从托管额度内资金申请
|
|
|
- * 业务表只存一条数据 托管出账通知书插入一条数据
|
|
|
- * -----------------------------------------------------------------------------
|
|
|
- * 正常拨付:
|
|
|
- * gdaccountid不为空时,即 托管户 -> 监管户 -> 一般户
|
|
|
- * 业务表插入两条数据 1.托管户->监管户 2.监管户->一般户
|
|
|
- * 托管出账通知书 监管入账通知书 监管出账通知书
|
|
|
- *
|
|
|
- * gdaccountid为空时, 即 托管户 -> 账户(这里填入的可能为监管户也可能为一般户,但是统一视为一般户处理)
|
|
|
- * 业务表插入一条数据
|
|
|
- * 托管出账通知书插入一条数据
|
|
|
- * -----------------------------------------------------------------------------
|
|
|
- * 额度外拨付(apptype=19 flowid=19)
|
|
|
- * gdaccountid不为空时,即 托管户 -> 监管户 -> 一般户
|
|
|
- * 业务表插入两条数据 1托管户->监管户 2监管户->一般户
|
|
|
- * 托管出账通知书 监管入账通知书 监管出账通知书
|
|
|
- *
|
|
|
- * gdaccountid为空时, 即 托管户 -> 账户(这里填入的可能为监管户也可能为一般户,但是统一视为一般户处理)
|
|
|
- * 业务表插入一条数据
|
|
|
- * 托管出账通知书插入一条数据
|
|
|
- */
|
|
|
-
|
|
|
- //查询流程信息
|
|
|
- ApprovalFlow approvalFlow = flowMapper.selectFlowByType(4); //工程形象进度申请flowType = 4
|
|
|
- //查询结束节点 节点信息
|
|
|
- List<ApprovalNode> approvalNodeList = flowMapper.selectNodeByFlowNumber(approvalFlow.getFlowNumber());
|
|
|
-
|
|
|
+ public void trusteeshipAppropriation() {
|
|
|
+ System.out.println("=============== 托管拨付 =================");
|
|
|
+ // 获取结束节点
|
|
|
+ ApprovalFlow approvalFlow = flowMapper.selectFlowByType(4); //托管拨付申请flowType = 4
|
|
|
ApprovalNode endNode = new ApprovalNode();
|
|
|
-
|
|
|
+ List<ApprovalNode> approvalNodeList = flowMapper.selectNodeByFlowNumber(approvalFlow.getFlowNumber());
|
|
|
for (ApprovalNode node : approvalNodeList) {
|
|
|
if (node.getNumber() == 4) {
|
|
|
endNode = node;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<ApprovalRecord> recordList = new ArrayList<>();
|
|
|
- List<AppropriationOutgoing> outgoingList = new ArrayList<>();
|
|
|
- List<AppropriationPosting> postingList = new ArrayList<>();
|
|
|
- List<AppropriationDetail> detailList = new ArrayList<>();
|
|
|
+ List<OracleAppropriation> oracleAppropriations = applyMapper.selectApply_18_19();
|
|
|
+
|
|
|
+ for (OracleAppropriation oracleAppropriation : oracleAppropriations) {
|
|
|
+
|
|
|
+ Appropriation appropriation = new Appropriation();
|
|
|
+
|
|
|
+ // 拨付明细
|
|
|
+ List<OracleAppropriationDetail> oracleAppropriationDetails =
|
|
|
+ applyMapper.selectApplyDetails_18_19(oracleAppropriation.getAppId());
|
|
|
+
|
|
|
+ // 开发单位
|
|
|
+ Org org = qyxxMapper.selectOrgByMisid(oracleAppropriation.getOrgMisId());
|
|
|
+ appropriation.setOrgId(org.getId());
|
|
|
+ appropriation.setOrgName(org.getOrgName());
|
|
|
+
|
|
|
+ // 付款银行
|
|
|
+ Account account = accountMapper.selectByAccountNO(
|
|
|
+ oracleAppropriation.getAppropriationAccount());
|
|
|
+ appropriation.setBusinessNumber(oracleAppropriation.getBusinessNumber());
|
|
|
+ appropriation.setBankCode(account.getBankCode());
|
|
|
+ appropriation.setAppropriationAccountId(account.getId());
|
|
|
+ appropriation.setAppropriationBank(account.getBankName());
|
|
|
+ appropriation.setAppropriationName(account.getName());
|
|
|
+ appropriation.setAppropriationAccount(account.getAccount());
|
|
|
+ appropriation.setAppropriationOpenAddress(account.getOpenAddress());
|
|
|
+
|
|
|
+ // 项目信息
|
|
|
+ ProjectAccount projectAccount = projectAccountMapper.selectByAregid(oracleAppropriation.getAregId());
|
|
|
+ appropriation.setProjectId(projectAccount.getProjectId());
|
|
|
+ appropriation.setProjectAccountId(projectAccount.getId());
|
|
|
+ appropriation.setProjectNumber(projectAccount.getProjectNumber());
|
|
|
+ appropriation.setProjectName(projectAccount.getProjectName());
|
|
|
+
|
|
|
+ // 联系人
|
|
|
+ appropriation.setDirector(oracleAppropriation.getDirectory());
|
|
|
+ appropriation.setPhone(oracleAppropriation.getPhone());
|
|
|
+
|
|
|
+ // 额度内拨付
|
|
|
+ if (oracleAppropriation.getAppType().equals(18)) {
|
|
|
+ appropriation.setApplicationType(1);
|
|
|
+ }
|
|
|
|
|
|
- int index = 0;
|
|
|
+ // 额度外拨付
|
|
|
+ if (oracleAppropriation.getAppType().equals(19)) {
|
|
|
+ appropriation.setApplicationType(2);
|
|
|
+ }
|
|
|
|
|
|
- //监管额度内拨付
|
|
|
- /*List<Bfxx> jgednList = applyMapper.selectBfxx(6,4);
|
|
|
- Bfxx lastJgedn = jgednList.get(jgednList.size() - 1);
|
|
|
- for (Bfxx bfxx : jgednList) {
|
|
|
- Account bfzh = accountMapper.selectByAccountNO(bfxx.getBfzh());
|
|
|
-// Account skzh = accountMapper.selectByAccountNO(bfxx.getSkzh());
|
|
|
+ if (oracleAppropriation.getZgFlag() != null &&
|
|
|
+ oracleAppropriation.getZgFlag().equals(1)) {
|
|
|
+ appropriation.setAppropriationType(3); // 政府拨付
|
|
|
+ } else {
|
|
|
+ appropriation.setAppropriationType(1); // 托管拨付
|
|
|
+ }
|
|
|
|
|
|
- Org org = qyxxMapper.selectOrgByMisid(bfxx.getQybh());
|
|
|
- ProjectAccount projectAccount = projectAccountMapper.selectByAregid(bfxx.getAregid());
|
|
|
+ // 托管转监管再转一般户
|
|
|
+ if (oracleAppropriation.getSuperviseAccount() != null) {
|
|
|
+ appropriation.setCollectionType(1);
|
|
|
+ // 收款账户系统内查找
|
|
|
+ Account collectionAccount = accountMapper.selectByAccountNO(
|
|
|
+ oracleAppropriation.getSuperviseAccount());
|
|
|
+ if (collectionAccount != null && collectionAccount.getId() != null) {
|
|
|
+ appropriation.setCollectionAccountId(collectionAccount.getId());
|
|
|
+ appropriation.setCollectionBank(collectionAccount.getBankName());
|
|
|
+ appropriation.setCollectionName(collectionAccount.getName());
|
|
|
+ appropriation.setCollectionAccount(collectionAccount.getAccount());
|
|
|
+ appropriation.setCollectionOpenAddress(collectionAccount.getOpenAddress());
|
|
|
+ }
|
|
|
+ // 拨付状态
|
|
|
+ if (oracleAppropriationDetails.get(0).getPayFlag2().equals(0)) {
|
|
|
+ appropriation.setApplicationState(0);
|
|
|
+ }
|
|
|
+ if (oracleAppropriationDetails.get(0).getPayFlag2().equals(1) ||
|
|
|
+ oracleAppropriationDetails.get(0).getPayFlag2().equals(2)) {
|
|
|
+ appropriation.setApplicationState(1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ appropriation.setCollectionType(2);
|
|
|
+ appropriation.setCollectionBank(oracleAppropriationDetails.get(0).getCollectionBank());
|
|
|
+ appropriation.setCollectionName(oracleAppropriationDetails.get(0).getCollectionName());
|
|
|
+ appropriation.setCollectionAccount(oracleAppropriationDetails.get(0).getCollectionAccount());
|
|
|
+ appropriation.setApplicationState(oracleAppropriationDetails.get(0).getPayFlag());
|
|
|
+ }
|
|
|
|
|
|
- Appropriation appropriation = new Appropriation(bfxx,bfzh,null,org,projectAccount);
|
|
|
- appropriation.setCollectionType(2);
|
|
|
- appropriation.setAppropriationType(2);
|
|
|
- appropriation.setApplicationType(1);
|
|
|
+ appropriation.setPurpose(oracleAppropriationDetails.get(0).getPurpose());
|
|
|
+ appropriation.setApplyAmount(oracleAppropriationDetails.get(0).getApplyAmountTotal());
|
|
|
+ // 如果是流程结束
|
|
|
+ if (oracleAppropriation.getFlowState().equals(0)) {
|
|
|
+ appropriation.setBusinessState(3);
|
|
|
+ }
|
|
|
+ if (oracleAppropriation.getFlowState().equals(1) && oracleAppropriation.getFlowNodeName().equals("保存")) {
|
|
|
+ appropriation.setBusinessState(0);
|
|
|
+ }
|
|
|
+ appropriation.setDelFlag(1);
|
|
|
+ appropriation.setCreateTime(oracleAppropriation.getCreateTime());
|
|
|
+ appropriation.setUpdateTime(oracleAppropriation.getUpdateTime());
|
|
|
appropriation.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
appropriation.setFlowNodeId(endNode.getId());
|
|
|
appropriation.setFlowNodeName(endNode.getNodeName());
|
|
|
- mySqlMapper.insertAppropriation(appropriation);
|
|
|
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(),appropriation));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation,4));
|
|
|
+ mySqlMapper.insertAppropriation(appropriation);
|
|
|
|
|
|
- index ++;
|
|
|
- //数据量达到200条时存一次 或 已到最后一条数据直接存
|
|
|
- if (index == 200 || lastJgedn.getYwbh().equals(bfxx.getYwbh())){ //200条数据为1组
|
|
|
- flowMapper.insertRecordBatch(recordList);
|
|
|
- recordList.clear();
|
|
|
- if (outgoingList.size()>0){
|
|
|
- mySqlMapper.insertAppropriationOutgoing(outgoingList);
|
|
|
- outgoingList.clear();
|
|
|
+ // 插入拨付明细
|
|
|
+ List<AppropriationDetail> details = new ArrayList<>();
|
|
|
+ for (OracleAppropriationDetail oracleAppropriationDetail : oracleAppropriationDetails) {
|
|
|
+ AppropriationDetail appropriationDetail = new AppropriationDetail(oracleAppropriationDetail);
|
|
|
+ appropriationDetail.setAppropriationId(appropriation.getId());
|
|
|
+ appropriation.setCreateTime(appropriation.getCreateTime());
|
|
|
+ appropriation.setUpdateTime(appropriation.getUpdateTime());
|
|
|
+ details.add(appropriationDetail);
|
|
|
+ }
|
|
|
+ mySqlMapper.insertAppropriationDetail(details);
|
|
|
+
|
|
|
+ // 插入审批记录
|
|
|
+ List<ApprovalRecord> records = new ArrayList<>();
|
|
|
+ List<OracleApprovalRecord> oracleApprovalRecords =
|
|
|
+ applyMapper.selectApprovalRecords_18_19(oracleAppropriation.getAppId());
|
|
|
+ if (oracleApprovalRecords != null && oracleApprovalRecords.size() > 0
|
|
|
+ && oracleApprovalRecords.get(0) != null
|
|
|
+ && !StringUtils.isEmpty(oracleApprovalRecords.get(0).getNodeName())) {
|
|
|
+ for (OracleApprovalRecord oracleApprovalRecord : oracleApprovalRecords) {
|
|
|
+ ApprovalRecord record = new ApprovalRecord();
|
|
|
+ record.setBusinessNumber(oracleAppropriation.getBusinessNumber());
|
|
|
+ record.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
+ record.setNodeId(endNode.getId());
|
|
|
+ if (!StringUtils.isEmpty(oracleApprovalRecord.getNodeName())) {
|
|
|
+ record.setNodeName(oracleApprovalRecord.getNodeName());
|
|
|
+ }
|
|
|
+ record.setApprover(oracleApprovalRecord.getApprover());
|
|
|
+ record.setApprovalTime(oracleApprovalRecord.getApprovalTime());
|
|
|
+ record.setTableId(appropriation.getId());
|
|
|
+ if (oracleApprovalRecord.getApprovalStatus() != null) {
|
|
|
+ record.setApprovalStatus(1);
|
|
|
+ }
|
|
|
+ record.setApprovalRemark(oracleApprovalRecord.getRemark());
|
|
|
+ records.add(record);
|
|
|
}
|
|
|
- index = 0;
|
|
|
+ flowMapper.insertRecordBatch(records);
|
|
|
}
|
|
|
- }*/
|
|
|
+ // 插入通知书
|
|
|
+ // 通知书类型(type) 1托管转监管户 2托管转一般户 3托管转其他户 4监管转一般户 5监管转其他户
|
|
|
+ mySqlMapper.insertAppropriationOutgoing(getAppropriationOutgoing(appropriation, 4));
|
|
|
+ }
|
|
|
+ // 更新楼幢账户表额度内已拨付金额
|
|
|
+ mySqlMapper.updateInLimitFund();
|
|
|
+ // 更新明细表楼幢账户主键
|
|
|
+ mySqlMapper.updateBuildingAccountId();
|
|
|
|
|
|
- //监管额度外拨付
|
|
|
- /*List<Bfxx> jgedwList = applyMapper.selectBfxx(7,5);
|
|
|
- Bfxx lastJgedw = jgedwList.get(jgedwList.size() - 1);
|
|
|
- for (Bfxx bfxx : jgedwList) {
|
|
|
- Account bfzh = accountMapper.selectByAccountNO(bfxx.getBfzh());
|
|
|
- Org org = qyxxMapper.selectOrgByMisid(bfxx.getQybh());
|
|
|
- ProjectAccount projectAccount = projectAccountMapper.selectByAregid(bfxx.getAregid());
|
|
|
+ System.out.println("=============== 托管拨付数据匹配结束 =================");
|
|
|
+ }
|
|
|
|
|
|
- Appropriation appropriation = new Appropriation(bfxx,bfzh,null,org,projectAccount);
|
|
|
- appropriation.setCollectionType(2);
|
|
|
+ @Transactional
|
|
|
+ public void superviseAppropriation() {
|
|
|
+ System.out.println("=============== 监管拨付 =================");
|
|
|
+ // 获取结束节点
|
|
|
+ ApprovalFlow approvalFlow = flowMapper.selectFlowByType(4); //托管拨付申请flowType = 4
|
|
|
+ ApprovalNode endNode = new ApprovalNode();
|
|
|
+ List<ApprovalNode> approvalNodeList = flowMapper.selectNodeByFlowNumber(approvalFlow.getFlowNumber());
|
|
|
+ for (ApprovalNode node : approvalNodeList) {
|
|
|
+ if (node.getNumber() == 4) {
|
|
|
+ endNode = node;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<OracleAppropriation> oracleAppropriations = applyMapper.selectApply_6_7();
|
|
|
+
|
|
|
+ for (OracleAppropriation oracleAppropriation : oracleAppropriations) {
|
|
|
+
|
|
|
+ Appropriation appropriation = new Appropriation();
|
|
|
+
|
|
|
+ // 拨付明细
|
|
|
+ List<OracleAppropriationDetail> oracleAppropriationDetails =
|
|
|
+ applyMapper.selectApplyDetails_6_7(oracleAppropriation.getAppId());
|
|
|
+
|
|
|
+ // 开发单位
|
|
|
+ Org org = qyxxMapper.selectOrgByMisid(oracleAppropriation.getOrgMisId());
|
|
|
+ appropriation.setOrgId(org.getId());
|
|
|
+ appropriation.setOrgName(org.getOrgName());
|
|
|
+
|
|
|
+ // 付款银行
|
|
|
+ appropriation.setBusinessNumber(oracleAppropriation.getBusinessNumber());
|
|
|
+ if (!StringUtils.isEmpty(oracleAppropriation.getAppropriationAccount())) {
|
|
|
+ Account account = accountMapper.selectByAccountNO(
|
|
|
+ oracleAppropriation.getAppropriationAccount());
|
|
|
+ appropriation.setBankCode(account.getBankCode());
|
|
|
+ appropriation.setAppropriationAccountId(account.getId());
|
|
|
+ appropriation.setAppropriationBank(account.getBankName());
|
|
|
+ appropriation.setAppropriationName(account.getName());
|
|
|
+ appropriation.setAppropriationAccount(account.getAccount());
|
|
|
+ appropriation.setAppropriationOpenAddress(account.getOpenAddress());
|
|
|
+ }
|
|
|
+ // 项目信息
|
|
|
+ ProjectAccount projectAccount = projectAccountMapper.selectByAregid(oracleAppropriation.getAregId());
|
|
|
+ appropriation.setProjectId(projectAccount.getProjectId());
|
|
|
+ appropriation.setProjectAccountId(projectAccount.getId());
|
|
|
+ appropriation.setProjectNumber(projectAccount.getProjectNumber());
|
|
|
+ appropriation.setProjectName(projectAccount.getProjectName());
|
|
|
+
|
|
|
+ // 联系人
|
|
|
+ appropriation.setDirector(oracleAppropriation.getDirectory());
|
|
|
+ appropriation.setPhone(oracleAppropriation.getPhone());
|
|
|
+
|
|
|
+ // 额度内拨付
|
|
|
+ if (oracleAppropriation.getAppType().equals(6)) {
|
|
|
+ appropriation.setApplicationType(1);
|
|
|
+ }
|
|
|
+ // 额度外拨付
|
|
|
+ if (oracleAppropriation.getAppType().equals(7)) {
|
|
|
+ appropriation.setApplicationType(2);
|
|
|
+ }
|
|
|
appropriation.setAppropriationType(2);
|
|
|
- appropriation.setApplicationType(2);
|
|
|
+ appropriation.setCollectionType(2);
|
|
|
+ if (oracleAppropriationDetails != null && oracleAppropriationDetails.size() != 0) {
|
|
|
+ appropriation.setCollectionBank(oracleAppropriationDetails.get(0) == null ? "":oracleAppropriationDetails.get(0).getCollectionBank());
|
|
|
+ appropriation.setCollectionName(oracleAppropriationDetails.get(0).getCollectionName());
|
|
|
+ appropriation.setCollectionAccount(oracleAppropriationDetails.get(0).getCollectionAccount());
|
|
|
+ appropriation.setApplicationState(oracleAppropriationDetails.get(0).getPayFlag());
|
|
|
+ appropriation.setPurpose(oracleAppropriationDetails.get(0).getPurpose());
|
|
|
+ appropriation.setApplyAmount(oracleAppropriationDetails.get(0).getApplyAmountTotal());
|
|
|
+ } else {
|
|
|
+ appropriation.setApplicationState(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是流程结束
|
|
|
+ if (oracleAppropriation.getFlowState().equals(0)) {
|
|
|
+ appropriation.setBusinessState(3);
|
|
|
+ }
|
|
|
+ if (oracleAppropriation.getFlowState().equals(1) && oracleAppropriation.getFlowNodeName().equals("保存")) {
|
|
|
+ // appropriation.setBusinessState(0);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (oracleAppropriation.getFlowState().equals(1) &&
|
|
|
+ oracleAppropriation.getFlowNodeName().equals("重点资金申请初审不通过")) {
|
|
|
+ // appropriation.setBusinessState(4);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (oracleAppropriation.getFlowState().equals(1) &&
|
|
|
+ oracleAppropriation.getFlowNodeName().equals("一般资金申请初审不通过")) {
|
|
|
+ // appropriation.setBusinessState(4);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ appropriation.setDelFlag(1);
|
|
|
+ appropriation.setCreateTime(oracleAppropriation.getCreateTime());
|
|
|
+ appropriation.setUpdateTime(oracleAppropriation.getUpdateTime());
|
|
|
appropriation.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
appropriation.setFlowNodeId(endNode.getId());
|
|
|
appropriation.setFlowNodeName(endNode.getNodeName());
|
|
|
- mySqlMapper.insertAppropriation(appropriation);
|
|
|
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(),appropriation));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation,4));
|
|
|
+ mySqlMapper.insertAppropriation(appropriation);
|
|
|
|
|
|
- index ++;
|
|
|
- //数据量达到200条时存一次 或 已到最后一条数据直接存
|
|
|
- if (index == 200 || lastJgedw.getYwbh().equals(bfxx.getYwbh())){ //200条数据为1组
|
|
|
- flowMapper.insertRecordBatch(recordList);
|
|
|
- recordList.clear();
|
|
|
- if (outgoingList.size()>0){
|
|
|
- mySqlMapper.insertAppropriationOutgoing(outgoingList);
|
|
|
- outgoingList.clear();
|
|
|
+ // 插入拨付明细
|
|
|
+ if (oracleAppropriationDetails != null && oracleAppropriationDetails.size() != 0) {
|
|
|
+ List<AppropriationDetail> details = new ArrayList<>();
|
|
|
+ for (OracleAppropriationDetail oracleAppropriationDetail : oracleAppropriationDetails) {
|
|
|
+ AppropriationDetail appropriationDetail = new AppropriationDetail(oracleAppropriationDetail);
|
|
|
+ appropriationDetail.setAppropriationId(appropriation.getId());
|
|
|
+ appropriation.setCreateTime(appropriation.getCreateTime());
|
|
|
+ appropriation.setUpdateTime(appropriation.getUpdateTime());
|
|
|
+ details.add(appropriationDetail);
|
|
|
}
|
|
|
- index = 0;
|
|
|
+ mySqlMapper.insertAppropriationDetail(details);
|
|
|
}
|
|
|
- }*/
|
|
|
-
|
|
|
- //通知书类型(type) 1托管转监管户 2托管转一般户 3托管转其他户 4监管转一般户 5监管转其他户
|
|
|
|
|
|
- //托管额度内拨付
|
|
|
- /*List<Bfxx> tgednList = applyMapper.selectBfxx(18, 18);
|
|
|
- Bfxx lastTgedn = tgednList.get(tgednList.size() - 1);
|
|
|
- for (Bfxx bfxx : tgednList) {
|
|
|
- Account bfzh = accountMapper.selectByAccountNO(bfxx.getBfzh());
|
|
|
- Org org = qyxxMapper.selectOrgByMisid(bfxx.getQybh());
|
|
|
- ProjectAccount projectAccount = projectAccountMapper.selectByAregid(bfxx.getAregid());
|
|
|
-
|
|
|
- if (bfxx.getZgflag() != null && bfxx.getZgflag() == 1) { //政府拨付 托管户 -> 一般户
|
|
|
- Appropriation appropriation = new Appropriation(bfxx, bfzh, null, org, projectAccount);
|
|
|
- appropriation.setCollectionType(2);
|
|
|
- appropriation.setAppropriationType(3);
|
|
|
- appropriation.setApplicationType(1);
|
|
|
- appropriation.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
- appropriation.setFlowNodeId(endNode.getId());
|
|
|
- appropriation.setFlowNodeName(endNode.getNodeName());
|
|
|
- mySqlMapper.insertAppropriation(appropriation);
|
|
|
-
|
|
|
- if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0) {
|
|
|
- List<AppropriationDetail> details = getAppropriationDetail(bfxx.getBfmxList(), appropriation);
|
|
|
- detailList.addAll(details);
|
|
|
- //如果有楼幢拨付 变更楼幢虚拟户额度内拨付金额
|
|
|
- if (appropriation.getApplicationState() == 1) {
|
|
|
- buildingAccountMapper.updateInLimitFundById(details);
|
|
|
- }
|
|
|
- }
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(), appropriation));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation, 2));
|
|
|
- } else {
|
|
|
- if (bfxx.getGdzh() != null) { //过渡账号不为空说明 托管户 -> 监管户 -> 一般户
|
|
|
- //托管户 -> 监管户(过渡户)
|
|
|
- Account gdzh = accountMapper.selectByAccountNO(bfxx.getGdzh());
|
|
|
- Appropriation appropriation1 = new Appropriation(bfxx, bfzh, gdzh, org, projectAccount);
|
|
|
- appropriation1.setBusinessNumber(appropriation1.getBusinessNumber() + "CZ");
|
|
|
- appropriation1.setCollectionType(1);
|
|
|
- appropriation1.setAppropriationType(1);
|
|
|
- appropriation1.setApplicationType(1);
|
|
|
- appropriation1.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
- appropriation1.setFlowNodeId(endNode.getId());
|
|
|
- appropriation1.setFlowNodeName(endNode.getNodeName());
|
|
|
- if (bfxx.getBfzt2() == 0) {
|
|
|
- appropriation1.setApplicationState(0);
|
|
|
- } else {
|
|
|
- appropriation1.setApplicationState(1);
|
|
|
- }
|
|
|
- mySqlMapper.insertAppropriation(appropriation1);
|
|
|
-
|
|
|
- if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0) {
|
|
|
- List<AppropriationDetail> details = getAppropriationDetail(bfxx.getBfmxList(), appropriation1);
|
|
|
- detailList.addAll(details);
|
|
|
- //如果有楼幢拨付 变更楼幢虚拟户额度内拨付金额
|
|
|
- if (appropriation1.getApplicationState() == 1) {
|
|
|
- buildingAccountMapper.updateInLimitFundById(details);
|
|
|
- }
|
|
|
- }
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(), appropriation1));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation1, 1));
|
|
|
- postingList.add(getAppropriationPosting(appropriation1));
|
|
|
-
|
|
|
- //监管户(过渡户) -> 一般户
|
|
|
- Appropriation appropriation2 = new Appropriation(bfxx, gdzh, null, org, projectAccount);
|
|
|
- appropriation2.setBusinessNumber(appropriation2.getBusinessNumber() + "RZ");
|
|
|
- appropriation2.setCollectionType(2);
|
|
|
- appropriation2.setAppropriationType(2);
|
|
|
- appropriation2.setApplicationType(1);
|
|
|
- appropriation2.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
- appropriation2.setFlowNodeId(endNode.getId());
|
|
|
- appropriation2.setFlowNodeName(endNode.getNodeName());
|
|
|
- if (bfxx.getBfzt2() == 2) {
|
|
|
- appropriation2.setApplicationState(1);
|
|
|
- } else {
|
|
|
- appropriation2.setApplicationState(0);
|
|
|
+ // 插入审批记录
|
|
|
+ List<ApprovalRecord> records = new ArrayList<>();
|
|
|
+ List<OracleApprovalRecord> oracleApprovalRecords =
|
|
|
+ applyMapper.selectApprovalRecords_6_7(oracleAppropriation.getAppId());
|
|
|
+ if (oracleApprovalRecords != null && oracleApprovalRecords.size() > 0
|
|
|
+ && oracleApprovalRecords.get(0) != null
|
|
|
+ && !StringUtils.isEmpty(oracleApprovalRecords.get(0).getNodeName())) {
|
|
|
+ for (OracleApprovalRecord oracleApprovalRecord : oracleApprovalRecords) {
|
|
|
+ ApprovalRecord record = new ApprovalRecord();
|
|
|
+ record.setBusinessNumber(oracleAppropriation.getBusinessNumber());
|
|
|
+ record.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
+ record.setNodeId(endNode.getId());
|
|
|
+ if (!StringUtils.isEmpty(oracleApprovalRecord.getNodeName())) {
|
|
|
+ record.setNodeName(oracleApprovalRecord.getNodeName());
|
|
|
}
|
|
|
- mySqlMapper.insertAppropriation(appropriation2);
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(), appropriation2));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation2, 4));
|
|
|
- } else { //过渡账号为空说明 托管户 -> 一般户
|
|
|
- Appropriation appropriation = new Appropriation(bfxx, bfzh, null, org, projectAccount);
|
|
|
- appropriation.setCollectionType(2);
|
|
|
- appropriation.setAppropriationType(1);
|
|
|
- appropriation.setApplicationType(1);
|
|
|
- appropriation.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
- appropriation.setFlowNodeId(endNode.getId());
|
|
|
- appropriation.setFlowNodeName(endNode.getNodeName());
|
|
|
- mySqlMapper.insertAppropriation(appropriation);
|
|
|
-
|
|
|
- if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0) {
|
|
|
- List<AppropriationDetail> details = getAppropriationDetail(bfxx.getBfmxList(), appropriation);
|
|
|
- detailList.addAll(details);
|
|
|
- //如果有楼幢拨付 变更楼幢虚拟户额度内拨付金额
|
|
|
- if (appropriation.getApplicationState() == 1) {
|
|
|
- buildingAccountMapper.updateInLimitFundById(details);
|
|
|
- }
|
|
|
+ record.setApprover(oracleApprovalRecord.getApprover());
|
|
|
+ record.setApprovalTime(oracleApprovalRecord.getApprovalTime());
|
|
|
+ record.setTableId(appropriation.getId());
|
|
|
+ if (oracleApprovalRecord.getApprovalStatus() != null) {
|
|
|
+ record.setApprovalStatus(Integer.parseInt(oracleApprovalRecord.getApprovalStatus()));
|
|
|
}
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(), appropriation));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation, 2));
|
|
|
- }
|
|
|
- }
|
|
|
- index++;
|
|
|
- //数据量达到200条时存一次 或 已到最后一条数据直接存
|
|
|
- if (index == 200 || lastTgedn.getYwbh().equals(bfxx.getYwbh())) { //200条数据为1组
|
|
|
- flowMapper.insertRecordBatch(recordList);
|
|
|
- recordList.clear();
|
|
|
- if (detailList.size() > 0) {
|
|
|
- mySqlMapper.insertAppropriationDetail(detailList);
|
|
|
- detailList.clear();
|
|
|
- }
|
|
|
- if (outgoingList.size() > 0) {
|
|
|
- mySqlMapper.insertAppropriationOutgoing(outgoingList);
|
|
|
- outgoingList.clear();
|
|
|
- }
|
|
|
- if (postingList.size() > 0) {
|
|
|
- mySqlMapper.insertAppropriationPosting(postingList);
|
|
|
- postingList.clear();
|
|
|
- }
|
|
|
- index = 0;
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
- //托管额度外拨付
|
|
|
- List<Bfxx> tgedwList = applyMapper.selectBfxx(19,18);
|
|
|
- Bfxx lastTgedw = tgedwList.get(tgedwList.size() - 1);
|
|
|
- for (Bfxx bfxx : tgedwList) {
|
|
|
- Account bfzh = accountMapper.selectByAccountNO(bfxx.getBfzh());
|
|
|
- Account skzh = accountMapper.selectByAccountNO(bfxx.getSkzh());
|
|
|
- Org org = qyxxMapper.selectOrgByMisid(bfxx.getQybh());
|
|
|
- ProjectAccount projectAccount = projectAccountMapper.selectByAregid(bfxx.getAregid());
|
|
|
-
|
|
|
- if (bfxx.getGdzh() != null){ //过渡账号不为空说明 托管户 -> 监管户 -> 一般户
|
|
|
- //托管户 -> 监管户(过渡户)
|
|
|
- Account gdzh = accountMapper.selectByAccountNO(bfxx.getGdzh());
|
|
|
- Appropriation appropriation1 = new Appropriation(bfxx,bfzh,gdzh,org,projectAccount);
|
|
|
- appropriation1.setBusinessNumber(appropriation1.getBusinessNumber()+"CZ");
|
|
|
- appropriation1.setCollectionType(1);
|
|
|
- appropriation1.setAppropriationType(1);
|
|
|
- appropriation1.setApplicationType(2);
|
|
|
- appropriation1.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
- appropriation1.setFlowNodeId(endNode.getId());
|
|
|
- appropriation1.setFlowNodeName(endNode.getNodeName());
|
|
|
- if (bfxx.getBfzt2() == 0){
|
|
|
- appropriation1.setApplicationState(0);
|
|
|
- }else {
|
|
|
- appropriation1.setApplicationState(1);
|
|
|
- }
|
|
|
- mySqlMapper.insertAppropriation(appropriation1);
|
|
|
-
|
|
|
- if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0){
|
|
|
- detailList.addAll(getAppropriationDetail(bfxx.getBfmxList(),appropriation1));
|
|
|
- }
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(),appropriation1));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation1,1));
|
|
|
- postingList.add(getAppropriationPosting(appropriation1));
|
|
|
-
|
|
|
- //监管户(过渡户) -> 一般户
|
|
|
- Appropriation appropriation2 = new Appropriation(bfxx,gdzh,null,org,projectAccount);
|
|
|
- appropriation2.setBusinessNumber(appropriation2.getBusinessNumber()+"RZ");
|
|
|
- appropriation2.setCollectionType(2);
|
|
|
- appropriation2.setAppropriationType(2);
|
|
|
- appropriation2.setApplicationType(2);
|
|
|
- appropriation2.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
- appropriation2.setFlowNodeId(endNode.getId());
|
|
|
- appropriation2.setFlowNodeName(endNode.getNodeName());
|
|
|
- if (bfxx.getBfzt2() == 2){
|
|
|
- appropriation2.setApplicationState(1);
|
|
|
- }else {
|
|
|
- appropriation2.setApplicationState(0);
|
|
|
- }
|
|
|
- mySqlMapper.insertAppropriation(appropriation2);
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(),appropriation2));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation2,4));
|
|
|
- }else { //过渡账号为空说明 托管户 -> 一般户
|
|
|
- Appropriation appropriation = new Appropriation(bfxx,bfzh,null,org,projectAccount);
|
|
|
- appropriation.setCollectionType(2);
|
|
|
- appropriation.setAppropriationType(1);
|
|
|
- appropriation.setApplicationType(2);
|
|
|
- appropriation.setFlowNumber(approvalFlow.getFlowNumber());
|
|
|
- appropriation.setFlowNodeId(endNode.getId());
|
|
|
- appropriation.setFlowNodeName(endNode.getNodeName());
|
|
|
- mySqlMapper.insertAppropriation(appropriation);
|
|
|
-
|
|
|
- if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0){
|
|
|
- detailList.addAll(getAppropriationDetail(bfxx.getBfmxList(),appropriation));
|
|
|
+ record.setApprovalRemark(oracleApprovalRecord.getRemark());
|
|
|
+ records.add(record);
|
|
|
}
|
|
|
- recordList.addAll(getBfFlow(bfxx.getsFlowList(),appropriation));
|
|
|
- outgoingList.add(getAppropriationOutgoing(appropriation,2));
|
|
|
+ flowMapper.insertRecordBatch(records);
|
|
|
}
|
|
|
-
|
|
|
- index ++;
|
|
|
- //数据量达到200条时存一次 或 已到最后一条数据直接存
|
|
|
- if (index == 200 || lastTgedw.getYwbh().equals(bfxx.getYwbh())){ //200条数据为1组
|
|
|
- flowMapper.insertRecordBatch(recordList);
|
|
|
- recordList.clear();
|
|
|
- if (detailList.size()>0){
|
|
|
- mySqlMapper.insertAppropriationDetail(detailList);
|
|
|
- detailList.clear();
|
|
|
- }
|
|
|
- if (outgoingList.size()>0){
|
|
|
- mySqlMapper.insertAppropriationOutgoing(outgoingList);
|
|
|
- outgoingList.clear();
|
|
|
- }
|
|
|
- if (postingList.size()>0){
|
|
|
- mySqlMapper.insertAppropriationPosting(postingList);
|
|
|
- postingList.clear();
|
|
|
- }
|
|
|
- index = 0;
|
|
|
+ // 插入通知书
|
|
|
+ // 通知书类型(type) 1托管转监管户 2托管转一般户 3托管转其他户 4监管转一般户 5监管转其他户
|
|
|
+ if (oracleAppropriation.getSuperviseAccount() != null) {
|
|
|
+ mySqlMapper.insertAppropriationOutgoing(getAppropriationOutgoing(appropriation, 1));
|
|
|
+ mySqlMapper.insertAppropriationPosting(getAppropriationPosting(appropriation));
|
|
|
+ } else {
|
|
|
+ mySqlMapper.insertAppropriationOutgoing(getAppropriationOutgoing(appropriation, 2));
|
|
|
}
|
|
|
}
|
|
|
- System.out.println("===============fc_appropriation、fc_appropriation_detail数据匹配结束=================");
|
|
|
- }
|
|
|
|
|
|
- //拨付明细
|
|
|
- public List<AppropriationDetail> getAppropriationDetail(List<Bfmx> bfmxList, Appropriation appropriation) {
|
|
|
- List<AppropriationDetail> detailList = new ArrayList<>();
|
|
|
- for (Bfmx bfmx : bfmxList) {
|
|
|
- BuildingAccount buildingAccount = buildingAccountMapper.selectByBuildingNumber(bfmx.getLzbh());
|
|
|
- AppropriationDetail appropriationDetail = new AppropriationDetail(bfmx, appropriation, buildingAccount);
|
|
|
- detailList.add(appropriationDetail);
|
|
|
- }
|
|
|
- return detailList;
|
|
|
+ System.out.println("=============== 监管拨付数据匹配结束 =================");
|
|
|
}
|
|
|
|
|
|
//拨付出账通知书
|
|
@@ -1112,41 +1108,6 @@ public class MySQLService {
|
|
|
return posting;
|
|
|
}
|
|
|
|
|
|
- //拨付审批流程
|
|
|
- public List<ApprovalRecord> getBfFlow(List<SFlow> sFlowList, Appropriation appropriation) {
|
|
|
- List<ApprovalRecord> recordList = new ArrayList<>();
|
|
|
- for (SFlow sFlow : sFlowList) {
|
|
|
- ApprovalRecord record = new ApprovalRecord();
|
|
|
- record.setBusinessNumber(appropriation.getBusinessNumber());
|
|
|
- record.setFlowNumber(appropriation.getFlowNumber());
|
|
|
- record.setTableId(appropriation.getId());
|
|
|
- record.setApprovalTime(sFlow.getShsj());
|
|
|
- record.setApprovalRemark(sFlow.getBz());
|
|
|
- record.setCreateTime(record.getApprovalTime());
|
|
|
- record.setUpdateTime(record.getApprovalTime());
|
|
|
- record.setDelFlag(1);
|
|
|
- if (sFlow.getShzt() == null) {
|
|
|
- record.setNodeName("申请节点");
|
|
|
- record.setApprover(appropriation.getOrgName() + "(" + sFlow.getShr() + ")");
|
|
|
- } else {
|
|
|
- //这种情况是范哥的托管额度外拨付流程与托管额度内拨付流程用的是同一个flowid,所以流程节点名称都是”额度内...“,需要此处判断替换一下
|
|
|
- if (appropriation.getAppropriationType() == 1 && appropriation.getApplicationType() == 2) {
|
|
|
- record.setNodeName(sFlow.getLcmc().replace("内", "外"));
|
|
|
- } else {
|
|
|
- record.setNodeName(sFlow.getLcmc());
|
|
|
- }
|
|
|
- record.setApprover("监管部门(" + sFlow.getShr() + ")");
|
|
|
- if (sFlow.getShzt() == 1) {
|
|
|
- record.setApprovalStatus(1);
|
|
|
- } else {
|
|
|
- record.setApprovalStatus(2);
|
|
|
- }
|
|
|
- }
|
|
|
- recordList.add(record);
|
|
|
- }
|
|
|
- return recordList;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 合同导入
|