瀏覽代碼

代码提交

171250443 1 年之前
父節點
當前提交
005a392672

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

@@ -145,15 +145,16 @@ public class BuildingAccount {
         this.keepPercentage = aregItem.getLcbl();
         this.keepAmount = aregItem.getLcje();
         this.superviseAmount = aregItem.getJgzj();
+        this.inTransitFund = new BigDecimal("0");
 
         this.accountType = project.getType();
         // 若为监管项目时,楼幢虚拟户中不记录账户余额和在途资金 默认为0
-        if (accountType == 0){
+        if (accountType == 2) {
             this.accountBalance = BigDecimal.ZERO;
             this.inTransitFund = BigDecimal.ZERO;
-        }else {
-            this.accountBalance = aregItem.getTgye();
-            this.inTransitFund = aregItem.getTgzt();
+        } else {
+            this.accountBalance = aregItem.getTgye() == null?BigDecimal.ZERO:aregItem.getTgye();
+            this.inTransitFund = BigDecimal.ZERO;
         }
 
         if (project.getType() == 1 && aregItem.getJazj().compareTo(2500) == 0) {

+ 3 - 3
src/main/java/com/cool/bang/modules/mysql/domain/ProjectAccount.java

@@ -105,7 +105,7 @@ public class ProjectAccount {
 
     public ProjectAccount(){}
 
-    public ProjectAccount(Project project, Areg areg){
+    public ProjectAccount(Project project, Areg areg) {
 
         List<AregItem> aregItemList = areg.getAregItemList();
 
@@ -156,8 +156,8 @@ public class ProjectAccount {
         //this.keepAmount = areg.getLcje();//留存金额 (楼幢监管面积 * 楼幢建筑成本 * 楼幢留存比例) lcje
         this.trusteeshipBalance = tgye;//托管余额 checkbacnlce
         this.superviseBalance = jgye;//监管余额 checkjgbanlece
-        this.trusteeshipInTransitFund = tgzt;//托管在途资金
-        this.superviseInTransitFund = jgzt;//监管在途资金
+        this.trusteeshipInTransitFund = new BigDecimal("0");//托管在途资金
+        this.superviseInTransitFund = new BigDecimal("0");//监管在途资金
         this.buildCostId = project.getBuildCostId();
         this.buildCostName = project.getBuildCostName();
         this.createTime = areg.getXmrq();

+ 20 - 0
src/main/java/com/cool/bang/modules/mysql/service/MySQLService.java

@@ -78,6 +78,26 @@ public class MySQLService {
                 continue;
             }
             Project project = new Project(map);
+            List<Map<String, Object>> aregs = oracleMapper.selectAregByXmbh((String) map.get("XMBH"));
+            boolean jg = false;
+            if (aregs.size() == 1) {
+                String jsstate = (String) aregs.get(0).get("JGSTATE");
+                if (jsstate.equals("-1")) {
+                    project.setState(0);
+                }
+                if (jsstate.equals("1")) {
+                    project.setState(1);
+                }
+            } else {
+                for (Map<String, Object> areg : aregs) {
+                    String jsstate = (String) aregs.get(0).get("JGSTATE");
+                    if (jsstate.equals("1")) {
+                        jg = true;
+                    }
+                }
+                project.setState(jg?1:-1);
+            }
+
             Org org = qyxxMapper.selectOrgByMisid(Integer.parseInt(map.get("QYBH").toString().trim()));
 //            if (org == null){
 //                project.setOrgId(0);

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

@@ -11,6 +11,8 @@ import java.util.Map;
 public interface OracleMapper {
     List<Map<String, Object>> selectFromBxm();
 
+    List<Map<String, Object>> selectAregByXmbh(String xmbh);
+
     List<Map<String, Object>> selectFromAreg();
 
     List<Map<String,Object>> selectFromAccount();

+ 1 - 1
src/main/resources/mapper/oracle/AregMapper.xml

@@ -10,7 +10,7 @@
         <result property="jgje"        column="jgje"        jdbcType="DECIMAL"/>
         <result property="lcje"        column="lcje"        jdbcType="DECIMAL"/>
         <result property="tgzh"        column="tgzh"        jdbcType="VARCHAR"/>
-        <result property="xmrq"        column="khrq"        jdbcType="TIMESTAMP"/>
+        <result property="xmrq"        column="xmrq"        jdbcType="TIMESTAMP"/>
         <collection property="aregItemList"  ofType="com.cool.bang.modules.oracle.domain.AregItem" >
             <result property="aregitemid"     column="aregitemid"   jdbcType="INTEGER"/>
             <result property="lzbh"           column="lzbh"         jdbcType="VARCHAR"/>

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

@@ -9,6 +9,10 @@
         where t1.xmbh in (select XMBH from areg group by XMBH)
     </select>
 
+    <select id="selectAregByXmbh" resultType="java.util.Map">
+        select XMBH, JGSTATE from AREG where XMBH = #{xmbh}
+    </select>
+
     <select id="selectFromAreg" resultType="java.util.Map">
         select t1.*,t3.name as BANKNAME,t3.code as BANKCODE
         from

二進制
target/classes/com/cool/bang/modules/mysql/domain/BuildingAccount.class


二進制
target/classes/com/cool/bang/modules/mysql/domain/ProjectAccount.class


二進制
target/classes/com/cool/bang/modules/mysql/service/MySQLService.class


二進制
target/classes/com/cool/bang/modules/oracle/mapper/OracleMapper.class


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

@@ -10,7 +10,7 @@
         <result property="jgje"        column="jgje"        jdbcType="DECIMAL"/>
         <result property="lcje"        column="lcje"        jdbcType="DECIMAL"/>
         <result property="tgzh"        column="tgzh"        jdbcType="VARCHAR"/>
-        <result property="xmrq"        column="khrq"        jdbcType="TIMESTAMP"/>
+        <result property="xmrq"        column="xmrq"        jdbcType="TIMESTAMP"/>
         <collection property="aregItemList"  ofType="com.cool.bang.modules.oracle.domain.AregItem" >
             <result property="aregitemid"     column="aregitemid"   jdbcType="INTEGER"/>
             <result property="lzbh"           column="lzbh"         jdbcType="VARCHAR"/>

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

@@ -9,6 +9,10 @@
         where t1.xmbh in (select XMBH from areg group by XMBH)
     </select>
 
+    <select id="selectAregByXmbh" resultType="java.util.Map">
+        select XMBH, JGSTATE from AREG where XMBH = #{xmbh}
+    </select>
+
     <select id="selectFromAreg" resultType="java.util.Map">
         select t1.*,t3.name as BANKNAME,t3.code as BANKCODE
         from