admin
2018-12-06 c8f771829c45debdc74c47f60d63dcf3137cf92b
删除原有收藏
4个文件已删除
2个文件已修改
798 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/goods/CollectionGoodsDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/CollectionGoods.java 496 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ExtractMapper.xml 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsFactory.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsV2Factory.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/goods/CollectionGoodsDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/CollectionGoods.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/mapping/ExtractMapper.xml
@@ -12,7 +12,7 @@
        <result column="state" property="state" jdbcType="INTEGER" />
        <result column="type" property="type" jdbcType="INTEGER" />
        <result column="adminId" property="adminId" jdbcType="BIGINT" />
        <association property="userInfo" column="uid"
            select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey">
        </association>
@@ -20,7 +20,7 @@
        <association property="system" column="sid"
            select="com.yeshi.fanli.dao.mybatis.SystemMapper.selectByPrimaryKey">
        </association>
    </resultMap>
    <sql id="Base_Column_List">
        id,account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId
@@ -32,7 +32,7 @@
        from yeshi_ec_extract
        where id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
@@ -40,9 +40,9 @@
        from yeshi_ec_extract
        where id = #{id,jdbcType=BIGINT} for update
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from
@@ -110,7 +110,7 @@
            <if test="system != null">
                adminId,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
@@ -226,92 +226,116 @@
        where id =
        #{id,jdbcType=BIGINT}
    </update>
    <select id="checkExtract" resultType="java.lang.Integer">
    <![CDATA[
         select ABS(ttt.totalmoney-ttt.hbmoney)<0.001
     ]]>
          from
        (select u.my_hongBao,s.uid AS uid,s.money AS hbmoney,IF(ss.money IS NOT NULL,ss.money,0) + u.my_hongBao+IF( dd.`money` IS NOT NULL,dd.money,0)  AS totalmoney  FROM yeshi_ec_user u
        left join  (select h.uid,SUM(h.money) AS money FROM yeshi_ec_hongbao h  WHERE  h.state=3  AND h.uid = #{uid,jdbcType=BIGINT}  GROUP BY h.uid)s  ON u.id=s.uid
        left join  (SELECT  SUM(t.`money`)AS money,t.uid FROM yeshi_ec_extract t WHERE (t.state=0 OR t.state=1) AND t.`uid`= #{uid,jdbcType=BIGINT}  GROUP BY t.uid)ss ON ss.uid=u.id
        LEFT JOIN  (SELECT  ABS (SUM(d.money)) AS money,d.`uid` FROM yeshi_ec_account_details d WHERE d.type=10 OR d.type=9 GROUP BY d.`uid`)  dd ON dd.uid=u.`id`
        where s.uid IS NOT NULL AND s.money!= u.my_hongbao)ttt
        left join yeshi_ec_user u ON ttt.uid=u.`id` WHERE ttt.hbmoney!=ttt.totalmoney
        <![CDATA[
         SELECT ABS(ttt.totalmoney-ttt.hbmoney)<0.001
         ]]>
        FROM
        (
        SELECT u.my_hongBao,s.uid AS uid,s.money AS hbmoney,IF(ss.money IS NOT
        NULL,ss.money,0) + u.my_hongBao+IF( dd.`money` IS NOT NULL,dd.money,0)
        +IF( cc.`money` IS NOT NULL,cc.money,0) AS totalmoney FROM
        yeshi_ec_user u
        LEFT JOIN (SELECT h.uid,SUM(h.money) AS money FROM yeshi_ec_hongbao h
        WHERE h.state=3 AND h.uid = #{uid,jdbcType=BIGINT} GROUP BY h.uid)s ON
        u.id=s.uid
        LEFT JOIN (SELECT SUM(t.`money`)AS money,t.uid FROM yeshi_ec_extract t
        WHERE (t.state=0 OR t.state=1) AND t.`uid`=#{uid,jdbcType=BIGINT}
        GROUP BY t.uid)ss ON ss.uid=u.id
        LEFT JOIN (SELECT ABS (SUM(d.money)) AS money,d.`uid` FROM
        yeshi_ec_account_details d WHERE (d.type=10 OR d.type=9 ) AND d.uid=
        #{uid,jdbcType=BIGINT} GROUP BY d.`uid`) dd ON dd.uid=u.`id`
        LEFT JOIN (SELECT SUM(c.ecc_money) AS money,c.`ecc_uid` AS uid FROM
        `yeshi_ec_extract_check_compensate` c WHERE
        c.ecc_uid=#{uid,jdbcType=BIGINT} GROUP BY c.ecc_uid) cc ON
        cc.uid=u.`id`
        WHERE s.uid IS NOT NULL AND s.money!= u.my_hongbao) ttt
        LEFT JOIN yeshi_ec_user u ON ttt.uid=u.`id` WHERE
        ttt.hbmoney!=ttt.totalmoney
    </select>
    <select id="getTodayCount" resultType="java.util.HashMap">
         SELECT IFNULL(COUNT(et.id), 0)AS total,IFNULL(SUM(CASE WHEN et.state = 1 THEN 1 ELSE 0 END),0) AS succeed,IFNULL(SUM(CASE WHEN et.state = 2 THEN 1 ELSE 0 END),0) AS fails
         FROM yeshi_ec_extract et  WHERE  (et.state=1 OR et.state= 2) AND
        SELECT IFNULL(COUNT(et.id), 0)AS total,IFNULL(SUM(CASE WHEN et.state =
        1 THEN 1 ELSE 0 END),0) AS succeed,IFNULL(SUM(CASE WHEN et.state = 2
        THEN 1 ELSE 0 END),0) AS fails
        FROM yeshi_ec_extract et WHERE (et.state=1 OR et.state= 2) AND
         <![CDATA[
             FROM_UNIXTIME(et.extractTime/1000) >=CURDATE();
         ]]>
         ]]>
    </select>
    <select id="getTodayTotalSuccessMoney" resultType="java.math.BigDecimal">
         SELECT  IFNULL(ROUND(SUM(money),2) ,0) AS moneys
          FROM yeshi_ec_extract et  WHERE  et.state=1  AND
        SELECT IFNULL(ROUND(SUM(money),2) ,0) AS moneys
        FROM yeshi_ec_extract et WHERE et.state=1 AND
          <![CDATA[
             FROM_UNIXTIME(et.extractTime/1000) >=CURDATE();
         ]]>
         ]]>
    </select>
    <select id="countTotalSuccess" resultType="java.util.HashMap">
        <!-- 提现成功 次数、总金额 -->
        SELECT IFNULL(ROUND(SUM(money),2),0) AS totalmoney,
            IFNULL(COUNT(et.id),0) AS totalamount FROM yeshi_ec_extract et  WHERE  et.state=1
        IFNULL(COUNT(et.id),0) AS totalamount FROM yeshi_ec_extract et WHERE
        et.state=1
    </select>
   <select id="getMyTaskInfo" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_extract
        WHERE adminId = ${adminId} and state=0     ORDER BY extractTime  LIMIT 0,1
   </select>
    <select id="getMyTaskInfo" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_extract
        WHERE adminId = ${adminId} and state=0 ORDER BY extractTime LIMIT 0,1
    </select>
    <select id="getNewTaskInfo" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_extract
        WHERE  state=0    ORDER BY extractTime  LIMIT 0,1
   </select>
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_extract
        WHERE state=0 ORDER BY extractTime LIMIT 0,1
    </select>
    <select id="countRecordsByUid" resultType="java.util.HashMap">
       SELECT IFNULL(COUNT(et.id), 0) AS totalamount,IFNULL(SUM(CASE WHEN et.state = 1 THEN 1 ELSE 0 END),0) AS succeed,
               IFNULL(SUM(CASE WHEN et.state = 2 THEN 1 ELSE 0 END),0) AS fail
        FROM yeshi_ec_extract et  WHERE  (et.state=1 OR et.state= 2)  AND et.uid = ${uid}
        SELECT IFNULL(COUNT(et.id), 0) AS totalamount,IFNULL(SUM(CASE WHEN et.state
        = 1 THEN 1 ELSE 0 END),0) AS succeed,
        IFNULL(SUM(CASE WHEN et.state = 2 THEN 1 ELSE 0 END),0) AS fail
        FROM yeshi_ec_extract
        et WHERE (et.state=1 OR et.state= 2) AND et.uid = ${uid}
    </select>
     <select id="countSuccessMoneysByUid" resultType="java.lang.Double">
      SELECT  IFNULL(ROUND(SUM(et.money),2),0) AS moneys  FROM yeshi_ec_extract et
         WHERE  et.state=1 AND et.uid = ${uid}
    <select id="countSuccessMoneysByUid" resultType="java.lang.Double">
        SELECT IFNULL(ROUND(SUM(et.money),2),0) AS moneys FROM yeshi_ec_extract et
        WHERE et.state=1 AND et.uid = ${uid}
    </select>
    <select id="countSuccessByUid" resultType="java.lang.Long">
      SELECT   COUNT(et.id)  FROM yeshi_ec_extract et
         WHERE  et.state=1 AND et.uid = ${uid}
        SELECT COUNT(et.id) FROM yeshi_ec_extract et
        WHERE et.state=1 AND et.uid = ${uid}
    </select>
    <select id="getFinishRecord" resultType="java.util.Map">
        SELECT ex.*,ar.*  FROM yeshi_ec_extract ex LEFT JOIN yeshi_ec_extract_audit_record ar ON ar.extractId=ex.id
            WHERE
        SELECT ex.*,ar.* FROM yeshi_ec_extract ex LEFT JOIN
        yeshi_ec_extract_audit_record ar ON ar.extractId=ex.id
        WHERE
      <![CDATA[
            FROM_UNIXTIME(ex.extractTime/1000)  >= #{startTime}
               AND  FROM_UNIXTIME(ex.extractTime/1000) <= #{endTime} 
       ]]>
       <if test='key != null and key != ""'>
               AND (ex.uid = #{key} OR ar.aid = #{key})
           </if>
        ORDER BY ex.extractTime DESC  LIMIT ${start},${count}
   </select>
     <select id="countTodayApply" resultType="java.lang.Integer">
        SELECT count(id)  FROM yeshi_ec_extract
            WHERE  <![CDATA[ FROM_UNIXTIME(extractTime/1000) >=CURDATE() ]]>
        <if test='key != null and key != ""'>
            AND (ex.uid = #{key} OR ar.aid = #{key})
        </if>
        ORDER BY ex.extractTime DESC LIMIT ${start},${count}
    </select>
    <select id="countTodayApply" resultType="java.lang.Integer">
        SELECT count(id) FROM yeshi_ec_extract
        WHERE  <![CDATA[ FROM_UNIXTIME(extractTime/1000) >=CURDATE() ]]>
    </select>
    <select id="countTodayComplete" resultType="java.lang.Integer">
        SELECT count(id)  FROM yeshi_ec_extract
            WHERE (state=1 OR state= 2) <![CDATA[AND  FROM_UNIXTIME(extractTime/1000) >=CURDATE() ]]>
        SELECT count(id) FROM yeshi_ec_extract
        WHERE (state=1 OR state= 2) <![CDATA[AND  FROM_UNIXTIME(extractTime/1000) >=CURDATE() ]]>
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsFactory.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsV2Factory.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -36,8 +36,6 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.user.CollectionGoods;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.common.ImageInfo;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.taobao.ScanHistory;
@@ -1063,30 +1061,6 @@
        return tb;
    }
    public static TaoBaoGoodsBrief getTaoBaoGoodsBrief(CollectionGoods sh) {
        TaoBaoGoodsBrief tb = new TaoBaoGoodsBrief();
        Field[] fields = tb.getClass().getDeclaredFields();
        Field[] shFields = sh.getClass().getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            Field field = fields[i];
            field.setAccessible(true);
            try {
                for (Field target : shFields) {
                    target.setAccessible(true);
                    if (target.getName().equalsIgnoreCase(field.getName())) {
                        if (!"createtime".equalsIgnoreCase(field.getName()))
                            field.set(tb, target.get(sh));
                        break;
                    }
                }
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return tb;
    }
    public static ScanHistory getScanHistory(TaoBaoGoodsBrief tb) {
        ScanHistory sh = new ScanHistory();
@@ -1393,66 +1367,7 @@
        return taoBaoGoodsBrief;
    }
    public static CollectionGoods getCollectionGoods(long auctionId, UserInfo userInfo) {
        TaoBaoGoodsBrief taoBaoGoodsBrief = null;
        try {
            taoBaoGoodsBrief = TaoKeApiUtil.searchGoodsDetail(auctionId);
        } catch (TaobaoGoodsDownException e1) {
            e1.printStackTrace();
        }
        CollectionGoods collectionGoods = new CollectionGoods();
        Field[] fields = taoBaoGoodsBrief.getClass().getDeclaredFields();
        Field[] shFields = collectionGoods.getClass().getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            Field field = fields[i];
            field.setAccessible(true);
            try {
                for (Field target : shFields) {
                    target.setAccessible(true);
                    if (target.getName().equalsIgnoreCase(field.getName())) {
                        if (!field.getName().equalsIgnoreCase("createTime"))
                            target.set(collectionGoods, field.get(taoBaoGoodsBrief));
                        break;
                    }
                }
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        collectionGoods.setUserInfo(userInfo);
        return collectionGoods;
    }
    public static CollectionGoods getCollectionGoods(TaoBaoGoodsBrief taoBaoGoodsBrief, UserInfo userInfo) {
        if (taoBaoGoodsBrief == null)
            return null;
        CollectionGoods collectionGoods = new CollectionGoods();
        Field[] fields = taoBaoGoodsBrief.getClass().getDeclaredFields();
        Field[] shFields = collectionGoods.getClass().getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            Field field = fields[i];
            field.setAccessible(true);
            try {
                for (Field target : shFields) {
                    target.setAccessible(true);
                    if (target.getName().equalsIgnoreCase(field.getName())) {
                        if (!field.getName().equalsIgnoreCase("createTime"))
                            target.set(collectionGoods, field.get(taoBaoGoodsBrief));
                        break;
                    }
                }
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        collectionGoods.setUserInfo(userInfo);
        return collectionGoods;
    }
    /**
     * 获取商品的用户分成比例