shenziyin-gh 1 éve
szülő
commit
496e3442b5
23 módosított fájl, 1919 hozzáadás és 241 törlés
  1. 47 2
      src/main/java/com/cool/bang/api/DataMatch.java
  2. 1 1
      src/main/java/com/cool/bang/modules/mysql/domain/BuildingAccount.java
  3. 1 0
      src/main/java/com/cool/bang/modules/mysql/domain/Contract.java
  4. 26 0
      src/main/java/com/cool/bang/modules/mysql/domain/ContractInfo.java
  5. 323 0
      src/main/java/com/cool/bang/modules/mysql/domain/FcTrade.java
  6. 422 0
      src/main/java/com/cool/bang/modules/mysql/domain/Refund.java
  7. 8 6
      src/main/java/com/cool/bang/modules/mysql/domain/SuperviseBusiness.java
  8. 138 0
      src/main/java/com/cool/bang/modules/mysql/domain/TradeInfo.java
  9. 25 0
      src/main/java/com/cool/bang/modules/mysql/mapper/MySqlMapper.java
  10. 213 0
      src/main/java/com/cool/bang/modules/mysql/service/MySQLSecondService.java
  11. 162 156
      src/main/java/com/cool/bang/modules/mysql/service/MySQLService.java
  12. 128 0
      src/main/java/com/cool/bang/modules/oracle/domain/po/TkInfo.java
  13. 39 0
      src/main/java/com/cool/bang/modules/oracle/mapper/OracleMapper.java
  14. 5 4
      src/main/resources/application.yml
  15. 5 3
      src/main/resources/mapper/mysql/BuildingAccountMapper.xml
  16. 245 66
      src/main/resources/mapper/mysql/MySQLMapper.xml
  17. 3 1
      src/main/resources/mapper/oracle/ApplyMapper.xml
  18. 59 0
      src/main/resources/mapper/oracle/OracleMapper.xml
  19. BIN
      target/classes/com/cool/bang/modules/mysql/domain/BuildingAccount.class
  20. BIN
      target/classes/com/cool/bang/modules/mysql/domain/TrusteeshipBusiness.class
  21. 3 1
      target/classes/mapper/oracle/ApplyMapper.xml
  22. 1 1
      target/classes/mapper/oracle/BxmxyMapper.xml
  23. 65 0
      target/classes/mapper/oracle/OracleMapper.xml

+ 47 - 2
src/main/java/com/cool/bang/api/DataMatch.java

@@ -1,5 +1,6 @@
 package com.cool.bang.api;
 
+import com.cool.bang.modules.mysql.service.MySQLSecondService;
 import com.cool.bang.modules.mysql.service.MySQLService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -12,6 +13,8 @@ public class DataMatch {
 
     @Autowired
     private MySQLService mySQLService;
+    @Autowired
+    private MySQLSecondService mySQLSecondService;
 
     /**
      * 账户表导入
@@ -94,21 +97,63 @@ public class DataMatch {
     }
 
 
-
+    /**
+     * 合同
+     */
     @GetMapping("htTo")
     public void htTo(){
         mySQLService.htTo();
     }
 
+
+    /**
+     *交存
+     */
     @GetMapping("htPayTo")
     public void htPayTo(){
         mySQLService.htPayTo();
     }
 
 
-
+    /**
+     * 定金
+     */
     @GetMapping("djTo")
     public void djTo(){
         mySQLService.djTo();
     }
+
+    /**
+     * 退款(合同)
+     */
+    @GetMapping("refundTo")
+    public void refundTo(){
+        mySQLSecondService.refundTo();
+    }
+
+
+    /**
+     * 交易 待对账
+     */
+    @GetMapping("tradeDDZTo")
+    public void tradeDDZTo(){
+        mySQLSecondService.tradeDDZTo();
+    }
+
+    /**
+     * 交易 托管
+     */
+    @GetMapping("tradeTgTo")
+    public void tradeTgTo(){
+        mySQLSecondService.tradeTgTo();
+    }
+
+    /**
+     * 对账
+     */
+    @GetMapping("accountChecking")
+    public void accountChecking(){
+        mySQLSecondService.accountChecking();
+    }
+
 }

+ 1 - 1
src/main/java/com/cool/bang/modules/mysql/domain/BuildingAccount.java

@@ -166,7 +166,7 @@ public class BuildingAccount {
             this.buildCostName = "精装房";
         }
 
-        this.inLimitFund = null; //额度内已拨付资金
+        this.inLimitFund = BigDecimal.ZERO; //额度内已拨付资金
         this.relieveId = null; //解除业务主键
         this.relieveDate = null; //解除日期
         this.isFrozen = 0; //冻结状态 yszjjg数据不涉及冻结信息所以这个字段默认0未冻结

+ 1 - 0
src/main/java/com/cool/bang/modules/mysql/domain/Contract.java

@@ -3,6 +3,7 @@ package com.cool.bang.modules.mysql.domain;
 import com.cool.bang.common.util.DateUtil;
 import com.cool.bang.modules.oracle.domain.po.BhtTrade;
 import com.cool.bang.modules.oracle.domain.po.HtInfo;
+import org.apache.ibatis.type.Alias;
 import org.springframework.util.StringUtils;
 
 import java.math.BigDecimal;

+ 26 - 0
src/main/java/com/cool/bang/modules/mysql/domain/ContractInfo.java

@@ -0,0 +1,26 @@
+package com.cool.bang.modules.mysql.domain;
+
+import java.math.BigDecimal;
+
+public class ContractInfo {
+    private Long id;
+
+    private BigDecimal contractPrice;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public BigDecimal getContractPrice() {
+        return contractPrice;
+    }
+
+    public void setContractPrice(BigDecimal contractPrice) {
+        this.contractPrice = contractPrice;
+    }
+}

+ 323 - 0
src/main/java/com/cool/bang/modules/mysql/domain/FcTrade.java

@@ -0,0 +1,323 @@
+package com.cool.bang.modules.mysql.domain;
+
+import com.cool.bang.common.util.DateUtil;
+
+import java.math.BigDecimal;
+
+public class FcTrade {
+
+
+    private Long id;
+
+    /**
+     * 银行流水
+     */
+    private String serialNumber;
+
+    /**
+     * 冲红原银行流水/补录银行流水
+     */
+    private String flushSerialNumber;
+
+    /**
+     * 业务编码
+     */
+    private String businessNumber;
+
+    /**
+     * 渠道类型 1银行 2pos
+     */
+    private Integer channelType;
+
+    /**
+     * 渠道编码
+     */
+    private String channelCode;
+
+    /**
+     * 账户类型 1托管账户 2监管账户
+     */
+    private Integer accountType;
+
+    /**
+     * 银行账号
+     */
+    private String account;
+
+    /**
+     * 账户主键
+     */
+    private Long accountId;
+
+    /**
+     * 项目虚拟户主键
+     */
+    private Long projectAccountId;
+
+    /**
+     * 楼幢虚拟户主键
+     */
+    private Long buildingAccountId;
+
+    /**
+     * 交易金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 交易类型 1收入 2支出
+     */
+    private Integer type;
+
+    /**
+     * 交易方式 1转账 2结息 3手续费 4法院划扣 9待查入账
+     */
+    private Integer transactionMode;
+
+    /**
+     * 交易时间
+     */
+    private String transactionTime;
+
+    /**
+     * 账户余额
+     */
+    private BigDecimal accountBalance;
+
+    /**
+     * 对方账号
+     */
+    private String reciprocalAccount;
+
+    /**
+     * 对账状态 0未对账 1对账成功 2错账 3单边账
+     */
+    private Integer checkStatus;
+
+    /**
+     * 对账日期
+     */
+    private String checkDate;
+
+    /**
+     * 是否冲正 0否 1是
+     */
+    private Integer isFlush;
+
+    /**
+     * 删除标识 1正常 0删除
+     */
+    private Integer delFlag;
+
+    private String remark;
+
+
+    public FcTrade(TradeInfo item, ProjectAccount projectAccount, Account account, BuildingAccount buildingAccount) {
+        this.serialNumber = item.getSerialNumber();
+        this.flushSerialNumber = item.getFlushSerialNumber();
+        this.businessNumber = item.getBusinessNumber();
+        this.channelType = item.getChannelType();
+        if(null != account){
+            this.channelCode = account.getBankCode();
+            this.accountType = account.getType();
+            this.account = account.getAccount();
+            this.accountId = account.getId();
+        }
+        if(null != projectAccount){
+            this.projectAccountId = projectAccount.getId();
+        }
+        if(null != buildingAccount){
+            this.buildingAccountId = buildingAccount.getId();
+        }
+        this.amount = item.getAmount();
+        if(null != item.getCode()){
+            String code = String.valueOf(item.getCode());
+            if(code.startsWith("1")){
+                this.type = 1;
+            }else if(code.startsWith("2")){
+                this.type = 2;
+            }
+        }
+        this.transactionMode = 1;
+        this.transactionTime = null != item.getTransactionTime() ? DateUtil.dateToStr(item.getTransactionTime(), "yyyy-MM-dd") : null;
+        this.checkStatus = 1;
+        this.delFlag = 1;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(String serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    public String getFlushSerialNumber() {
+        return flushSerialNumber;
+    }
+
+    public void setFlushSerialNumber(String flushSerialNumber) {
+        this.flushSerialNumber = flushSerialNumber;
+    }
+
+    public String getBusinessNumber() {
+        return businessNumber;
+    }
+
+    public void setBusinessNumber(String businessNumber) {
+        this.businessNumber = businessNumber;
+    }
+
+    public Integer getChannelType() {
+        return channelType;
+    }
+
+    public void setChannelType(Integer channelType) {
+        this.channelType = channelType;
+    }
+
+    public String getChannelCode() {
+        return channelCode;
+    }
+
+    public void setChannelCode(String channelCode) {
+        this.channelCode = channelCode;
+    }
+
+    public Integer getAccountType() {
+        return accountType;
+    }
+
+    public void setAccountType(Integer accountType) {
+        this.accountType = accountType;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public Long getProjectAccountId() {
+        return projectAccountId;
+    }
+
+    public void setProjectAccountId(Long projectAccountId) {
+        this.projectAccountId = projectAccountId;
+    }
+
+    public Long getBuildingAccountId() {
+        return buildingAccountId;
+    }
+
+    public void setBuildingAccountId(Long buildingAccountId) {
+        this.buildingAccountId = buildingAccountId;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getTransactionMode() {
+        return transactionMode;
+    }
+
+    public void setTransactionMode(Integer transactionMode) {
+        this.transactionMode = transactionMode;
+    }
+
+    public String getTransactionTime() {
+        return transactionTime;
+    }
+
+    public void setTransactionTime(String transactionTime) {
+        this.transactionTime = transactionTime;
+    }
+
+    public BigDecimal getAccountBalance() {
+        return accountBalance;
+    }
+
+    public void setAccountBalance(BigDecimal accountBalance) {
+        this.accountBalance = accountBalance;
+    }
+
+    public String getReciprocalAccount() {
+        return reciprocalAccount;
+    }
+
+    public void setReciprocalAccount(String reciprocalAccount) {
+        this.reciprocalAccount = reciprocalAccount;
+    }
+
+    public Integer getCheckStatus() {
+        return checkStatus;
+    }
+
+    public void setCheckStatus(Integer checkStatus) {
+        this.checkStatus = checkStatus;
+    }
+
+    public String getCheckDate() {
+        return checkDate;
+    }
+
+    public void setCheckDate(String checkDate) {
+        this.checkDate = checkDate;
+    }
+
+    public Integer getIsFlush() {
+        return isFlush;
+    }
+
+    public void setIsFlush(Integer isFlush) {
+        this.isFlush = isFlush;
+    }
+
+    public Integer getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Integer delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+}

+ 422 - 0
src/main/java/com/cool/bang/modules/mysql/domain/Refund.java

@@ -0,0 +1,422 @@
+package com.cool.bang.modules.mysql.domain;
+
+import com.cool.bang.modules.oracle.domain.po.TkInfo;
+
+import java.math.BigDecimal;
+
+public class Refund {
+
+
+    /**
+     * 业务编号
+     */
+    private String businessNumber;
+
+    /**
+     * 银行编码
+     */
+    private String bankCode;
+
+    /**
+     * 企业主键
+     */
+    private Integer orgId;
+
+    /**
+     * 开发企业
+     */
+    private String orgName;
+
+    private Long projectAccountId;
+
+    /**
+     * 项目编码
+     */
+    private String projectNumber;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    private Long buildingAccountId;
+
+    private String buildingName;
+
+    private Long contractId;
+
+    private String contractNumber;
+
+    private BigDecimal contractPrice;
+
+
+    /**
+     * 买受人
+     */
+    private String buyer;
+
+    /**
+     * 身份证号
+     */
+    private String idCard;
+
+    /**
+     * 付款账户主键
+     */
+    private Long accountId;
+
+    private Integer accountType;
+
+    private String appropriationBank;
+
+    private String appropriationAccount;
+
+
+    /**
+     * 收款银行
+     */
+    private String collectionBank;
+
+    /**
+     * 收款户名
+     */
+    private String collectionName;
+
+    /**
+     * 收款账号
+     */
+    private String collectionAccount;
+
+    /**
+     * 开户网点
+     */
+    private String collectionOpenAddress;
+
+    /**
+     * 退款金额
+     */
+    private BigDecimal refundAmount;
+
+    private String signer;
+
+    private String signerPhone;
+    /**
+     * 流程号
+     */
+    private String flowNumber;
+
+    /**
+     * 流程节点id
+     */
+    private Long flowNodeId;
+
+    /**
+     * 流程节点名称
+     */
+    private String flowNodeName;
+
+    /**
+     * 业务状态 0暂存 1发起申请 2正在审核 3申请成功 4申请退回
+     */
+    private Integer businessState;
+
+    /**
+     * 退款状态 0待退款 1已退款
+     */
+    private String appropriationStatus;
+
+    /**
+     * 删除标识 1正常 0删除
+     */
+    private Integer delFlag;
+
+
+    public Refund(TkInfo item, Org org, ProjectAccount projectAccount, Account account,ContractInfo contract,BuildingAccount buildingAccount) {
+        this.businessNumber = item.getBusinessNumber();
+        this.orgId = org.getId();
+        this.orgName = org.getOrgName();
+        if (null != projectAccount) {
+            this.projectAccountId = projectAccount.getAccountId();
+            this.projectName = projectAccount.getProjectName();
+            this.projectNumber = projectAccount.getProjectNumber();
+        }
+        if(buildingAccount != null){
+            this.buildingAccountId = buildingAccount.getId();
+            this.buildingName = buildingAccount.getBuildingName();
+        }
+        this.buyer = item.getBuyer();
+        this.idCard = item.getIdCard();
+        if (null != account) {
+            this.bankCode = account.getBankCode();
+            this.accountId = account.getId();
+            this.accountType = account.getType();
+            this.appropriationBank = account.getBankName();
+            this.appropriationAccount = account.getAccount();
+        }
+        this.collectionName = item.getCollectionName();
+        this.collectionAccount = item.getCollectionAccount();
+        this.signer = null;
+        this.signerPhone = null;
+        this.contractNumber = item.getHtBh();
+        if(contract != null){
+            this.contractId = contract.getId();
+            this.contractPrice = contract.getContractPrice();
+        }
+        //this.contractPrice = item.getHtZj();
+        this.delFlag = 1;
+        this.refundAmount = item.getMoney();
+    }
+
+
+
+
+
+    public String getSigner() {
+        return signer;
+    }
+
+    public void setSigner(String signer) {
+        this.signer = signer;
+    }
+
+    public String getSignerPhone() {
+        return signerPhone;
+    }
+
+    public void setSignerPhone(String signerPhone) {
+        this.signerPhone = signerPhone;
+    }
+
+    public String getBusinessNumber() {
+        return businessNumber;
+    }
+
+    public void setBusinessNumber(String businessNumber) {
+        this.businessNumber = businessNumber;
+    }
+
+    public String getBankCode() {
+        return bankCode;
+    }
+
+    public void setBankCode(String bankCode) {
+        this.bankCode = bankCode;
+    }
+
+    public Integer getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Integer orgId) {
+        this.orgId = orgId;
+    }
+
+    public String getOrgName() {
+        return orgName;
+    }
+
+    public void setOrgName(String orgName) {
+        this.orgName = orgName;
+    }
+
+    public String getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(String projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+
+    public Long getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(Long contractId) {
+        this.contractId = contractId;
+    }
+
+    public String getContractNumber() {
+        return contractNumber;
+    }
+
+    public void setContractNumber(String contractNumber) {
+        this.contractNumber = contractNumber;
+    }
+
+    public BigDecimal getContractPrice() {
+        return contractPrice;
+    }
+
+    public void setContractPrice(BigDecimal contractPrice) {
+        this.contractPrice = contractPrice;
+    }
+
+    public String getBuyer() {
+        return buyer;
+    }
+
+    public void setBuyer(String buyer) {
+        this.buyer = buyer;
+    }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public String getCollectionBank() {
+        return collectionBank;
+    }
+
+    public void setCollectionBank(String collectionBank) {
+        this.collectionBank = collectionBank;
+    }
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public void setCollectionName(String collectionName) {
+        this.collectionName = collectionName;
+    }
+
+    public String getCollectionAccount() {
+        return collectionAccount;
+    }
+
+    public void setCollectionAccount(String collectionAccount) {
+        this.collectionAccount = collectionAccount;
+    }
+
+    public String getCollectionOpenAddress() {
+        return collectionOpenAddress;
+    }
+
+    public void setCollectionOpenAddress(String collectionOpenAddress) {
+        this.collectionOpenAddress = collectionOpenAddress;
+    }
+
+    public String getFlowNumber() {
+        return flowNumber;
+    }
+
+    public void setFlowNumber(String flowNumber) {
+        this.flowNumber = flowNumber;
+    }
+
+    public Long getFlowNodeId() {
+        return flowNodeId;
+    }
+
+    public void setFlowNodeId(Long flowNodeId) {
+        this.flowNodeId = flowNodeId;
+    }
+
+    public String getFlowNodeName() {
+        return flowNodeName;
+    }
+
+    public void setFlowNodeName(String flowNodeName) {
+        this.flowNodeName = flowNodeName;
+    }
+
+    public Integer getBusinessState() {
+        return businessState;
+    }
+
+    public void setBusinessState(Integer businessState) {
+        this.businessState = businessState;
+    }
+
+    public Integer getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Integer delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Long getProjectAccountId() {
+        return projectAccountId;
+    }
+
+    public void setProjectAccountId(Long projectAccountId) {
+        this.projectAccountId = projectAccountId;
+    }
+
+    public Long getBuildingAccountId() {
+        return buildingAccountId;
+    }
+
+    public void setBuildingAccountId(Long buildingAccountId) {
+        this.buildingAccountId = buildingAccountId;
+    }
+
+    public String getBuildingName() {
+        return buildingName;
+    }
+
+    public void setBuildingName(String buildingName) {
+        this.buildingName = buildingName;
+    }
+
+    public Integer getAccountType() {
+        return accountType;
+    }
+
+    public void setAccountType(Integer accountType) {
+        this.accountType = accountType;
+    }
+
+    public String getAppropriationBank() {
+        return appropriationBank;
+    }
+
+    public void setAppropriationBank(String appropriationBank) {
+        this.appropriationBank = appropriationBank;
+    }
+
+    public String getAppropriationAccount() {
+        return appropriationAccount;
+    }
+
+    public void setAppropriationAccount(String appropriationAccount) {
+        this.appropriationAccount = appropriationAccount;
+    }
+
+    public BigDecimal getRefundAmount() {
+        return refundAmount;
+    }
+
+    public void setRefundAmount(BigDecimal refundAmount) {
+        this.refundAmount = refundAmount;
+    }
+
+    public String getAppropriationStatus() {
+        return appropriationStatus;
+    }
+
+    public void setAppropriationStatus(String appropriationStatus) {
+        this.appropriationStatus = appropriationStatus;
+    }
+}

+ 8 - 6
src/main/java/com/cool/bang/modules/mysql/domain/SuperviseBusiness.java

@@ -90,18 +90,20 @@ public class SuperviseBusiness {
 
     public SuperviseBusiness(Account account, Org org, Project project, Jgyw jgyw){
         this.businessNumber = jgyw.getYwbh();
-        this.bankCode = account.getBankCode();
+        if(null != account){
+            this.bankCode = account.getBankCode();
+            this.accountId = account.getId();
+            this.bankName = account.getBankName();
+            this.name = account.getName();
+            this.account = account.getAccount();
+            this.accountOpenAddress = account.getOpenAddress();
+        }
         this.orgId = org.getId();
         this.orgName = org.getOrgName();
         this.projectId = project.getId();
         this.projectNumber = project.getProjectNumber();
         this.projectName = project.getProjectName();
         this.projectAddress = project.getProjectAddress();
-        this.accountId = account.getId();
-        this.bankName = account.getBankName();
-        this.name = account.getName();
-        this.account = account.getAccount();
-        this.accountOpenAddress = account.getOpenAddress();
         this.operator = jgyw.getLxr();
         this.operatorPhone = jgyw.getLxdh();
         this.businessState = 2;

+ 138 - 0
src/main/java/com/cool/bang/modules/mysql/domain/TradeInfo.java

@@ -0,0 +1,138 @@
+package com.cool.bang.modules.mysql.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class TradeInfo {
+
+    private Long id;
+
+    private String accountNo;
+
+    private String serialNumber;
+
+    private String flushSerialNumber;
+
+    private String businessNumber;
+
+    private Integer channelType;
+
+    private BigDecimal amount;
+
+    private Integer code;
+
+    private Integer checkStatus;
+
+    private Integer transactionMode;
+
+    private Date checkDate;
+
+    private Date transactionTime;
+
+    private String lzbh;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getAccountNo() {
+        return accountNo;
+    }
+
+    public void setAccountNo(String accountNo) {
+        this.accountNo = accountNo;
+    }
+
+    public String getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(String serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    public String getFlushSerialNumber() {
+        return flushSerialNumber;
+    }
+
+    public void setFlushSerialNumber(String flushSerialNumber) {
+        this.flushSerialNumber = flushSerialNumber;
+    }
+
+    public String getBusinessNumber() {
+        return businessNumber;
+    }
+
+    public void setBusinessNumber(String businessNumber) {
+        this.businessNumber = businessNumber;
+    }
+
+    public Integer getChannelType() {
+        return channelType;
+    }
+
+    public void setChannelType(Integer channelType) {
+        this.channelType = channelType;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public Integer getCheckStatus() {
+        return checkStatus;
+    }
+
+    public void setCheckStatus(Integer checkStatus) {
+        this.checkStatus = checkStatus;
+    }
+
+    public Integer getTransactionMode() {
+        return transactionMode;
+    }
+
+    public void setTransactionMode(Integer transactionMode) {
+        this.transactionMode = transactionMode;
+    }
+
+    public Date getCheckDate() {
+        return checkDate;
+    }
+
+    public void setCheckDate(Date checkDate) {
+        this.checkDate = checkDate;
+    }
+
+    public Date getTransactionTime() {
+        return transactionTime;
+    }
+
+    public void setTransactionTime(Date transactionTime) {
+        this.transactionTime = transactionTime;
+    }
+
+    public String getLzbh() {
+        return lzbh;
+    }
+
+    public void setLzbh(String lzbh) {
+        this.lzbh = lzbh;
+    }
+}

+ 25 - 0
src/main/java/com/cool/bang/modules/mysql/mapper/MySqlMapper.java

@@ -4,7 +4,9 @@ import com.cool.bang.modules.mysql.domain.*;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.math.BigDecimal;
 import java.util.List;
+import java.util.Map;
 
 @Repository
 public interface MySqlMapper {
@@ -50,4 +52,27 @@ public interface MySqlMapper {
     Long getContractIdByNumber(@Param("htbh") String htbh);
 
     int insertEarnest(@Param("list") List<Earnest> earnests);
+
+    int insertRefund(@Param("list") List<Refund> refunds);
+
+    ContractInfo getInfoByNumber(@Param("htBh") String htBh);
+
+    int insertFcTrade(@Param("list") List<FcTrade> fcTrades);
+
+    /**
+     * 查询正常的 托管项目
+     * @return
+     */
+    List<Map<String, Object>> selectTgXm();
+
+    /**
+     * 根据项目id 查询项目虚拟户
+     * @param
+     * @return
+     */
+    List<Map<String, Object>> selectXmAccountByProjectId(@Param("projectId") Long projectId);
+
+    List<Map<String, Object>> selectBuildingBy(@Param("projectId") Long id,@Param("projectAccountId") Long projectAccountId);
+
+    BigDecimal getAccountBalanceByNumber(@Param("buildingNumber") String buildingNumber);
 }

+ 213 - 0
src/main/java/com/cool/bang/modules/mysql/service/MySQLSecondService.java

@@ -0,0 +1,213 @@
+package com.cool.bang.modules.mysql.service;
+
+import com.cool.bang.common.util.DateUtil;
+import com.cool.bang.modules.mysql.domain.*;
+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.po.*;
+import com.cool.bang.modules.oracle.mapper.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+@Service
+public class MySQLSecondService {
+
+    @Autowired
+    private MySqlMapper mySqlMapper;
+    @Autowired
+    private OracleMapper oracleMapper;
+    @Autowired
+    private OrgMapper qyxxMapper;
+    @Autowired
+    private AccountMapper accountMapper;
+    ;
+    @Autowired
+    private ProjectAccountMapper projectAccountMapper;
+    @Autowired
+    private BuildingAccountMapper buildingAccountMapper;
+
+
+    /**
+     * 定金导入
+     */
+    @Transactional
+    public void refundTo() {
+        System.out.println("===============fc_refund 导入数据开始=================");
+        //List<TkInfo> djTkList = oracleMapper.selectDjTk();
+        List<TkInfo> htTkList = oracleMapper.selectHtTk();
+        /*List<Integer> otherHtIds = new ArrayList<>();
+        otherHtIds.add(40051);
+        otherHtIds.add(3958);
+        otherHtIds.add(13496);
+        otherHtIds.add(19046);*/
+
+        //List<TkInfo> otherChange = oracleMapper.selectOtherHtTk(otherHtIds);
+        //List<TkInfo> tkInfoList = Stream.concat(djTkList.stream(), htTkList.stream()).collect(Collectors.toList());
+        //tkInfoList = Stream.concat(tkInfoList.stream(), otherChange.stream()).collect(Collectors.toList());
+        List<Refund> refunds = new ArrayList<>();
+        for (TkInfo item : htTkList) {
+            Integer qybh = StringUtils.isEmpty(item.getQybh()) ? null : Integer.valueOf(item.getQybh());
+            Org org = qyxxMapper.selectOrgByMisid(qybh);
+            if (org == null) { //测试用
+                org = new Org();
+                org.setId(3);
+                org.setOrgName("山东酷邦软件有限公司");
+            }
+            BuildingAccount buildingAccount = null;
+            if (!StringUtils.isEmpty(item.getLzbh())) {
+                buildingAccount = buildingAccountMapper.getInfoByLZBH(item.getLzbh());
+            }
+            Long projectAccountId = (null != buildingAccount && null != buildingAccount.getProjectAccountId()) ? buildingAccount.getProjectAccountId() : null;
+            ProjectAccount projectAccount = null;
+            if (null != projectAccountId) {
+                projectAccount = projectAccountMapper.getInfoById(projectAccountId);
+            }
+            Account account = null;
+            if (!StringUtils.isEmpty(item.getAccountNo())) {
+                account = accountMapper.selectByAccountNO(item.getAccountNo());
+            }
+            ContractInfo contract = null;
+            if (!StringUtils.isEmpty(item.getHtBh())) {
+                contract = mySqlMapper.getInfoByNumber(item.getHtBh());
+            }
+            Refund refund = new Refund(item, org, projectAccount, account, contract, buildingAccount);
+            //定金退款的
+            if (null == item.getMoney()) {
+                refund.setAppropriationStatus("0");
+            } else {
+                refund.setAppropriationStatus("1");
+            }
+            refunds.add(refund);
+        }
+        mySqlMapper.insertRefund(refunds);
+        System.out.println("===============fc_refund数据匹配结束=================");
+    }
+
+
+    @Transactional
+    public void tradeDDZTo() {
+        System.out.println("===============fc_trade 导入数据开始=================");
+        List<TradeInfo> tradeInfoList = oracleMapper.selectDDZ();
+        List<FcTrade> fcTrades = new ArrayList<>();
+
+        for (TradeInfo item : tradeInfoList) {
+            BuildingAccount buildingAccount = null;
+            if (!StringUtils.isEmpty(item.getLzbh())) {
+                buildingAccount = buildingAccountMapper.getInfoByLZBH(item.getLzbh());
+            }
+            Long projectAccountId = (null != buildingAccount && null != buildingAccount.getProjectAccountId()) ? buildingAccount.getProjectAccountId() : null;
+            ProjectAccount projectAccount = null;
+            if (null != projectAccountId) {
+                projectAccount = projectAccountMapper.getInfoById(projectAccountId);
+            }
+            Account account = null;
+            if (!StringUtils.isEmpty(item.getAccountNo())) {
+                account = accountMapper.selectByAccountNO(item.getAccountNo());
+            }
+
+            FcTrade fcTrade = new FcTrade(item, projectAccount, account, buildingAccount);
+
+            fcTrades.add(fcTrade);
+        }
+        mySqlMapper.insertFcTrade(fcTrades);
+        System.out.println("===============fc_trade数据匹配结束=================");
+    }
+
+    @Transactional
+    public void tradeTgTo() {
+        System.out.println("===============fc_trade 导入数据开始=================");
+        List<TradeInfo> tradeInfoList = oracleMapper.selectTG();
+        List<FcTrade> fcTrades = new ArrayList<>();
+
+        for (TradeInfo item : tradeInfoList) {
+            BuildingAccount buildingAccount = null;
+            if (!StringUtils.isEmpty(item.getLzbh())) {
+                buildingAccount = buildingAccountMapper.getInfoByLZBH(item.getLzbh());
+            }
+            Long projectAccountId = (null != buildingAccount && null != buildingAccount.getProjectAccountId()) ? buildingAccount.getProjectAccountId() : null;
+            ProjectAccount projectAccount = null;
+            if (null != projectAccountId) {
+                projectAccount = projectAccountMapper.getInfoById(projectAccountId);
+            }
+            Account account = null;
+
+            if (!StringUtils.isEmpty(item.getAccountNo())) {
+                account = accountMapper.selectByAccountNO(item.getAccountNo());
+            }
+
+            FcTrade fcTrade = new FcTrade(item, projectAccount, account, buildingAccount);
+
+            fcTrades.add(fcTrade);
+        }
+        mySqlMapper.insertFcTrade(fcTrades);
+        System.out.println("===============fc_trade数据匹配结束=================");
+    }
+
+    /**
+     * 对账
+     */
+    public void accountChecking() {
+        List<Map<String, Object>> tgXm = mySqlMapper.selectTgXm();
+        List<String> list = new ArrayList<>();
+        for (Map<String, Object> map : tgXm) {
+            List<Map<String, Object>> xmAccount = mySqlMapper.selectXmAccountByProjectId((Long) map.get("id"));
+            for (Map<String, Object> account : xmAccount) {
+                List<Map<String, Object>> buildingInfo = mySqlMapper.selectBuildingBy((Long) map.get("id"), (Long) account.get("id"));
+                for (Map<String, Object> building : buildingInfo) {
+                    //监管转托管
+                    BigDecimal zgToTg = oracleMapper.sumByZgToTg((String)(building.get("building_number")));
+                    zgToTg = null == zgToTg ? BigDecimal.ZERO : zgToTg;
+                    //交存
+                    BigDecimal jc = oracleMapper.sumByJc((String) building.get("building_number"));
+                    jc = null == jc ? BigDecimal.ZERO : jc;
+                    //拨付
+                    BigDecimal bf = oracleMapper.sumByBf((String) building.get("building_number"));
+                    bf = null == bf ? BigDecimal.ZERO : bf;
+
+                    BigDecimal accountBalance = mySqlMapper.getAccountBalanceByNumber((String) building.get("building_number"));
+                    accountBalance = accountBalance == null ? BigDecimal.ZERO : accountBalance;
+                    BigDecimal hj = (zgToTg.add(jc)).subtract(bf);
+                    StringBuilder str = new StringBuilder();
+                    String buildingName = String.valueOf(building.get("building_name"));
+                    BigDecimal cz = BigDecimal.ZERO;
+                    if(!(hj.compareTo(accountBalance) == 0)){
+                        cz = hj.subtract(accountBalance);
+                    }
+                    str.append(building.get("project_name").toString())
+                            .append(";"+building.get("project_number").toString())
+                            .append(";" + buildingName)
+                            .append(";" + building.get("building_number").toString())
+                            .append(";" + zgToTg)
+                            .append(";" + jc)
+                            .append(";" + bf)
+                            .append(";" + hj)
+                            .append(";" + accountBalance)
+                            .append(";" + (hj.compareTo(accountBalance) == 0 ? "是" :"否"))
+                            .append(";" + (hj.compareTo(accountBalance) == 0 ? "" : cz));
+                    System.out.println(str.toString());
+                    list.add(str.toString());
+                }
+            }
+        }
+        for (String str : list) {
+            System.out.println(str);
+        }
+    }
+}

+ 162 - 156
src/main/java/com/cool/bang/modules/mysql/service/MySQLService.java

@@ -26,6 +26,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 @Service
 public class MySQLService {
@@ -74,7 +75,7 @@ public class MySQLService {
         //对应YSZJJG--BXM表
 
         System.out.println("===============fc_project 数据匹配开始=================");
-        List<Map<String,Object>> list = oracleMapper.selectFromBxm();
+        List<Map<String, Object>> list = oracleMapper.selectFromBxm();
 
         List<Project> projectList = new ArrayList<>();
         for (Map<String, Object> map : list) {
@@ -95,19 +96,19 @@ public class MySQLService {
                 }
             } else {
                 for (Map<String, Object> areg : aregs) {
-                    String jsstate = (String) aregs.get(0).get("JGSTATE");
+                    String jsstate = (String) areg.get("JGSTATE");
                     if (jsstate.equals("1")) {
                         jg = true;
                     }
                 }
-                project.setState(jg?1:-1);
+                project.setState(jg ? 1 : 0);
             }
 
             Org org = qyxxMapper.selectOrgByMisid(Integer.parseInt(map.get("QYBH").toString().trim()));
 //            if (org == null){
 //                project.setOrgId(0);
 //            }else {
-                project.setOrgId(org.getId());
+            project.setOrgId(org.getId());
 //            }
             //查询该项目下房屋总套数
             Integer houseTotal = projectMapper.selectProjectHouseTotal(project.getProjectNumber());
@@ -115,7 +116,7 @@ public class MySQLService {
             projectList.add(project);
         }
         int i = projectMapper.insertProject(projectList);
-        System.out.println("===============fc_project 数据匹配结束==插入"+i+"条数据==============");
+        System.out.println("===============fc_project 数据匹配结束==插入" + i + "条数据==============");
     }
 
     public void projectBuildingTotal () {
@@ -125,23 +126,23 @@ public class MySQLService {
     /**
      * 账户表 数据匹配
      */
-    public void account(){
+    public void account() {
         //对应ACCOUNT表
         System.out.println("===============fc_account 数据匹配开始=================");
-        List<Map<String,Object>> list = oracleMapper.selectFromAccount();
+        List<Map<String, Object>> list = oracleMapper.selectFromAccount();
 
         List<Account> accountList = new ArrayList<>();
         for (Map<String, Object> map : list) {
             Account account = new Account(map);
-            if (map.get("QYBH") != null){
+            if (map.get("QYBH") != null) {
                 Org org = qyxxMapper.selectOrgByMisid(Integer.parseInt(map.get("QYBH").toString().trim()));
                 account.setOrgId(org.getId());
                 account.setOrgName(org.getOrgName());
                 account.setName(org.getOrgName());
             }
-            if (map.get("XMBH") != null){
+            if (map.get("XMBH") != null) {
                 Project project = projectMapper.selectByProjectNumber((String) map.get("XMBH"));
-                if (project != null){
+                if (project != null) {
                     account.setProjectId(project.getId());
                     account.setProjectName(project.getProjectName());
                     account.setProjectNumber(project.getProjectNumber());
@@ -149,7 +150,7 @@ public class MySQLService {
             }
             //查询账户在途资金
             BigDecimal inTransitFund = oracleMapper.selectAccountInTransitFund(Integer.parseInt(map.get("ACCOUNTID").toString()));
-            if (inTransitFund != null){
+            if (inTransitFund != null) {
                 account.setInTransitFund(inTransitFund);
             }
             accountList.add(account);
@@ -162,14 +163,14 @@ public class MySQLService {
             accountMapper.deleteById(id);
         }
 
-        System.out.println("===============fc_account 数据匹配结束==插入"+i+"条数据==============");
+        System.out.println("===============fc_account 数据匹配结束==插入" + i + "条数据==============");
     }
 
     /**
      * 项目账户表 楼幢账户表 数据匹配
      */
     @Transactional
-    public void projectAccount(){
+    public void projectAccount() {
         //对应YSZJJG--AREG、AREGITEM表
         System.out.println("===============fc_project_account fc_building_account数据匹配开始=================");
 
@@ -179,20 +180,20 @@ public class MySQLService {
         for (Areg areg : aregList) {
             List<AregItem> aregItemList = areg.getAregItemList();
             for (AregItem aregItem : aregItemList) {
-               if (aregItem.getAregitemid() != null) {
-                   //查询楼幢信息
-                   Building building = buildingMapper.selectByBuildingNumber(aregItem.getLzbh());
-                   aregItem.setBuilding(building);
-                   //查询楼幢虚拟户托管、监管在途资金
-                   aregItem.setTgzt(aregMapper.selectLzTgzt(aregItem.getAregitemid()));
-                   aregItem.setJgzt(aregMapper.selectLzJgzt(aregItem.getAregitemid()));
-               }
+                if (aregItem.getAregitemid() != null) {
+                    //查询楼幢信息
+                    Building building = buildingMapper.selectByBuildingNumber(aregItem.getLzbh());
+                    aregItem.setBuilding(building);
+                    //查询楼幢虚拟户托管、监管在途资金
+                    aregItem.setTgzt(aregMapper.selectLzTgzt(aregItem.getAregitemid()));
+                    aregItem.setJgzt(aregMapper.selectLzJgzt(aregItem.getAregitemid()));
+                }
             }
 
             //查询项目信息
             Project project = projectMapper.selectByProjectNumber(areg.getXmbh());
             ProjectAccount projectAccount = new ProjectAccount(project, areg);
-            if (areg.getTgzh() != null){
+            if (areg.getTgzh() != null) {
                 Account account = accountMapper.selectByAccountNO(areg.getTgzh());
                 projectAccount.setBankCode(account.getBankCode());
                 projectAccount.setBankName(account.getBankName());
@@ -202,10 +203,10 @@ public class MySQLService {
             //插入
             int i = projectAccountMapper.insertProjectAccount(projectAccount);
             System.out.println("*******************");
-            System.out.println(projectAccount.getProjectName()+"插入完成");
-            if (projectAccount.getBuildingAccountList().size() > 0){
-                int n = buildingAccountMapper.insertBuildingAccount(projectAccount.getId(),projectAccount.getBuildingAccountList());
-                System.out.println("插入楼幢虚拟户数据"+n+"条");
+            System.out.println(projectAccount.getProjectName() + "插入完成");
+            if (projectAccount.getBuildingAccountList().size() > 0) {
+                int n = buildingAccountMapper.insertBuildingAccount(projectAccount.getId(), projectAccount.getBuildingAccountList());
+                System.out.println("插入楼幢虚拟户数据" + n + "条");
             }
             // 更新每个项目虚拟户留存金额
             projectAccountMapper.updateKeepAmount(projectAccount.getId());
@@ -227,12 +228,12 @@ public class MySQLService {
      * 托管申请表 托管协议表 导入 托管申请的APPTYPE = 0
      */
     @Transactional
-    public void trusteeshipBusiness(){
+    public void trusteeshipBusiness() {
         System.out.println("===============fc_trusteeship_agreement fc_trusteeship_business 数据匹配开始=================");
 
         List<Bxmxy> xmxyList = bxmxyMapper.selectFromBxmxy();
 
-        System.out.println("查询出项目协议信息共"+xmxyList.size()+"条");
+        System.out.println("查询出项目协议信息共" + xmxyList.size() + "条");
 
         //查询流程信息
         ApprovalFlow approvalFlow = flowMapper.selectFlowByType(1); //托管申请flowType = 1
@@ -242,17 +243,17 @@ public class MySQLService {
         for (Bxmxy bxmxy : xmxyList) {
             Project project = projectMapper.selectByProjectNumber(bxmxy.getXmbh());
             Org org = qyxxMapper.selectOrgByMisid(Integer.valueOf(bxmxy.getQybh()));
-            if (org == null){ //测试用
+            if (org == null) { //测试用
                 org = new Org();
                 org.setId(3);
                 org.setOrgName("山东酷邦软件有限公司");
             }
 
-            TrusteeshipBusiness trusteeshipBusiness = new TrusteeshipBusiness(project,org,bxmxy);
+            TrusteeshipBusiness trusteeshipBusiness = new TrusteeshipBusiness(project, org, bxmxy);
 
             trusteeshipBusiness.setFlowNumber(approvalFlow.getFlowNumber());
 
-            if (bxmxy.getBljd() == 1){ //申请
+            if (bxmxy.getBljd() == 1) { //申请
                 // 添加开始节点
                 ApprovalNode approvalNode = nodeList.get(0);
                 trusteeshipBusiness.setFlowNodeId(approvalNode.getNextNodeId());
@@ -267,10 +268,10 @@ public class MySQLService {
                 approvalRecord.setNodeId(trusteeshipBusiness.getFlowNodeId());
                 approvalRecord.setNodeName(trusteeshipBusiness.getFlowNodeName());
                 approvalRecord.setApprover(org.getOrgName());
-                approvalRecord.setApprovalTime(DateUtil.strToDate(bxmxy.getSqsj(),"yyyy-MM-dd HH:mm:ss"));
+                approvalRecord.setApprovalTime(DateUtil.strToDate(bxmxy.getSqsj(), "yyyy-MM-dd HH:mm:ss"));
                 approvalRecord.setDelFlag(1);
                 flowMapper.insertRecord(approvalRecord);
-            }else { //已经审核
+            } else { //已经审核
                 // 开始节点
                 ApprovalNode startNode = nodeList.get(0);
                 // 结束节点
@@ -288,7 +289,7 @@ public class MySQLService {
                 startNodeRecord.setNodeId(startNode.getId());
                 startNodeRecord.setNodeName(startNode.getNodeName());
                 startNodeRecord.setApprover(org.getOrgName());
-                startNodeRecord.setApprovalTime(DateUtil.strToDate(bxmxy.getSqsj(),"yyyy-MM-dd HH:mm:ss"));
+                startNodeRecord.setApprovalTime(DateUtil.strToDate(bxmxy.getSqsj(), "yyyy-MM-dd HH:mm:ss"));
                 startNodeRecord.setDelFlag(1);
                 flowMapper.insertRecord(startNodeRecord);
 
@@ -300,18 +301,18 @@ public class MySQLService {
                 endNodeRecord.setNodeName(endNode.getNodeName());
                 endNodeRecord.setApproverId(null);
                 endNodeRecord.setApprover("监管部门");
-                endNodeRecord.setApprovalTime(DateUtil.strToDate(bxmxy.getShsj(),"yyyy-MM-dd HH:mm:ss"));
+                endNodeRecord.setApprovalTime(DateUtil.strToDate(bxmxy.getShsj(), "yyyy-MM-dd HH:mm:ss"));
                 endNodeRecord.setApprovalStatus(1);
                 endNodeRecord.setApprovalRemark("无");
                 endNodeRecord.setDelFlag(1);
                 flowMapper.insertRecord(endNodeRecord);
 
                 //已经审核通过的添加托管协议信息、签章信息
-                TrusteeshipAgreement trusteeshipAgreement = new TrusteeshipAgreement(trusteeshipBusiness,bxmxy);
+                TrusteeshipAgreement trusteeshipAgreement = new TrusteeshipAgreement(trusteeshipBusiness, bxmxy);
 
                 String tgzh = bxmxy.getTgzh();
-                if (tgzh != null){
-                    if (tgzh.contains(",")){//是否包含逗号,包含的说明两家托管银行
+                if (tgzh != null) {
+                    if (tgzh.contains(",")) {//是否包含逗号,包含的说明两家托管银行
                         String[] arr = tgzh.split(",");
                         Account account1 = accountMapper.selectByAccountNO(arr[0]);
                         trusteeshipAgreement.setTrusteeship0AccountId(account1.getId());
@@ -326,7 +327,7 @@ public class MySQLService {
                         trusteeshipAgreement.setTrusteeship1Bank(account2.getBankName());
                         trusteeshipAgreement.setTrusteeship1BankCode(account2.getBankCode());
                         trusteeshipAgreement.setTrusteeship1Range(bxmxy.getJgld());
-                    }else {
+                    } else {
                         Account account = accountMapper.selectByAccountNO(tgzh);
                         trusteeshipAgreement.setTrusteeship0AccountId(account.getId());
                     }
@@ -334,8 +335,8 @@ public class MySQLService {
                 trusteeshipMapper.insertTrusteeshipAgreement(trusteeshipAgreement);
 
                 //需要判断 什么时候插入的签章信息
-                if (bxmxy.getCadocid() != null && bxmxy.getCaxyid() != null){
-                    Signatory signatory = new Signatory(bxmxy,trusteeshipAgreement);
+                if (bxmxy.getCadocid() != null && bxmxy.getCaxyid() != null) {
+                    Signatory signatory = new Signatory(bxmxy, trusteeshipAgreement);
                     List<Signatory> signatoryList = new ArrayList<>();
                     signatoryList.add(signatory.getSignatory());
                     signatoryList.add(signatory.getSignatory2());
@@ -350,43 +351,45 @@ public class MySQLService {
      * 监管开户申请业务表导入
      */
     @Transactional
-    public void superviseBusiness(){
+    public void superviseBusiness() {
         System.out.println("===============fc_supervise_business数据匹配开始=================");
 
         List<Jgyw> jgywList = applyMapper.selectJgkh();
 
         List<SuperviseBusiness> superviseBusinessList = new ArrayList<>();
         for (Jgyw jgyw : jgywList) {
+            Project project = projectMapper.selectByProjectNumber(jgyw.getXmbh());
+
             Account account = accountMapper.selectByAccountNO(jgyw.getAccountno());
             Org org = qyxxMapper.selectOrgByMisid(jgyw.getQybh());
-            if (org == null){ //测试用
+            if (org == null) { //测试用
                 org = new Org();
                 org.setId(3);
                 org.setOrgName("山东酷邦软件有限公司");
             }
-            Project project = projectMapper.selectByProjectNumber(jgyw.getXmbh());
 
-            SuperviseBusiness superviseBusiness = new SuperviseBusiness(account,org,project,jgyw);
+
+            SuperviseBusiness superviseBusiness = new SuperviseBusiness(account, org, project, jgyw);
 
             superviseBusinessList.add(superviseBusiness);
         }
         int i = mySqlMapper.insertSuperviseBusiness(superviseBusinessList);
 
-        System.out.println("===============fc_supervise_business数据匹配结束 插入数据"+i+"条==============");
+        System.out.println("===============fc_supervise_business数据匹配结束 插入数据" + i + "条==============");
     }
 
     /**
      * 监管项目解除
      */
     @Transactional
-    public void relieve(){
+    public void relieve() {
         List<Jgxmjc> jgxmjcList = applyMapper.selectJgxmjc();
         List<SuperviseRelieve> superviseRelieveList = new ArrayList<>();
         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){
+            if (node.getNumber() == 3) {
                 endNode = node;
             }
         }
@@ -398,33 +401,34 @@ public class MySQLService {
             ProjectAccount projectAccount = projectAccountMapper.selectByAregid(jgxmjc.getAregid());
             List<Areg> aregList = applyMapper.selectByXmbhFromAreg(jgxmjc.getXmbh());
             //项目解除业务信息
-            Relieve relieve = new Relieve(jgxmjc,org,project);
+            Relieve relieve = new Relieve(jgxmjc, org, project);
             relieve.setFlowNumber(approvalFlow.getFlowNumber());
             relieve.setFlowNodeId(endNode.getId());
             relieve.setFlowNodeName(endNode.getNodeName());
-            if (aregList.size() == 1){//说明该项目下所有的项目虚拟户都已经解除,可以解除项目、项目虚拟户、账户、楼幢
+            if (aregList.size() == 1) {//说明该项目下所有的项目虚拟户都已经解除,可以解除项目、项目虚拟户、账户、楼幢
                 relieve.setRelieveType(1);
                 mySqlMapper.insertRelieve(relieve);
                 projectMapper.updateRelieve(relieve.getProjectId());
-            }else { //说明该项目下存在还没有解除的项目虚拟户,所以只解除该项目虚拟户、以及该项目虚拟户绑定的账户、楼幢
+            } else { //说明该项目下存在还没有解除的项目虚拟户,所以只解除该项目虚拟户、以及该项目虚拟户绑定的账户、楼幢
                 relieve.setRelieveType(2);
+                //楼栋解除需
                 mySqlMapper.insertRelieve(relieve);
             }
             //项目虚拟户变更解除状态
-            projectAccountMapper.updateRelieveByAregid(jgxmjc.getAregid(),jgxmjc.getSqrq());
+            projectAccountMapper.updateRelieveByAregid(jgxmjc.getAregid(), jgxmjc.getSqrq());
             //监管账户解除业务信息
-            if (jgxmjc.getAccountList() != null && jgxmjc.getAccountList().size() > 0){
+            if (jgxmjc.getAccountList() != null && jgxmjc.getAccountList().size() > 0) {
                 for (Account account : jgxmjc.getAccountList()) {
                     account = accountMapper.selectByAccountNO(account.getAccount());
-                    SuperviseRelieve superviseRelieve = new SuperviseRelieve(account,org,projectAccount,jgxmjc);
+                    SuperviseRelieve superviseRelieve = new SuperviseRelieve(account, org, projectAccount, jgxmjc);
                     superviseRelieveList.add(superviseRelieve);
                     //更新账户解除日期
-                    accountMapper.updateCancelDate(account.getId(),superviseRelieve.getUpdateTime());
+                    accountMapper.updateCancelDate(account.getId(), superviseRelieve.getUpdateTime());
                 }
             }
             //解除明细
             List<RelieveDetail> relieveDetailList = new ArrayList<>();
-            if (jgxmjc.getAregItemList() != null && jgxmjc.getAregItemList().size() > 0){
+            if (jgxmjc.getAregItemList() != null && jgxmjc.getAregItemList().size() > 0) {
                 for (AregItem aregItem : jgxmjc.getAregItemList()) {
                     BuildingAccount buildingAccount = buildingAccountMapper.selectByBuildingNumber(aregItem.getLzbh());
                     RelieveDetail relieveDetail = new RelieveDetail(buildingAccount);
@@ -432,10 +436,10 @@ public class MySQLService {
                     relieveDetailList.add(relieveDetail);
                 }
                 mySqlMapper.insertRelieveDetail(relieveDetailList);
-                buildingAccountMapper.updateRelieve(relieveDetailList,jgxmjc.getShrq());
+                buildingAccountMapper.updateRelieve(relieveDetailList, jgxmjc.getShrq());
             }
             //审批流程
-            if (jgxmjc.getsFlowList() != null && jgxmjc.getsFlowList().size() > 0){
+            if (jgxmjc.getsFlowList() != null && jgxmjc.getsFlowList().size() > 0) {
                 for (SFlow sFlow : jgxmjc.getsFlowList()) {
                     ApprovalRecord record = new ApprovalRecord();
                     record.setBusinessNumber(relieve.getBusinessNumber());
@@ -446,15 +450,15 @@ public class MySQLService {
                     record.setCreateTime(record.getApprovalTime());
                     record.setUpdateTime(record.getApprovalTime());
                     record.setDelFlag(1);
-                    if (sFlow.getShzt() == null){
+                    if (sFlow.getShzt() == null) {
                         record.setNodeName("申请节点");
-                        record.setApprover(relieve.getOrgName()+"("+sFlow.getShr()+")");
-                    }else {
+                        record.setApprover(relieve.getOrgName() + "(" + sFlow.getShr() + ")");
+                    } else {
                         record.setNodeName(sFlow.getLcmc());
-                        record.setApprover("监管部门("+sFlow.getShr()+")");
-                        if (sFlow.getShzt() == 1){
+                        record.setApprover("监管部门(" + sFlow.getShr() + ")");
+                        if (sFlow.getShzt() == 1) {
                             record.setApprovalStatus(1);
-                        }else {
+                        } else {
                             record.setApprovalStatus(2);
                         }
                     }
@@ -502,7 +506,7 @@ public class MySQLService {
      * 监管资金转托管业务表、明细表导入
      */
     @Transactional
-    public void superviseTo(){
+    public void superviseTo() {
         System.out.println("===============fc_supervise_to、fc_supervise_to_detail数据匹配开始=================");
         List<Jgztg> jgztgList = applyMapper.selectJgztg();
 
@@ -512,7 +516,7 @@ public class MySQLService {
         List<ApprovalNode> approvalNodeList = flowMapper.selectNodeByFlowNumber(approvalFlow.getFlowNumber());
         ApprovalNode currentNode = new ApprovalNode();
         for (ApprovalNode approvalNode : approvalNodeList) {
-            if (approvalNode.getNodeName().equals("流程结束")){
+            if (approvalNode.getNodeName().equals("流程结束")) {
                 currentNode = approvalNode;
             }
         }
@@ -525,7 +529,7 @@ public class MySQLService {
             Account superviseAccount = accountMapper.selectByAccountNO(jgztg.getJgzh());
             Account trusteeshipAccount = accountMapper.selectByAccountNO(jgztg.getTgzh());
             Org org = qyxxMapper.selectOrgByMisid(jgztg.getQybh());
-            if (org == null){ //测试用
+            if (org == null) { //测试用
                 org = new Org();
                 org.setId(3);
                 org.setOrgName("山东酷邦软件有限公司");
@@ -533,7 +537,7 @@ public class MySQLService {
             Project project = projectMapper.selectByProjectNumber(jgztg.getXmbh());
 
             //业务表
-            SuperviseTo superviseTo = new SuperviseTo(superviseAccount,trusteeshipAccount,org,project,jgztg);
+            SuperviseTo superviseTo = new SuperviseTo(superviseAccount, trusteeshipAccount, org, project, jgztg);
             superviseTo.setFlowNumber(approvalFlow.getFlowNumber());
             superviseTo.setFlowNodeId(currentNode.getId());
             superviseTo.setFlowNodeName(currentNode.getNodeName());
@@ -543,7 +547,7 @@ public class MySQLService {
             List<Jgztgmx> jgztgmxList = jgztg.getJgztgmxList();
             for (Jgztgmx jgztgmx : jgztgmxList) {
                 BuildingAccount buildingAccount = buildingAccountMapper.selectByBuildingNumber(jgztgmx.getLzbh());
-                SuperviseToDetail superviseToDetail = new SuperviseToDetail(buildingAccount,jgztgmx);
+                SuperviseToDetail superviseToDetail = new SuperviseToDetail(buildingAccount, jgztgmx);
                 superviseToDetail.setSuperviseToId(superviseTo.getId());
                 superviseToDetail.setCreateTime(superviseTo.getCreateTime());
                 superviseToDetail.setUpdateTime(superviseTo.getUpdateTime());
@@ -560,9 +564,9 @@ public class MySQLService {
             //入账记录
             Trade tradeRz = new Trade();
             for (Trade t : trades) {
-                if (t.getTradecode().equals("1002")){
+                if (t.getTradecode().equals("1002")) {
                     tradeRz = t;
-                }else if (t.getTradecode().equals("3002")){
+                } else if (t.getTradecode().equals("3002")) {
                     tradeCz = t;
                 }
             }
@@ -574,10 +578,10 @@ public class MySQLService {
             SuperviseToOutgoing superviseToOutgoing = new SuperviseToOutgoing();
             superviseToOutgoing.initNotice(superviseTo);
             superviseToOutgoing.setBusinessNumber(jgztg.getPaycode());
-            if (tradeCz.getId() != null){
+            if (tradeCz.getId() != null) {
                 superviseToOutgoing.setAppropriationStatus(1);
-                superviseToOutgoing.setUpdateTime(DateUtil.dateToStr(tradeCz.getTradedate(),"yyyy-MM-dd HH:mm:ss"));
-            }else {
+                superviseToOutgoing.setUpdateTime(DateUtil.dateToStr(tradeCz.getTradedate(), "yyyy-MM-dd HH:mm:ss"));
+            } else {
                 superviseToOutgoing.setAppropriationStatus(0);
             }
             superviseToOutgoingList.add(superviseToOutgoing);
@@ -586,10 +590,10 @@ public class MySQLService {
             SuperviseToPosting superviseToPosting = new SuperviseToPosting();
             superviseToPosting.initNotice(superviseTo);
             superviseToPosting.setBusinessNumber(jgztg.getPaycode());
-            if (tradeRz.getId() != null){
+            if (tradeRz.getId() != null) {
                 superviseToPosting.setPostingStatus(1);
-                superviseToPosting.setUpdateTime(DateUtil.dateToStr(tradeCz.getTradedate(),"yyyy-MM-dd HH:mm:ss"));
-            }else {
+                superviseToPosting.setUpdateTime(DateUtil.dateToStr(tradeCz.getTradedate(), "yyyy-MM-dd HH:mm:ss"));
+            } else {
                 superviseToPosting.setPostingStatus(0);
             }
             superviseToPostingList.add(superviseToPosting);
@@ -604,12 +608,12 @@ public class MySQLService {
                 record.setCreateTime(record.getApprovalTime());
                 record.setUpdateTime(record.getApprovalTime());
                 record.setDelFlag(1);
-                if (sFlow.getLcmc().equals("监管资金转托管申请上报")){
+                if (sFlow.getLcmc().equals("监管资金转托管申请上报")) {
                     record.setNodeName("申请节点");
-                    record.setApprover(org.getOrgName()+"("+sFlow.getShr()+")");
-                }else {
+                    record.setApprover(org.getOrgName() + "(" + sFlow.getShr() + ")");
+                } else {
                     record.setNodeName(sFlow.getLcmc());
-                    record.setApprover("监管部门("+sFlow.getShr()+")");
+                    record.setApprover("监管部门(" + sFlow.getShr() + ")");
                     record.setApprovalStatus(1);
                 }
                 recordList.add(record);
@@ -625,14 +629,14 @@ public class MySQLService {
      * 工程形象进度业务表、明细表导入
      */
     @Transactional
-    public void progressBusiness(){
+    public void progressBusiness() {
         System.out.println("===============fc_progress_business、fc_progress_detail数据匹配开始=================");
         Long a = new Date().getTime();
         List<Gcjdsq> gcjdsqList = oracleMapper.selectPromProgress();
         Long b = new Date().getTime();
         System.out.println("************************");
         System.out.println("耗时");
-        System.out.println((b-a)/1000);
+        System.out.println((b - a) / 1000);
 
         Gcjdsq lastGcjdsq = gcjdsqList.get(gcjdsqList.size() - 1);
 
@@ -661,15 +665,15 @@ public class MySQLService {
             ProjectAccount projectAccount = projectAccountMapper.selectByAregid(gcjdsq.getAregid());
 
             for (ProgressConfig progressConfig : progressConfigList) {
-                if (progressConfig.getLimitPercentage().compareTo(gcjdsq.getSqjd()) == 0){
+                if (progressConfig.getLimitPercentage().compareTo(gcjdsq.getSqjd()) == 0) {
                     currProgressConfig = progressConfig;
                 }
             }
 
-            Progress progress = new Progress(org,projectAccount,gcjdsq);
+            Progress progress = new Progress(org, projectAccount, gcjdsq);
             progress.setFlowNumber(approvalFlow.getFlowNumber());
 
-            if (progress.getBusinessState() == 1){ //待审核
+            if (progress.getBusinessState() == 1) { //待审核
                 progress.setFlowNodeId(node1.getId());
                 progress.setFlowNodeName(node1.getNodeName());
                 mySqlMapper.insertProgress(progress);
@@ -680,12 +684,12 @@ public class MySQLService {
                 record.setTableId(progress.getId());
                 record.setNodeId(node1.getId());
                 record.setNodeName(node1.getNodeName());
-                record.setApprover(progress.getOrgName()+"("+gcjdsq.getSqr()+")");
+                record.setApprover(progress.getOrgName() + "(" + gcjdsq.getSqr() + ")");
                 record.setApprovalTime(gcjdsq.getSqsj());
                 record.setCreateTime(gcjdsq.getSqsj());
                 record.setUpdateTime(gcjdsq.getSqsj());
                 recordList.add(record);
-            }else {
+            } else {
                 progress.setFlowNodeId(node3.getId());
                 progress.setFlowNodeName(node3.getNodeName());
                 mySqlMapper.insertProgress(progress);
@@ -696,7 +700,7 @@ public class MySQLService {
                 record1.setTableId(progress.getId());
                 record1.setNodeId(node1.getId());
                 record1.setNodeName(node1.getNodeName());
-                record1.setApprover(progress.getOrgName()+"("+gcjdsq.getSqr()+")");
+                record1.setApprover(progress.getOrgName() + "(" + gcjdsq.getSqr() + ")");
                 record1.setApprovalTime(gcjdsq.getSqsj());
                 record1.setCreateTime(gcjdsq.getSqsj());
                 record1.setUpdateTime(gcjdsq.getSqsj());
@@ -711,9 +715,9 @@ public class MySQLService {
                 record2.setApprovalTime(gcjdsq.getShsj());
                 record2.setCreateTime(gcjdsq.getShsj());
                 record2.setUpdateTime(gcjdsq.getShsj());
-                if (progress.getBusinessState() == 3){ //审核通过
+                if (progress.getBusinessState() == 3) { //审核通过
                     record2.setApprovalStatus(1);
-                }else { //审核驳回
+                } else { //审核驳回
                     record2.setApprovalStatus(2);
                 }
 
@@ -721,13 +725,13 @@ public class MySQLService {
                 recordList.add(record2);
             }
 
-            ProgressDetail detail = new ProgressDetail(buildingAccount,currProgressConfig,gcjdsq);
+            ProgressDetail detail = new ProgressDetail(buildingAccount, currProgressConfig, gcjdsq);
             detail.setProgressBusinessId(progress.getId());
             progressDetailList.add(detail);
 
-            index ++;
+            index++;
             //数据量达到200条时存一次 或 已到最后一条数据直接存
-            if (index == 200 || gcjdsq.getId().equals(lastGcjdsq.getId())){ //200条数据为1组
+            if (index == 200 || gcjdsq.getId().equals(lastGcjdsq.getId())) { //200条数据为1组
                 mySqlMapper.insertProgressDetail(progressDetailList);
                 progressDetailList.clear();
                 flowMapper.insertRecordBatch(recordList);
@@ -742,7 +746,7 @@ public class MySQLService {
      * 拨付业务信息导入
      */
     @Transactional
-    public void appropriation(){
+    public void appropriation() {
         System.out.println("===============fc_appropriation、fc_appropriation_detail数据匹配开始=================");
 
         /**
@@ -785,7 +789,7 @@ public class MySQLService {
         ApprovalNode endNode = new ApprovalNode();
 
         for (ApprovalNode node : approvalNodeList) {
-            if (node.getNumber() == 4){
+            if (node.getNumber() == 4) {
                 endNode = node;
             }
         }
@@ -868,15 +872,15 @@ public class MySQLService {
         //通知书类型(type) 1托管转监管户 2托管转一般户 3托管转其他户 4监管转一般户 5监管转其他户
 
         //托管额度内拨付
-        List<Bfxx> tgednList = applyMapper.selectBfxx(18,18);
+        /*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);
+            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);
@@ -885,66 +889,66 @@ public class MySQLService {
                 appropriation.setFlowNodeName(endNode.getNodeName());
                 mySqlMapper.insertAppropriation(appropriation);
 
-                if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0){
+                if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0) {
                     List<AppropriationDetail> details = getAppropriationDetail(bfxx.getBfmxList(), appropriation);
                     detailList.addAll(details);
                     //如果有楼幢拨付 变更楼幢虚拟户额度内拨付金额
-                    if (appropriation.getApplicationState() == 1){
+                    if (appropriation.getApplicationState() == 1) {
                         buildingAccountMapper.updateInLimitFundById(details);
                     }
                 }
-                recordList.addAll(getBfFlow(bfxx.getsFlowList(),appropriation));
-                outgoingList.add(getAppropriationOutgoing(appropriation,2));
-            }else {
-                if (bfxx.getGdzh() != null){ //过渡账号不为空说明 托管户 -> 监管户 -> 一般户
+                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");
+                    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){
+                    if (bfxx.getBfzt2() == 0) {
                         appropriation1.setApplicationState(0);
-                    }else {
+                    } else {
                         appropriation1.setApplicationState(1);
                     }
                     mySqlMapper.insertAppropriation(appropriation1);
 
-                    if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0){
+                    if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0) {
                         List<AppropriationDetail> details = getAppropriationDetail(bfxx.getBfmxList(), appropriation1);
                         detailList.addAll(details);
                         //如果有楼幢拨付 变更楼幢虚拟户额度内拨付金额
-                        if (appropriation1.getApplicationState() == 1){
+                        if (appropriation1.getApplicationState() == 1) {
                             buildingAccountMapper.updateInLimitFundById(details);
                         }
                     }
-                    recordList.addAll(getBfFlow(bfxx.getsFlowList(),appropriation1));
-                    outgoingList.add(getAppropriationOutgoing(appropriation1,1));
+                    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");
+                    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){
+                    if (bfxx.getBfzt2() == 2) {
                         appropriation2.setApplicationState(1);
-                    }else {
+                    } 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);
+                    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);
@@ -953,41 +957,41 @@ public class MySQLService {
                     appropriation.setFlowNodeName(endNode.getNodeName());
                     mySqlMapper.insertAppropriation(appropriation);
 
-                    if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0){
+                    if (bfxx.getBfmxList() != null && bfxx.getBfmxList().size() > 0) {
                         List<AppropriationDetail> details = getAppropriationDetail(bfxx.getBfmxList(), appropriation);
                         detailList.addAll(details);
                         //如果有楼幢拨付 变更楼幢虚拟户额度内拨付金额
-                        if (appropriation.getApplicationState() == 1){
+                        if (appropriation.getApplicationState() == 1) {
                             buildingAccountMapper.updateInLimitFundById(details);
                         }
                     }
-                    recordList.addAll(getBfFlow(bfxx.getsFlowList(),appropriation));
-                    outgoingList.add(getAppropriationOutgoing(appropriation,2));
+                    recordList.addAll(getBfFlow(bfxx.getsFlowList(), appropriation));
+                    outgoingList.add(getAppropriationOutgoing(appropriation, 2));
                 }
             }
-            index ++;
+            index++;
             //数据量达到200条时存一次 或 已到最后一条数据直接存
-            if (index == 200 || lastTgedn.getYwbh().equals(bfxx.getYwbh())){ //200条数据为1组
+            if (index == 200 || lastTgedn.getYwbh().equals(bfxx.getYwbh())) { //200条数据为1组
                 flowMapper.insertRecordBatch(recordList);
                 recordList.clear();
-                if (detailList.size()>0){
+                if (detailList.size() > 0) {
                     mySqlMapper.insertAppropriationDetail(detailList);
                     detailList.clear();
                 }
-                if (outgoingList.size()>0){
+                if (outgoingList.size() > 0) {
                     mySqlMapper.insertAppropriationOutgoing(outgoingList);
                     outgoingList.clear();
                 }
-                if (postingList.size()>0){
+                if (postingList.size() > 0) {
                     mySqlMapper.insertAppropriationPosting(postingList);
                     postingList.clear();
                 }
                 index = 0;
             }
-        }
+        }*/
 
         //托管额度外拨付
-        /*List<Bfxx> tgedwList = applyMapper.selectBfxx(19,18);
+        List<Bfxx> tgedwList = applyMapper.selectBfxx(19,18);
         Bfxx lastTgedw = tgedwList.get(tgedwList.size() - 1);
         for (Bfxx bfxx : tgedwList) {
             Account bfzh = accountMapper.selectByAccountNO(bfxx.getBfzh());
@@ -1073,30 +1077,33 @@ public class MySQLService {
                 }
                 index = 0;
             }
-        }*/
+        }
         System.out.println("===============fc_appropriation、fc_appropriation_detail数据匹配结束=================");
     }
+
     //拨付明细
-    public List<AppropriationDetail> getAppropriationDetail(List<Bfmx> bfmxList,Appropriation appropriation){
+    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);
+            AppropriationDetail appropriationDetail = new AppropriationDetail(bfmx, appropriation, buildingAccount);
             detailList.add(appropriationDetail);
         }
         return detailList;
     }
+
     //拨付出账通知书
-    public AppropriationOutgoing getAppropriationOutgoing(Appropriation appropriation,Integer type){
+    public AppropriationOutgoing getAppropriationOutgoing(Appropriation appropriation, Integer type) {
         AppropriationNotice notice = new AppropriationNotice();
         notice.initNotice(appropriation);
 
         AppropriationOutgoing outgoing = new AppropriationOutgoing();
-        outgoing.initNotice(appropriation,type);
+        outgoing.initNotice(appropriation, type);
         return outgoing;
     }
+
     //拨付入账通知书
-    public AppropriationPosting getAppropriationPosting(Appropriation appropriation){
+    public AppropriationPosting getAppropriationPosting(Appropriation appropriation) {
         AppropriationNotice notice = new AppropriationNotice();
         notice.initNotice(appropriation);
 
@@ -1104,8 +1111,9 @@ public class MySQLService {
         posting.initNotice(appropriation);
         return posting;
     }
+
     //拨付审批流程
-    public List<ApprovalRecord> getBfFlow(List<SFlow> sFlowList, Appropriation appropriation){
+    public List<ApprovalRecord> getBfFlow(List<SFlow> sFlowList, Appropriation appropriation) {
         List<ApprovalRecord> recordList = new ArrayList<>();
         for (SFlow sFlow : sFlowList) {
             ApprovalRecord record = new ApprovalRecord();
@@ -1117,20 +1125,20 @@ public class MySQLService {
             record.setCreateTime(record.getApprovalTime());
             record.setUpdateTime(record.getApprovalTime());
             record.setDelFlag(1);
-            if (sFlow.getShzt() == null){
+            if (sFlow.getShzt() == null) {
                 record.setNodeName("申请节点");
-                record.setApprover(appropriation.getOrgName()+"("+sFlow.getShr()+")");
-            }else {
+                record.setApprover(appropriation.getOrgName() + "(" + sFlow.getShr() + ")");
+            } else {
                 //这种情况是范哥的托管额度外拨付流程与托管额度内拨付流程用的是同一个flowid,所以流程节点名称都是”额度内...“,需要此处判断替换一下
-                if (appropriation.getAppropriationType() == 1 && appropriation.getApplicationType() == 2){
-                    record.setNodeName(sFlow.getLcmc().replace("内","外"));
-                }else {
+                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.setApprover("监管部门(" + sFlow.getShr() + ")");
+                if (sFlow.getShzt() == 1) {
                     record.setApprovalStatus(1);
-                }else {
+                } else {
                     record.setApprovalStatus(2);
                 }
             }
@@ -1210,7 +1218,7 @@ public class MySQLService {
             Account account = accountMapper.selectByAccountNO(item.getACCOUNTNO());
             Long newContractId = mySqlMapper.getContractIdByNumber(item.getHTBH());
             List<BhtTrade> bhtTrades = oracleMapper.getTradeByBHTPayJKBH(item.getJKBH());
-            Fund fund = new Fund(account, item, newContractId,bhtTrades);
+            Fund fund = new Fund(account, item, newContractId, bhtTrades);
             funds.add(fund);
             index++;
             //数据量达到200条时存一次 或 已到最后一条数据直接存
@@ -1224,7 +1232,6 @@ public class MySQLService {
     }
 
 
-
     /**
      * 定金导入
      */
@@ -1253,23 +1260,23 @@ public class MySQLService {
                 org.setOrgName("山东酷邦软件有限公司");
             }
             BuildingAccount buildingAccount = null;
-            if(!StringUtils.isEmpty(item.getLZBH())){
+            if (!StringUtils.isEmpty(item.getLZBH())) {
                 buildingAccount = buildingAccountMapper.getInfoByLZBH(item.getLZBH());
             }
             Long projectAccountId = (null != buildingAccount && null != buildingAccount.getProjectAccountId()) ? buildingAccount.getProjectAccountId() : null;
             ProjectAccount projectAccount = null;
-            if(null != projectAccountId){
+            if (null != projectAccountId) {
                 projectAccount = projectAccountMapper.getInfoById(projectAccountId);
             }
             Account account = null;
-            if(!StringUtils.isEmpty(item.getACCOUNTNO())){
+            if (!StringUtils.isEmpty(item.getACCOUNTNO())) {
                 account = accountMapper.selectByAccountNO(item.getACCOUNTNO());
             }
             //BDJ TRADESTATE  是2但是TRADENUM 没有的  是退款的    BDJ 的TRADESTATE  应该是-2  退款
-            if(!StringUtils.isEmpty(item.getTRADESTATE()) && "2".equals(item.getTRADESTATE()) &&StringUtils.isEmpty(item.getTRADENUM())){
+            if (!StringUtils.isEmpty(item.getTRADESTATE()) && "2".equals(item.getTRADESTATE()) && StringUtils.isEmpty(item.getTRADENUM())) {
                 item.setTRADESTATE("-2");
             }
-            Earnest earnest = new Earnest(item,buildingAccount,projectAccount,account,org);
+            Earnest earnest = new Earnest(item, buildingAccount, projectAccount, account, org);
             earnests.add(earnest);
             index++;
             //数据量达到200条时存一次 或 已到最后一条数据直接存
@@ -1281,5 +1288,4 @@ public class MySQLService {
         }
         System.out.println("===============fc_earnest数据匹配结束=================");
     }
-
 }

+ 128 - 0
src/main/java/com/cool/bang/modules/oracle/domain/po/TkInfo.java

@@ -0,0 +1,128 @@
+package com.cool.bang.modules.oracle.domain.po;
+
+import java.math.BigDecimal;
+
+public class TkInfo {
+
+    private String qybh;
+
+    private String lzbh;
+
+    private String accountNo;
+
+    private String applicationState;
+
+    private BigDecimal money;
+
+    private String businessNumber;
+
+    private String buyer;
+
+    private String idCard;
+
+    private String collectionName;
+
+    private String collectionAccount;
+
+    private String htBh;
+
+    private BigDecimal htZj;
+
+
+    public String getQybh() {
+        return qybh;
+    }
+
+    public void setQybh(String qybh) {
+        this.qybh = qybh;
+    }
+
+    public String getLzbh() {
+        return lzbh;
+    }
+
+    public void setLzbh(String lzbh) {
+        this.lzbh = lzbh;
+    }
+
+    public String getAccountNo() {
+        return accountNo;
+    }
+
+    public void setAccountNo(String accountNo) {
+        this.accountNo = accountNo;
+    }
+
+    public String getApplicationState() {
+        return applicationState;
+    }
+
+    public void setApplicationState(String applicationState) {
+        this.applicationState = applicationState;
+    }
+
+    public BigDecimal getMoney() {
+        return money;
+    }
+
+    public void setMoney(BigDecimal money) {
+        this.money = money;
+    }
+
+    public String getBusinessNumber() {
+        return businessNumber;
+    }
+
+    public void setBusinessNumber(String businessNumber) {
+        this.businessNumber = businessNumber;
+    }
+
+    public String getBuyer() {
+        return buyer;
+    }
+
+    public void setBuyer(String buyer) {
+        this.buyer = buyer;
+    }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public void setCollectionName(String collectionName) {
+        this.collectionName = collectionName;
+    }
+
+    public String getCollectionAccount() {
+        return collectionAccount;
+    }
+
+    public void setCollectionAccount(String collectionAccount) {
+        this.collectionAccount = collectionAccount;
+    }
+
+
+    public String getHtBh() {
+        return htBh;
+    }
+
+    public void setHtBh(String htBh) {
+        this.htBh = htBh;
+    }
+
+    public BigDecimal getHtZj() {
+        return htZj;
+    }
+
+    public void setHtZj(BigDecimal htZj) {
+        this.htZj = htZj;
+    }
+}

+ 39 - 0
src/main/java/com/cool/bang/modules/oracle/mapper/OracleMapper.java

@@ -1,6 +1,8 @@
 package com.cool.bang.modules.oracle.mapper;
 
+import com.cool.bang.modules.mysql.domain.TradeInfo;
 import com.cool.bang.modules.oracle.domain.OracleUser;
+import com.cool.bang.modules.oracle.domain.Trade;
 import com.cool.bang.modules.oracle.domain.po.*;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -33,8 +35,45 @@ public interface OracleMapper {
 
     List<BDj> selectBDJInfo();
 
+    List<TkInfo> selectHtTk();
+
+
     /**
      * 用户查询
      */
     List<OracleUser> selectByUser();
+
+    /**
+     * 查询待对账 的TRADE
+     * @return
+     */
+    List<TradeInfo> selectDDZ();
+
+    /**
+     * 查询托管的账户的交易
+     * @return
+     */
+    List<TradeInfo> selectTG();
+
+
+    /**
+     * 监管转托管
+     * @param buildingNumber
+     * @return
+     */
+    BigDecimal sumByZgToTg(@Param("buildingNumber") String buildingNumber);
+
+    /**
+     * 交存
+     * @param buildingNumber
+     * @return
+     */
+    BigDecimal sumByJc(@Param("buildingNumber") String buildingNumber);
+
+    /**
+     * 拨付
+     * @param buildingNumber
+     * @return
+     */
+    BigDecimal sumByBf(@Param("buildingNumber") String buildingNumber);
 }

+ 5 - 4
src/main/resources/application.yml

@@ -13,8 +13,8 @@ spring:
     druid:
       zjjg-mysql:
         driver-class-name: com.mysql.cj.jdbc.Driver
-        url: jdbc:mysql://192.168.0.199:3306/sg_zjjg?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
-#        url: jdbc:mysql://localhost:3306/sg_zjjg_sjdr?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
+       #url: jdbc:mysql://192.168.0.199:3306/sg_zjjg?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
+        url: jdbc:mysql://localhost:3306/sg_zjjg?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowMultiQueries=true
         username: root
         password: 123456
         initial-size: 10
@@ -34,9 +34,10 @@ spring:
         stat-view-servlet.enabled: true
       yszj-oracle:
         driver-class-name: oracle.jdbc.driver.OracleDriver
-        url: jdbc:oracle:thin:@192.168.0.199:1521:orcl
+        url: jdbc:oracle:thin:@192.168.0.102:1521:orcl
         username: yszjjg
-        password: yszjjg
+        #password: yszjjg
+        password: zjjg
         initial-size: 1
         min-idle: 5
         max-active: 20

+ 5 - 3
src/main/resources/mapper/mysql/BuildingAccountMapper.xml

@@ -5,17 +5,19 @@
     <!--  插入楼幢虚拟户表数据  -->
     <insert id="insertBuildingAccount">
         insert into
-            fc_building_account (id, org_id, org_name, project_id, project_account_id, project_number, project_name, building_id, building_number, building_name, building_address, build_area, house_number, build_cost_id, build_cost_name, build_cost_price, progress_id, progress_name, limit_percentage, adjustment_percentage, bank_percentage, keep_percentage, keep_amount, supervise_amount, account_balance, in_transit_fund, in_limit_fund, relieve_id, relieve_date, is_frozen, account_type, state, create_time, del_flag)
+            fc_building_account (id, org_id, org_name, project_id, project_account_id, project_number, project_name, building_id, building_number, building_name, building_address, build_area, house_number, build_cost_id, build_cost_name, build_cost_price, progress_id, progress_name, limit_percentage, adjustment_percentage, bank_percentage, keep_percentage, keep_amount, supervise_amount, account_balance, in_transit_fund, in_limit_fund, relieve_date, is_frozen, account_type, state, create_time, del_flag)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.orgId}, #{item.orgName}, #{item.projectId}, #{projectAccountId}, #{item.projectNumber}, #{item.projectName}, #{item.buildingId}, #{item.buildingNumber}, #{item.buildingName}, #{item.buildingAddress}, #{item.buildArea}, #{item.houseNumber}, #{item.buildCostId}, #{item.buildCostName}, #{item.buildCostPrice}, #{item.progressId}, #{item.progressName}, #{item.limitPercentage}, #{item.adjustmentPercentage}, #{item.bankPercentage}, #{item.keepPercentage}, #{item.keepAmount}, #{item.superviseAmount}, #{item.accountBalance}, #{item.inTransitFund}, #{item.inLimitFund}, #{item.relieveId}, #{item.relieveDate}, #{item.isFrozen}, #{item.accountType}, #{item.state}, #{item.createTime}, #{item.delFlag})
+            (#{item.id}, #{item.orgId}, #{item.orgName}, #{item.projectId}, #{projectAccountId}, #{item.projectNumber}, #{item.projectName}, #{item.buildingId}, #{item.buildingNumber}, #{item.buildingName}, #{item.buildingAddress}, #{item.buildArea}, #{item.houseNumber}, #{item.buildCostId}, #{item.buildCostName}, #{item.buildCostPrice}, #{item.progressId}, #{item.progressName}, #{item.limitPercentage}, #{item.adjustmentPercentage}, #{item.bankPercentage}, #{item.keepPercentage}, #{item.keepAmount}, #{item.superviseAmount}, #{item.accountBalance}, #{item.inTransitFund}, #{item.inLimitFund}, #{item.relieveDate}, #{item.isFrozen}, #{item.accountType}, #{item.state}, #{item.createTime}, #{item.delFlag})
         </foreach>
     </insert>
 
     <!--  变更楼幢虚拟户额度内拨付金额  -->
     <update id="updateInLimitFundById">
         <foreach collection="list" item="item" separator=";">
-            update fc_building_account set in_limit_fund = in_limit_fund + #{item.applyAmount} where id = #{item.buildingAccountId}
+            update fc_building_account
+                set in_limit_fund = in_limit_fund + #{item.applyAmount}
+            where id = #{item.buildingAccountId}
         </foreach>
     </update>
 

+ 245 - 66
src/main/resources/mapper/mysql/MySQLMapper.xml

@@ -5,188 +5,367 @@
     <!-- 插入监管开户申请业务表数据 -->
     <insert id="insertSuperviseBusiness">
         insert into
-            fc_supervise_business (id, business_number, bank_code, org_id, org_name, project_id, project_number, project_name, project_address, account_id, bank_name, name, account, account_open_address, operator, operator_phone, notice_pdf_url, agreement_pdf_url, business_state, open_date, create_time, update_time, del_flag)
+        fc_supervise_business (id, business_number, bank_code, org_id, org_name, project_id, project_number,
+        project_name, project_address, account_id, bank_name, name, account, account_open_address, operator,
+        operator_phone, notice_pdf_url, agreement_pdf_url, business_state, open_date, create_time, update_time,
+        del_flag)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName}, #{item.projectId}, #{item.projectNumber}, #{item.projectName}, #{item.projectAddress}, #{item.accountId}, #{item.bankName}, #{item.name}, #{item.account}, #{item.accountOpenAddress}, #{item.operator}, #{item.operatorPhone}, #{item.noticePdfUrl}, #{item.agreementPdfUrl}, #{item.businessState}, #{item.openDate}, #{item.createTime}, #{item.updateTime}, #{item.delFlag})
+            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName}, #{item.projectId},
+            #{item.projectNumber}, #{item.projectName}, #{item.projectAddress}, #{item.accountId}, #{item.bankName},
+            #{item.name}, #{item.account}, #{item.accountOpenAddress}, #{item.operator}, #{item.operatorPhone},
+            #{item.noticePdfUrl}, #{item.agreementPdfUrl}, #{item.businessState}, #{item.openDate}, #{item.createTime},
+            #{item.updateTime}, #{item.delFlag})
         </foreach>
     </insert>
 
     <!--  插入监管解除申请业务表数据  -->
     <insert id="insertSuperviseRelieve">
         insert into
-            fc_supervise_relieve (id, business_number, account_id, name, account, org_id, org_name, bank_code, bank_name, account_open_address, project_account_id, project_number, project_name, project_address, pdf_url, business_state, create_time, update_time, del_flag)
+        fc_supervise_relieve (id, business_number, account_id, name, account, org_id, org_name, bank_code, bank_name,
+        account_open_address, project_account_id, project_number, project_name, project_address, pdf_url,
+        business_state, create_time, update_time, del_flag)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.businessNumber}, #{item.accountId}, #{item.name}, #{item.account}, #{item.orgId}, #{item.orgName}, #{item.bankCode}, #{item.bankName}, #{item.accountOpenAddress}, #{item.projectAccountId}, #{item.projectNumber}, #{item.projectName}, #{item.projectAddress}, #{item.pdfUrl}, #{item.businessState}, #{item.createTime}, #{item.updateTime}, #{item.delFlag})
+            (#{item.id}, #{item.businessNumber}, #{item.accountId}, #{item.name}, #{item.account}, #{item.orgId},
+            #{item.orgName}, #{item.bankCode}, #{item.bankName}, #{item.accountOpenAddress}, #{item.projectAccountId},
+            #{item.projectNumber}, #{item.projectName}, #{item.projectAddress}, #{item.pdfUrl}, #{item.businessState},
+            #{item.createTime}, #{item.updateTime}, #{item.delFlag})
         </foreach>
     </insert>
 
     <!--  插入监管资金转托管业务数据  -->
     <insert id="insertSuperviseTo" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-        insert into
-            fc_supervise_to (id, business_number, bank_code, org_id, org_name, project_id, project_number, project_name, project_account_id, director, phone, appropriation_account_id, appropriation_bank, appropriation_name, appropriation_account, appropriation_open_address, collection_account_id, collection_bank, collection_name, collection_account, collection_open_address,transfer_amount,  flow_number, flow_node_id, flow_node_name, business_state, application_state, create_time, update_time, remark, del_flag)
-        values
-            (#{id}, #{businessNumber}, #{bankCode}, #{orgId}, #{orgName}, #{projectId}, #{projectNumber}, #{projectName}, #{projectAccountId}, #{director}, #{phone}, #{appropriationAccountId}, #{appropriationBank}, #{appropriationName}, #{appropriationAccount}, #{appropriationOpenAddress}, #{collectionAccountId}, #{collectionBank}, #{collectionName}, #{collectionAccount},#{collectionOpenAddress}, #{transferAmount}, #{flowNumber}, #{flowNodeId}, #{flowNodeName}, #{businessState}, #{applicationState}, #{createTime}, #{updateTime}, #{remark}, #{delFlag})
+        insert into fc_supervise_to (id, business_number, bank_code, org_id, org_name, project_id, project_number,
+                                     project_name, project_account_id, director, phone, appropriation_account_id,
+                                     appropriation_bank, appropriation_name, appropriation_account,
+                                     appropriation_open_address, collection_account_id, collection_bank,
+                                     collection_name, collection_account, collection_open_address, transfer_amount,
+                                     flow_number, flow_node_id, flow_node_name, business_state, application_state,
+                                     create_time, update_time, remark, del_flag)
+        values (#{id}, #{businessNumber}, #{bankCode}, #{orgId}, #{orgName}, #{projectId}, #{projectNumber},
+                #{projectName}, #{projectAccountId}, #{director}, #{phone}, #{appropriationAccountId},
+                #{appropriationBank}, #{appropriationName}, #{appropriationAccount}, #{appropriationOpenAddress},
+                #{collectionAccountId}, #{collectionBank}, #{collectionName}, #{collectionAccount},
+                #{collectionOpenAddress}, #{transferAmount}, #{flowNumber}, #{flowNodeId}, #{flowNodeName},
+                #{businessState}, #{applicationState}, #{createTime}, #{updateTime}, #{remark}, #{delFlag})
     </insert>
 
     <!--  插入监管资金转托管详情数据  -->
     <insert id="insertSuperviseToDetail">
         insert into
-            fc_supervise_to_detail (id, supervise_to_id, building_account_id, building_number, building_name, account_balance, keep_percentage, keep_amount, transfer_amount, create_time, update_time, del_flag)
+        fc_supervise_to_detail (id, supervise_to_id, building_account_id, building_number, building_name,
+        account_balance, keep_percentage, keep_amount, transfer_amount, create_time, update_time, del_flag)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.superviseToId}, #{item.buildingAccountId}, #{item.buildingNumber}, #{item.buildingName}, #{item.accountBalance}, #{item.keepPercentage}, #{item.keepAmount}, #{item.transferAmount}, #{item.createTime}, #{item.updateTime}, #{item.delFlag})
+            (#{item.id}, #{item.superviseToId}, #{item.buildingAccountId}, #{item.buildingNumber}, #{item.buildingName},
+            #{item.accountBalance}, #{item.keepPercentage}, #{item.keepAmount}, #{item.transferAmount},
+            #{item.createTime}, #{item.updateTime}, #{item.delFlag})
         </foreach>
     </insert>
 
     <!--  插入监管资金转托管 转入通知书数据  -->
     <insert id="insertSuperviseToPosting">
         insert into
-            fc_supervise_to_posting (id, business_number, bank_code, org_id, org_name, supervise_to_id, project_id, project_number, project_name, project_account_id, appropriation_account_id, appropriation_bank, appropriation_name, appropriation_account, appropriation_open_address, collection_account_id, collection_bank, collection_name, collection_account, posting_amount, posting_status, is_rescind, remark, create_time, update_time)
+        fc_supervise_to_posting (id, business_number, bank_code, org_id, org_name, supervise_to_id, project_id,
+        project_number, project_name, project_account_id, appropriation_account_id, appropriation_bank,
+        appropriation_name, appropriation_account, appropriation_open_address, collection_account_id, collection_bank,
+        collection_name, collection_account, posting_amount, posting_status, is_rescind, remark, create_time,
+        update_time)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName}, #{item.superviseToId}, #{item.projectId}, #{item.projectNumber}, #{item.projectName}, #{item.projectAccountId}, #{item.appropriationAccountId}, #{item.appropriationBank}, #{item.appropriationName}, #{item.appropriationAccount}, #{item.appropriationOpenAddress}, #{item.collectionAccountId}, #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount}, #{item.postingAmount}, #{item.postingStatus}, #{item.isRescind}, #{item.remark}, #{item.createTime}, #{item.updateTime})
+            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName},
+            #{item.superviseToId}, #{item.projectId}, #{item.projectNumber}, #{item.projectName},
+            #{item.projectAccountId}, #{item.appropriationAccountId}, #{item.appropriationBank},
+            #{item.appropriationName}, #{item.appropriationAccount}, #{item.appropriationOpenAddress},
+            #{item.collectionAccountId}, #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount},
+            #{item.postingAmount}, #{item.postingStatus}, #{item.isRescind}, #{item.remark}, #{item.createTime},
+            #{item.updateTime})
         </foreach>
     </insert>
 
     <!--  插入监管资金转托管 转出通知书数据  -->
     <insert id="insertSuperviseToOutgoing">
         insert into
-            fc_supervise_to_outgoing (id, business_number, bank_code, org_id, org_name, supervise_to_id, project_id, project_number, project_name, project_account_id, appropriation_account_id, appropriation_bank, appropriation_name, appropriation_account, appropriation_open_address, collection_account_id,collection_open_address, collection_bank, collection_name, collection_account, apply_amount, appropriation_status, is_rescind, remark, create_time, update_time)
+        fc_supervise_to_outgoing (id, business_number, bank_code, org_id, org_name, supervise_to_id, project_id,
+        project_number, project_name, project_account_id, appropriation_account_id, appropriation_bank,
+        appropriation_name, appropriation_account, appropriation_open_address,
+        collection_account_id,collection_open_address, collection_bank, collection_name, collection_account,
+        apply_amount, appropriation_status, is_rescind, remark, create_time, update_time)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName}, #{item.superviseToId}, #{item.projectId}, #{item.projectNumber}, #{item.projectName}, #{item.projectAccountId}, #{item.appropriationAccountId}, #{item.appropriationBank}, #{item.appropriationName}, #{item.appropriationAccount}, #{item.appropriationOpenAddress}, #{item.collectionAccountId},#{item.collectionOpenAddress}, #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount}, #{item.applyAmount}, #{item.appropriationStatus}, #{item.isRescind}, #{item.remark}, #{item.createTime}, #{item.updateTime})
+            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName},
+            #{item.superviseToId}, #{item.projectId}, #{item.projectNumber}, #{item.projectName},
+            #{item.projectAccountId}, #{item.appropriationAccountId}, #{item.appropriationBank},
+            #{item.appropriationName}, #{item.appropriationAccount}, #{item.appropriationOpenAddress},
+            #{item.collectionAccountId},#{item.collectionOpenAddress}, #{item.collectionBank}, #{item.collectionName},
+            #{item.collectionAccount}, #{item.applyAmount}, #{item.appropriationStatus}, #{item.isRescind},
+            #{item.remark}, #{item.createTime}, #{item.updateTime})
         </foreach>
     </insert>
 
     <!--  插入施工进度申请业务信息  -->
     <insert id="insertProgress" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-        insert into
-            fc_progress_business (id, business_number, org_id, org_name, project_account_id, project_name, flow_number, flow_node_id, flow_node_name, business_state, create_time, update_time, del_flag)
-        values
-            (#{id,jdbcType=BIGINT}, #{businessNumber,jdbcType=VARCHAR}, #{orgId,jdbcType=BIGINT}, #{orgName,jdbcType=VARCHAR}, #{projectAccountId,jdbcType=BIGINT}, #{projectName,jdbcType=VARCHAR}, #{flowNumber,jdbcType=VARCHAR}, #{flowNodeId,jdbcType=BIGINT}, #{flowNodeName,jdbcType=VARCHAR}, #{businessState,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
-   </insert>
+        insert into fc_progress_business (id, business_number, org_id, org_name, project_account_id, project_name,
+                                          flow_number, flow_node_id, flow_node_name, business_state, create_time,
+                                          update_time, del_flag)
+        values (#{id,jdbcType=BIGINT}, #{businessNumber,jdbcType=VARCHAR}, #{orgId,jdbcType=BIGINT},
+                #{orgName,jdbcType=VARCHAR}, #{projectAccountId,jdbcType=BIGINT}, #{projectName,jdbcType=VARCHAR},
+                #{flowNumber,jdbcType=VARCHAR}, #{flowNodeId,jdbcType=BIGINT}, #{flowNodeName,jdbcType=VARCHAR},
+                #{businessState,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
+                #{delFlag,jdbcType=TINYINT})
+    </insert>
 
     <!--  插入施工进度申请明细表信息  -->
     <insert id="insertProgressDetail">
         insert into
-            fc_progress_detail (id, progress_business_id, building_number, building_name, now_progress_name, progress_id, progress_name, limit_percentage, building_account_id, building_account_name, url, create_time, update_time)
+        fc_progress_detail (id, progress_business_id, building_number, building_name, now_progress_name, progress_id,
+        progress_name, limit_percentage, building_account_id, building_account_name, url, create_time, update_time)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.progressBusinessId}, #{item.buildingNumber}, #{item.buildingName},#{item.nowProgressName}, #{item.progressId}, #{item.progressName}, #{item.limitPercentage}, #{item.buildingAccountId}, #{item.buildingAccountName}, #{item.url}, #{item.createTime}, #{item.updateTime})
+            (#{item.id}, #{item.progressBusinessId}, #{item.buildingNumber},
+            #{item.buildingName},#{item.nowProgressName}, #{item.progressId}, #{item.progressName},
+            #{item.limitPercentage}, #{item.buildingAccountId}, #{item.buildingAccountName}, #{item.url},
+            #{item.createTime}, #{item.updateTime})
         </foreach>
     </insert>
 
     <!--  插入拨付申请业务数据  -->
     <insert id="insertAppropriation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-        insert into
-            fc_appropriation (id, business_number, bank_code, org_id, org_name, project_id, project_account_id, project_number, project_name, director, phone, application_type, appropriation_account_id, appropriation_bank, appropriation_name, appropriation_account, appropriation_open_address, collection_account_id, collection_bank, collection_name, collection_account, collection_open_address, collection_type, appropriation_type, apply_amount, purpose, flow_number, flow_node_id, flow_node_name, pdf_url, pdf_url_notice, business_state, application_state, create_time, update_time, remark, del_flag)
-        values
-            (#{id}, #{businessNumber}, #{bankCode}, #{orgId}, #{orgName}, #{projectId}, #{projectAccountId}, #{projectNumber}, #{projectName}, #{director}, #{phone}, #{applicationType}, #{appropriationAccountId}, #{appropriationBank}, #{appropriationName}, #{appropriationAccount}, #{appropriationOpenAddress}, #{collectionAccountId}, #{collectionBank}, #{collectionName}, #{collectionAccount}, #{collectionOpenAddress}, #{collectionType}, #{appropriationType}, #{applyAmount}, #{purpose}, #{flowNumber}, #{flowNodeId}, #{flowNodeName}, #{pdfUrl}, #{pdfUrlNotice}, #{businessState}, #{applicationState}, #{createTime}, #{updateTime}, #{remark}, #{delFlag})
+        insert into fc_appropriation (id, business_number, bank_code, org_id, org_name, project_id, project_account_id,
+                                      project_number, project_name, director, phone, application_type,
+                                      appropriation_account_id, appropriation_bank, appropriation_name,
+                                      appropriation_account, appropriation_open_address, collection_account_id,
+                                      collection_bank, collection_name, collection_account, collection_open_address,
+                                      collection_type, appropriation_type, apply_amount, purpose, flow_number,
+                                      flow_node_id, flow_node_name, pdf_url, pdf_url_notice, business_state,
+                                      application_state, create_time, update_time, remark, del_flag)
+        values (#{id}, #{businessNumber}, #{bankCode}, #{orgId}, #{orgName}, #{projectId}, #{projectAccountId},
+                #{projectNumber}, #{projectName}, #{director}, #{phone}, #{applicationType}, #{appropriationAccountId},
+                #{appropriationBank}, #{appropriationName}, #{appropriationAccount}, #{appropriationOpenAddress},
+                #{collectionAccountId}, #{collectionBank}, #{collectionName}, #{collectionAccount},
+                #{collectionOpenAddress}, #{collectionType}, #{appropriationType}, #{applyAmount}, #{purpose},
+                #{flowNumber}, #{flowNodeId}, #{flowNodeName}, #{pdfUrl}, #{pdfUrlNotice}, #{businessState},
+                #{applicationState}, #{createTime}, #{updateTime}, #{remark}, #{delFlag})
     </insert>
 
     <!--  插入拨付申请业务详情数据  -->
     <insert id="insertAppropriationDetail">
         insert into
-            fc_appropriation_detail (id, appropriation_id, building_account_id, building_number, building_name, account_balance, keep_percentage, keep_amount, apply_amount, create_time, update_time, del_flag)
+        fc_appropriation_detail (id, appropriation_id, building_account_id, building_number, building_name,
+        account_balance, keep_percentage, keep_amount, apply_amount, create_time, update_time, del_flag)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.appropriationId}, #{item.buildingAccountId}, #{item.buildingNumber}, #{item.buildingName}, #{item.accountBalance}, #{item.keepPercentage}, #{item.keepAmount}, #{item.applyAmount}, #{item.createTime}, #{item.updateTime}, #{item.delFlag})
+            (#{item.id}, #{item.appropriationId}, #{item.buildingAccountId}, #{item.buildingNumber},
+            #{item.buildingName}, #{item.accountBalance}, #{item.keepPercentage}, #{item.keepAmount},
+            #{item.applyAmount}, #{item.createTime}, #{item.updateTime}, #{item.delFlag})
         </foreach>
     </insert>
 
     <!--  插入拨付出账通知书  -->
     <insert id="insertAppropriationOutgoing">
         insert into
-            fc_appropriation_outgoing (id, business_number, bank_code, org_id, org_name, appropriation_id,application_type, project_account_id, project_name, appropriation_account_id, appropriation_bank, appropriation_name, appropriation_account, appropriation_open_address, collection_account_id, collection_bank, collection_name, collection_account, collection_open_address, apply_amount, purpose, type, appropriation_status, pdf_url, is_rescind, create_time, update_time, del_flag, remark)
+        fc_appropriation_outgoing (id, business_number, bank_code, org_id, org_name, appropriation_id,application_type,
+        project_account_id, project_name, appropriation_account_id, appropriation_bank, appropriation_name,
+        appropriation_account, appropriation_open_address, collection_account_id, collection_bank, collection_name,
+        collection_account, collection_open_address, apply_amount, purpose, type, appropriation_status, pdf_url,
+        is_rescind, create_time, update_time, del_flag, remark)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName}, #{item.appropriationId}, #{item.applicationType}, #{item.projectAccountId}, #{item.projectName}, #{item.appropriationAccountId}, #{item.appropriationBank}, #{item.appropriationName}, #{item.appropriationAccount}, #{item.appropriationOpenAddress}, #{item.collectionAccountId}, #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount}, #{item.collectionOpenAddress}, #{item.applyAmount}, #{item.purpose}, #{item.type}, #{item.appropriationStatus}, #{item.pdfUrl}, #{item.isRescind}, #{item.createTime}, #{item.updateTime}, #{item.delFlag}, #{item.remark})
+            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName},
+            #{item.appropriationId}, #{item.applicationType}, #{item.projectAccountId}, #{item.projectName},
+            #{item.appropriationAccountId}, #{item.appropriationBank}, #{item.appropriationName},
+            #{item.appropriationAccount}, #{item.appropriationOpenAddress}, #{item.collectionAccountId},
+            #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount}, #{item.collectionOpenAddress},
+            #{item.applyAmount}, #{item.purpose}, #{item.type}, #{item.appropriationStatus}, #{item.pdfUrl},
+            #{item.isRescind}, #{item.createTime}, #{item.updateTime}, #{item.delFlag}, #{item.remark})
         </foreach>
     </insert>
 
     <!--  插入拨付入账通知书  -->
     <insert id="insertAppropriationPosting">
         insert into
-            fc_appropriation_posting (id, business_number, bank_code, org_id, org_name, appropriation_id, project_account_id, project_name, appropriation_account_id, appropriation_bank, appropriation_name, appropriation_account, appropriation_open_address, collection_account_id, collection_bank, collection_name, collection_account, collection_open_address, posting_amount, posting_status, purpose, is_rescind, create_time, update_time, del_flag, remark)
+        fc_appropriation_posting (id, business_number, bank_code, org_id, org_name, appropriation_id,
+        project_account_id, project_name, appropriation_account_id, appropriation_bank, appropriation_name,
+        appropriation_account, appropriation_open_address, collection_account_id, collection_bank, collection_name,
+        collection_account, collection_open_address, posting_amount, posting_status, purpose, is_rescind, create_time,
+        update_time, del_flag, remark)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName}, #{item.appropriationId}, #{item.projectAccountId}, #{item.projectName}, #{item.appropriationAccountId}, #{item.appropriationBank}, #{item.appropriationName}, #{item.appropriationAccount}, #{item.appropriationOpenAddress}, #{item.collectionAccountId}, #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount}, #{item.collectionOpenAddress}, #{item.postingAmount}, #{item.postingStatus}, #{item.purpose}, #{item.isRescind}, #{item.createTime}, #{item.updateTime}, #{item.delFlag}, #{item.remark})
+            (#{item.id}, #{item.businessNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName},
+            #{item.appropriationId}, #{item.projectAccountId}, #{item.projectName}, #{item.appropriationAccountId},
+            #{item.appropriationBank}, #{item.appropriationName}, #{item.appropriationAccount},
+            #{item.appropriationOpenAddress}, #{item.collectionAccountId}, #{item.collectionBank},
+            #{item.collectionName}, #{item.collectionAccount}, #{item.collectionOpenAddress}, #{item.postingAmount},
+            #{item.postingStatus}, #{item.purpose}, #{item.isRescind}, #{item.createTime}, #{item.updateTime},
+            #{item.delFlag}, #{item.remark})
         </foreach>
     </insert>
 
     <!--  插入项目解除监管业务数据  -->
     <insert id="insertRelieve" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-        insert into
-            fc_relieve (id, business_number, org_id, org_name, project_id, project_number, project_name, director, phone, flow_number, flow_node_id, flow_node_name, relieve_type, business_type, business_state, remark, create_time, update_time, del_flag)
-        values
-            (#{id}, #{businessNumber},#{orgId}, #{orgName}, #{projectId}, #{projectNumber}, #{projectName}, #{director}, #{phone}, #{flowNumber}, #{flowNodeId}, #{flowNodeName}, #{relieveType}, #{businessType}, #{businessState}, #{remark}, #{createTime}, #{updateTime}, #{delFlag})
+        insert into fc_relieve (id, business_number, org_id, org_name, project_id, project_number, project_name,
+                                director, phone, flow_number, flow_node_id, flow_node_name, relieve_type, business_type,
+                                business_state, remark, create_time, update_time, del_flag)
+        values (#{id}, #{businessNumber}, #{orgId}, #{orgName}, #{projectId}, #{projectNumber}, #{projectName},
+                #{director}, #{phone}, #{flowNumber}, #{flowNodeId}, #{flowNodeName}, #{relieveType}, #{businessType},
+                #{businessState}, #{remark}, #{createTime}, #{updateTime}, #{delFlag})
     </insert>
 
     <!--  插入项目解除监管业务详情数据  -->
     <insert id="insertRelieveDetail">
         insert into
-            fc_relieve_detail (id, relieve_id, building_account_id, building_id, building_number, building_name, building_address, build_area, account_balance, in_transit_fund)
+        fc_relieve_detail (id, relieve_id, building_account_id, building_id, building_number, building_name,
+        building_address, build_area, account_balance, in_transit_fund)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.id}, #{item.relieveId}, #{item.buildingAccountId}, #{item.buildingId}, #{item.buildingNumber}, #{item.buildingName}, #{item.buildingAddress}, #{item.buildArea}, #{item.accountBalance}, #{item.inTransitFund})
+            (#{item.id}, #{item.relieveId}, #{item.buildingAccountId}, #{item.buildingId}, #{item.buildingNumber},
+            #{item.buildingName}, #{item.buildingAddress}, #{item.buildArea}, #{item.accountBalance},
+            #{item.inTransitFund})
         </foreach>
     </insert>
 
     <!--  插入合同  -->
     <insert id="insertContract">
         insert into
-            fc_contract
-                (contract_number, bank_code, org_id, org_name, project_id, project_account_id, project_number, project_name,
-                 building_id, building_account_id, building_number, building_name, house_id, house_address, house_area, house_use,
-                 buyer, id_card, pay_way, contract_price, payment_amount_1, payment_amount_2, payment_amount_3, payment_amount_4,
-                 sign_time,  collection_bank, collection_name, collection_account, collection_open_address,
-                 account_id, account_type, is_mortgage, is_refund, is_earnest, is_rescind, del_flag,is_overdue,payment_status)
+        fc_contract
+        (contract_number, bank_code, org_id, org_name, project_id, project_account_id, project_number, project_name,
+        building_id, building_account_id, building_number, building_name, house_id, house_address, house_area,
+        house_use,
+        buyer, id_card, pay_way, contract_price, payment_amount_1, payment_amount_2, payment_amount_3, payment_amount_4,
+        sign_time, collection_bank, collection_name, collection_account, collection_open_address,
+        account_id, account_type, is_mortgage, is_refund, is_earnest, is_rescind, del_flag,is_overdue,payment_status)
         values
         <foreach collection="list" item="item" separator=",">
-                (#{item.contractNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName}, #{item.projectId}, #{item.projectAccountId},
-                 #{item.projectNumber}, #{item.projectName}, #{item.buildingId}, #{item.buildingAccountId}, #{item.buildingNumber}, #{item.buildingName},
-                 #{item.houseId}, #{item.houseAddress}, #{item.houseArea}, #{item.houseUse}, #{item.buyer}, #{item.idCard}, #{item.payWay},
-                 #{item.contractPrice}, #{item.paymentAmount1}, #{item.paymentAmount2}, #{item.paymentAmount3}, #{item.paymentAmount4}, #{item.signTime},
-                  #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount},
-                 #{item.collectionOpenAddress}, #{item.accountId}, #{item.accountType}, #{item.isMortgage}, #{item.isRefund}, #{item.isEarnest},
-                 #{item.isRescind}, #{item.delFlag},#{item.isOverdue},#{item.paymentStatus})
+            (#{item.contractNumber}, #{item.bankCode}, #{item.orgId}, #{item.orgName}, #{item.projectId},
+            #{item.projectAccountId},
+            #{item.projectNumber}, #{item.projectName}, #{item.buildingId}, #{item.buildingAccountId},
+            #{item.buildingNumber}, #{item.buildingName},
+            #{item.houseId}, #{item.houseAddress}, #{item.houseArea}, #{item.houseUse}, #{item.buyer}, #{item.idCard},
+            #{item.payWay},
+            #{item.contractPrice}, #{item.paymentAmount1}, #{item.paymentAmount2}, #{item.paymentAmount3},
+            #{item.paymentAmount4}, #{item.signTime},
+            #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount},
+            #{item.collectionOpenAddress}, #{item.accountId}, #{item.accountType}, #{item.isMortgage}, #{item.isRefund},
+            #{item.isEarnest},
+            #{item.isRescind}, #{item.delFlag},#{item.isOverdue},#{item.paymentStatus})
         </foreach>
     </insert>
 
     <!--插入交存 -->
     <insert id="insertFund">
         insert into
-            fc_fund (business_number, bank_code, contract_id, contract_number, payment_type, payable_amount, paid_amount, unpaid_amount,
-                     collection_bank, collection_name, collection_account, collection_open_address, account_type, pdf_url, payment_status,
-                     is_rescind,del_flag)
+        fc_fund (business_number, bank_code, contract_id, contract_number, payment_type, payable_amount, paid_amount,
+        unpaid_amount,
+        collection_bank, collection_name, collection_account, collection_open_address, account_type, pdf_url,
+        payment_status,
+        is_rescind,del_flag)
         values
         <foreach collection="list" item="item" separator=",">
-            (#{item.businessNumber}, #{item.bankCode}, #{item.contractId}, #{item.contractNumber}, #{item.paymentType}, #{item.payableAmount},
-             #{item.paidAmount}, #{item.unpaidAmount}, #{item.collectionBank}, #{item.collectionName}, #{item.collectionAccount},
-             #{item.collectionOpenAddress}, #{item.accountType}, #{item.pdfUrl}, #{item.paymentStatus}, #{item.isRescind},#{item.delFlag})
+            (#{item.businessNumber}, #{item.bankCode}, #{item.contractId}, #{item.contractNumber}, #{item.paymentType},
+            #{item.payableAmount},
+            #{item.paidAmount}, #{item.unpaidAmount}, #{item.collectionBank}, #{item.collectionName},
+            #{item.collectionAccount},
+            #{item.collectionOpenAddress}, #{item.accountType}, #{item.pdfUrl}, #{item.paymentStatus},
+            #{item.isRescind},#{item.delFlag})
         </foreach>
     </insert>
 
     <select id="getContractIdByNumber" resultType="long">
-        select id from fc_contract where contract_number = #{htbh} ORDER BY is_refund ASC LIMIT 1
+        select id
+        from fc_contract
+        where contract_number = #{htbh}
+        ORDER BY is_refund ASC LIMIT 1
     </select>
 
     <insert id="insertEarnest">
         insert into
-            fc_earnest
-            (business_number, bank_code, contract_number, org_id, org_name, project_id, project_account_id,
-             project_number, project_name, building_account_id, building_number, building_name, buyer, id_card, phone,
-             collection_bank, collection_name, collection_account, collection_open_address, account_id, account_type,
-             payable_amount, paid_amount, unpaid_amount, pdf_url, payment_status, connect_status, remark, del_flag)
+        fc_earnest
+        (business_number, bank_code, contract_number, org_id, org_name, project_id, project_account_id,
+        project_number, project_name, building_account_id, building_number, building_name, buyer, id_card, phone,
+        collection_bank, collection_name, collection_account, collection_open_address, account_id, account_type,
+        payable_amount, paid_amount, unpaid_amount, pdf_url, payment_status, connect_status, remark, del_flag)
         values
         <foreach collection="list" item="item" separator=",">
             (#{item.businessNumber}, #{item.bankCode}, #{item.contractNumber}, #{item.orgId}, #{item.orgName},
-             #{item.projectId}, #{item.projectAccountId}, #{item.projectNumber}, #{item.projectName}, #{item.buildingAccountId},
-             #{item.buildingNumber}, #{item.buildingName}, #{item.buyer}, #{item.idCard}, #{item.phone}, #{item.collectionBank}, #{item.collectionName},
-             #{item.collectionAccount}, #{item.collectionOpenAddress}, #{item.accountId}, #{item.accountType}, #{item.payableAmount},
-             #{item.paidAmount}, #{item.unpaidAmount}, #{item.pdfUrl}, #{item.paymentStatus}, #{item.connectStatus}, #{item.remark}, #{item.delFlag})
+            #{item.projectId}, #{item.projectAccountId}, #{item.projectNumber}, #{item.projectName},
+            #{item.buildingAccountId},
+            #{item.buildingNumber}, #{item.buildingName}, #{item.buyer}, #{item.idCard}, #{item.phone},
+            #{item.collectionBank}, #{item.collectionName},
+            #{item.collectionAccount}, #{item.collectionOpenAddress}, #{item.accountId}, #{item.accountType},
+            #{item.payableAmount},
+            #{item.paidAmount}, #{item.unpaidAmount}, #{item.pdfUrl}, #{item.paymentStatus}, #{item.connectStatus},
+            #{item.remark}, #{item.delFlag})
+        </foreach>
+    </insert>
+
+    <insert id="insertRefund">
+        insert into
+        fc_refund
+        (business_number,bank_code,contract_number,contract_id,contract_price,org_id,org_name,project_account_id,project_name,project_number,
+        buyer,id_card,account_id,account_type,appropriation_bank,appropriation_account,collection_bank,collection_name,collection_account,
+        refund_amount,signer,signer_phone,flow_number,flow_node_id,flow_node_name,business_state,appropriation_status,del_flag,
+        building_account_id,building_name)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.businessNumber},#{item.bankCode},#{item.contractNumber},#{item.contractId},#{item.contractPrice},#{item.orgId},
+            #{item.orgName},#{item.projectAccountId},#{item.projectName},#{item.projectNumber},#{item.buyer},#{item.idCard},
+            #{item.accountId},#{item.accountType},#{item.appropriationBank},#{item.appropriationAccount},#{item.collectionBank},
+            #{item.collectionName},#{item.collectionAccount},#{item.refundAmount},
+            #{item.signer},#{item.signerPhone},#{item.flowNumber},#{item.flowNodeId},#{item.flowNodeName},#{item.businessState},
+            #{item.appropriationStatus},#{item.delFlag},#{item.buildingAccountId},#{item.buildingName})
         </foreach>
     </insert>
+
+    <select id="getInfoByNumber" resultType="com.cool.bang.modules.mysql.domain.ContractInfo">
+        select id, contract_price AS contractPrice
+        from fc_contract
+        where contract_number = #{htBh} LIMIT 1
+    </select>
+
+    <insert id="insertFcTrade">
+        insert into
+        fc_trade (serial_number, flush_serial_number, business_number, channel_type, channel_code, account_type,
+        account, account_id, project_account_id, building_account_id, amount, type, transaction_mode,
+        transaction_time, account_balance, reciprocal_account, check_status, check_date, is_flush, remark,del_flag)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.serialNumber}, #{item.flushSerialNumber}, #{item.businessNumber}, #{item.channelType},
+            #{item.channelCode},
+            #{item.accountType}, #{item.account}, #{item.accountId}, #{item.projectAccountId},
+            #{item.buildingAccountId}, #{item.amount},
+            #{item.type}, #{item.transactionMode}, #{item.transactionTime}, #{item.accountBalance},
+            #{item.reciprocalAccount}, #{item.checkStatus},
+            #{item.checkDate}, #{item.isFlush}, #{item.remark},#{item.delFlag})
+        </foreach>
+    </insert>
+
+    <select id="selectTgXm" resultType="map">
+        select *
+        FROM fc_project
+        WHERE state = 1
+          AND type = 1
+    </select>
+
+    <select id="selectXmAccountByProjectId" resultType="map">
+        SELECT pa.*,a.name
+        FROM fc_project_account pa
+        LEFT JOIN fc_account a ON  pa.account_id = a.id
+        WHERE pa.account_type = 1
+          AND pa.state = 1
+          AND pa.del_flag = 1
+          AND pa.project_id = #{projectId}
+    </select>
+
+    <select id="selectBuildingBy" resultType="map">
+        SELECT *
+        FROM fc_building_account
+        WHERE project_id = #{projectId}
+          AND project_account_id = #{projectAccountId}
+          AND account_type = 1
+    </select>
+
+    <select id="getAccountBalanceByNumber" resultType="decimal">
+        select account_balance from  fc_building_account where building_number = #{buildingNumber}
+    </select>
 </mapper>

+ 3 - 1
src/main/resources/mapper/oracle/ApplyMapper.xml

@@ -9,11 +9,13 @@
         from
             apply t1
         left join
-            account t2 on t1.appid = t2.appid and t2.state = 1 and t2.accountno is not null
+            account t2 on t1.appid = t2.appid
         left join
             areg t3 on t1.aregid = t3.aregid
+        LEFT JOIN BXM t4 ON t4.XMBH = t3.XMBH
         where
             t1.apptype = 0 and t1.flownodename = '开户申请审批通过'
+            AND	t4.JGZT != 0
     </select>
 
     <!--  查询监管解除业务信息  -->

+ 59 - 0
src/main/resources/mapper/oracle/OracleMapper.xml

@@ -114,4 +114,63 @@
         from SUSER t left join BQY t2 on t2.qybh = t.TYPECODE where t.USERTYPE = 1 and t.state = 1 and t2.qyid is not null
     </select>
 
+    <select id="selectHtTk" resultType="com.cool.bang.modules.oracle.domain.po.TkInfo">
+        SELECT
+            a.APPBH,tr.TRADEAMOUNT AS money,it.PAYCODE AS businessNumber,ht.LZBH AS lzbh,ht.QYBH AS qybh,ht.HTBH AS htBh,a.APPID,tr.ACCOUNTNO AS accountNo,
+            it.PAYACCOUNTNAME AS collectionName,it.PAYACCOUNTNO AS collectionAccount,ht.BUYERNAME AS buyer,
+            ht.BUYERCODE AS idCard,ht.HTBH AS htBh,it.PAYUSE AS remark
+        FROM PAYITEM it
+                 LEFT JOIN APPLY a  ON it.APPID = a.APPID  AND a.STATE =1  AND a.APPTYPE = 8
+                 LEFT JOIN BHT ht ON ht.HTID = a.HTID
+                 LEFT JOIN TRADE tr ON tr.TRADENUM = it.PAYCODE AND tr.TRADESTATE = 1
+        WHERE it.STATE =1 AND it.PAYTYPE = 8   AND a.APPBH IS NOT NULL
+    </select>
+
+    <select id="selectDDZ" resultType="com.cool.bang.modules.mysql.domain.TradeInfo">
+        SELECT
+            ID AS id,ACCOUNTNO AS accountNo,BANKSER AS serialNumber,OLDBANKSER AS flushSerialNumber,
+            TRADENUM AS businessNumber,BANKFLAG AS channelType,TRADEAMOUNT AS amount,TRADECODE  AS code,
+            CHECKFLAG AS checkStatus,CHECKDATE AS checkDate, 1 AS transactionMode,TRADEDATE AS  transactionTime,LZBH AS lzbh
+        from TRADE
+        WHERE CHECKFLAG =1
+    </select>
+
+    <select id="selectTG" resultType="com.cool.bang.modules.mysql.domain.TradeInfo">
+        SELECT
+            ID AS id,ACCOUNTNO AS accountNo,BANKSER AS serialNumber,OLDBANKSER AS flushSerialNumber,
+            TRADENUM AS businessNumber,BANKFLAG AS channelType,TRADEAMOUNT AS amount,TRADECODE  AS code,
+            CHECKFLAG AS checkStatus,CHECKDATE AS checkDate, 1 AS transactionMode,TRADEDATE AS  transactionTime,LZBH AS lzbh
+        FROM
+            trade
+        WHERE
+            accountno IN ( SELECT accountno FROM account  WHERE accountid &lt;= 8 ) AND CHECKFLAG = 2 AND TRADESTATE =1
+    </select>
+
+
+    <select id="sumByZgToTg" resultType="decimal">
+        SELECT NVL(SUM(t3.money),0)
+        FROM TRADE t
+                 left join PAYITEM t2 on t2.PAYCODE = t.TRADENUM
+                 left join PAYITEMLZ t3 on t3.PAYITEMID = t2.PAYITEMID
+                 left join AREGITEM t4 on t4.AREGITEMID = t3.AREGITEMID
+        WHERE t.ACCOUNTNO IN (SELECT ACCOUNTNO FROM ACCOUNT WHERE accountid  &lt;= 8) AND t.PAYTYPE in (16)
+          AND t4.lzbh = #{buildingNumber}
+    </select>
+
+    <select id="sumByJc" resultType="decimal">
+        SELECT NVL(SUM(TRADEAMOUNT),0)
+        FROM TRADE
+        WHERE ACCOUNTNO IN (SELECT ACCOUNTNO FROM ACCOUNT WHERE accountid &lt;= 8)
+          and CHECKFLAG = 2 AND ZJJGFLAG = 1 AND TRADESTATE = 1 AND PAYTYPE in (01) and LZBH = #{buildingNumber}
+    </select>
+
+    <select id="sumByBf" resultType="decimal">
+        SELECT NVL(SUM(t3.money),0)
+        FROM TRADE t
+                 left join PAYITEM t2 on t2.PAYCODE = t.TRADENUM
+                 left join PAYITEMLZ t3 on t3.PAYITEMID = t2.PAYITEMID
+                 left join AREGITEM t4 on t4.AREGITEMID = t3.AREGITEMID
+        WHERE t.ACCOUNTNO IN (SELECT ACCOUNTNO FROM ACCOUNT WHERE accountid  &lt;= 8) AND t.PAYTYPE in (18,19,20)
+          AND t4.lzbh = #{buildingNumber}
+    </select>
 </mapper>

BIN
target/classes/com/cool/bang/modules/mysql/domain/BuildingAccount.class


BIN
target/classes/com/cool/bang/modules/mysql/domain/TrusteeshipBusiness.class


+ 3 - 1
target/classes/mapper/oracle/ApplyMapper.xml

@@ -9,11 +9,13 @@
         from
             apply t1
         left join
-            account t2 on t1.appid = t2.appid and t2.state = 1 and t2.accountno is not null
+            account t2 on t1.appid = t2.appid
         left join
             areg t3 on t1.aregid = t3.aregid
+        LEFT JOIN BXM t4 ON t4.XMBH = t3.XMBH
         where
             t1.apptype = 0 and t1.flownodename = '开户申请审批通过'
+            AND	t4.JGZT != 0
     </select>
 
     <!--  查询监管解除业务信息  -->

+ 1 - 1
target/classes/mapper/oracle/BxmxyMapper.xml

@@ -3,6 +3,6 @@
 <mapper namespace="com.cool.bang.modules.oracle.mapper.BxmxyMapper">
 
     <select id="selectFromBxmxy" resultType="com.cool.bang.modules.oracle.domain.Bxmxy">
-        select t1.* from bxmxy t1 left join bxm t2 on t2.xmbh = t1.xmbh   where t1.state = 1 and t2.jgzt != 0
+        select t1.* from bxmxy t1 left join bxm t2 on t2.xmbh = t1.xmbh where t1.state = 1 and t1.bljd = 9 and t2.jgzt != 0
     </select>
 </mapper>

+ 65 - 0
target/classes/mapper/oracle/OracleMapper.xml

@@ -108,4 +108,69 @@
         WHERE dj.STATE = 1 AND (dj.TRADESTATE = 0 OR dj.TRADESTATE = 1 OR dj.TRADESTATE = 2)
     </select>
 
+    <!-- 用户 -->
+    <select id="selectByUser" resultType="com.cool.bang.modules.oracle.domain.OracleUser">
+        select t.loginname, t.sex, t.state, t.tel, t.typecode, t.username, t.usertype, t2.qybh, t2.qymc
+        from SUSER t left join BQY t2 on t2.qybh = t.TYPECODE where t.USERTYPE = 1 and t.state = 1 and t2.qyid is not null
+    </select>
+
+    <select id="selectHtTk" resultType="com.cool.bang.modules.oracle.domain.po.TkInfo">
+        SELECT
+            a.APPBH,tr.TRADEAMOUNT AS money,it.PAYCODE AS businessNumber,ht.LZBH AS lzbh,ht.QYBH AS qybh,ht.HTBH AS htBh,a.APPID,tr.ACCOUNTNO AS accountNo,
+            it.PAYACCOUNTNAME AS collectionName,it.PAYACCOUNTNO AS collectionAccount,ht.BUYERNAME AS buyer,
+            ht.BUYERCODE AS idCard,ht.HTBH AS htBh,it.PAYUSE AS remark
+        FROM PAYITEM it
+                 LEFT JOIN APPLY a  ON it.APPID = a.APPID  AND a.STATE =1  AND a.APPTYPE = 8
+                 LEFT JOIN BHT ht ON ht.HTID = a.HTID
+                 LEFT JOIN TRADE tr ON tr.TRADENUM = it.PAYCODE AND tr.TRADESTATE = 1
+        WHERE it.STATE =1 AND it.PAYTYPE = 8   AND a.APPBH IS NOT NULL
+    </select>
+
+    <select id="selectDDZ" resultType="com.cool.bang.modules.mysql.domain.TradeInfo">
+        SELECT
+            ID AS id,ACCOUNTNO AS accountNo,BANKSER AS serialNumber,OLDBANKSER AS flushSerialNumber,
+            TRADENUM AS businessNumber,BANKFLAG AS channelType,TRADEAMOUNT AS amount,TRADECODE  AS code,
+            CHECKFLAG AS checkStatus,CHECKDATE AS checkDate, 1 AS transactionMode,TRADEDATE AS  transactionTime,LZBH AS lzbh
+        from TRADE
+        WHERE CHECKFLAG =1
+    </select>
+
+    <select id="selectTG" resultType="com.cool.bang.modules.mysql.domain.TradeInfo">
+        SELECT
+            ID AS id,ACCOUNTNO AS accountNo,BANKSER AS serialNumber,OLDBANKSER AS flushSerialNumber,
+            TRADENUM AS businessNumber,BANKFLAG AS channelType,TRADEAMOUNT AS amount,TRADECODE  AS code,
+            CHECKFLAG AS checkStatus,CHECKDATE AS checkDate, 1 AS transactionMode,TRADEDATE AS  transactionTime,LZBH AS lzbh
+        FROM
+            trade
+        WHERE
+            accountno IN ( SELECT accountno FROM account  WHERE accountid &lt;= 8 ) AND CHECKFLAG = 2 AND TRADESTATE =1
+    </select>
+
+
+    <select id="sumByZgToTg" resultType="decimal">
+        SELECT NVL(SUM(t3.money),0)
+        FROM TRADE t
+                 left join PAYITEM t2 on t2.PAYCODE = t.TRADENUM
+                 left join PAYITEMLZ t3 on t3.PAYITEMID = t2.PAYITEMID
+                 left join AREGITEM t4 on t4.AREGITEMID = t3.AREGITEMID
+        WHERE t.ACCOUNTNO IN (SELECT ACCOUNTNO FROM ACCOUNT WHERE accountid  &lt;= 8) AND t.PAYTYPE in (16)
+          AND t4.lzbh = #{buildingNumber}
+    </select>
+
+    <select id="sumByJc" resultType="decimal">
+        SELECT NVL(SUM(TRADEAMOUNT),0)
+        FROM TRADE
+        WHERE ACCOUNTNO IN (SELECT ACCOUNTNO FROM ACCOUNT WHERE accountid &lt;= 8)
+          and CHECKFLAG = 2 AND ZJJGFLAG = 1 AND TRADESTATE = 1 AND PAYTYPE in (01) and LZBH = #{buildingNumber}
+    </select>
+
+    <select id="sumByBf" resultType="decimal">
+        SELECT NVL(SUM(t3.money),0)
+        FROM TRADE t
+                 left join PAYITEM t2 on t2.PAYCODE = t.TRADENUM
+                 left join PAYITEMLZ t3 on t3.PAYITEMID = t2.PAYITEMID
+                 left join AREGITEM t4 on t4.AREGITEMID = t3.AREGITEMID
+        WHERE t.ACCOUNTNO IN (SELECT ACCOUNTNO FROM ACCOUNT WHERE accountid  &lt;= 8) AND t.PAYTYPE in (18,19,20)
+          AND t4.lzbh = #{buildingNumber}
+    </select>
 </mapper>