2 Commits 94e04765d9 ... 1cf28495bf

Autor SHA1 Mensagem Data
  171250443 1cf28495bf Merge branch 'master' of http://175.27.189.80:3000/souguang/sg_zjjg_sjqy 1 ano atrás
  171250443 005a392672 代码提交 1 ano atrás

+ 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

@@ -79,6 +79,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

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


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


BIN
target/classes/com/cool/bang/modules/mysql/service/MySQLService.class


BIN
target/classes/com/cool/bang/modules/oracle/mapper/OracleMapper.class


+ 86 - 0
target/classes/mapper/oracle/AregMapper.xml

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.cool.bang.modules.oracle.mapper.AregMapper">
+
+    <resultMap id="AregMap" type="com.cool.bang.modules.oracle.domain.Areg">
+        <id property="aregid" column="aregid"/>
+        <result property="qybh"        column="qybh"        jdbcType="VARCHAR"/>
+        <result property="xmbh"        column="xmbh"        jdbcType="VARCHAR"/>
+        <result property="jgState"     column="jgstate"     jdbcType="INTEGER"/>
+        <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="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"/>
+            <result property="bhpercent"      column="bhpercent"    jdbcType="INTEGER"/>
+            <result property="jdpercent"      column="jdpercent"    jdbcType="INTEGER"/>
+            <result property="propercent"     column="propercent"   jdbcType="INTEGER"/>
+            <result property="progressname"   column="progressname" jdbcType="VARCHAR"/>
+            <result property="jgye"           column="jgye"         jdbcType="DECIMAL"/>
+            <result property="tgye"           column="tgye"         jdbcType="DECIMAL"/>
+            <result property="jgzt"           column="jgzt"         jdbcType="DECIMAL"/>
+            <result property="jazj"           column="jazj"         jdbcType="INTEGER"/>
+            <result property="lcbl"           column="lcbl"         jdbcType="DECIMAL"/>
+            <result property="lcje"           column="lcje"         jdbcType="DECIMAL"/>
+            <result property="jgzj"           column="jgzj"         jdbcType="DECIMAL"/>
+            <result property="jgState"        column="lz_jgstate"   jdbcType="INTEGER"/>
+            <result property="jzmj"           column="jzmj"         jdbcType="DECIMAL"/>
+            <result property="lzrq"           column="lzrq"        jdbcType="TIMESTAMP"/>
+        </collection>
+    </resultMap>
+
+    <select id="selectFromAreg" resultMap="AregMap">
+        SELECT
+            t1.aregid,
+            t1.qybh,
+            t1.xmbh,
+            t1.jgstate,
+            t1.zdmoney AS jgje,
+            t2.lcje,
+            t3.accountno AS tgzh,
+            t2.aregitemid,
+            t2.lzmc,
+            t2.lzbh,
+            t2.jiananzaojia AS jazj,
+            t2.bhpercent,
+            t2.jdpercent,
+            t2.propercent,
+            t2.progressname,
+            t2.jzmj,
+            t2.checkbalance AS tgye,
+            t2.checkjgbalance AS jgye,
+            t2.lcbl,
+            t2.lcje,
+            t2.zdmoney AS jgzj,
+            t2.jgstate AS lz_jgstate,
+            to_date(to_char(t4.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as xmrq,
+            to_date(to_char(t5.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as lzrq
+        FROM
+            AREG t1
+                LEFT JOIN AREGITEM t2 ON t1.aregid = t2.aregid
+                LEFT JOIN account t3 ON t1.tgzhid = t3.accountid
+                LEFT JOIN APPLY t4 on t1.aregid = t4.aregid AND t4.APPTYPE = 0 and t4.state = 1
+                LEFT JOIN APPLY t5 on t2.appid = t5.appid AND t4.APPTYPE in (0, 2) and t4.state = 1
+        WHERE
+            t1.state = 1 and t1.jgzt != 0
+    </select>
+
+    <!--  查询楼幢虚拟户托管在途资金  -->
+    <select id="selectLzTgzt" resultType="java.math.BigDecimal">
+        select sum(pl.money) from aregitem i,payitemlz pl, payitem p,apply a
+        where a.appid =p.appid and p.payitemid =pl.payitemid and pl.aregitemid =i.aregitemid
+        and a.state ='1' and p.state ='1' and pl.state ='1' and a.apptype in ('18','19') and p.paycode  not in (select t.tradenum from trade t where t.tradestate ='1' and t.tradenum is not null)
+        and i.aregitemid = #{aregitemid}
+    </select>
+
+    <!--  查询楼幢虚拟户监管在途资金  -->
+    <select id="selectLzJgzt" resultType="java.math.BigDecimal">
+        select sum(pl.money) from aregitem i,payitemlz pl, payitem p,apply a
+        where a.appid =p.appid and p.payitemid =pl.payitemid and pl.aregitemid =i.aregitemid
+        and a.state ='1' and p.state ='1' and pl.state ='1' and a.apptype in ('6','7') and p.paycode  not in (select t.tradenum from trade t where t.tradestate ='1' and t.tradenum is not null)
+        and i.aregitemid = #{aregitemid}
+    </select>
+
+</mapper>

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

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.cool.bang.modules.oracle.mapper.OracleMapper">
+
+    <select id="selectFromBxm" resultType="java.util.Map">
+        select t1.*, t2.qymc, t3.SPJSSJ from BXM t1
+            left join BQY t2 on t1.qybh = t2.qybh
+            left join (select t.* from (select t.XMBH, to_date(to_char(t2.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as SPJSSJ, ROW_NUMBER() OVER (PARTITION BY t.XMBH ORDER BY t.XMBH DESC) rn from AREG t left join APPLY t2 on t2.AREGID = t.AREGID and t2.APPTYPE = 0 and T2.STATE = 1) t  where t.rn = 1) t3 on t3.XMBH = t1.XMBH
+        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
+            AREG t1
+        LEFT JOIN
+            ACCOUNT t2 on t1.aregid = t2.aregid
+        left join
+            BANK t3 on t2.bankcode = t3.code
+    </select>
+
+    <select id="selectFromAccount" resultType="java.util.Map">
+        SELECT t1.ACCOUNTID,t4.QYBH,t1.ACCOUNTNAME,t1.ACCOUNTNO,t1.BANKCODE,t2.NAME as BANKNAME,t3.NAME as OPENADDRESS,t4.XMMC,t4.XMBH,
+        t1.JGSTATE,t1.BALANCE as ACCOUNTBALANCE,t1.BALANCE as BOOKBALANCE ,t1.STATE,
+        t1.ACCOUNTTYPE as TYPE,t1.FREEZE,to_date(to_char(t5.SPJSSJ,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') as KHRQ
+        FROM ACCOUNT t1
+        LEFT JOIN BANK t2 on t1.BANKCODE = t2.code
+        LEFT JOIN BRANCH t3 on t1.BRANCHCODE = t3.code
+        LEFT JOIN AREG t4 on t1.AREGID = t4.AREGID
+        LEFT JOIN APPLY t5 on t1.APPID = t5.APPID AND t5.APPTYPE = 0
+        WHERE ACCOUNTNAME IS NOT NULL
+    </select>
+
+    <!--  查询账户(托管户/监管户)在途资金  -->
+    <select id="selectAccountInTransitFund" resultType="java.math.BigDecimal">
+        select sum(p.money) zhztzj from apply a,payitem p where a.appid =p.appid and p.state ='1' and a.state ='1'
+        and p.paycode not in (select t.tradenum from trade t where t.tradestate ='1' and tradenum is not null) and p.accountid = #{accountid}
+    </select>
+
+    <!--  查询工程进度申请信息  -->
+    <resultMap id="GcjdsqMap" type="com.cool.bang.modules.oracle.domain.po.Gcjdsq">
+        <result property="id"        column="progressid"   jdbcType="VARCHAR"/>
+        <result property="xmbh"      column="xmbh"         jdbcType="VARCHAR"/>
+        <result property="qybh"      column="qybh"         jdbcType="VARCHAR"/>
+        <result property="jdmc"      column="name"         jdbcType="VARCHAR"/>
+        <result property="lzbh"      column="lzbh"         jdbcType="VARCHAR"/>
+        <result property="sqjd"      column="percent"      jdbcType="DECIMAL"/>
+        <result property="aregid"    column="regid"        jdbcType="INTEGER"/>
+        <result property="shzt"      column="taskstate"    jdbcType="INTEGER"/>
+        <result property="bz"        column="taskopinion"  jdbcType="VARCHAR"/>
+        <result property="sqr"       column="sqr"          jdbcType="VARCHAR"/>
+        <result property="sqsj"      column="sqsj"         jdbcType="TIMESTAMP"/>
+        <result property="shsj"      column="shsj"         jdbcType="TIMESTAMP"/>
+    </resultMap>
+    <select id="selectPromProgress" resultMap="GcjdsqMap">
+        select * from progress where state = 1 and taskstate is not null
+    </select>
+
+
+</mapper>