Просмотр исходного кода

统计模块开发,公出统计待完善

anderx лет назад: 4
Родитель
Сommit
196c18548a

+ 7 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -1,10 +1,13 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.common.model.OutPublicReleaseCount;
 import com.goafanti.common.model.PublicRelease;
+import com.goafanti.common.model.PublicReleaseCount;
 import com.goafanti.weChat.bo.OutPublicRelease;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
+import java.util.List;
 
 public interface PublicReleaseMapper {
     int deleteByPrimaryKey(Integer id);
@@ -19,10 +22,14 @@ public interface PublicReleaseMapper {
 
     int updateByPrimaryKey(PublicRelease record);
 
+
     void insertSelectiveGetId(PublicRelease in);
 
     OutPublicRelease selectDtails(@Param("id") Integer id, @Param("ufid")String ufid);
 
     int checkTime(@Param("aid")String aid, @Param("start") Date start, @Param("end")Date end);
 
+    void updateSignByAidAndUid(@Param("uid") String buyerId, @Param("aid") String salesmanId);
+
+    List<OutPublicReleaseCount > getTimeUserFollow(@Param("date")Date date, @Param("now")Date now);
 }

+ 1 - 1
src/main/java/com/goafanti/common/dao/TOrderNewMapper.java

@@ -39,7 +39,7 @@ public interface TOrderNewMapper {
     List<TOrderNewBo> selectUsedOrderByOrder(String orderNo);
     void updaterefund(TOrderNew o);
 
-    List<BigDecimal> selectByUidAndNewUser(@Param("uid")String uid, @Param("newUser")Integer newUser, @Param("date") Date date, @Param("now")Date now);
+    List<BigDecimal> selectByUidAndNewUser(@Param("uid")String uid,@Param("aid")String aid, @Param("newUser")Integer newUser, @Param("date") Date date, @Param("now")Date now);
 
     List<outStatisticsList> statisticsList(InputStatistics in);
 

+ 24 - 13
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -24,7 +24,7 @@
     <result column="valid_date" jdbcType="VARCHAR" property="validDate" />
     <result column="new_user" jdbcType="INTEGER" property="newUser" />
     <result column="sign_sum" jdbcType="INTEGER" property="signSum" />
-    <result column="mian_status" jdbcType="INTEGER" property="mianStatus" />
+    <result column="mian_status" jdbcType="INTEGER" property="mainStatus" />
     <result column="supplement" jdbcType="VARCHAR" property="supplement" />
     <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
   </resultMap>
@@ -60,7 +60,7 @@
       #{clockInTime,jdbcType=TIMESTAMP}, #{photoUrl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, 
       #{pname,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE}, 
       #{validDate,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER}, 
-      #{mianStatus,jdbcType=INTEGER}, #{supplement,jdbcType=VARCHAR}, #{auditInfo,jdbcType=VARCHAR}
+      #{mainStatus,jdbcType=INTEGER}, #{supplement,jdbcType=VARCHAR}, #{auditInfo,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
@@ -129,7 +129,7 @@
       <if test="signSum != null">
         sign_sum,
       </if>
-      <if test="mianStatus != null">
+      <if test="mainStatus != null">
         mian_status,
       </if>
       <if test="supplement != null">
@@ -203,8 +203,8 @@
       <if test="signSum != null">
         #{signSum,jdbcType=INTEGER},
       </if>
-      <if test="mianStatus != null">
-        #{mianStatus,jdbcType=INTEGER},
+      <if test="mainStatus != null">
+        #{mainStatus,jdbcType=INTEGER},
       </if>
       <if test="supplement != null">
         #{supplement,jdbcType=VARCHAR},
@@ -280,8 +280,8 @@
       <if test="signSum != null">
         sign_sum = #{signSum,jdbcType=INTEGER},
       </if>
-      <if test="mianStatus != null">
-        mian_status = #{mianStatus,jdbcType=INTEGER},
+      <if test="mainStatus != null">
+        mian_status = #{mainStatus,jdbcType=INTEGER},
       </if>
       <if test="supplement != null">
         supplement = #{supplement,jdbcType=VARCHAR},
@@ -315,13 +315,19 @@
       valid_date = #{validDate,jdbcType=VARCHAR},
       new_user = #{newUser,jdbcType=INTEGER},
       sign_sum = #{signSum,jdbcType=INTEGER},
-      mian_status = #{mianStatus,jdbcType=INTEGER},
+      mian_status = #{mainStatus,jdbcType=INTEGER},
       supplement = #{supplement,jdbcType=VARCHAR},
       audit_info = #{auditInfo,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
-   <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
+  <update id="updateSignByAidAndUid">
+    update public_release a ,(select max(create_time)create_time from public_release
+      where aid= #{aid} and uid=#{uid} and main_status =1 group by aid,uid)b
+    set a.sign_sum =a.sign_sum +1
+    where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
+  </update>
+  <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
      insert into public_release
      <trim prefix="(" suffix=")" suffixOverrides=",">
        <if test="uid != null">
@@ -387,7 +393,7 @@
        <if test="signSum != null">
          sign_sum,
        </if>
-       <if test="mianStatus != null">
+       <if test="mainStatus != null">
          mian_status,
        </if>
        <if test="supplement != null">
@@ -461,8 +467,8 @@
        <if test="signSum != null">
          #{signSum,jdbcType=INTEGER},
        </if>
-       <if test="mianStatus != null">
-         #{mianStatus,jdbcType=INTEGER},
+       <if test="mainStatus != null">
+         #{mainStatus,jdbcType=INTEGER},
        </if>
        <if test="supplement != null">
          #{supplement,jdbcType=VARCHAR},
@@ -673,5 +679,10 @@
   or  (release_start &lt; #{start} and release_end &gt; #{start})
   or  (release_start &lt; #{end} and release_end &gt; #{end}))
   </select>
-
+  <select id="getTimeUserFollow" resultType="com.goafanti.common.model.OutPublicReleaseCount">
+    select e.id province,d.id depId,a.aid,a.uid,a.new_user newUser from (select aid,uid,new_user from public_release
+     where main_status =1 and create_time between #{date} and #{now}
+     group by aid,uid,new_user)a left join admin c on a.aid=c.id
+    left join department d on c.department_id =d.id left join district_glossory e on d.province =e.id
+  </select>
 </mapper>

Разница между файлами не показана из-за своего большого размера
+ 217 - 591
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml


+ 13 - 0
src/main/java/com/goafanti/common/model/OutPublicReleaseCount.java

@@ -0,0 +1,13 @@
+package com.goafanti.common.model;
+
+public class OutPublicReleaseCount extends PublicReleaseCount {
+    private String aid;
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+}

+ 201 - 395
src/main/java/com/goafanti/common/model/PublicRelease.java

@@ -118,7 +118,7 @@ public class PublicRelease implements Serializable {
     /**
      * 0辅助根据 1主要跟进
      */
-    private Integer mianStatus;
+    private Integer mainStatus;
 
     /**
      * 公出补充
@@ -132,398 +132,204 @@ public class PublicRelease implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.id
-	 * @return  the value of public_release.id
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public Integer getId() {
-		return id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.id
-	 * @param id  the value for public_release.id
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setId(Integer id) {
-		this.id = id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.uid
-	 * @return  the value of public_release.uid
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getUid() {
-		return uid;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.uid
-	 * @param uid  the value for public_release.uid
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setUid(String uid) {
-		this.uid = uid == null ? null : uid.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.aid
-	 * @return  the value of public_release.aid
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getAid() {
-		return aid;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.aid
-	 * @param aid  the value for public_release.aid
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setAid(String aid) {
-		this.aid = aid == null ? null : aid.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.release_start
-	 * @return  the value of public_release.release_start
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public Date getReleaseStart() {
-		return releaseStart;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.release_start
-	 * @param releaseStart  the value for public_release.release_start
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setReleaseStart(Date releaseStart) {
-		this.releaseStart = releaseStart;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.release_end
-	 * @return  the value of public_release.release_end
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public Date getReleaseEnd() {
-		return releaseEnd;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.release_end
-	 * @param releaseEnd  the value for public_release.release_end
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setReleaseEnd(Date releaseEnd) {
-		this.releaseEnd = releaseEnd;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.remarks
-	 * @return  the value of public_release.remarks
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getRemarks() {
-		return remarks;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.remarks
-	 * @param remarks  the value for public_release.remarks
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setRemarks(String remarks) {
-		this.remarks = remarks == null ? null : remarks.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.user_name
-	 * @return  the value of public_release.user_name
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getUserName() {
-		return userName;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.user_name
-	 * @param userName  the value for public_release.user_name
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setUserName(String userName) {
-		this.userName = userName == null ? null : userName.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.longitude
-	 * @return  the value of public_release.longitude
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getLongitude() {
-		return longitude;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.longitude
-	 * @param longitude  the value for public_release.longitude
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setLongitude(String longitude) {
-		this.longitude = longitude == null ? null : longitude.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.latitude
-	 * @return  the value of public_release.latitude
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getLatitude() {
-		return latitude;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.latitude
-	 * @param latitude  the value for public_release.latitude
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setLatitude(String latitude) {
-		this.latitude = latitude == null ? null : latitude.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.status
-	 * @return  the value of public_release.status
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.status
-	 * @param status  the value for public_release.status
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.create_time
-	 * @return  the value of public_release.create_time
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.create_time
-	 * @param createTime  the value for public_release.create_time
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.clock_in
-	 * @return  the value of public_release.clock_in
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public Integer getClockIn() {
-		return clockIn;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.clock_in
-	 * @param clockIn  the value for public_release.clock_in
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setClockIn(Integer clockIn) {
-		this.clockIn = clockIn;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.clock_in_time
-	 * @return  the value of public_release.clock_in_time
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public Date getClockInTime() {
-		return clockInTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.clock_in_time
-	 * @param clockInTime  the value for public_release.clock_in_time
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setClockInTime(Date clockInTime) {
-		this.clockInTime = clockInTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.pid
-	 * @return  the value of public_release.pid
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getPid() {
-		return pid;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.pid
-	 * @param pid  the value for public_release.pid
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setPid(String pid) {
-		this.pid = pid == null ? null : pid.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.pname
-	 * @return  the value of public_release.pname
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getPname() {
-		return pname;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.pname
-	 * @param pname  the value for public_release.pname
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setPname(String pname) {
-		this.pname = pname == null ? null : pname.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.ufid
-	 * @return  the value of public_release.ufid
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getUfid() {
-		return ufid;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.ufid
-	 * @param ufid  the value for public_release.ufid
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setUfid(String ufid) {
-		this.ufid = ufid == null ? null : ufid.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.duration
-	 * @return  the value of public_release.duration
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public Double getDuration() {
-		return duration;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.duration
-	 * @param duration  the value for public_release.duration
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setDuration(Double duration) {
-		this.duration = duration;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.valid_date
-	 * @return  the value of public_release.valid_date
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getValidDate() {
-		return validDate;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.valid_date
-	 * @param validDate  the value for public_release.valid_date
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setValidDate(String validDate) {
-		this.validDate = validDate == null ? null : validDate.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.annex_url
-	 * @return  the value of public_release.annex_url
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getAnnexUrl() {
-		return annexUrl;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.annex_url
-	 * @param annexUrl  the value for public_release.annex_url
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setAnnexUrl(String annexUrl) {
-		this.annexUrl = annexUrl == null ? null : annexUrl.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column public_release.photo_url
-	 * @return  the value of public_release.photo_url
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public String getPhotoUrl() {
-		return photoUrl;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column public_release.photo_url
-	 * @param photoUrl  the value for public_release.photo_url
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	public void setPhotoUrl(String photoUrl) {
-		this.photoUrl = photoUrl == null ? null : photoUrl.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
-	 * @mbg.generated  Thu Jun 10 15:22:12 CST 2021
-	 */
-	@Override
-	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append(getClass().getSimpleName());
-		sb.append(" [");
-		sb.append("Hash = ").append(hashCode());
-		sb.append(", id=").append(id);
-		sb.append(", uid=").append(uid);
-		sb.append(", aid=").append(aid);
-		sb.append(", releaseStart=").append(releaseStart);
-		sb.append(", releaseEnd=").append(releaseEnd);
-		sb.append(", remarks=").append(remarks);
-		sb.append(", userName=").append(userName);
-		sb.append(", longitude=").append(longitude);
-		sb.append(", latitude=").append(latitude);
-		sb.append(", status=").append(status);
-		sb.append(", createTime=").append(createTime);
-		sb.append(", clockIn=").append(clockIn);
-		sb.append(", clockInTime=").append(clockInTime);
-		sb.append(", pid=").append(pid);
-		sb.append(", pname=").append(pname);
-		sb.append(", ufid=").append(ufid);
-		sb.append(", duration=").append(duration);
-		sb.append(", validDate=").append(validDate);
-		sb.append(", annexUrl=").append(annexUrl);
-		sb.append(", photoUrl=").append(photoUrl);
-		sb.append(", serialVersionUID=").append(serialVersionUID);
-		sb.append("]");
-		return sb.toString();
-	}
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Date getReleaseStart() {
+        return releaseStart;
+    }
+
+    public void setReleaseStart(Date releaseStart) {
+        this.releaseStart = releaseStart;
+    }
+
+    public Date getReleaseEnd() {
+        return releaseEnd;
+    }
+
+    public void setReleaseEnd(Date releaseEnd) {
+        this.releaseEnd = releaseEnd;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getAnnexUrl() {
+        return annexUrl;
+    }
+
+    public void setAnnexUrl(String annexUrl) {
+        this.annexUrl = annexUrl;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Integer getClockIn() {
+        return clockIn;
+    }
+
+    public void setClockIn(Integer clockIn) {
+        this.clockIn = clockIn;
+    }
+
+    public Date getClockInTime() {
+        return clockInTime;
+    }
+
+    public void setClockInTime(Date clockInTime) {
+        this.clockInTime = clockInTime;
+    }
+
+    public String getPhotoUrl() {
+        return photoUrl;
+    }
+
+    public void setPhotoUrl(String photoUrl) {
+        this.photoUrl = photoUrl;
+    }
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+    public String getPname() {
+        return pname;
+    }
+
+    public void setPname(String pname) {
+        this.pname = pname;
+    }
+
+    public String getUfid() {
+        return ufid;
+    }
+
+    public void setUfid(String ufid) {
+        this.ufid = ufid;
+    }
+
+    public Double getDuration() {
+        return duration;
+    }
+
+    public void setDuration(Double duration) {
+        this.duration = duration;
+    }
+
+    public String getValidDate() {
+        return validDate;
+    }
+
+    public void setValidDate(String validDate) {
+        this.validDate = validDate;
+    }
+
+    public Integer getNewUser() {
+        return newUser;
+    }
+
+    public void setNewUser(Integer newUser) {
+        this.newUser = newUser;
+    }
+
+    public Integer getSignSum() {
+        return signSum;
+    }
+
+    public void setSignSum(Integer signSum) {
+        this.signSum = signSum;
+    }
+
+
+    public Integer getMainStatus() {
+        return mainStatus;
+    }
+
+    public void setMainStatus(Integer mainStatus) {
+        this.mainStatus = mainStatus;
+    }
+
+    public String getSupplement() {
+        return supplement;
+    }
+
+    public void setSupplement(String supplement) {
+        this.supplement = supplement;
+    }
+
+    public String getAuditInfo() {
+        return auditInfo;
+    }
+
+    public void setAuditInfo(String auditInfo) {
+        this.auditInfo = auditInfo;
+    }
 }

+ 9 - 6
src/main/java/com/goafanti/common/task/UserFollowTask.java

@@ -4,6 +4,7 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.PublicReleaseCountMapper;
 import com.goafanti.common.dao.PublicReleaseMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.model.OutPublicReleaseCount;
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.common.model.PublicReleaseCount;
 import com.goafanti.common.model.outUserFollowCount;
@@ -43,13 +44,14 @@ public class UserFollowTask {
         Calendar now=getNowDate();
         Calendar date=getNowDate();
         String ym=getYearMonth();
+
         date.set(Calendar.MONTH,now.get(Calendar.MONTH)-1);
-        List<PublicReleaseCount> list =publicReleaseMapper.getTimeUserFollow(date.getTime(),now.getTime());
-        for (PublicReleaseCount out : list) {
+        List<OutPublicReleaseCount> list =publicReleaseMapper.getTimeUserFollow(date.getTime(),now.getTime());
+        for (OutPublicReleaseCount out : list) {
             out.setDate(ym);
-            List<BigDecimal> aList=tOrderNewMapper.selectByUidAndNewUser(out.getUid(),out.getNewUser(),date.getTime(),now.getTime());
+            out.setQuantity(1);
+            List<BigDecimal> aList=tOrderNewMapper.selectByUidAndNewUser(out.getUid(),out.getAid(),out.getNewUser(),date.getTime(),now.getTime());
             if (aList.isEmpty()){
-                out.setQuantity(0);
                 out.setTotal(new BigDecimal(0));
             }else{
                 out.setQuantity(aList.size());
@@ -63,10 +65,10 @@ public class UserFollowTask {
         List<PublicReleaseCount> newList=new ArrayList<>();
         if (list != null && list.size() > 0) {
             for (int i = 0; i < list.size(); i++) {
-                newList.add(list.get(i));
+                newList.add((PublicReleaseCount)list.get(i));
                 if (50 == newList.size() || i == list.size() - 1) {
                     if (newList.size() > 0) {
-                        publicReleaseCountMapper.insertBatch(list);
+                        publicReleaseCountMapper.insertBatch(newList);
                     }
                     newList.clear();
                     Thread.sleep(2000);
@@ -82,6 +84,7 @@ public class UserFollowTask {
         now.set(Calendar.HOUR_OF_DAY, 0);
         now.clear(Calendar.MINUTE);
         now.clear(Calendar.SECOND);
+        now.clear(Calendar.MILLISECOND);
         return now;
     }
     public String getYearMonth(){

+ 0 - 9
src/main/java/com/goafanti/order/bo/InputStatistics.java

@@ -5,7 +5,6 @@ public class InputStatistics {
     private String depName;
     private Integer province;
     private String provinceName;
-    private String orderNo;
     private String startCreate;
     private String endCreate;
     private String startSign;
@@ -31,14 +30,6 @@ public class InputStatistics {
         this.depName = depName;
     }
 
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
     public String getDepId() {
         return depId;
     }

+ 9 - 0
src/main/java/com/goafanti/order/bo/outProvinceStatisticsList.java

@@ -6,6 +6,7 @@ import java.math.BigDecimal;
 
 public class outProvinceStatisticsList {
 
+    private  String aid;
     @Excel(name = "订单部门")
     private String depName;
     @Excel(name = "签单人")
@@ -15,6 +16,14 @@ public class outProvinceStatisticsList {
     @Excel(name = "总签单额(万元)")
     private BigDecimal total;
 
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
     public String getDepName() {
         return depName;
     }

+ 9 - 0
src/main/java/com/goafanti/order/bo/outStatisticsList.java

@@ -6,6 +6,7 @@ import java.math.BigDecimal;
 
 public class outStatisticsList {
 
+    private  Integer id;
     @Excel(name = "省")
     private String province;
     @Excel(name = "签单人数(人)")
@@ -15,6 +16,14 @@ public class outStatisticsList {
     @Excel(name = "总签单额(万元)")
     private BigDecimal total;
 
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
     public String getProvince() {
         return province;
     }

+ 27 - 0
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -574,4 +574,31 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res().data(orderNewService.provinceStatisticsList(in));
 	}
 
+	/**
+	 * 	签单统计表
+	 * @throws IOException
+	 */
+	@RequestMapping(value = "/provinceStatisticsListExprot", method = RequestMethod.GET)
+	public Result provinceStatisticsListExprot(InputStatistics in){
+		List<outProvinceStatisticsList>  list =orderNewService.provinceStatisticsList(in);
+		NewExcelUtil<outProvinceStatisticsList> excelUtil=new NewExcelUtil<>(outProvinceStatisticsList.class);
+		StringBuffer sb=new StringBuffer("搜索条件=》");
+		if (in.getDepName()!=null)sb=sb.append("部门:").append(in.getDepName()).append(",");
+		if(in.getProvinceName()!=null)sb=sb.append("省份:").append(in.getProvinceName()).append(",");
+		if(in.getSort()!=null){
+			sb=sb.append("排序:");
+			if (in.getSort()==0)sb=sb.append("按签单额");
+			else if (in.getSort()==1)sb=sb.append("按签单总量");
+			else if (in.getSort()==2)sb=sb.append("按签单人数");
+			sb=sb.append(",");
+		}
+		if (in.getStartCreate()!=null&&in.getEndCreate()!=null){
+			sb=sb.append("下单时间:").append(in.getStartCreate()).append("~").append(in.getEndCreate()).append(",");
+		}
+		if (in.getStartSign()!=null&&in.getEndSign()!=null){
+			sb=sb.append("合同时间:").append(in.getStartSign()).append("~").append(in.getEndSign()).append(",");
+		}
+		return excelUtil.exportExcel(list,"签单省份统计表",uploadPath,sb.substring(0,sb.toString().length()-1));
+	}
+
 }

+ 9 - 21
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -80,13 +80,15 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		Date date =new Date();
 		in.setCreateTime(date);
 		in.setStatus(1);
-		String aid=TokenManager.getAdminId();
-		in.setAid(aid);
+
+		in.setAid(TokenManager.getAdminId());
+		in.setNewUser(0);
 		User u=userMapper.selectByPrimaryKey(in.getUid());
-		if (u.getAid().equals(aid)){
-			in.setMianStatus(1);
-		}else{
-			in.setMianStatus(0);
+		if (u!=null&&u.getShareType()==2){
+			in.setNewUser(1);
+		}
+		if (u.getAid().equals(TokenManager.getAdminId())){
+			in.setMainStatus(1);
 		}
 		publicReleaseMapper.insertSelectiveGetId(in);
 		AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
@@ -131,13 +133,6 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		asyncUtils.addNotice(n);
 	}
 
-
-
-
-
-
-
-
 	private void sendEmail(AdminListBo my, Admin a,Integer type) {
 		String title="外出申请提醒";
 		if (type==0) title="外出申请驳回提醒";
@@ -148,13 +143,6 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}
 	}
 	
-	
-	
-	
-
-
-	
-	
 	@Override
 	public int updatePublicRelease(InputPublicRelease in) {
 		try {
@@ -266,7 +254,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			fbb.setFollowTime(DateUtils.formatDate(p.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
 			String ufid=UUID.randomUUID().toString();
 			p.setUfid(ufid);
-			customerService.addFollow(fbb,ufid,use.getMianStatus());
+			customerService.addFollow(fbb,ufid,use.getMainStatus());
 			str="公出人员打卡";
 		}else {
 			str="刷新打卡";

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -1,11 +1,11 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=123456
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
-#jdbc.password=aftdev
+#jdbc.password=123456
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20