|
@@ -5,6 +5,7 @@ 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.domain.mysql.MysqlUser;
|
|
|
import com.cool.bang.modules.mysql.mapper.*;
|
|
|
import com.cool.bang.modules.oracle.domain.*;
|
|
|
import com.cool.bang.modules.oracle.domain.po.*;
|
|
@@ -182,11 +183,13 @@ public class MySQLSecondService {
|
|
|
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);
|
|
|
- }
|
|
|
+
|
|
|
+ // Long projectAccountId = (null != buildingAccount && null != buildingAccount.getProjectAccountId()) ? buildingAccount.getProjectAccountId() : null;
|
|
|
+ // ProjectAccount projectAccount = null;
|
|
|
+ // if (null != projectAccountId) {
|
|
|
+ // projectAccount = projectAccountMapper.getInfoById(projectAccountId);
|
|
|
+ // }
|
|
|
+ ProjectAccount projectAccount = projectAccountMapper.selectByAregid(item.getAregId());
|
|
|
Account account = null;
|
|
|
|
|
|
if (!StringUtils.isEmpty(item.getAccountNo())) {
|
|
@@ -256,6 +259,41 @@ public class MySQLSecondService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 项目对账
|
|
|
+ */
|
|
|
+ public void projectCheck() {
|
|
|
+ List<Map<String, Object>> tgXm = mySqlMapper.selectTgXm();
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
+ list.add("企业名称;项目名称;项目金额;楼幢金额;是否一致;余额差值");
|
|
|
+ for (Map<String, Object> map : tgXm) {
|
|
|
+ // 项目虚拟户
|
|
|
+ List<Map<String, Object>> xmAccount = mySqlMapper.selectXmAccountByProjectId((Long) map.get("id"));
|
|
|
+ BigDecimal projectBalance = new BigDecimal("0");
|
|
|
+ BigDecimal buildingBalance = new BigDecimal("0");
|
|
|
+ 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) {
|
|
|
+ buildingBalance = buildingBalance.add((BigDecimal) building.get("account_balance"));
|
|
|
+ }
|
|
|
+ projectBalance = projectBalance.add((BigDecimal) account.get("trusteeship_balance"));
|
|
|
+ }
|
|
|
+ StringBuilder str = new StringBuilder();
|
|
|
+ str.append(map.get("org_name").toString())
|
|
|
+ .append(";" + map.get("project_name").toString())
|
|
|
+ .append(";" + projectBalance)
|
|
|
+ .append(";" + buildingBalance)
|
|
|
+ .append(";" + (projectBalance.compareTo(buildingBalance) == 0 ? "是" : "否"))
|
|
|
+ .append(";" + (projectBalance.subtract(buildingBalance)));
|
|
|
+ // System.out.println(str.toString());
|
|
|
+ list.add(str.toString());
|
|
|
+ }
|
|
|
+ for (String str : list) {
|
|
|
+ System.out.println(str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 银行账户对账
|
|
|
*/
|
|
@@ -265,7 +303,7 @@ public class MySQLSecondService {
|
|
|
List<Account> appropriations = oracleMapper.getWdzBf();
|
|
|
|
|
|
List<String> systemOut = new ArrayList<>();
|
|
|
- systemOut.add("银行名称;银行编号;交存;支出;未对账交存;未对账支出;计算;账户余额;差值");
|
|
|
+ systemOut.add("银行名称;银行编号;交存;支出;未对账交存;未对账支出;计算;项目;账户余额;差值;项目差值;最终差值");
|
|
|
for (Account account : list) {
|
|
|
|
|
|
BigDecimal payment = BigDecimal.ZERO;
|
|
@@ -298,6 +336,14 @@ public class MySQLSecondService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ BigDecimal projectBalance = BigDecimal.ZERO;
|
|
|
+ List<ProjectAccount> projects = mySqlMapper.selectTgProjectAccountInfo(account.getBankCode());
|
|
|
+ for (ProjectAccount project : projects) {
|
|
|
+ if (project.getTrusteeshipBalance() != null) {
|
|
|
+ projectBalance = projectBalance.add(project.getTrusteeshipBalance());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
StringBuilder str = new StringBuilder();
|
|
|
str.append(account.getBankName())
|
|
|
.append(";" + account.getBankCode())
|
|
@@ -306,8 +352,11 @@ public class MySQLSecondService {
|
|
|
.append(";" + notPayment)
|
|
|
.append(";" + notAppropriation)
|
|
|
.append(";" + payment.subtract(appropriation))
|
|
|
+ .append(";" + projectBalance)
|
|
|
.append(";" + account.getAccountBalance())
|
|
|
- .append(";" + (payment.subtract(appropriation)).subtract(account.getAccountBalance()));
|
|
|
+ .append(";" + (payment.subtract(appropriation)).subtract(account.getAccountBalance()))
|
|
|
+ .append(";" + account.getAccountBalance().subtract(projectBalance))
|
|
|
+ .append(";" + (account.getAccountBalance().subtract(projectBalance)).add(notPayment).subtract(notAppropriation));
|
|
|
systemOut.add(str.toString());
|
|
|
}
|
|
|
|