Эх сурвалжийг харах

提交portal模块功能修改:功能包括(走马灯功能:)

qiubo 4 жил өмнө
parent
commit
5085b1a7bd
49 өөрчлөгдсөн 2644 нэмэгдсэн , 49 устгасан
  1. 12 0
      forest-admin/admin-mbg/src/main/java/com/hwrj/cloud/admin/model/SmsHomeAdvertise.java
  2. 60 0
      forest-admin/admin-mbg/src/main/java/com/hwrj/cloud/admin/model/SmsHomeAdvertiseExample.java
  3. 22 5
      forest-admin/admin-mbg/src/main/resources/com/hwrj/cloud/admin/mapper/SmsHomeAdvertiseMapper.xml
  4. 1 1
      forest-admin/admin-mbg/src/main/resources/generatorConfig.xml
  5. 7 0
      forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/controller/SmsHomeAdvertiseController.java
  6. 10 0
      forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/dao/AdvertiseDao.java
  7. 1 1
      forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/service/impl/CmsSubjectServiceImpl.java
  8. 37 1
      forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/service/impl/SmsHomeAdvertiseServiceImpl.java
  9. 15 0
      forest-admin/admin-server/src/main/resources/dao/AdvertiseDao.xml
  10. 1 1
      forest-admin/admin-server/src/main/resources/dao/UmsCompanyInfoDao.xml
  11. 17 1
      forest-common/pom.xml
  12. 1478 0
      forest-common/src/main/java/com/hwrj/cloud/common/util/DateCommonUtil.java
  13. 6 0
      forest-common/src/main/java/com/hwrj/cloud/common/util/StringUtil.java
  14. 4 1
      forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/mapper/UmsCompanyInfoMapper.java
  15. 13 1
      forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/model/SmsHomeAdvertise.java
  16. 60 0
      forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/model/SmsHomeAdvertiseExample.java
  17. 22 5
      forest-portal/portal-mbg/src/main/resources/com/hwrj/cloud/portal/mapper/SmsHomeAdvertiseMapper.xml
  18. 1 1
      forest-portal/portal-mbg/src/main/resources/generatorConfig.xml
  19. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/FileUploadController.java
  20. 4 5
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/HomeController.java
  21. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/MemberAttentionController.java
  22. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/MemberProductCollectionController.java
  23. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/MemberReadHistoryController.java
  24. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/OmePreItemController.java
  25. 1 2
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/OmsCartItemController.java
  26. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/OmsPortalOrderController.java
  27. 1 2
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/OmsPortalOrderReturnApplyController.java
  28. 1 0
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/PmsBasePositiontController.java
  29. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/PmsPortalProductController.java
  30. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/PortalBrandController.java
  31. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/PortalProductPublishController.java
  32. 1 2
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/SubjectController.java
  33. 11 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/UmsCompanyInfoController.java
  34. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/UmsMemberController.java
  35. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/UmsMemberCouponController.java
  36. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/UmsMemberReceiveAddressController.java
  37. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/WechatH5Controller.java
  38. 1 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/WechatH5PayController.java
  39. 5 0
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/dao/HomeDao.java
  40. 41 0
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/dao/UmsCompanyInfoDao.java
  41. 6 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/domain/HomeContentResult.java
  42. 6 0
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/CouponService.java
  43. 5 0
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/HomeService.java
  44. 10 0
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/UmsCompanyInfoService.java
  45. 13 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/impl/CouponServiceImpl.java
  46. 21 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/impl/HomeServiceImpl.java
  47. 19 1
      forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/impl/UmsCompanyInfoServiceImpl.java
  48. 12 1
      forest-portal/portal-server/src/main/resources/dao/HomeDao.xml
  49. 706 0
      forest-portal/portal-server/src/main/resources/dao/UmsCompanyInfoDao.xml

+ 12 - 0
forest-admin/admin-mbg/src/main/java/com/hwrj/cloud/admin/model/SmsHomeAdvertise.java

@@ -36,6 +36,9 @@ public class SmsHomeAdvertise implements Serializable {
     @ApiModelProperty(value = "排序")
     private Integer sort;
 
+    @ApiModelProperty(value = "弹窗时间单位毫秒")
+    private Long jumpTime;
+
     private static final long serialVersionUID = 1L;
 
     public Long getId() {
@@ -134,6 +137,14 @@ public class SmsHomeAdvertise implements Serializable {
         this.sort = sort;
     }
 
+    public Long getJumpTime() {
+        return jumpTime;
+    }
+
+    public void setJumpTime(Long jumpTime) {
+        this.jumpTime = jumpTime;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -152,6 +163,7 @@ public class SmsHomeAdvertise implements Serializable {
         sb.append(", url=").append(url);
         sb.append(", note=").append(note);
         sb.append(", sort=").append(sort);
+        sb.append(", jumpTime=").append(jumpTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 60 - 0
forest-admin/admin-mbg/src/main/java/com/hwrj/cloud/admin/model/SmsHomeAdvertiseExample.java

@@ -864,6 +864,66 @@ public class SmsHomeAdvertiseExample {
             addCriterion("sort not between", value1, value2, "sort");
             return (Criteria) this;
         }
+
+        public Criteria andJumpTimeIsNull() {
+            addCriterion("jump_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeIsNotNull() {
+            addCriterion("jump_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeEqualTo(Long value) {
+            addCriterion("jump_time =", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeNotEqualTo(Long value) {
+            addCriterion("jump_time <>", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeGreaterThan(Long value) {
+            addCriterion("jump_time >", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeGreaterThanOrEqualTo(Long value) {
+            addCriterion("jump_time >=", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeLessThan(Long value) {
+            addCriterion("jump_time <", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeLessThanOrEqualTo(Long value) {
+            addCriterion("jump_time <=", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeIn(List<Long> values) {
+            addCriterion("jump_time in", values, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeNotIn(List<Long> values) {
+            addCriterion("jump_time not in", values, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeBetween(Long value1, Long value2) {
+            addCriterion("jump_time between", value1, value2, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeNotBetween(Long value1, Long value2) {
+            addCriterion("jump_time not between", value1, value2, "jumpTime");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 22 - 5
forest-admin/admin-mbg/src/main/resources/com/hwrj/cloud/admin/mapper/SmsHomeAdvertiseMapper.xml

@@ -14,6 +14,7 @@
     <result column="url" jdbcType="VARCHAR" property="url" />
     <result column="note" jdbcType="VARCHAR" property="note" />
     <result column="sort" jdbcType="INTEGER" property="sort" />
+    <result column="jump_time" jdbcType="BIGINT" property="jumpTime" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -75,7 +76,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, name, type, pic, start_time, end_time, status, click_count, order_count, url, 
-    note, sort
+    note, sort, jump_time
   </sql>
   <select id="selectByExample" parameterType="com.hwrj.cloud.admin.model.SmsHomeAdvertiseExample" resultMap="BaseResultMap">
     select
@@ -114,11 +115,13 @@
     insert into sms_home_advertise (name, type, pic, 
       start_time, end_time, status, 
       click_count, order_count, url, 
-      note, sort)
+      note, sort, jump_time
+      )
     values (#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{pic,jdbcType=VARCHAR}, 
       #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, 
       #{clickCount,jdbcType=INTEGER}, #{orderCount,jdbcType=INTEGER}, #{url,jdbcType=VARCHAR}, 
-      #{note,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER})
+      #{note,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{jumpTime,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.hwrj.cloud.admin.model.SmsHomeAdvertise">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -159,6 +162,9 @@
       <if test="sort != null">
         sort,
       </if>
+      <if test="jumpTime != null">
+        jump_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="name != null">
@@ -194,6 +200,9 @@
       <if test="sort != null">
         #{sort,jdbcType=INTEGER},
       </if>
+      <if test="jumpTime != null">
+        #{jumpTime,jdbcType=BIGINT},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.hwrj.cloud.admin.model.SmsHomeAdvertiseExample" resultType="java.lang.Long">
@@ -241,6 +250,9 @@
       <if test="record.sort != null">
         sort = #{record.sort,jdbcType=INTEGER},
       </if>
+      <if test="record.jumpTime != null">
+        jump_time = #{record.jumpTime,jdbcType=BIGINT},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -259,7 +271,8 @@
       order_count = #{record.orderCount,jdbcType=INTEGER},
       url = #{record.url,jdbcType=VARCHAR},
       note = #{record.note,jdbcType=VARCHAR},
-      sort = #{record.sort,jdbcType=INTEGER}
+      sort = #{record.sort,jdbcType=INTEGER},
+      jump_time = #{record.jumpTime,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -300,6 +313,9 @@
       <if test="sort != null">
         sort = #{sort,jdbcType=INTEGER},
       </if>
+      <if test="jumpTime != null">
+        jump_time = #{jumpTime,jdbcType=BIGINT},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -315,7 +331,8 @@
       order_count = #{orderCount,jdbcType=INTEGER},
       url = #{url,jdbcType=VARCHAR},
       note = #{note,jdbcType=VARCHAR},
-      sort = #{sort,jdbcType=INTEGER}
+      sort = #{sort,jdbcType=INTEGER},
+      jump_time = #{jumpTime,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>

+ 1 - 1
forest-admin/admin-mbg/src/main/resources/generatorConfig.xml

@@ -37,7 +37,7 @@
         <javaClientGenerator type="XMLMAPPER" targetPackage="com.hwrj.cloud.admin.mapper"
                              targetProject="forest-admin\admin-mbg\src\main\java"/>
         <!--生成全部表tableName设为%-->
-        <table tableName="ums_roll%">
+        <table tableName="sms_home_advertise%">
             <generatedKey column="id" sqlStatement="MySql" identity="true"/>
         </table>
     </context>

+ 7 - 0
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/controller/SmsHomeAdvertiseController.java

@@ -82,4 +82,11 @@ public class SmsHomeAdvertiseController {
         List<SmsHomeAdvertise> advertiseList = advertiseService.list(name, type, endTime, pageSize, pageNum);
         return CommonResult.success(CommonPage.restPage(advertiseList));
     }
+
+
+
+
+
+
+
 }

+ 10 - 0
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/dao/AdvertiseDao.java

@@ -0,0 +1,10 @@
+package com.hwrj.cloud.admin.dao;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+
+public interface AdvertiseDao {
+
+    public Integer checkAdvertiseJumpTime(@Param(value = "startTime") Date startTime,@Param(value = "endTime")Date endTime,@Param("id")Long id);
+}

+ 1 - 1
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/service/impl/CmsSubjectServiceImpl.java

@@ -43,7 +43,7 @@ public class CmsSubjectServiceImpl implements CmsSubjectService {
         CmsSubjectExample example = new CmsSubjectExample();
         CmsSubjectExample.Criteria criteria = example.createCriteria();
         criteria.andDelFlagEqualTo(0);
-        criteria.andShowStatusEqualTo(1);
+//        criteria.andShowStatusEqualTo(1);
         example.setOrderByClause("sort asc");
         return subjectMapper.selectByExample(example);
     }

+ 37 - 1
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/service/impl/SmsHomeAdvertiseServiceImpl.java

@@ -1,10 +1,14 @@
 package com.hwrj.cloud.admin.service.impl;
 
 import com.github.pagehelper.PageHelper;
+import com.hwrj.cloud.admin.dao.AdvertiseDao;
 import com.hwrj.cloud.admin.mapper.SmsHomeAdvertiseMapper;
 import com.hwrj.cloud.admin.model.SmsHomeAdvertise;
 import com.hwrj.cloud.admin.model.SmsHomeAdvertiseExample;
 import com.hwrj.cloud.admin.service.SmsHomeAdvertiseService;
+import com.hwrj.cloud.common.exception.ApiException;
+import com.hwrj.cloud.common.util.DateCommonUtil;
+import net.bytebuddy.asm.Advice;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -16,20 +20,46 @@ import java.util.List;
 
 /**
  * 首页广告管理Service实现类
- * Created by macro on 2018/11/7.
  */
 @Service
 public class SmsHomeAdvertiseServiceImpl implements SmsHomeAdvertiseService {
     @Autowired
     private SmsHomeAdvertiseMapper advertiseMapper;
 
+    @Autowired
+    private AdvertiseDao advertiseDao;
+
     @Override
     public int create(SmsHomeAdvertise advertise) {
         advertise.setClickCount(0);
         advertise.setOrderCount(0);
+        if (advertise.getType()==0){
+            checkJumpTime(advertise);
+        }
         return advertiseMapper.insert(advertise);
     }
 
+    public boolean checkJumpTime(SmsHomeAdvertise advertise){
+
+
+        if (advertise.getStartTime()==null||advertise.getEndTime()==null){
+            throw new RuntimeException("开始时间为空");
+        }
+
+        Boolean gt = DateCommonUtil.whenGT(new Date(), advertise.getEndTime());
+        Boolean gt1 = DateCommonUtil.whenGT(advertise.getStartTime(), advertise.getEndTime());
+        if (gt||gt1){
+            throw new ApiException("结束时间小于现在的时间或者结束时间小于开始时间");
+        }
+
+        Integer integer = advertiseDao.checkAdvertiseJumpTime(advertise.getStartTime(), advertise.getEndTime(),advertise.getId());
+        if (integer != null&& integer>0){
+            throw new ApiException("弹窗时间区间重复");
+
+        }
+        return true;
+    }
+
     @Override
     public int delete(List<Long> ids) {
         SmsHomeAdvertiseExample example = new SmsHomeAdvertiseExample();
@@ -45,6 +75,7 @@ public class SmsHomeAdvertiseServiceImpl implements SmsHomeAdvertiseService {
         return advertiseMapper.updateByPrimaryKeySelective(record);
     }
 
+
     @Override
     public SmsHomeAdvertise getItem(Long id) {
         return advertiseMapper.selectByPrimaryKey(id);
@@ -53,9 +84,14 @@ public class SmsHomeAdvertiseServiceImpl implements SmsHomeAdvertiseService {
     @Override
     public int update(Long id, SmsHomeAdvertise advertise) {
         advertise.setId(id);
+        if (advertise.getType()==0){
+            checkJumpTime(advertise);
+        }
         return advertiseMapper.updateByPrimaryKeySelective(advertise);
     }
 
+
+
     @Override
     public List<SmsHomeAdvertise> list(String name, Integer type, String endTime, Integer pageSize, Integer pageNum) {
         PageHelper.startPage(pageNum, pageSize);

+ 15 - 0
forest-admin/admin-server/src/main/resources/dao/AdvertiseDao.xml

@@ -0,0 +1,15 @@
+<?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.hwrj.cloud.admin.dao.AdvertiseDao">
+    <select id="checkAdvertiseJumpTime" parameterType="java.util.Date" resultType="java.lang.Integer">
+        select count(0) from sms_home_advertise s where ((s.start_time between #{startTime} and #{endTime}  )
+            OR (s.end_time between #{startTime} and #{endTime})
+            OR (#{startTime} between s.start_time and s.end_time)
+            OR (#{endTime} between s.start_time and s.end_time))
+            and s.type=0
+            and s.status = 1
+            <if test="id != null">
+              and  s.id != #{id,jdbcType=BIGINT}
+            </if>
+    </select>
+</mapper>

+ 1 - 1
forest-admin/admin-server/src/main/resources/dao/UmsCompanyInfoDao.xml

@@ -68,4 +68,4 @@
         ORDER BY
         a.id DESC
     </select>
-</mapper>
+</mapper>

+ 17 - 1
forest-common/pom.xml

@@ -20,6 +20,22 @@
             <artifactId>pagehelper-spring-boot-starter</artifactId>
         </dependency>
 
+
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.10.8</version>
+        </dependency>
+
+        <!-- commons-lang3 -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.11</version>
+        </dependency>
+
+
+
         <dependency>
             <groupId>io.springfox</groupId>
             <artifactId>springfox-swagger2</artifactId>
@@ -82,4 +98,4 @@
 
     </dependencies>
 
-</project>
+</project>

+ 1478 - 0
forest-common/src/main/java/com/hwrj/cloud/common/util/DateCommonUtil.java

@@ -0,0 +1,1478 @@
+package com.hwrj.cloud.common.util;
+
+import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+
+
+public class DateCommonUtil {
+    // 默认日期格式
+    public static final String DATE_DEFAULT_FORMAT = "yyyy-MM-dd";
+
+    // 默认时间格式
+    public static final String DATETIME_DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss";
+
+    // 默认时间格式
+    public static final String DATETIME_NOSECOND_FORMAT = "yyyy-MM-dd HH:mm";
+
+    public static final String DATETIME_HOUR_FORMAT = "yyyy-MM-dd HH";
+
+    public static final String TIME_DEFAULT_FORMAT = "HH:mm:ss";
+
+    public static final String TIME_HOUSER_FORMAT = "HH:mm";
+
+    public static final String TIME_MONTH_DAY_FORMAT = "MM.dd";
+
+    public static final ThreadLocal<DateFormat> DATE_FORMATTER = new ThreadLocal<DateFormat>() {
+        @Override
+        protected DateFormat initialValue() {
+            return new SimpleDateFormat("yyyy-MM-dd");
+        }
+    };
+
+    public static final DateTimeFormatter YMD_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+
+    public static final String DATE_YEAR_MONTH_FORMAT = "yyyy-MM";
+
+    public static final String DATE_DEFAULT_FORMAT_NO_SPACE = "yyyyMMdd";
+
+    /**
+     * 获取当前日期(yyyy-MM-dd)
+     *
+     * @return Date
+     */
+    public static Date getNowDate() {
+        return new DateTime().toDate();
+    }
+
+    /**
+     * 获取当前日期(yyyy-MM-dd)
+     *
+     * @return Date
+     */
+    public static String getNowDateToString() {
+        return new DateTime().toString(DATE_DEFAULT_FORMAT);
+    }
+
+    /**
+     * 获取当前日期时间戳
+     *
+     * @return
+     */
+    public static Long getNowTimestamp() {
+        return getNowDateTime().getTime();
+    }
+
+    /**
+     * 获取指定日期时间戳
+     *
+     * @return
+     */
+    public static Long getDateTimestamp(Date date) {
+        return getDate(date).getTime();
+    }
+
+    /**
+     * 获取指定日期时间戳
+     *
+     * @return
+     */
+    public static Long getDateTimestamp(String date) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return getDate(date).getTime();
+    }
+
+    /**
+     * 获取当前日期(yyyy-MM-dd)
+     *
+     * @return
+     */
+    public static Date getNowDateTime() {
+        return getDate(new Date());
+    }
+
+    /**
+     * 获取当前日期(yyyy-MM-dd)
+     *
+     * @return
+     */
+    public static String getNowDateTimeToString() {
+        return new DateTime().toString(DATE_DEFAULT_FORMAT);
+    }
+
+    /**
+     * 日期格式化yyyy-MM-dd
+     *
+     * @param date
+     * @return DATE
+     */
+    public static Date getDate(Date date) {
+        try {
+            return new DateTime(getDateToString(date)).toDate();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 日期格式化
+     *
+     * @param date
+     * @return
+     */
+    public static Date getDate(String date) {
+        try {
+            date = date.replace(" ", "T");//把空格替换成T
+            return new DateTime(date).toDate();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 时间戳转日期
+     *
+     * @param timeStamp
+     * @return
+     */
+    public static Date getDate(long timeStamp) {
+        return new Date(timeStamp);
+    }
+
+
+    /**
+     * 日期格式化yyyy-MM-dd
+     *
+     * @param date
+     * @return String
+     */
+    public static String getDateToString(Date date) {
+        return new DateTime(date).toString(DATE_DEFAULT_FORMAT);
+    }
+
+    /**
+     * 日期格式化yyyy-MM-dd
+     *
+     * @param date
+     * @return String
+     */
+    public static String getDateToStringEx(Date date) {
+        if (null == date) {
+            return null;
+        }
+        return new DateTime(date).toString(DATE_DEFAULT_FORMAT);
+    }
+
+    public static String getDateToStringhour(Date date) {
+        if (null == date) {
+            return null;
+        }
+        return new DateTime(date).toString(TIME_DEFAULT_FORMAT);
+    }
+
+    /**
+     * 日期格式化yyyy-MM-dd hh:MM:ss
+     *
+     * @param date
+     * @return String
+     */
+    public static String getDateToStrings(Date date) {
+        return new DateTime(date).toString(DATETIME_DEFAULT_FORMAT);
+    }
+
+    /**
+     * 日期格式化yyyy-MM-dd
+     *
+     * @param date
+     * @return String
+     */
+    public static String getDateToString(String date) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return new DateTime(date).toString(DATE_DEFAULT_FORMAT);
+    }
+
+    /**
+     * 日期格式化
+     *
+     * @param date
+     * @param formatStr
+     * @return
+     */
+    public static String getDateFormatToString(Date date, String formatStr) {
+        if (StringUtils.isNotBlank(formatStr)) {
+            return new DateTime(date).toString(formatStr);
+        }
+        return null;
+    }
+
+    /**
+     * 日期格式化
+     *
+     * @param date
+     * @param formatStr
+     * @return
+     */
+    public static String getDateFormatToString(String date, String formatStr) {
+        if (StringUtils.isNotBlank(formatStr)) {
+            date = date.replace(" ", "T");//把空格替换成T
+            return new DateTime(date).toString(formatStr);
+        }
+        return null;
+    }
+
+    /**
+     * 日期格式化
+     *
+     * @param date
+     * @param formatStr
+     * @return
+     */
+    public static Date getDateFormat(Date date, String formatStr) {
+        if (StringUtils.isNotBlank(formatStr)) {
+            return new DateTime(new DateTime(date).toString(formatStr)).toDate();
+        }
+        return null;
+    }
+
+    /**
+     * 日期格式化
+     *
+     * @param date
+     * @param formatStr
+     * @return
+     */
+    public static Date getDateFormat(String date, String formatStr) {
+        if (StringUtils.isNotBlank(formatStr)) {
+            date = date.replace(" ", "T");//把空格替换成T
+            return new DateTime(new DateTime(date).toString(formatStr)).toDate();
+        }
+        return null;
+    }
+    //-----------------
+
+    /**
+     * 日期格式化 yyyy-MM-dd HH:mm:ss
+     *
+     * @param date
+     * @return DATE
+     */
+    public static Date getDateTime(Date date) {
+        try {
+            return new DateTime(date).toDate();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 日期格式化 yyyy-MM-dd HH:mm:ss
+     *
+     * @param date
+     * @return DATE
+     */
+    public static Date getDateTime(String date) {
+        try {
+            date = date.replace(" ", "T");//把空格替换成T
+            return new DateTime(date).toDate();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 日期格式化 yyyy-MM-dd HH:mm:ss
+     *
+     * @param date
+     * @return String
+     */
+    public static String getDateTimeToString(Date date) {
+        return new DateTime(date).toString(DATETIME_DEFAULT_FORMAT);
+    }
+
+    /**
+     * 日期格式化 yyyy-MM-dd HH:mm:ss
+     *
+     * @param date
+     * @return String
+     */
+    public static String getDateTimeToString(String date) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return new DateTime(date).toString(DATETIME_DEFAULT_FORMAT);
+    }
+
+    /**
+     * 获取指定日期年份
+     *
+     * @param date
+     * @return
+     */
+    public static int geYear(Date date) {
+        return new DateTime(date).getYear();
+    }
+
+    /**
+     * 获取指定日期年份
+     *
+     * @param date
+     * @return
+     */
+    public static int getYear(String date) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return new DateTime(date).getYear();
+    }
+
+    /**
+     * 获取指定日期年份
+     *
+     * @param date
+     * @return
+     */
+    public static int getYear(Date date) {
+        return new DateTime(date).getYear();
+    }
+
+    /**
+     * 获取指定日期月份
+     *
+     * @param date
+     * @return
+     */
+    public static int getMonth(Date date) {
+        return new DateTime(date).getMonthOfYear();
+    }
+
+    /**
+     * 获取指定日期月份
+     *
+     * @param date
+     * @return
+     */
+    public static int getMonth(String date) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return new DateTime(date).getMonthOfYear();
+    }
+
+    /**
+     * 获取指定日期天数(号)
+     *
+     * @param date
+     * @return
+     */
+    public static int getDay(Date date) {
+        return new DateTime(date).getDayOfMonth();
+    }
+
+    /**
+     * 获取指定日期天数(号)
+     *
+     * @param date
+     * @return
+     */
+    public static int getDay(String date) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return new DateTime(date).getDayOfMonth();
+    }
+
+
+    /**
+     * 获取当前年
+     *
+     * @return
+     */
+    public static int getNowYear() {
+        Calendar d = Calendar.getInstance();
+        return d.get(Calendar.YEAR);
+    }
+
+    /**
+     * 获取当前月份
+     *
+     * @return
+     */
+    public static int getNowMonth() {
+        Calendar d = Calendar.getInstance();
+        return d.get(Calendar.MONTH) + 1;
+    }
+
+    /**
+     * 获取当月天数
+     *
+     * @return
+     */
+    public static int getNowMonthDay() {
+        Calendar d = Calendar.getInstance();
+        return d.getActualMaximum(Calendar.DATE);
+    }
+
+    /**
+     * 比较两日期大小
+     *
+     * @param date      日期字符串
+     * @param otherDate 另一个日期字符串
+     * @return 比较两日期大小。如果date>otherDate则返回true,否则false
+     */
+    public static Boolean whenGT(String date, String otherDate) {
+        date = date.replace(" ", "T");//把空格替换成T
+        otherDate = otherDate.replace(" ", "T");//把空格替换成T
+        return whenGT(getDate(date), getDate(otherDate));
+    }
+
+    /**
+     * 比较两日期大小
+     *
+     * @param date      日期
+     * @param otherDate 另一个日期
+     * @return 比较两日期大小。如果date>otherDate则返回true,否则false
+     */
+    public static Boolean whenGT(Date date, Date otherDate) {
+        Boolean flag = false;
+        Date dateTmp = getDateTime(date);
+        Date otherDateTmp = getDateTime(otherDate);
+        if (dateTmp != null && otherDateTmp != null) {
+            long time = dateTmp.getTime() - otherDateTmp.getTime();
+            if (time > 0) {
+                flag = true;
+            }
+        }
+        return flag;
+    }
+
+    /**
+     * 比较两日期是否相等
+     *
+     * @param date      日期字符串
+     * @param otherDate 另一个日期字符串
+     * @return 比较两日期大小。如果date==otherDate则返回true,否则false
+     */
+    public static Boolean whenEQ(String date, String otherDate) {
+        date = date.replace(" ", "T");//把空格替换成T
+        otherDate = otherDate.replace(" ", "T");//把空格替换成T
+        return whenEQ(getDate(date), getDate(otherDate));
+    }
+
+    /**
+     * 比较两日期是否相等
+     *
+     * @param date      日期
+     * @param otherDate 另一个日期
+     * @return 比较两日期大小。如果date==otherDate则返回true,否则false
+     */
+    public static Boolean whenEQ(Date date, Date otherDate) {
+        Boolean flag = false;
+        Date dateTmp = getDateTime(date);
+        Date otherDateTmp = getDateTime(otherDate);
+        if (dateTmp != null && otherDateTmp != null) {
+            long time = dateTmp.getTime() - otherDateTmp.getTime();
+            if (time == 0) {
+                flag = true;
+            }
+        }
+        return flag;
+    }
+
+    /**
+     * 比较两日期是否在同一天
+     *
+     * @param date      日期字符串
+     * @param otherDate 另一个日期字符串
+     * @return 比较两日期大小。如果date==otherDate则返回true,否则false
+     */
+    public static Boolean whenEQDay(String date, String otherDate) {
+        date = date.replace(" ", "T");//把空格替换成T
+        otherDate = otherDate.replace(" ", "T");//把空格替换成T
+        return whenEQ(getDate(date), getDate(otherDate));
+    }
+
+    /**
+     * 比较两日期是否在同一天
+     *
+     * @param date      日期
+     * @param otherDate 另一个日期
+     * @return 比较两日期大小。如果date==otherDate则返回true,否则false
+     */
+    public static Boolean whenEQDay(Date date, Date otherDate) {
+        Boolean flag = false;
+        Date dateTmp = getDate(date);
+        Date otherDateTmp = getDate(otherDate);
+        if (dateTmp != null && otherDateTmp != null) {
+            long time = dateTmp.getTime() - otherDateTmp.getTime();
+            if (time == 0) {
+                flag = true;
+            }
+        }
+        return flag;
+    }
+
+    /**
+     * 获取提前多少个月
+     *
+     * @param monty
+     * @return
+     */
+    public static Date getFirstMonth(int monty) {
+        Calendar c = Calendar.getInstance();
+        c.add(Calendar.MONTH, -monty);
+        return c.getTime();
+    }
+
+    /**
+     * 获取两日期差,返回年月日差值
+     *
+     * @param date1
+     * @param date2
+     * @return
+     */
+    public static List<Integer> getDiffDates(String date1, String date2) {
+        String dates = "";
+        List<Integer> diffList = new ArrayList<Integer>();
+        try {
+            Date startDate = getDate(date1);
+            Date endDate = getDate(date2);
+            Calendar calS = Calendar.getInstance();
+            // 开始时间
+            calS.setTime(startDate);
+            int startY = calS.get(Calendar.YEAR);
+            int startM = calS.get(Calendar.MONTH);
+            int startD = calS.get(Calendar.DATE);
+            int startDayOfMonth = calS.getActualMaximum(Calendar.DAY_OF_MONTH);
+            // 结束时间
+            calS.setTime(endDate);
+            int endY = calS.get(Calendar.YEAR);
+            int endM = calS.get(Calendar.MONTH);
+            // 处理起止日期为同一天,默认服务为一天 示例:2016-01-01 至 2016-01-01
+            int endD = calS.get(Calendar.DATE) + 1;
+            int endDayOfMonth = calS.getActualMaximum(Calendar.DAY_OF_MONTH);
+            int lday = endD - startD;
+            // 每月按照30天计算
+            if (endD < startD) {
+                endM = endM - 1;
+                lday = 30 - startD + endD;
+            }
+            /*
+             * 按照正常日期计算 if (lday<0) { endM = endM -1; lday = startDayOfMonth+
+             * lday; }
+             */
+            // 处理服务天数问题,示例:2016-01-01 到 2017-12-31 实际上是1年
+            if (lday == endDayOfMonth) {
+                endM = endM + 1;
+                lday = 0;
+            }
+            int mos = (endY - startY) * 12 + (endM - startM);
+            int lyear = mos / 12;
+            int lmonth = mos % 12;
+            diffList.add(lyear);
+            diffList.add(lmonth);
+            diffList.add(lday);
+            dates = lyear + "年" + lmonth + "个月" + lday + "天";
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return diffList;
+    }
+    /**
+     * 获取两日期差,返回年月日差值
+     *
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    public static List<Integer> getDiffDates(Date startDate, Date endDate) {
+        String dates = "";
+        List<Integer> diffList = new ArrayList<Integer>();
+        try {
+            Calendar calS = Calendar.getInstance();
+            // 开始时间
+            calS.setTime(startDate);
+            int startY = calS.get(Calendar.YEAR);
+            int startM = calS.get(Calendar.MONTH);
+            int startD = calS.get(Calendar.DATE);
+            int startDayOfMonth = calS.getActualMaximum(Calendar.DAY_OF_MONTH);
+            // 结束时间
+            calS.setTime(endDate);
+            int endY = calS.get(Calendar.YEAR);
+            int endM = calS.get(Calendar.MONTH);
+            // 处理起止日期为同一天,默认服务为一天 示例:2016-01-01 至 2016-01-01
+            int endD = calS.get(Calendar.DATE) + 1;
+            int endDayOfMonth = calS.getActualMaximum(Calendar.DAY_OF_MONTH);
+            int lday = endD - startD;
+            // 每月按照30天计算
+            if (endD < startD) {
+                endM = endM - 1;
+                lday = 30 - startD + endD;
+            }
+            /*
+             * 按照正常日期计算 if (lday<0) { endM = endM -1; lday = startDayOfMonth+
+             * lday; }
+             */
+            // 处理服务天数问题,示例:2016-01-01 到 2017-12-31 实际上是1年
+            if (lday == endDayOfMonth) {
+                endM = endM + 1;
+                lday = 0;
+            }
+            int mos = (endY - startY) * 12 + (endM - startM);
+            int lyear = mos / 12;
+            int lmonth = mos % 12;
+            diffList.add(lyear);
+            diffList.add(lmonth);
+            diffList.add(lday);
+            dates = lyear + "年" + lmonth + "个月" + lday + "天";
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return diffList;
+    }
+    /**
+     * 获取两日期相差的天数
+     *
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    public static Integer getDiffDays(Date startDate, Date endDate) {
+        if (StringUtil.isEmpty(startDate) || StringUtil.isEmpty(endDate)) {
+            return 0;
+        }
+        return (int) ((endDate.getTime() - startDate.getTime()) / (1000 * 3600 * 24));
+    }
+    /**
+     * @Description: 计算两个日期相隔多少天
+     * @Param: [start, end]
+     * @return: int
+     * @Author: cx
+     * @Date: 2018/6/28
+     */
+    public static int daysApart(Date start, Date end) {
+        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            Date StartDate = df.parse(df.format(start));
+            Date endDate = df.parse(df.format(end));
+            return (int) ((endDate.getTime() - StartDate.getTime()) / (24 * 60 * 60 * 1000L));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return 0;
+    }
+    /**
+     * 增加日期的年份。失败返回null。
+     *
+     * @param date       日期
+     * @param yearAmount 增加数量。可为负数
+     * @return String 增加年份后的日期字符串
+     */
+    public static String addYear(String date, int yearAmount) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return new DateTime(date).plusMonths(yearAmount).toString();
+    }
+    /**
+     * 增加日期的年份。失败返回null。
+     *
+     * @param date       日期
+     * @param yearAmount 增加数量。可为负数
+     * @return 增加年份后的日期
+     */
+    public static Date addYear(Date date, int yearAmount) {
+        return new DateTime(date).plusMonths(yearAmount).toDate();
+    }
+    /**
+     * 增加日期的月份。失败返回null
+     *
+     * @param date        日期
+     * @param monthAmount 增加数量。可为负数
+     * @return String 增加月份后的日期字符串
+     */
+    public static String addMonth(String date, int monthAmount) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return new DateTime(date).plusMonths(monthAmount).toString();
+    }
+    /**
+     * 增加日期的月份。失败返回null。
+     *
+     * @param date        日期
+     * @param monthAmount 增加数量。可为负数
+     * @return 增加月份后的日期
+     */
+    public static Date addMonth(Date date, int monthAmount) {
+        return new DateTime(date).plusMonths(monthAmount).toDate();
+    }
+    /**
+     * 增加日期的天数。失败返回null。
+     *
+     * @param date      日期字符串
+     * @param dayAmount 增加数量。可为负数
+     * @return 增加天数后的日期字符串
+     */
+    public static String addDay(String date, int dayAmount) {
+        date = date.replace(" ", "T");//把空格替换成T
+        return new DateTime(date).plusDays(dayAmount).toString();
+    }
+    /**
+     * 增加日期的天数。失败返回null。
+     *
+     * @param date      日期
+     * @param dayAmount 增加数量。可为负数
+     * @return 增加天数后的日期
+     */
+    public static Date addDay(Date date, int dayAmount) {
+        return new DateTime(date).plusDays(dayAmount).toDate();
+    }
+    /**
+     * 设置指定日期(天)。失败返回null。
+     *
+     * @param date      日期
+     * @param dayAmount 增加数量。可为负数
+     * @return 增加天数后的日期
+     */
+    public static Date setDay(Date date, int dayAmount) {
+        DateTime dateTime = new DateTime(date);
+        return new DateTime(dateTime.getYear(), dateTime.getMonthOfYear(), dayAmount, dateTime.getHourOfDay(), dateTime.getMillisOfDay()).toDate();
+    }
+    /**
+     * 设置指定日期(天)。失败返回null。
+     *
+     * @param date      日期
+     * @param dayAmount 增加数量。可为负数
+     * @return 增加天数后的日期
+     */
+    public static Date setDay(String date, int dayAmount) {
+        date = date.replace(" ", "T");//把空格替换成T
+        DateTime dateTime = new DateTime(date);
+        return new DateTime(dateTime.getYear(), dateTime.getMonthOfYear(), dayAmount, dateTime.getHourOfDay(), dateTime.getMillisOfDay()).toDate();
+    }
+    /**
+     * 设置固定日期,如果输入数字大于该月最大日期那么默认为当月最大日期
+     *
+     * @param date
+     * @param dayAmount
+     * @return
+     */
+    public static Date setDayPlus(String date, int dayAmount) {
+        date = date.replace(" ", "T");//把空格替换成T
+        DateTime dateTime = new DateTime(date);
+        if (dayAmount >= 29) {
+            Date[] dates = DateCommonUtil.computeMonthFirstAndLastDay(DateCommonUtil.getDate(date), 0);
+            String dateStr = DateCommonUtil.getDateToString(dates[1]);
+            String dayStr = dateStr.substring(dateStr.length() - 2);
+            Integer day = Integer.valueOf(dayStr);
+            if (dayAmount > day) {
+                {
+                    dayAmount = day;
+                }
+            }
+        }
+        return new DateTime(dateTime.getYear(), dateTime.getMonthOfYear(), dayAmount, dateTime.getHourOfDay(), dateTime.getMillisOfDay()).toDate();
+    }
+
+    /**
+     * 获取日期是一周中的第几天 每周从周一开始
+     *
+     * @param date
+     * @return
+     */
+    public static int getDateInWeekFewDay(Date date) {
+        SimpleDateFormat sdf = new SimpleDateFormat("E");
+        String key = sdf.format(getDateFormat(date, DATE_DEFAULT_FORMAT));
+        if ("星期一".equals(key) || "Mon".equals(key) || "MON".equals(key)) {
+            return 1;
+        } else if ("星期二".equals(key) || "Tue".equals(key) || "TUE".equals(key)) {
+            return 2;
+        } else if ("星期三".equals(key) || "Wed".equals(key) || "WED".equals(key)) {
+            return 3;
+        } else if ("星期四".equals(key) || "Thu".equals(key) || "THU".equals(key)) {
+            return 4;
+        } else if ("星期五".equals(key) || "Fri".equals(key) || "FRI".equals(key)) {
+            return 5;
+        } else if ("星期六".equals(key) || "Sat".equals(key) || "SAT".equals(key)) {
+            return 6;
+        }
+        return 7;
+    }
+
+    /**
+     * 计算得到日期区间的所有日期
+     * 例如:from=2017-06-25 to=2017-06-28 那么他们之间的日期就是 2017-06-26 2017-06-27
+     *
+     * @param from
+     * @param to
+     * @return
+     */
+    public static List<Date> computeDateRangeDate(Date from, Date to) {
+        List<Date> dateRange = new ArrayList<Date>();
+        from = DateCommonUtil.getDateFormat(from, DATE_DEFAULT_FORMAT);
+        to = DateCommonUtil.getDateFormat(to, DATE_DEFAULT_FORMAT);
+        Calendar startCal = Calendar.getInstance();
+        startCal.setTime(getDateFormat(from, DATE_DEFAULT_FORMAT));
+        startCal.add(Calendar.DAY_OF_YEAR, 1);
+        Calendar endCal = Calendar.getInstance();
+        endCal.setTime(getDateFormat(to, DATE_DEFAULT_FORMAT));
+        while (startCal.before(endCal)) {
+            dateRange.add(startCal.getTime());
+            startCal.add(Calendar.DAY_OF_YEAR, 1);
+        }
+        return dateRange;
+    }
+
+    /**
+     * 获取指定日期所在月总天数
+     *
+     * @param sourceDate
+     * @return
+     */
+    public static int getMonthDayCount(Date sourceDate) {
+        Calendar d = Calendar.getInstance();
+        d.setTime(sourceDate);
+        return d.getActualMaximum(Calendar.DATE);
+    }
+
+    /**
+     * Date转换为LocalDate
+     */
+    public static LocalDate dateToLocalDate(Date date) {
+        Instant instant = date.toInstant();
+        ZoneId zoneId = ZoneId.systemDefault();
+        return instant.atZone(zoneId).toLocalDate();
+    }
+
+    /**
+     * LocalDate转换为Date
+     */
+    public static Date localDateToDate(LocalDate localDate) {
+        ZoneId zoneId = ZoneId.systemDefault();
+        ZonedDateTime zdt = localDate.atStartOfDay(zoneId);
+        return Date.from(zdt.toInstant());
+    }
+
+    /**
+     * 计算某月一号和最后一天
+     *
+     * @param sourceDate    源日期
+     * @param monthInterval 目标月与当前月月差值(正负均可)
+     * @return
+     */
+    public static Date[] computeMonthFirstAndLastDay(Date sourceDate, int monthInterval) {
+        Date[] destDates = new Date[2];
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(sourceDate);
+        cal.add(Calendar.MONTH, monthInterval);
+        cal.set(Calendar.DAY_OF_MONTH, 1);
+        destDates[0] = DateCommonUtil.getDate(DATE_FORMATTER.get().format(cal.getTime()));
+        if (monthInterval < 0) {
+            cal.setTime(sourceDate);
+            if (monthInterval < -1) {
+                cal.add(Calendar.MONTH, monthInterval + 1);
+            }
+        }
+        if (monthInterval >= 0) {
+            cal.add(Calendar.MONTH, 1);
+        }
+        cal.set(Calendar.DAY_OF_MONTH, 0);
+        destDates[1] = DateCommonUtil.getDate(DATE_FORMATTER.get().format(cal.getTime()));
+
+        return destDates;
+    }
+
+    /**
+     * 获取当前日期的下一天
+     *
+     * @return
+     */
+    public static String getAfterDay(Date date) {
+        Calendar calendar = new GregorianCalendar();
+        calendar.setTime(date);
+        calendar.add(Calendar.DATE, 1);//把日期往后增加一天.整数往后推,负数往前移动
+        date = calendar.getTime();   //这个时间就是日期往后推一天的结果
+        return DateCommonUtil.getDateToString(date);
+    }
+
+    /**
+     * 获取当前日期的前一天
+     *
+     * @return
+     */
+    public static String getBeforeDay(Date date) {
+        Calendar calendar = new GregorianCalendar();
+        calendar.setTime(date);
+        calendar.add(Calendar.DATE, -1);//把日期往后增加一天.整数往后推,负数往前移动
+        date = calendar.getTime();   //这个时间就是日期往后推一天的结果
+        return DateCommonUtil.getDateToString(date);
+    }
+
+    /**
+     * 获取两日期相差的天数(格式转为YMD格式 消除HMS带来的误差)
+     *
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    public static Integer getDiffDaysEx(Date startDate, Date endDate) {
+        if (StringUtil.isEmpty(startDate) || StringUtil.isEmpty(endDate)) {
+            return 0;
+        }
+        try {
+            DateFormat df = DATE_FORMATTER.get();
+            startDate = df.parse(df.format(startDate));
+            endDate = df.parse(df.format(endDate));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return (int) ((endDate.getTime() - startDate.getTime()) / (1000 * 3600 * 24)) + 1;
+    }
+
+    /**
+     * 比较两日期大小
+     *
+     * @param date      日期
+     * @param otherDate 另一个日期
+     * @return 比较两日期大小。如果date>otherDate则返回true,否则false
+     */
+    public static Boolean whenGTOrEQ(Date date, Date otherDate) {
+        Boolean flag = false;
+        Date dateTmp = getDateTime(date);
+        Date otherDateTmp = getDateTime(otherDate);
+        if (dateTmp != null && otherDateTmp != null) {
+            long time = dateTmp.getTime() - otherDateTmp.getTime();
+            if (time >= 0) {
+                flag = true;
+            }
+        }
+        return flag;
+    }
+
+    /**
+     * 计算得到日期区间的所有日期(包含开始日期)
+     * 例如:from=2017-06-25 to=2017-06-28 那么他们之间的日期就是 2017-06-25 2017-06-26 2017-06-27
+     *
+     * @param from
+     * @param to
+     * @return
+     */
+    public static List<Date> computeDateRangeDateEx(Date from, Date to) {
+        List<Date> dateRange = new ArrayList<Date>();
+        from = DateCommonUtil.getDateFormat(from, DATE_DEFAULT_FORMAT);
+        to = DateCommonUtil.getDateFormat(to, DATE_DEFAULT_FORMAT);
+        dateRange.add(from);
+        Calendar startCal = Calendar.getInstance();
+        startCal.setTime(getDateFormat(from, DATE_DEFAULT_FORMAT));
+        startCal.add(Calendar.DAY_OF_YEAR, 1);
+        Calendar endCal = Calendar.getInstance();
+        endCal.setTime(getDateFormat(to, DATE_DEFAULT_FORMAT));
+        while (startCal.before(endCal)) {
+            dateRange.add(startCal.getTime());
+            startCal.add(Calendar.DAY_OF_YEAR, 1);
+        }
+        return dateRange;
+    }
+
+    /**
+     * 格式化日期 yyyy-MM
+     *
+     * @param date
+     * @return
+     */
+    public static Date getYearMonth(Date date) {
+        return getDate(new DateTime(date).toString(DATE_YEAR_MONTH_FORMAT));
+    }
+
+    /**
+     * 格式化日期 yyyy-MM 月份-1
+     *
+     * @param date
+     * @return
+     */
+    public static Date getPreYearMonth(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.MONTH, -1);
+        return calendar.getTime();
+    }
+
+    public static int compareYearMonth(Date d1, Date d2) {
+
+        Calendar c1 = Calendar.getInstance();
+        c1.setTime(d1);
+        int y1 = c1.get(Calendar.YEAR);
+        int m1 = c1.get(Calendar.MONTH);
+
+        Calendar c2 = Calendar.getInstance();
+        c2.setTime(d2);
+        int y2 = c2.get(Calendar.YEAR);
+        int m2 = c2.get(Calendar.MONTH);
+        if (y1 == y2) {
+            return m1 - m2;
+        }
+        return y1 - y2;
+    }
+
+    public static int compareYearMonthDay(Date d1, Date d2) {
+        int compareYearMonth = compareYearMonth(d1, d2);
+        if (compareYearMonth == 0) {
+            Calendar c1 = Calendar.getInstance();
+            c1.setTime(d1);
+            int day1 = c1.get(Calendar.DAY_OF_MONTH);
+
+            Calendar c2 = Calendar.getInstance();
+            c2.setTime(d2);
+            int day2 = c2.get(Calendar.DAY_OF_MONTH);
+            return day1 - day2;
+        }
+        return compareYearMonth;
+    }
+
+    /**
+     * 给日期加上小时
+     *
+     * @param date yyyy-MM-dd格式的日期
+     * @param hour
+     * @return
+     */
+    public static Date addHour(Date date, int hour) {
+        //当前日期毫秒数
+        long currentTime = date.getTime();
+        //计算小时总计的毫秒数
+        long hourTime = hour * 60 * 60 * 1000;
+        //总的毫秒数
+        long totalTime = currentTime + hourTime;
+        return new Date(totalTime);
+    }
+
+
+    /**
+     * 判断两个日期区间是否存在交叉
+     *
+     * @param firstBeginDate
+     * @param firstEndDate
+     * @param secondBeginDate
+     * @param secondEndDate
+     * @return 如果有交叉返回true  否则返回false
+     */
+    public static boolean checkDateRangeCross(Date firstBeginDate, Date firstEndDate, Date secondBeginDate, Date secondEndDate) {
+        return ((firstBeginDate.getTime() >= secondBeginDate.getTime())
+                && firstBeginDate.getTime() < secondEndDate.getTime())
+                ||
+                ((firstBeginDate.getTime() > secondBeginDate.getTime())
+                        && firstBeginDate.getTime() <= secondEndDate.getTime())
+                ||
+                ((secondBeginDate.getTime() >= firstBeginDate.getTime())
+                        && secondBeginDate.getTime() < firstEndDate.getTime())
+                ||
+                ((secondBeginDate.getTime() > firstBeginDate.getTime())
+                        && secondBeginDate.getTime() <= firstEndDate.getTime());
+    }
+    /**
+     * 判断两个日期区间是否存在交叉
+     *
+     * @param firstBeginDate
+     * @param firstEndDate
+     * @param secondBeginDate
+     * @param secondEndDate
+     * @return 如果有交叉返回true  否则返回false
+     */
+    public static boolean checkDateRangeCross(long firstBeginDate, long firstEndDate, long secondBeginDate, long secondEndDate) {
+        return ((firstBeginDate >= secondBeginDate)
+                && firstBeginDate < secondEndDate)
+                ||
+                ((firstBeginDate > secondBeginDate)
+                        && firstBeginDate <= secondEndDate)
+                ||
+                ((secondBeginDate >= firstBeginDate)
+                        && secondBeginDate < firstEndDate)
+                ||
+                ((secondBeginDate > firstBeginDate)
+                        && secondBeginDate <= firstEndDate);
+    }
+    //小红点项目 获取开始显示红点的日期
+    public static Date getRedSpotDate() {
+        Date redSpotDate = DateCommonUtil.getDate("2018-2-21");
+        return redSpotDate;
+    }
+    /**
+     * 获得两个日期之间的所有月份
+     *
+     * @param minDate
+     * @param maxDate
+     * @return
+     * @throws Exception
+     */
+    public static List<String> getMonthBetween(String minDate, String maxDate) throws Exception {
+        ArrayList<String> result = new ArrayList<String>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");//格式化为年月
+        Calendar min = Calendar.getInstance();
+        Calendar max = Calendar.getInstance();
+        min.setTime(sdf.parse(minDate));
+        min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1);
+        max.setTime(sdf.parse(maxDate));
+        max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2);
+        Calendar curr = min;
+        while (curr.before(max)) {
+            result.add(sdf.format(curr.getTime()));
+            curr.add(Calendar.MONTH, 1);
+        }
+
+        return result;
+    }
+
+    /**
+     * 获得两个日期之间的所有日期
+     *
+     * @param startDate
+     * @param endDate
+     * @return
+     * @throws Exception
+     */
+    private static List<Date> dateSplit(Date startDate, Date endDate) throws Exception {
+        if (!startDate.before(endDate)) {
+            throw new Exception("开始时间应该在结束时间之后");
+        }
+        Long spi = endDate.getTime() - startDate.getTime();
+        Long step = spi / (24 * 60 * 60 * 1000);// 相隔天数
+        List<Date> dateList = new ArrayList<Date>();
+        dateList.add(endDate);
+        for (int i = 1; i <= step; i++) {
+            dateList.add(new Date(dateList.get(i - 1).getTime()
+                    - (24 * 60 * 60 * 1000)));// 比上一天减一
+        }
+        return dateList;
+    }
+    /**
+     * 获取某一时间段特定星期几的日期
+     *
+     * @param beginTime 开始时间
+     * @param endTime   结束时间
+     * @param weekDays  星期几
+     * @param dateTime  具体时间
+     *                  getDates("2013-04-01", "2014-04-14","星期一|星期二|星期日");
+     * @return 返回时间数组
+     */
+    public static List<Date> getDates(Date beginTime, Date endTime, String weekDays, Date dateTime) throws Exception {
+        String dateFrom = null;
+        String dateEnd = null;
+        long time = 1L;
+        long perDayMilSec = 24 * 60 * 60 * 1000;
+        List<Date> dateList = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat hms = new SimpleDateFormat("hh:mm:ss");
+        //需要查询的星期系数
+        String strWeekNumber = weekForNum(weekDays);
+        String houreTime = null;
+        if (dateTime != null) {
+            houreTime = hms.format(dateTime);
+        }
+        try {
+            dateFrom = sdf.format(beginTime.getTime() - perDayMilSec);
+            dateEnd = sdf.format(endTime);
+            while (true) {
+                time = sdf.parse(dateFrom).getTime();
+                time = time + perDayMilSec;
+                Date date = new Date(time);
+                dateFrom = sdf.format(date);
+                if (dateFrom.compareTo(dateEnd) <= 0) {
+                    //查询的某一时间的星期系数
+                    Integer weekDay = dayForWeek(date);
+                    //判断当期日期的星期系数是否是需要查询的
+                    if (strWeekNumber.indexOf(weekDay.toString()) != -1) {
+                        Date timeDate = sdf.parse(dateFrom + " " + houreTime);
+                        dateList.add(timeDate);
+                    }
+                } else {
+                    break;
+                }
+            }
+        } catch (ParseException e1) {
+            e1.printStackTrace();
+        }
+        return dateList;
+    }
+    //等到当期时间的周系数。星期日:1,星期一:2,星期二:3,星期三:4,星期四:5,星期五:6,星期六:7
+    public static Integer dayForWeek(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        return calendar.get(Calendar.DAY_OF_WEEK);
+    }
+    /**
+     * 得到对应星期的系数  星期日:1,星期一:2,星期二:3,星期三:4,星期四:5,星期五:6,星期六:7
+     *
+     * @param weekDays 星期格式  星期一|星期二
+     */
+    public static String weekForNum(String weekDays) {
+        //返回结果为组合的星期系数
+        String weekNumber = "";
+        //解析传入的星期
+        if (weekDays.indexOf("|") != -1) {//多个星期数
+            String[] strWeeks = weekDays.split("\\|");
+            for (int i = 0; i < strWeeks.length; i++) {
+                weekNumber = weekNumber + "" + getWeekNum(strWeeks[i]).toString();
+            }
+        } else {//一个星期数
+            weekNumber = getWeekNum(weekDays).toString();
+        }
+        return weekNumber;
+    }
+    /**
+     * 将星期转换为对应的系数  星期日:1,星期一:2,星期二:3,星期三:4,星期四:5,星期五:6,星期六:7
+     * @param strWeek
+     * @return
+     */
+    public static Integer getWeekNum(String strWeek) {
+        Integer number = 1;//默认为星期日
+        if ("星期日".equals(strWeek)) {
+            number = 1;
+        } else if ("星期一".equals(strWeek)) {
+            number = 2;
+        } else if ("星期二".equals(strWeek)) {
+            number = 3;
+        } else if ("星期三".equals(strWeek)) {
+            number = 4;
+        } else if ("星期四".equals(strWeek)) {
+            number = 5;
+        } else if ("星期五".equals(strWeek)) {
+            number = 6;
+        } else if ("星期六".equals(strWeek)) {
+            number = 7;
+        }
+        return number;
+    }
+    /**
+     * 获取当前日期是星期几<br>
+     *
+     * @param date
+     * @return 当前日期是星期几
+     */
+    public static String getWeekOfDate(Date date) {
+        String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
+        if (w < 0) {
+            w = 0;
+        }
+        return weekDays[w];
+    }
+    /**
+     * 获取时间段内固定日期集合
+     *
+     * @param start
+     * @param end
+     * @param dayOfMonth
+     * @return
+     */
+    public static List<Date> getFixedDateList(Date start, Date end, int dayOfMonth) {
+        List<Date> dateList = new ArrayList<>();
+        List<Integer> diff = getDiffDates(start, end);
+//        int totalMonth = diff.get(0)*12 + diff.get(1) + (diff.get(2) > 0?1:0);
+        int totalMonth = diff.get(1);
+        //如果目标天小于开始日期的天那么从下月开始
+        if (DateCommonUtil.getDay(start) <= dayOfMonth) {
+            Date[] dates = DateCommonUtil.computeMonthFirstAndLastDay(DateCommonUtil.getDate(start), 0);
+            String dateStr = DateCommonUtil.getDateToString(dates[1]);
+            String dayStr = dateStr.substring(dateStr.length() - 2);
+            Integer day = Integer.valueOf(dayStr);
+            if (dayOfMonth <= day) {
+                String computeDate = dateStr.substring(0, dateStr.lastIndexOf("-") + 1);
+                Date targetDate = DateCommonUtil.getDate(computeDate + dayOfMonth);
+                dateList.add(targetDate);
+            }
+        }
+        //如果目标天大于结束日期的天那么只计算到结束日期的上个月
+        if (DateCommonUtil.getDay(end) < dayOfMonth) {
+            totalMonth--;
+        }
+        String sourceDate = DateCommonUtil.getDateToString(start);
+        for (int i = 0; i < totalMonth; i++) {
+            sourceDate = DateCommonUtil.getDateToString(DateCommonUtil.addMonth(sourceDate, 1));
+            String computeDate = sourceDate.substring(0, sourceDate.lastIndexOf("-") + 1);
+            Date[] dates = DateCommonUtil.computeMonthFirstAndLastDay(DateCommonUtil.getDate(sourceDate), 0);
+            String dateStr = DateCommonUtil.getDateToString(dates[1]);
+            String dayStr = dateStr.substring(dateStr.length() - 2);
+            Integer day = Integer.valueOf(dayStr);
+            if (dayOfMonth <= day) {
+                Date targetDate = DateCommonUtil.getDate(computeDate + dayOfMonth);
+                dateList.add(targetDate);
+            }
+        }
+        return dateList;
+    }
+    /**
+     * 获取时间段内固定日期时间集合
+     *
+     * @param start
+     * @param end
+     * @param dateTime
+     * @return
+     */
+    public static List<Date> getFixedDateTimeList(Date start, Date end, Date dateTime) {
+        List<Date> dateList = new ArrayList<>();
+        List<Integer> diff = getDiffDates(start, end);
+        String datetime = getDateFormatToString(dateTime, DATETIME_DEFAULT_FORMAT);
+        int dayOfMonth = Integer.parseInt(datetime.substring(8, 10));
+        String hms = datetime.substring(11, 19);
+//        int totalMonth = diff.get(0)*12 + diff.get(1) + (diff.get(2) > 0?1:0);
+        int totalMonth = diff.get(1);
+        //如果目标天小于开始日期的天那么从下月开始
+        if (DateCommonUtil.getDay(start) <= dayOfMonth) {
+            Date[] dates = DateCommonUtil.computeMonthFirstAndLastDay(DateCommonUtil.getDate(start), 0);
+            String dateStr = DateCommonUtil.getDateToString(dates[1]);
+            String dayStr = dateStr.substring(dateStr.length() - 2);
+            Integer day = Integer.valueOf(dayStr);
+            if (dayOfMonth <= day) {
+                String computeDate = dateStr.substring(0, dateStr.lastIndexOf("-") + 1);
+                computeDate = computeDate + dayOfMonth + " " + hms;
+                Date targetDate = DateCommonUtil.getDate(computeDate);
+                dateList.add(targetDate);
+            }
+        }
+        //如果目标天大于结束日期的天那么只计算到结束日期的上个月
+        if (DateCommonUtil.getDay(end) < dayOfMonth) {
+            totalMonth--;
+        }
+        String sourceDate = DateCommonUtil.getDateToString(start);
+        for (int i = 0; i < totalMonth; i++) {
+            sourceDate = DateCommonUtil.getDateToString(DateCommonUtil.addMonth(sourceDate, 1));
+            String computeDate = sourceDate.substring(0, sourceDate.lastIndexOf("-") + 1);
+            Date[] dates = DateCommonUtil.computeMonthFirstAndLastDay(DateCommonUtil.getDate(sourceDate), 0);
+            String dateStr = DateCommonUtil.getDateToString(dates[1]);
+            String dayStr = dateStr.substring(dateStr.length() - 2);
+            Integer day = Integer.valueOf(dayStr);
+            if (dayOfMonth <= day) {
+                computeDate = computeDate + dayOfMonth + " " + hms;
+                Date targetDate = DateCommonUtil.getDate(computeDate);
+                dateList.add(targetDate);
+            }
+        }
+        return dateList;
+    }
+    /**
+     * 获取固定日期
+     *
+     * @param begin
+     * @param end
+     * @return
+     */
+    public static List<Date> getData(Date begin, Date end, int day) {
+        Calendar l_begin = Calendar.getInstance();
+        l_begin.clear();
+        l_begin.setTime(begin);
+
+        Calendar l_end = Calendar.getInstance();
+        l_end.clear();
+        l_end.setTime(end);
+        List<Date> list = new ArrayList<Date>();
+        boolean ifOk = true;
+        if (day == l_begin.get(Calendar.DATE)) {
+            list.add(new Date(l_begin.getTimeInMillis()));
+        }
+        do {
+            l_begin.add(Calendar.DATE, 1);
+            if (day == l_begin.get(Calendar.DATE) && l_begin.compareTo(l_end) == -1) {
+                list.add(new Date(l_begin.getTimeInMillis()));
+            }
+            if (l_begin.compareTo(l_end) == 1) {
+                ifOk = false;
+            }
+        } while (ifOk);
+        return list;
+    }
+
+    /**
+     * 开始时间--结束时间拼凑字符串
+     * @param start
+     * @param end
+     * @return
+     */
+    public static String getStringTime(Date start, Date end) {
+        String startTime = getDateFormatToString(start, DATE_DEFAULT_FORMAT);
+        String endTime = getDateFormatToString(end, DATE_DEFAULT_FORMAT);
+        if (startTime != null && endTime != null) {
+            return startTime + "~" + endTime;
+        }
+        return "暂无~暂无";
+    }
+
+    /**
+     * @Description: yyyyMMddHHmmss字符串转化为日期
+     * @Param: [time]
+     * @return: java.util.Date
+     * @Author: cx
+     * @Date: 2018/5/17
+     */
+    public static Date getStringTimeToDate(String time, String pattern) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
+        Date date = null;
+        try {
+            date = simpleDateFormat.parse(time);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return date;
+    }
+
+    /**
+     * @Description: yyyyMMddHHmmss字符串转化为日期
+     * @Param: [time]
+     * @return: java.util.Date
+     * @Author: cx
+     * @Date: 2018/5/17
+     */
+    public static boolean dateEqInMinute(Date date, Date otherDate) {
+        String dateStr = getDateFormatToString(date, "yyyyMMddHHmm");
+        String otherDateStr = getDateFormatToString(otherDate, "yyyyMMddHHmm");
+        if (dateStr != null && otherDateStr != null) {
+            return dateStr.equals(otherDateStr);
+        }
+        return false;
+    }
+
+    /**
+     * 清空时分秒
+     *
+     * @param date
+     * @return
+     */
+    public static void clearHHMMSS(Date date) {
+        if (date == null) {
+            return;
+        }
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        // 将时分秒,毫秒域清零
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        date.setTime(cal.getTime().getTime());
+    }
+
+
+    /**
+     * 获取格式 年-月-日  上午/下午
+     *
+     * @param date
+     * @return
+     */
+    public static String getDateWU(Date date) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd a");
+        String format = sdf.format(new Date());
+        return format;
+    }
+
+    public static void main(String[] args) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd a");
+        String format = sdf.format(new Date());
+        System.out.println(format);
+
+    }
+
+
+}

+ 6 - 0
forest-common/src/main/java/com/hwrj/cloud/common/util/StringUtil.java

@@ -0,0 +1,6 @@
+package com.hwrj.cloud.common.util;
+
+import org.springframework.util.StringUtils;
+
+public class StringUtil extends StringUtils {
+}

+ 4 - 1
forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/mapper/UmsCompanyInfoMapper.java

@@ -1,5 +1,6 @@
 package com.hwrj.cloud.portal.mapper;
 
+import com.hwrj.cloud.portal.model.UmsCompanyFile;
 import com.hwrj.cloud.portal.model.UmsCompanyInfo;
 import com.hwrj.cloud.portal.model.UmsCompanyInfoExample;
 import java.util.List;
@@ -33,4 +34,6 @@ public interface UmsCompanyInfoMapper {
     int updateByPrimaryKeyWithBLOBs(UmsCompanyInfo record);
 
     int updateByPrimaryKey(UmsCompanyInfo record);
-}
+
+
+}

+ 13 - 1
forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/model/SmsHomeAdvertise.java

@@ -9,7 +9,7 @@ public class SmsHomeAdvertise implements Serializable {
 
     private String name;
 
-    @ApiModelProperty(value = "轮播位置:0->PC首页轮播;1->app首页轮播")
+    @ApiModelProperty(value = "轮播位置:0->推广;1->app首页轮播")
     private Integer type;
 
     private String pic;
@@ -36,6 +36,9 @@ public class SmsHomeAdvertise implements Serializable {
     @ApiModelProperty(value = "排序")
     private Integer sort;
 
+    @ApiModelProperty(value = "弹窗时间单位毫秒")
+    private Long jumpTime;
+
     private static final long serialVersionUID = 1L;
 
     public Long getId() {
@@ -134,6 +137,14 @@ public class SmsHomeAdvertise implements Serializable {
         this.sort = sort;
     }
 
+    public Long getJumpTime() {
+        return jumpTime;
+    }
+
+    public void setJumpTime(Long jumpTime) {
+        this.jumpTime = jumpTime;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -152,6 +163,7 @@ public class SmsHomeAdvertise implements Serializable {
         sb.append(", url=").append(url);
         sb.append(", note=").append(note);
         sb.append(", sort=").append(sort);
+        sb.append(", jumpTime=").append(jumpTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 60 - 0
forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/model/SmsHomeAdvertiseExample.java

@@ -864,6 +864,66 @@ public class SmsHomeAdvertiseExample {
             addCriterion("sort not between", value1, value2, "sort");
             return (Criteria) this;
         }
+
+        public Criteria andJumpTimeIsNull() {
+            addCriterion("jump_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeIsNotNull() {
+            addCriterion("jump_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeEqualTo(Long value) {
+            addCriterion("jump_time =", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeNotEqualTo(Long value) {
+            addCriterion("jump_time <>", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeGreaterThan(Long value) {
+            addCriterion("jump_time >", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeGreaterThanOrEqualTo(Long value) {
+            addCriterion("jump_time >=", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeLessThan(Long value) {
+            addCriterion("jump_time <", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeLessThanOrEqualTo(Long value) {
+            addCriterion("jump_time <=", value, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeIn(List<Long> values) {
+            addCriterion("jump_time in", values, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeNotIn(List<Long> values) {
+            addCriterion("jump_time not in", values, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeBetween(Long value1, Long value2) {
+            addCriterion("jump_time between", value1, value2, "jumpTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andJumpTimeNotBetween(Long value1, Long value2) {
+            addCriterion("jump_time not between", value1, value2, "jumpTime");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 22 - 5
forest-portal/portal-mbg/src/main/resources/com/hwrj/cloud/portal/mapper/SmsHomeAdvertiseMapper.xml

@@ -14,6 +14,7 @@
     <result column="url" jdbcType="VARCHAR" property="url" />
     <result column="note" jdbcType="VARCHAR" property="note" />
     <result column="sort" jdbcType="INTEGER" property="sort" />
+    <result column="jump_time" jdbcType="BIGINT" property="jumpTime" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -75,7 +76,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, name, type, pic, start_time, end_time, status, click_count, order_count, url, 
-    note, sort
+    note, sort, jump_time
   </sql>
   <select id="selectByExample" parameterType="com.hwrj.cloud.portal.model.SmsHomeAdvertiseExample" resultMap="BaseResultMap">
     select
@@ -114,11 +115,13 @@
     insert into sms_home_advertise (name, type, pic, 
       start_time, end_time, status, 
       click_count, order_count, url, 
-      note, sort)
+      note, sort, jump_time
+      )
     values (#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{pic,jdbcType=VARCHAR}, 
       #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, 
       #{clickCount,jdbcType=INTEGER}, #{orderCount,jdbcType=INTEGER}, #{url,jdbcType=VARCHAR}, 
-      #{note,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER})
+      #{note,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{jumpTime,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.hwrj.cloud.portal.model.SmsHomeAdvertise">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -159,6 +162,9 @@
       <if test="sort != null">
         sort,
       </if>
+      <if test="jumpTime != null">
+        jump_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="name != null">
@@ -194,6 +200,9 @@
       <if test="sort != null">
         #{sort,jdbcType=INTEGER},
       </if>
+      <if test="jumpTime != null">
+        #{jumpTime,jdbcType=BIGINT},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.hwrj.cloud.portal.model.SmsHomeAdvertiseExample" resultType="java.lang.Long">
@@ -241,6 +250,9 @@
       <if test="record.sort != null">
         sort = #{record.sort,jdbcType=INTEGER},
       </if>
+      <if test="record.jumpTime != null">
+        jump_time = #{record.jumpTime,jdbcType=BIGINT},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -259,7 +271,8 @@
       order_count = #{record.orderCount,jdbcType=INTEGER},
       url = #{record.url,jdbcType=VARCHAR},
       note = #{record.note,jdbcType=VARCHAR},
-      sort = #{record.sort,jdbcType=INTEGER}
+      sort = #{record.sort,jdbcType=INTEGER},
+      jump_time = #{record.jumpTime,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -300,6 +313,9 @@
       <if test="sort != null">
         sort = #{sort,jdbcType=INTEGER},
       </if>
+      <if test="jumpTime != null">
+        jump_time = #{jumpTime,jdbcType=BIGINT},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -315,7 +331,8 @@
       order_count = #{orderCount,jdbcType=INTEGER},
       url = #{url,jdbcType=VARCHAR},
       note = #{note,jdbcType=VARCHAR},
-      sort = #{sort,jdbcType=INTEGER}
+      sort = #{sort,jdbcType=INTEGER},
+      jump_time = #{jumpTime,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>

+ 1 - 1
forest-portal/portal-mbg/src/main/resources/generatorConfig.xml

@@ -37,7 +37,7 @@
         <javaClientGenerator type="XMLMAPPER" targetPackage="com.hwrj.cloud.portal.mapper"
                              targetProject="forest-portal\portal-mbg\src\main\java"/>
         <!--生成全部表tableName设为%-->
-        <table tableName="ums_roll_buy%">
+        <table tableName="sms_home_advertise%">
             <generatedKey column="id" sqlStatement="MySql" identity="true"/>
         </table>
     </context>

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/FileUploadController.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
-@Api(tags = "FileUploadController",description = "图片上传接口")
+@Api(tags = "图片上传接口",description = "FileUploadController")
 @RestController
 @RequestMapping("/upload")
 public class FileUploadController {

+ 4 - 5
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/HomeController.java

@@ -18,10 +18,9 @@ import java.util.List;
 
 /**
  * 首页内容管理Controller
- * Created by macro on 2019/1/28.
  */
 @Controller
-@Api(tags = "HomeController", description = "首页内容管理")
+@Api(tags = "首页内容管理", description = "首页内容管理")
 @RequestMapping("/home")
 public class HomeController {
     @Autowired
@@ -53,7 +52,7 @@ public class HomeController {
     @ResponseBody
     public CommonResult<CommonPage<PmsProduct>> hotProduct(@RequestParam(value = "pageSize", defaultValue = "4") Integer pageSize,
                                                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
-        List<PmsProduct> productList = homeService.hotProductList(pageSize, pageNum);
+        List<PmsProduct> productList = homeService.hotProductPage(pageNum, pageSize);
         return CommonResult.success(CommonPage.restPage(productList));
     }
 
@@ -100,10 +99,10 @@ public class HomeController {
     @ApiOperation("分页获取新品推荐商品")
     @RequestMapping(value = "/newProductList", method = RequestMethod.GET)
     @ResponseBody
-    public CommonResult<List<PmsProduct>> newProductList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+    public CommonResult<CommonPage<PmsProduct>> newProductList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                          @RequestParam(value = "pageSize", defaultValue = "6") Integer pageSize) {
         List<PmsProduct> productList = homeService.newProductList(pageNum, pageSize);
-        return CommonResult.success(productList);
+        return CommonResult.success(CommonPage.restPage(productList));
     }
 
     @ApiOperation("分页获取走马灯")

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/MemberAttentionController.java

@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
  * Created by macro on 2018/8/2.
  */
 @Controller
-@Api(tags = "MemberAttentionController", description = "会员关注品牌管理")
+@Api(tags = "会员关注品牌管理", description = "MemberAttentionController")
 @RequestMapping("/member/attention")
 public class MemberAttentionController {
     @Autowired

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/MemberProductCollectionController.java

@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
  * Created by macro on 2018/8/2.
  */
 @Controller
-@Api(tags = "MemberCollectionController", description = "会员收藏管理")
+@Api(tags = "会员收藏管理", description = "MemberProductCollectionController")
 @RequestMapping("/member/productCollection")
 public class MemberProductCollectionController {
     @Autowired

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/MemberReadHistoryController.java

@@ -18,7 +18,7 @@ import java.util.List;
  * Created by macro on 2018/8/3.
  */
 @Controller
-@Api(tags = "MemberReadHistoryController", description = "会员商品浏览记录管理")
+@Api(tags = "会员商品浏览记录管理", description = "MemberReadHistoryController")
 @RequestMapping("/member/readHistory")
 public class MemberReadHistoryController {
     @Autowired

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/OmePreItemController.java

@@ -22,7 +22,7 @@ import java.util.List;
 import java.util.Map;
 
 @Controller
-@Api(tags = "OmePreItemController", description = "预购信息处理")
+@Api(tags = "预购信息处理", description = "OmePreItemController")
 @RequestMapping("/pre")
 public class OmePreItemController {
 

+ 1 - 2
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/OmsCartItemController.java

@@ -18,10 +18,9 @@ import java.util.List;
 
 /**
  * 购物车管理Controller
- * Created by macro on 2018/8/2.
  */
 @Controller
-@Api(tags = "OmsCartItemController", description = "购物车管理")
+@Api(tags = "购物车管理", description = "OmsCartItemController")
 @RequestMapping("/cart")
 public class OmsCartItemController {
     @Autowired

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/OmsPortalOrderController.java

@@ -23,7 +23,7 @@ import java.util.Map;
  * Created by macro on 2018/8/30.
  */
 @Controller
-@Api(tags = "OmsPortalOrderController", description = "订单管理")
+@Api(tags = "订单管理", description = "OmsPortalOrderController")
 @RequestMapping("/order")
 public class OmsPortalOrderController {
     @Autowired

+ 1 - 2
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/OmsPortalOrderReturnApplyController.java

@@ -14,10 +14,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 /**
  * 申请退货管理Controller
- * Created by macro on 2018/10/17.
  */
 @Controller
-@Api(tags = "OmsPortalOrderReturnApplyController", description = "申请退货管理")
+@Api(tags = "申请退货管理", description = "OmsPortalOrderReturnApplyController")
 @RequestMapping("/returnApply")
 public class OmsPortalOrderReturnApplyController {
     @Autowired

+ 1 - 0
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/PmsBasePositiontController.java

@@ -33,4 +33,5 @@ public class PmsBasePositiontController {
         List<AreaVo> list = pmsBasePositiontService.search(parentId);
         return CommonResult.success(list);
     }
+
 }

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/PmsPortalProductController.java

@@ -22,7 +22,7 @@ import java.util.List;
  * Created by macro on 2020/4/6.
  */
 @Controller
-@Api(tags = "PmsPortalProductController", description = "前台商品管理")
+@Api(tags = "前台商品管理", description = "前台商品管理")
 @RequestMapping("/product")
 public class PmsPortalProductController {
 

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/PortalBrandController.java

@@ -18,7 +18,7 @@ import java.util.List;
  * Created by macro on 2020/5/15.
  */
 @Controller
-@Api(tags = "PortalBrandController", description = "前台品牌管理")
+@Api(tags = "前台品牌管理", description = "前台品牌管理")
 @RequestMapping("/brand")
 public class PortalBrandController {
 

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/PortalProductPublishController.java

@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 
 @Slf4j
-@Api(tags = "PortalProductPublishController",description = "h5端产品发布接口")
+@Api(tags = "h5端产品发布接口",description = "h5端产品发布接口")
 @RestController
 @RequestMapping("/prod/pub")
 public class PortalProductPublishController {

+ 1 - 2
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/SubjectController.java

@@ -15,11 +15,10 @@ import java.util.List;
 
 /**
  * @author mtcarpenter
- * @github https://github.com/mtcarpenter/mall-cloud-alibaba
  * @desc 微信公众号:山间木匠
  */
 @RestController
-@Api(tags = "MemberCollectionController", description = "专题")
+@Api(tags = "专题", description = "SubjectController")
 @RequestMapping("/member/subject")
 public class SubjectController {
 

+ 11 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/UmsCompanyInfoController.java

@@ -1,5 +1,6 @@
 package com.hwrj.cloud.portal.controller;
 
+import com.hwrj.cloud.common.api.CommonPage;
 import com.hwrj.cloud.common.api.CommonResult;
 import com.hwrj.cloud.portal.domain.BrandVO;
 import com.hwrj.cloud.portal.domain.UmsCompanyInfoDto;
@@ -21,7 +22,7 @@ import java.util.List;
 
 @RestController
 @RequestMapping("company")
-@Api(tags = "UmsCompanyInfoController",description = "供应商信息标")
+@Api(tags = "供应商信息",description = "UmsCompanyInfoController")
 public class UmsCompanyInfoController {
     @Autowired
     private UmsCompanyInfoService umsCompanyInfoService;
@@ -51,6 +52,15 @@ public class UmsCompanyInfoController {
         return CommonResult.success(infos);
     }
 
+    @ApiOperation("搜索供应商列表")
+    @GetMapping("/cp/page")
+    public CommonResult<CommonPage<UmsCompanyInfoDto>> search(@RequestParam(value = "key",required = false)String key,
+                                           @RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum,
+                                           @RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize){
+        List<UmsCompanyInfoDto> infos = umsCompanyInfoService.searchCompanyInfo(key,pageNum,pageSize);
+        return CommonResult.success(CommonPage.restPage(infos));
+    }
+
     @ApiOperation("获取生产地")
     @GetMapping("/cp/origin")
     public CommonResult searchOrigin(@RequestParam(value = "compId",required = true)Long compId){

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/UmsMemberController.java

@@ -25,7 +25,7 @@ import java.util.Map;
  * Created by macro on 2018/8/3.
  */
 @Controller
-@Api(tags = "UmsMemberController", description = "会员登录注册管理")
+@Api(tags = "会员登录注册管理", description = "会员登录注册管理")
 @RequestMapping("/sso")
 public class UmsMemberController {
     @Value("${jwt.tokenHeader}")

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/UmsMemberCouponController.java

@@ -20,7 +20,7 @@ import java.util.List;
  * Created by macro on 2018/8/29.
  */
 @Controller
-@Api(tags = "UmsMemberCouponController", description = "用户优惠券管理")
+@Api(tags = "用户优惠券管理", description = "用户优惠券管理")
 @RequestMapping("/member/coupon")
 public class UmsMemberCouponController {
     @Autowired

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/UmsMemberReceiveAddressController.java

@@ -16,7 +16,7 @@ import java.util.List;
  * Created by macro on 2018/8/28.
  */
 @Controller
-@Api(tags = "UmsMemberReceiveAddressController", description = "会员收货地址管理")
+@Api(tags = "会员收货地址管理", description = "会员收货地址管理")
 @RequestMapping("/member/address")
 public class UmsMemberReceiveAddressController {
     @Autowired

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/WechatH5Controller.java

@@ -32,7 +32,7 @@ import java.util.Map;
 
 @Slf4j
 @Controller
-@Api(tags = "WechatH5Controller", description = "微信登录")
+@Api(tags = "微信登录", description = "微信登录")
 @RequestMapping("/wechat/h5")
 public class WechatH5Controller {
     /**

+ 1 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/WechatH5PayController.java

@@ -33,7 +33,7 @@ import java.math.BigDecimal;
 
 @Slf4j
 @Controller
-@Api(tags = "AppPayController", description = "支付")
+@Api(tags = "支付", description = "支付")
 @RequestMapping("/app")
 public class WechatH5PayController {
 

+ 5 - 0
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/dao/HomeDao.java

@@ -35,4 +35,9 @@ public interface HomeDao {
      */
     List<PmsProduct> getHotProductList(@Param("offset") Integer offset, @Param("limit") Integer limit);
 
+    /**
+     * 获取人气推荐
+     */
+    List<PmsProduct> getHotProductPage();
+
 }

+ 41 - 0
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/dao/UmsCompanyInfoDao.java

@@ -0,0 +1,41 @@
+package com.hwrj.cloud.portal.dao;
+
+import com.hwrj.cloud.portal.domain.UmsCompanyInfoDto;
+import com.hwrj.cloud.portal.model.UmsCompanyFile;
+import com.hwrj.cloud.portal.model.UmsCompanyInfo;
+import com.hwrj.cloud.portal.model.UmsCompanyInfoExample;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface UmsCompanyInfoDao {
+    long countByExample(UmsCompanyInfoExample example);
+
+    int deleteByExample(UmsCompanyInfoExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(UmsCompanyInfo record);
+
+    int insertSelective(UmsCompanyInfo record);
+
+    List<UmsCompanyInfoDto> selectByExampleWithBLOBs(UmsCompanyInfoExample example);
+
+    List<UmsCompanyInfoDto> selectByExample(UmsCompanyInfoExample example);
+
+    UmsCompanyInfoDto selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") UmsCompanyInfo record, @Param("example") UmsCompanyInfoExample example);
+
+    int updateByExampleWithBLOBs(@Param("record") UmsCompanyInfo record, @Param("example") UmsCompanyInfoExample example);
+
+    int updateByExample(@Param("record") UmsCompanyInfo record, @Param("example") UmsCompanyInfoExample example);
+
+    int updateByPrimaryKeySelective(UmsCompanyInfo record);
+
+    int updateByPrimaryKeyWithBLOBs(UmsCompanyInfo record);
+
+    int updateByPrimaryKey(UmsCompanyInfo record);
+
+    public UmsCompanyFile companyFile(Long compId);
+}

+ 6 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/domain/HomeContentResult.java

@@ -17,7 +17,7 @@ import java.util.List;
 @Setter
 public class HomeContentResult {
     //   轮播广告
-     private List<SmsHomeAdvertise> advertiseList;
+    private List<SmsHomeAdvertise> advertiseList;
     //推荐品牌
     private List<PmsBrand> brandList;
     //当前秒杀场次
@@ -28,4 +28,9 @@ public class HomeContentResult {
     private List<PmsProduct> hotProductList;
     //推荐专题
     private List<CmsSubject> subjectList;
+    //首页推广
+    private List<SmsHomeAdvertise> promote;
+
+    //供应商
+    private List<UmsCompanyInfoDto> companyInfos;
 }

+ 6 - 0
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/CouponService.java

@@ -72,6 +72,12 @@ public interface CouponService {
      */
     List<SmsHomeAdvertise> getHomeAdvertiseList();
 
+    /**
+     * 获取首页广告
+     * @return
+     */
+    List<SmsHomeAdvertise> advertise();
+
     /**
      * 根据时间获取秒杀活动
      * @param date

+ 5 - 0
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/HomeService.java

@@ -52,6 +52,11 @@ public interface HomeService {
      */
     List<PmsProduct> hotProductList(Integer pageNum, Integer pageSize);
 
+    /**
+     * 分页获取人气推荐商品
+     */
+    List<PmsProduct> hotProductPage(Integer pageNum, Integer pageSize);
+
     /**
      * 分页获取新品推荐商品
      */

+ 10 - 0
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/UmsCompanyInfoService.java

@@ -15,6 +15,16 @@ public interface UmsCompanyInfoService {
      */
     public List<UmsCompanyInfo> searchCompanyInfo(String key);
 
+
+    /**
+     * 分页获取供应商信息
+     * @param key
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    public List<UmsCompanyInfoDto> searchCompanyInfo(String key,Integer pageNo,Integer pageSize);
+
     /**
      * 供应商详情
      * @param id

+ 13 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/impl/CouponServiceImpl.java

@@ -243,11 +243,23 @@ public class CouponServiceImpl implements CouponService {
     @Override
     public List<SmsHomeAdvertise> getHomeAdvertiseList() {
         SmsHomeAdvertiseExample example = new SmsHomeAdvertiseExample();
-        example.createCriteria().andTypeEqualTo(1).andStatusEqualTo(1);
+        example.createCriteria().andTypeEqualTo(1).andStatusEqualTo(1)
+                .andStartTimeLessThanOrEqualTo(new Date())
+                .andEndTimeGreaterThanOrEqualTo(new Date());
         example.setOrderByClause("sort desc");
         return advertiseMapper.selectByExample(example);
     }
 
+    @Override
+    public List<SmsHomeAdvertise> advertise() {
+        SmsHomeAdvertiseExample example = new SmsHomeAdvertiseExample();
+        example.createCriteria().andTypeEqualTo(0).andStatusEqualTo(1);
+        example.setOrderByClause("sort asc");
+        List<SmsHomeAdvertise> advertises = advertiseMapper.selectByExample(example);
+
+        return advertises;
+    }
+
     /**
      * 根据时间获取秒杀活动
      *

+ 21 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/impl/HomeServiceImpl.java

@@ -3,6 +3,7 @@ package com.hwrj.cloud.portal.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.hwrj.cloud.common.exception.ApiException;
 import com.hwrj.cloud.portal.dao.PmsProductDao;
+import com.hwrj.cloud.portal.domain.UmsCompanyInfoDto;
 import com.hwrj.cloud.portal.mapper.*;
 import com.hwrj.cloud.portal.model.*;
 import com.hwrj.cloud.portal.dao.HomeDao;
@@ -12,6 +13,7 @@ import com.hwrj.cloud.portal.domain.HomeFlashPromotion;
 import com.hwrj.cloud.portal.service.CouponService;
 import com.hwrj.cloud.portal.service.HomeService;
 import com.hwrj.cloud.portal.service.SubjectService;
+import com.hwrj.cloud.portal.service.UmsCompanyInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -45,12 +47,23 @@ public class HomeServiceImpl implements HomeService {
     @Autowired
     private CouponService couponService;
 
+    @Autowired
+    private UmsCompanyInfoService umsCompanyInfoService;
+
     @Override
     public HomeContentResult content() {
         HomeContentResult result = new HomeContentResult();
         //获取首页广告
         List<SmsHomeAdvertise> smsHomeAdvertise = couponService.getHomeAdvertiseList();
         result.setAdvertiseList(smsHomeAdvertise);
+
+        /**
+         * 获取弹窗广告
+         */
+        List<SmsHomeAdvertise> advertise = couponService.advertise();
+        if (advertise != null&&advertise.size()>0){
+            result.setPromote(advertise);
+        }
 //        result.setAdvertiseList(couponFeign.getHomeAdvertiseList().getData());
         //获取推荐品牌
 //        result.setBrandList(homeDao.getRecommendBrandList(0,6));
@@ -60,7 +73,8 @@ public class HomeServiceImpl implements HomeService {
         result.setNewProductList(homeDao.getNewProductList(0, 4));
         //获取人气推荐
         result.setHotProductList(homeDao.getHotProductList(0, 4));
-
+        List<UmsCompanyInfoDto> infoDtos = umsCompanyInfoService.searchCompanyInfo(null, 1, 5);
+        result.setCompanyInfos(infoDtos);
 
         //获取推荐专题
         List<CmsSubject> cmsSubjects = subjectService.getRecommendSubjectList(0, 4);
@@ -121,6 +135,12 @@ public class HomeServiceImpl implements HomeService {
         return homeDao.getHotProductList(offset, pageSize);
     }
 
+    @Override
+    public List<PmsProduct> hotProductPage(Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum,pageSize);
+        return homeDao.getHotProductPage();
+    }
+
     @Override
     public List<PmsProduct> newProductList(Integer pageNum, Integer pageSize) {
         int offset = pageSize * (pageNum - 1);

+ 19 - 1
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/impl/UmsCompanyInfoServiceImpl.java

@@ -1,13 +1,15 @@
 package com.hwrj.cloud.portal.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import com.github.pagehelper.PageHelper;
+import com.hwrj.cloud.common.util.StringUtil;
+import com.hwrj.cloud.portal.dao.UmsCompanyInfoDao;
 import com.hwrj.cloud.portal.domain.UmsCompanyInfoDto;
 import com.hwrj.cloud.portal.mapper.UmsCompanyFileMapper;
 import com.hwrj.cloud.portal.mapper.UmsCompanyInfoMapper;
 import com.hwrj.cloud.portal.mapper.UmsCompanyShopMapper;
 import com.hwrj.cloud.portal.model.*;
 import com.hwrj.cloud.portal.service.UmsCompanyInfoService;
-import net.bytebuddy.asm.Advice;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -23,6 +25,9 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyInfoService {
     @Autowired
     private UmsCompanyShopMapper umsCompanyShopMapper;
 
+    @Autowired
+    private UmsCompanyInfoDao umsCompanyDao;
+
 
     @Override
     public List<UmsCompanyInfo> searchCompanyInfo(String key) {
@@ -36,6 +41,19 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyInfoService {
         return infos;
     }
 
+    @Override
+    public List<UmsCompanyInfoDto> searchCompanyInfo(String key, Integer pageNo, Integer pageSize) {
+        PageHelper.startPage(pageNo,pageSize);
+        UmsCompanyInfoExample example = new UmsCompanyInfoExample();
+        UmsCompanyInfoExample.Criteria criteria = example.createCriteria();
+        if (!StringUtils.isEmpty(key)){
+            criteria.andCompNameLike("%"+key+"%");
+        }
+        List<UmsCompanyInfoDto> dtos = umsCompanyDao.selectByExampleWithBLOBs(example);
+
+        return dtos;
+    }
+
     @Override
     public UmsCompanyInfoDto detailInfo(Long id) {
         if (id == null){

+ 12 - 1
forest-portal/portal-server/src/main/resources/dao/HomeDao.xml

@@ -61,5 +61,16 @@
         LIMIT #{offset}, #{limit};
     </select>
 
+    <select id="getHotProductPage" resultMap="com.hwrj.cloud.portal.mapper.PmsProductMapper.BaseResultMap">
+        SELECT p.*
+        FROM
+            sms_home_recommend_product hp
+            LEFT JOIN pms_product p ON hp.product_id = p.id
+        WHERE
+            hp.recommend_status = 1
+            AND p.publish_status = 1
+        ORDER BY
+            hp.sort DESC
+    </select>
 
-</mapper>
+</mapper>

+ 706 - 0
forest-portal/portal-server/src/main/resources/dao/UmsCompanyInfoDao.xml

@@ -0,0 +1,706 @@
+<?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.hwrj.cloud.portal.dao.UmsCompanyInfoDao">
+  <resultMap id="BaseResultMap" type="com.hwrj.cloud.portal.domain.UmsCompanyInfoDto">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="comp_name" jdbcType="VARCHAR" property="compName" />
+    <result column="company_type" jdbcType="VARCHAR" property="companyType" />
+    <result column="comp_level" jdbcType="INTEGER" property="compLevel" />
+    <result column="comp_qual" jdbcType="VARCHAR" property="compQual" />
+    <result column="comp_imgs" jdbcType="VARCHAR" property="compImgs" />
+    <result column="comp_url" jdbcType="VARCHAR" property="compUrl" />
+    <result column="comp_prod_license_num" jdbcType="VARCHAR" property="compProdLicenseNum" />
+    <result column="comp_manage_license_num" jdbcType="VARCHAR" property="compManageLicenseNum" />
+    <result column="comp_social_code" jdbcType="VARCHAR" property="compSocialCode" />
+    <result column="comp_con_person" jdbcType="VARCHAR" property="compConPerson" />
+    <result column="is_cert" jdbcType="INTEGER" property="isCert" />
+    <result column="comp_con_type" jdbcType="VARCHAR" property="compConType" />
+    <result column="comp_con_num" jdbcType="VARCHAR" property="compConNum" />
+    <result column="comp_qq" jdbcType="VARCHAR" property="compQq" />
+    <result column="comp_manage_product" jdbcType="VARCHAR" property="compManageProduct" />
+    <result column="province_id" jdbcType="VARCHAR" property="provinceId" />
+    <result column="city_id" jdbcType="VARCHAR" property="cityId" />
+    <result column="county_id" jdbcType="VARCHAR" property="countyId" />
+    <result column="town_id" jdbcType="VARCHAR" property="townId" />
+    <result column="village_id" jdbcType="VARCHAR" property="villageId" />
+    <result column="detail_address" jdbcType="VARCHAR" property="detailAddress" />
+    <result column="longitude" jdbcType="VARCHAR" property="longitude" />
+    <result column="latitude" jdbcType="VARCHAR" property="latitude" />
+    <result column="comp_status" jdbcType="INTEGER" property="compStatus" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="create_id" jdbcType="BIGINT" property="createId" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="update_id" jdbcType="BIGINT" property="updateId" />
+    <collection property="files" ofType="com.hwrj.cloud.portal.model.UmsCompanyFile"
+                select="com.hwrj.cloud.portal.dao.UmsCompanyInfoDao.companyFile" column="id"></collection>
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.hwrj.cloud.portal.domain.UmsCompanyInfoDto">
+    <result column="comp_sum" jdbcType="LONGVARCHAR" property="compSum" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, comp_name, company_type, comp_level, comp_qual, comp_imgs, comp_url, comp_prod_license_num,
+    comp_manage_license_num, comp_social_code, comp_con_person, is_cert, comp_con_type,
+    comp_con_num, comp_qq, comp_manage_product, province_id, city_id, county_id, town_id,
+    village_id, detail_address, longitude, latitude, comp_status, create_time, create_id,
+    update_time, update_id
+  </sql>
+  <sql id="Blob_Column_List">
+    comp_sum
+  </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfoExample" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from ums_company_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByExample" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from ums_company_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
+    select
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from ums_company_info
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from ums_company_info
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfoExample">
+    delete from ums_company_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfo">
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into ums_company_info (comp_name, company_type, comp_level,
+      comp_qual, comp_imgs, comp_url,
+      comp_prod_license_num, comp_manage_license_num,
+      comp_social_code, comp_con_person, is_cert,
+      comp_con_type, comp_con_num, comp_qq,
+      comp_manage_product, province_id, city_id,
+      county_id, town_id, village_id,
+      detail_address, longitude, latitude,
+      comp_status, create_time, create_id,
+      update_time, update_id, comp_sum
+      )
+    values (#{compName,jdbcType=VARCHAR}, #{companyType,jdbcType=VARCHAR}, #{compLevel,jdbcType=INTEGER},
+      #{compQual,jdbcType=VARCHAR}, #{compImgs,jdbcType=VARCHAR}, #{compUrl,jdbcType=VARCHAR},
+      #{compProdLicenseNum,jdbcType=VARCHAR}, #{compManageLicenseNum,jdbcType=VARCHAR},
+      #{compSocialCode,jdbcType=VARCHAR}, #{compConPerson,jdbcType=VARCHAR}, #{isCert,jdbcType=INTEGER},
+      #{compConType,jdbcType=VARCHAR}, #{compConNum,jdbcType=VARCHAR}, #{compQq,jdbcType=VARCHAR},
+      #{compManageProduct,jdbcType=VARCHAR}, #{provinceId,jdbcType=VARCHAR}, #{cityId,jdbcType=VARCHAR},
+      #{countyId,jdbcType=VARCHAR}, #{townId,jdbcType=VARCHAR}, #{villageId,jdbcType=VARCHAR},
+      #{detailAddress,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR},
+      #{compStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{createId,jdbcType=BIGINT},
+      #{updateTime,jdbcType=TIMESTAMP}, #{updateId,jdbcType=BIGINT}, #{compSum,jdbcType=LONGVARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfo">
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into ums_company_info
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="compName != null">
+        comp_name,
+      </if>
+      <if test="companyType != null">
+        company_type,
+      </if>
+      <if test="compLevel != null">
+        comp_level,
+      </if>
+      <if test="compQual != null">
+        comp_qual,
+      </if>
+      <if test="compImgs != null">
+        comp_imgs,
+      </if>
+      <if test="compUrl != null">
+        comp_url,
+      </if>
+      <if test="compProdLicenseNum != null">
+        comp_prod_license_num,
+      </if>
+      <if test="compManageLicenseNum != null">
+        comp_manage_license_num,
+      </if>
+      <if test="compSocialCode != null">
+        comp_social_code,
+      </if>
+      <if test="compConPerson != null">
+        comp_con_person,
+      </if>
+      <if test="isCert != null">
+        is_cert,
+      </if>
+      <if test="compConType != null">
+        comp_con_type,
+      </if>
+      <if test="compConNum != null">
+        comp_con_num,
+      </if>
+      <if test="compQq != null">
+        comp_qq,
+      </if>
+      <if test="compManageProduct != null">
+        comp_manage_product,
+      </if>
+      <if test="provinceId != null">
+        province_id,
+      </if>
+      <if test="cityId != null">
+        city_id,
+      </if>
+      <if test="countyId != null">
+        county_id,
+      </if>
+      <if test="townId != null">
+        town_id,
+      </if>
+      <if test="villageId != null">
+        village_id,
+      </if>
+      <if test="detailAddress != null">
+        detail_address,
+      </if>
+      <if test="longitude != null">
+        longitude,
+      </if>
+      <if test="latitude != null">
+        latitude,
+      </if>
+      <if test="compStatus != null">
+        comp_status,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="createId != null">
+        create_id,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="updateId != null">
+        update_id,
+      </if>
+      <if test="compSum != null">
+        comp_sum,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="compName != null">
+        #{compName,jdbcType=VARCHAR},
+      </if>
+      <if test="companyType != null">
+        #{companyType,jdbcType=VARCHAR},
+      </if>
+      <if test="compLevel != null">
+        #{compLevel,jdbcType=INTEGER},
+      </if>
+      <if test="compQual != null">
+        #{compQual,jdbcType=VARCHAR},
+      </if>
+      <if test="compImgs != null">
+        #{compImgs,jdbcType=VARCHAR},
+      </if>
+      <if test="compUrl != null">
+        #{compUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="compProdLicenseNum != null">
+        #{compProdLicenseNum,jdbcType=VARCHAR},
+      </if>
+      <if test="compManageLicenseNum != null">
+        #{compManageLicenseNum,jdbcType=VARCHAR},
+      </if>
+      <if test="compSocialCode != null">
+        #{compSocialCode,jdbcType=VARCHAR},
+      </if>
+      <if test="compConPerson != null">
+        #{compConPerson,jdbcType=VARCHAR},
+      </if>
+      <if test="isCert != null">
+        #{isCert,jdbcType=INTEGER},
+      </if>
+      <if test="compConType != null">
+        #{compConType,jdbcType=VARCHAR},
+      </if>
+      <if test="compConNum != null">
+        #{compConNum,jdbcType=VARCHAR},
+      </if>
+      <if test="compQq != null">
+        #{compQq,jdbcType=VARCHAR},
+      </if>
+      <if test="compManageProduct != null">
+        #{compManageProduct,jdbcType=VARCHAR},
+      </if>
+      <if test="provinceId != null">
+        #{provinceId,jdbcType=VARCHAR},
+      </if>
+      <if test="cityId != null">
+        #{cityId,jdbcType=VARCHAR},
+      </if>
+      <if test="countyId != null">
+        #{countyId,jdbcType=VARCHAR},
+      </if>
+      <if test="townId != null">
+        #{townId,jdbcType=VARCHAR},
+      </if>
+      <if test="villageId != null">
+        #{villageId,jdbcType=VARCHAR},
+      </if>
+      <if test="detailAddress != null">
+        #{detailAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="longitude != null">
+        #{longitude,jdbcType=VARCHAR},
+      </if>
+      <if test="latitude != null">
+        #{latitude,jdbcType=VARCHAR},
+      </if>
+      <if test="compStatus != null">
+        #{compStatus,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createId != null">
+        #{createId,jdbcType=BIGINT},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateId != null">
+        #{updateId,jdbcType=BIGINT},
+      </if>
+      <if test="compSum != null">
+        #{compSum,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfoExample" resultType="java.lang.Long">
+    select count(*) from ums_company_info
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update ums_company_info
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.compName != null">
+        comp_name = #{record.compName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.companyType != null">
+        company_type = #{record.companyType,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compLevel != null">
+        comp_level = #{record.compLevel,jdbcType=INTEGER},
+      </if>
+      <if test="record.compQual != null">
+        comp_qual = #{record.compQual,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compImgs != null">
+        comp_imgs = #{record.compImgs,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compUrl != null">
+        comp_url = #{record.compUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compProdLicenseNum != null">
+        comp_prod_license_num = #{record.compProdLicenseNum,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compManageLicenseNum != null">
+        comp_manage_license_num = #{record.compManageLicenseNum,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compSocialCode != null">
+        comp_social_code = #{record.compSocialCode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compConPerson != null">
+        comp_con_person = #{record.compConPerson,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isCert != null">
+        is_cert = #{record.isCert,jdbcType=INTEGER},
+      </if>
+      <if test="record.compConType != null">
+        comp_con_type = #{record.compConType,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compConNum != null">
+        comp_con_num = #{record.compConNum,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compQq != null">
+        comp_qq = #{record.compQq,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compManageProduct != null">
+        comp_manage_product = #{record.compManageProduct,jdbcType=VARCHAR},
+      </if>
+      <if test="record.provinceId != null">
+        province_id = #{record.provinceId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.cityId != null">
+        city_id = #{record.cityId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.countyId != null">
+        county_id = #{record.countyId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.townId != null">
+        town_id = #{record.townId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.villageId != null">
+        village_id = #{record.villageId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.detailAddress != null">
+        detail_address = #{record.detailAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="record.longitude != null">
+        longitude = #{record.longitude,jdbcType=VARCHAR},
+      </if>
+      <if test="record.latitude != null">
+        latitude = #{record.latitude,jdbcType=VARCHAR},
+      </if>
+      <if test="record.compStatus != null">
+        comp_status = #{record.compStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.createId != null">
+        create_id = #{record.createId,jdbcType=BIGINT},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateId != null">
+        update_id = #{record.updateId,jdbcType=BIGINT},
+      </if>
+      <if test="record.compSum != null">
+        comp_sum = #{record.compSum,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update ums_company_info
+    set id = #{record.id,jdbcType=BIGINT},
+      comp_name = #{record.compName,jdbcType=VARCHAR},
+      company_type = #{record.companyType,jdbcType=VARCHAR},
+      comp_level = #{record.compLevel,jdbcType=INTEGER},
+      comp_qual = #{record.compQual,jdbcType=VARCHAR},
+      comp_imgs = #{record.compImgs,jdbcType=VARCHAR},
+      comp_url = #{record.compUrl,jdbcType=VARCHAR},
+      comp_prod_license_num = #{record.compProdLicenseNum,jdbcType=VARCHAR},
+      comp_manage_license_num = #{record.compManageLicenseNum,jdbcType=VARCHAR},
+      comp_social_code = #{record.compSocialCode,jdbcType=VARCHAR},
+      comp_con_person = #{record.compConPerson,jdbcType=VARCHAR},
+      is_cert = #{record.isCert,jdbcType=INTEGER},
+      comp_con_type = #{record.compConType,jdbcType=VARCHAR},
+      comp_con_num = #{record.compConNum,jdbcType=VARCHAR},
+      comp_qq = #{record.compQq,jdbcType=VARCHAR},
+      comp_manage_product = #{record.compManageProduct,jdbcType=VARCHAR},
+      province_id = #{record.provinceId,jdbcType=VARCHAR},
+      city_id = #{record.cityId,jdbcType=VARCHAR},
+      county_id = #{record.countyId,jdbcType=VARCHAR},
+      town_id = #{record.townId,jdbcType=VARCHAR},
+      village_id = #{record.villageId,jdbcType=VARCHAR},
+      detail_address = #{record.detailAddress,jdbcType=VARCHAR},
+      longitude = #{record.longitude,jdbcType=VARCHAR},
+      latitude = #{record.latitude,jdbcType=VARCHAR},
+      comp_status = #{record.compStatus,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      create_id = #{record.createId,jdbcType=BIGINT},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      update_id = #{record.updateId,jdbcType=BIGINT},
+      comp_sum = #{record.compSum,jdbcType=LONGVARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update ums_company_info
+    set id = #{record.id,jdbcType=BIGINT},
+      comp_name = #{record.compName,jdbcType=VARCHAR},
+      company_type = #{record.companyType,jdbcType=VARCHAR},
+      comp_level = #{record.compLevel,jdbcType=INTEGER},
+      comp_qual = #{record.compQual,jdbcType=VARCHAR},
+      comp_imgs = #{record.compImgs,jdbcType=VARCHAR},
+      comp_url = #{record.compUrl,jdbcType=VARCHAR},
+      comp_prod_license_num = #{record.compProdLicenseNum,jdbcType=VARCHAR},
+      comp_manage_license_num = #{record.compManageLicenseNum,jdbcType=VARCHAR},
+      comp_social_code = #{record.compSocialCode,jdbcType=VARCHAR},
+      comp_con_person = #{record.compConPerson,jdbcType=VARCHAR},
+      is_cert = #{record.isCert,jdbcType=INTEGER},
+      comp_con_type = #{record.compConType,jdbcType=VARCHAR},
+      comp_con_num = #{record.compConNum,jdbcType=VARCHAR},
+      comp_qq = #{record.compQq,jdbcType=VARCHAR},
+      comp_manage_product = #{record.compManageProduct,jdbcType=VARCHAR},
+      province_id = #{record.provinceId,jdbcType=VARCHAR},
+      city_id = #{record.cityId,jdbcType=VARCHAR},
+      county_id = #{record.countyId,jdbcType=VARCHAR},
+      town_id = #{record.townId,jdbcType=VARCHAR},
+      village_id = #{record.villageId,jdbcType=VARCHAR},
+      detail_address = #{record.detailAddress,jdbcType=VARCHAR},
+      longitude = #{record.longitude,jdbcType=VARCHAR},
+      latitude = #{record.latitude,jdbcType=VARCHAR},
+      comp_status = #{record.compStatus,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      create_id = #{record.createId,jdbcType=BIGINT},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      update_id = #{record.updateId,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfo">
+    update ums_company_info
+    <set>
+      <if test="compName != null">
+        comp_name = #{compName,jdbcType=VARCHAR},
+      </if>
+      <if test="companyType != null">
+        company_type = #{companyType,jdbcType=VARCHAR},
+      </if>
+      <if test="compLevel != null">
+        comp_level = #{compLevel,jdbcType=INTEGER},
+      </if>
+      <if test="compQual != null">
+        comp_qual = #{compQual,jdbcType=VARCHAR},
+      </if>
+      <if test="compImgs != null">
+        comp_imgs = #{compImgs,jdbcType=VARCHAR},
+      </if>
+      <if test="compUrl != null">
+        comp_url = #{compUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="compProdLicenseNum != null">
+        comp_prod_license_num = #{compProdLicenseNum,jdbcType=VARCHAR},
+      </if>
+      <if test="compManageLicenseNum != null">
+        comp_manage_license_num = #{compManageLicenseNum,jdbcType=VARCHAR},
+      </if>
+      <if test="compSocialCode != null">
+        comp_social_code = #{compSocialCode,jdbcType=VARCHAR},
+      </if>
+      <if test="compConPerson != null">
+        comp_con_person = #{compConPerson,jdbcType=VARCHAR},
+      </if>
+      <if test="isCert != null">
+        is_cert = #{isCert,jdbcType=INTEGER},
+      </if>
+      <if test="compConType != null">
+        comp_con_type = #{compConType,jdbcType=VARCHAR},
+      </if>
+      <if test="compConNum != null">
+        comp_con_num = #{compConNum,jdbcType=VARCHAR},
+      </if>
+      <if test="compQq != null">
+        comp_qq = #{compQq,jdbcType=VARCHAR},
+      </if>
+      <if test="compManageProduct != null">
+        comp_manage_product = #{compManageProduct,jdbcType=VARCHAR},
+      </if>
+      <if test="provinceId != null">
+        province_id = #{provinceId,jdbcType=VARCHAR},
+      </if>
+      <if test="cityId != null">
+        city_id = #{cityId,jdbcType=VARCHAR},
+      </if>
+      <if test="countyId != null">
+        county_id = #{countyId,jdbcType=VARCHAR},
+      </if>
+      <if test="townId != null">
+        town_id = #{townId,jdbcType=VARCHAR},
+      </if>
+      <if test="villageId != null">
+        village_id = #{villageId,jdbcType=VARCHAR},
+      </if>
+      <if test="detailAddress != null">
+        detail_address = #{detailAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="longitude != null">
+        longitude = #{longitude,jdbcType=VARCHAR},
+      </if>
+      <if test="latitude != null">
+        latitude = #{latitude,jdbcType=VARCHAR},
+      </if>
+      <if test="compStatus != null">
+        comp_status = #{compStatus,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createId != null">
+        create_id = #{createId,jdbcType=BIGINT},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateId != null">
+        update_id = #{updateId,jdbcType=BIGINT},
+      </if>
+      <if test="compSum != null">
+        comp_sum = #{compSum,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfo">
+    update ums_company_info
+    set comp_name = #{compName,jdbcType=VARCHAR},
+      company_type = #{companyType,jdbcType=VARCHAR},
+      comp_level = #{compLevel,jdbcType=INTEGER},
+      comp_qual = #{compQual,jdbcType=VARCHAR},
+      comp_imgs = #{compImgs,jdbcType=VARCHAR},
+      comp_url = #{compUrl,jdbcType=VARCHAR},
+      comp_prod_license_num = #{compProdLicenseNum,jdbcType=VARCHAR},
+      comp_manage_license_num = #{compManageLicenseNum,jdbcType=VARCHAR},
+      comp_social_code = #{compSocialCode,jdbcType=VARCHAR},
+      comp_con_person = #{compConPerson,jdbcType=VARCHAR},
+      is_cert = #{isCert,jdbcType=INTEGER},
+      comp_con_type = #{compConType,jdbcType=VARCHAR},
+      comp_con_num = #{compConNum,jdbcType=VARCHAR},
+      comp_qq = #{compQq,jdbcType=VARCHAR},
+      comp_manage_product = #{compManageProduct,jdbcType=VARCHAR},
+      province_id = #{provinceId,jdbcType=VARCHAR},
+      city_id = #{cityId,jdbcType=VARCHAR},
+      county_id = #{countyId,jdbcType=VARCHAR},
+      town_id = #{townId,jdbcType=VARCHAR},
+      village_id = #{villageId,jdbcType=VARCHAR},
+      detail_address = #{detailAddress,jdbcType=VARCHAR},
+      longitude = #{longitude,jdbcType=VARCHAR},
+      latitude = #{latitude,jdbcType=VARCHAR},
+      comp_status = #{compStatus,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      create_id = #{createId,jdbcType=BIGINT},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      update_id = #{updateId,jdbcType=BIGINT},
+      comp_sum = #{compSum,jdbcType=LONGVARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hwrj.cloud.portal.model.UmsCompanyInfo">
+    update ums_company_info
+    set comp_name = #{compName,jdbcType=VARCHAR},
+      company_type = #{companyType,jdbcType=VARCHAR},
+      comp_level = #{compLevel,jdbcType=INTEGER},
+      comp_qual = #{compQual,jdbcType=VARCHAR},
+      comp_imgs = #{compImgs,jdbcType=VARCHAR},
+      comp_url = #{compUrl,jdbcType=VARCHAR},
+      comp_prod_license_num = #{compProdLicenseNum,jdbcType=VARCHAR},
+      comp_manage_license_num = #{compManageLicenseNum,jdbcType=VARCHAR},
+      comp_social_code = #{compSocialCode,jdbcType=VARCHAR},
+      comp_con_person = #{compConPerson,jdbcType=VARCHAR},
+      is_cert = #{isCert,jdbcType=INTEGER},
+      comp_con_type = #{compConType,jdbcType=VARCHAR},
+      comp_con_num = #{compConNum,jdbcType=VARCHAR},
+      comp_qq = #{compQq,jdbcType=VARCHAR},
+      comp_manage_product = #{compManageProduct,jdbcType=VARCHAR},
+      province_id = #{provinceId,jdbcType=VARCHAR},
+      city_id = #{cityId,jdbcType=VARCHAR},
+      county_id = #{countyId,jdbcType=VARCHAR},
+      town_id = #{townId,jdbcType=VARCHAR},
+      village_id = #{villageId,jdbcType=VARCHAR},
+      detail_address = #{detailAddress,jdbcType=VARCHAR},
+      longitude = #{longitude,jdbcType=VARCHAR},
+      latitude = #{latitude,jdbcType=VARCHAR},
+      comp_status = #{compStatus,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      create_id = #{createId,jdbcType=BIGINT},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      update_id = #{updateId,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <select id="companyFile" parameterType="java.lang.Long" resultMap="com.hwrj.cloud.portal.mapper.UmsCompanyFileMapper.BaseResultMap">
+    select
+    <include refid="com.hwrj.cloud.portal.mapper.UmsCompanyFileMapper.Base_Column_List">
+    </include>
+    from ums_company_file a where a.comp_id = #{compId} and a.file_type='logo'
+  </select>
+</mapper>