Kaynağa Gözat

Merge branch 'test' of jishutao/kede-server into prod

anderx 4 yıl önce
ebeveyn
işleme
c26a3ed15f
44 değiştirilmiş dosya ile 1943 ekleme ve 2182 silme
  1. 1 1
      .idea/artifacts/kede_server_war_exploded.xml
  2. 7 2
      src/main/java/com/goafanti/common/constant/ErrorConstants.java
  3. 0 20
      src/main/java/com/goafanti/common/controller/BaseController.java
  4. 12 37
      src/main/java/com/goafanti/common/dao/PublicReleaseCountMapper.java
  5. 7 0
      src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java
  6. 31 88
      src/main/java/com/goafanti/common/dao/TOrderNewMapper.java
  7. 2 2
      src/main/java/com/goafanti/common/dao/UserMapper.java
  8. 127 108
      src/main/java/com/goafanti/common/mapper/PublicReleaseCountMapper.xml
  9. 24 13
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  10. 217 591
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  11. 1 0
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  12. 13 0
      src/main/java/com/goafanti/common/model/OutPublicReleaseCount.java
  13. 7 6
      src/main/java/com/goafanti/common/model/PublicRelease.java
  14. 51 204
      src/main/java/com/goafanti/common/model/PublicReleaseCount.java
  15. 514 920
      src/main/java/com/goafanti/common/model/TOrderNew.java
  16. 53 0
      src/main/java/com/goafanti/common/model/outUserFollowCount.java
  17. 3 4
      src/main/java/com/goafanti/common/task/ReleaseUserTask.java
  18. 112 0
      src/main/java/com/goafanti/common/task/UserFollowTask.java
  19. 46 8
      src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java
  20. 1 2
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  21. 88 0
      src/main/java/com/goafanti/order/bo/InputStatistics.java
  22. 58 0
      src/main/java/com/goafanti/order/bo/outProvinceStatisticsList.java
  23. 58 0
      src/main/java/com/goafanti/order/bo/outStatisticsList.java
  24. 82 14
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  25. 1 33
      src/main/java/com/goafanti/order/controller/AdminOrderApiController.java
  26. 0 2
      src/main/java/com/goafanti/order/service/OrderInvoiceService.java
  27. 7 13
      src/main/java/com/goafanti/order/service/OrderNewService.java
  28. 1 8
      src/main/java/com/goafanti/order/service/OrderService.java
  29. 1 1
      src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java
  30. 8 0
      src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java
  31. 32 17
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  32. 5 27
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  33. 1 26
      src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java
  34. 101 7
      src/main/java/com/goafanti/order/service/impl/PushOrderService.java
  35. 138 0
      src/main/java/com/goafanti/user/bo/outFollowStatisticsList.java
  36. 49 0
      src/main/java/com/goafanti/user/bo/outProvinceFollowStatistic.java
  37. 0 2
      src/main/java/com/goafanti/user/controller/UserChannelApiController.java
  38. 48 0
      src/main/java/com/goafanti/user/controller/UserFollowController.java
  39. 6 0
      src/main/java/com/goafanti/user/service/UserFollowService.java
  40. 17 0
      src/main/java/com/goafanti/user/service/impl/UserFollowServiceImpl.java
  41. 1 1
      src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java
  42. 9 21
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  43. 2 3
      src/main/resources/props/config_local.properties
  44. 1 1
      src/main/resources/props/config_test.properties

+ 1 - 1
.idea/artifacts/kede_server_war_exploded.xml

@@ -1,6 +1,6 @@
 <component name="ArtifactManager">
   <artifact type="exploded-war" build-on-make="true" name="kede-server:war exploded">
-    <output-path>$PROJECT_DIR$/out</output-path>
+    <output-path>$PROJECT_DIR$/target/kede-server-1.0.0-BUILD-SNAPSHOT</output-path>
     <properties id="maven-jee-properties">
       <options>
         <exploded>true</exploded>

+ 7 - 2
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -115,14 +115,19 @@ public class ErrorConstants {
 	public static final String MARKET_BOOTH_MAX						= "MARKET_BOOTH_MAX";	
 	
 	public static final String CUSTOMER_ALREADY_EXIST				= "CUSTOMER_ALREADY_EXIST";
-	
+
+	/**
+	 * 客户*已锁定
+	 */
 	public static final String CUSTOMER_ALREADY_LOCKED				= "CUSTOMER_ALREADY_LOCKED";
 	
 	/** 该客户已经被领取 */
 	public static final String CUSTOMER_ALREADY_RECEIVE				= "CUSTOMER_ALREADY_RECEIVE";
 	public static final String CUSTOM_EREXCESS						= "CUSTOM_EREXCESS";		
 	public static final String CUSTOMER_TRANSFER_FAIL				= "CUSTOMER_ALREADY_RECEIVE";
-	
+	/**
+	 * 项目*已锁定
+	 */
 	public static final String BUSINESS_ALREADY_LOCKED				= "BUSINESS_ALREADY_LOCKED";
 	
 	public static final String BUSINESS_ALREADY_EXIST				= "BUSINESS_ALREADY_EXIST";

+ 0 - 20
src/main/java/com/goafanti/common/controller/BaseController.java

@@ -126,31 +126,11 @@ public class BaseController {
 			model.addAttribute("userData", TokenManager.getUserToken());
 			model.addAttribute("userName", TokenManager.getUserToken().getNickname());
 		}
-
 		if (TokenManager.isLogin() && TokenManager.getToken() instanceof Admin) {
 			model.addAttribute("adminData", TokenManager.getAdminToken());
 			model.addAttribute("userName", TokenManager.getAdminToken().getName());
 			model.addAttribute("departmentId", TokenManager.getAdminToken().getDepartmentId());
 			model.addAttribute("isAdmin", true);
-			//0其他 1营销 2营销管理 3财务专员 4总裁 5外包审核员 6营销经理 99超级管理员
-			Integer role=0;
-			if (TokenManager.hasRole(AFTConstants.SALESMAN)){
-				role=1;
-			}else if (TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
-				role=2;
-			}else if (TokenManager.hasRole(AFTConstants.FINANCE)){
-				role=3;
-			}else if (TokenManager.hasRole(AFTConstants.CED)){
-				role=4;
-			}else if (TokenManager.hasRole(AFTConstants.OUTSOURCE_AUDITOR)){
-				role=5;
-			}else if (TokenManager.hasRole(AFTConstants.SUPERADMIN)){
-				role=99;
-			}else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
-				role=6;
-			}
-			model.addAttribute("role", role);
-
 		}
 	}
 }

+ 12 - 37
src/main/java/com/goafanti/common/dao/PublicReleaseCountMapper.java

@@ -1,55 +1,30 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PublicReleaseCount;
+import com.goafanti.user.bo.outFollowStatisticsList;
+import com.goafanti.user.bo.outProvinceFollowStatistic;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface PublicReleaseCountMapper {
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release_count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
     int deleteByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release_count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
     int insert(PublicReleaseCount record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release_count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
     int insertSelective(PublicReleaseCount record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release_count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
     PublicReleaseCount selectByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release_count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
     int updateByPrimaryKeySelective(PublicReleaseCount record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release_count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
     int updateByPrimaryKey(PublicReleaseCount record);
 
-	PublicReleaseCount selectByAid(String aid);
+    void insertBatch(List<PublicReleaseCount> list);
+
+    List<outFollowStatisticsList> followStatisticsList(@Param("depId")String depId, @Param("date")String date,
+                                                       @Param("province")Integer province ,@Param("sort")Integer sort);
+
+    List<outProvinceFollowStatistic> provinceFollowStatisticsList(@Param("depId")String depId, @Param("date")String date,
+                                                                  @Param("province")Integer province ,@Param("sort")Integer sort);
 }

+ 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);
 }

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

@@ -2,103 +2,46 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.common.model.TOrderNew;
-import com.goafanti.common.model.TOrderNewExample;
-import com.goafanti.order.bo.OrderListBo;
-import com.goafanti.order.bo.OrderRefundDetailBo;
-import com.goafanti.order.bo.TOrderNewBo;
+import com.goafanti.order.bo.*;
+import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.ibatis.annotations.Param;
-import com.goafanti.common.model.TOrderNewWithBLOBs;
-
 public interface TOrderNewMapper {
-    /**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	long countByExample(TOrderNewExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int deleteByExample(TOrderNewExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int deleteByPrimaryKey(String orderNo);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int insert(TOrderNew record);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int insertSelective(TOrderNew record);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	List<TOrderNewWithBLOBs> selectByExampleWithBLOBs(TOrderNewExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	List<TOrderNew> selectByExample(TOrderNewExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	TOrderNewWithBLOBs selectByPrimaryKey(String orderNo);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int updateByExampleSelective(@Param("record") TOrderNew record,
-			@Param("example") TOrderNewExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int updateByExampleWithBLOBs(@Param("record") TOrderNew record,
-			@Param("example") TOrderNewExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int updateByExample(@Param("record") TOrderNew record, @Param("example") TOrderNewExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int updateByPrimaryKeySelective(TOrderNew record);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int updateByPrimaryKeyWithBLOBs(TOrderNew record);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_new
-	 * @mbg.generated  Fri May 15 10:33:54 CST 2020
-	 */
-	int updateByPrimaryKey(TOrderNew record);
-	TOrderNewBo getOrderNewDetail(String orderNo); 
+    int deleteByPrimaryKey(String orderNo);
+
+    int insert(TOrderNew record);
+
+    int insertSelective(TOrderNew record);
+
+    TOrderNew selectByPrimaryKey(String orderNo);
+
+    int updateByPrimaryKeySelective(TOrderNew record);
+
+    int updateByPrimaryKey(TOrderNew record);
+
+    TOrderNewBo getOrderNewDetail(String orderNo);
     int getCountByIdAndStatus(TOrderNew orderNew);
-    
+
     TOrderNewBo getSaleIdByOno(String ono);
     TOrderNewBo agreeEmailData(Integer fid);
 
     OrderRefundDetailBo orderRefundDetail(String id);
 
-	int updateFinance(@Param("aid")String aid, @Param("orderNos")List<String> orderNos, @Param("newFinance")String newFinance);
-	int checkContractNo(String sno);
-	Map<String, Object> countTotalAndActually(@Param("o")OrderListBo o, @Param("fids")List<String> fids);
-	TOrderBillNew getLastPayment(String orderNo);
-	int updateSalesmanId(@Param("aid")String aid, @Param("transferId")String transferId);
-	List<TOrderNewBo> selectUsedOrderByOrder(String orderNo);
-	void updaterefund(TOrderNew o);
+    int updateFinance(@Param("aid")String aid, @Param("orderNos") List<String> orderNos, @Param("newFinance")String newFinance);
+    int checkContractNo(String sno);
+    Map<String, Object> countTotalAndActually(@Param("o") OrderListBo o, @Param("fids")List<String> fids);
+    TOrderBillNew getLastPayment(String orderNo);
+    int updateSalesmanId(@Param("aid")String aid, @Param("transferId")String transferId);
+    List<TOrderNewBo> selectUsedOrderByOrder(String orderNo);
+    void updaterefund(TOrderNew o);
+
+    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);
+
+    List<outProvinceStatisticsList> provinceStatisticsList(InputStatistics in);
 }

+ 2 - 2
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -297,6 +297,6 @@ public interface UserMapper {
 
 
 	List<CustomerListOut> selectPrivateOrganizationCustomerList(Map<String,Object> map);
-	
-	
+
+
 }

+ 127 - 108
src/main/java/com/goafanti/common/mapper/PublicReleaseCountMapper.xml

@@ -2,163 +2,182 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.PublicReleaseCountMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.PublicReleaseCount">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 11:08:16 CST 2021.
-    -->
     <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="aid" jdbcType="VARCHAR" property="aid" />
-    <result column="count" jdbcType="INTEGER" property="count" />
-    <result column="hour" jdbcType="DOUBLE" property="hour" />
-    <result column="no_approved" jdbcType="INTEGER" property="noApproved" />
-    <result column="reject" jdbcType="INTEGER" property="reject" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="province" jdbcType="INTEGER" property="province" />
+    <result column="dep_id" jdbcType="VARCHAR" property="depId" />
+    <result column="uid" jdbcType="VARCHAR" property="uid" />
+    <result column="quantity" jdbcType="INTEGER" property="quantity" />
+    <result column="new_user" jdbcType="INTEGER" property="newUser" />
+    <result column="total" jdbcType="DECIMAL" property="total" />
+    <result column="date" jdbcType="VARCHAR" property="date" />
   </resultMap>
   <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 11:08:16 CST 2021.
-    -->
-    id, aid, `count`, `hour`, no_approved, reject, create_time
+    id, province, dep_id, `uid`, quantity, new_user, total, `date`
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 11:08:16 CST 2021.
-    -->
     select 
     <include refid="Base_Column_List" />
     from public_release_count
     where id = #{id,jdbcType=INTEGER}
   </select>
+  <select id="followStatisticsList" resultType="com.goafanti.user.bo.outFollowStatisticsList">
+    select z.*,(z.totalQuantity/z.totalInterview)totalRatio from(select name,use_interview useInterview,
+      use_quantity useQuantity,use_total useTotal,(use_quantity/use_interview)useRatio,
+      new_interview newInterview,new_quantity newQuantity,new_total newTotal,(new_quantity/new_interview)newRatio,
+      (use_interview+new_interview)totalInterview,(use_quantity+new_quantity)totalQuantity,(use_total+new_total)total
+   from (select dg.name,sum(use_interview)use_interview,sum(use_quantity)use_quantity,sum(use_total)use_total,
+         sum(new_interview)new_interview,sum(new_quantity)new_quantity,sum(new_total)new_total
+   from (select province,if(new_user=1,1,0)use_interview,if(new_user=1,a.quantity ,0)use_quantity,
+    if(new_user=1,a.total ,0)use_total,if(new_user=0,1,0)new_interview,if(new_user=0,a.quantity ,0)new_quantity,
+    if(new_user=0,a.total ,0)new_total from public_release_count a
+   where a.`date` = #{date}
+     <if test="depId !=null">
+     and a.dep_id= #{depId}
+     </if>
+    <if test="province !=null">
+      and a.province= #{province}
+    </if>
+    )x
+    left join district_glossory dg on x.province=dg.id group by dg.id )y )z
+    order by
+    <if test="sort==0">
+      totalQuantity
+    </if>
+    <if test="sort==1">
+      total
+    </if>
+    <if test="sort==2">
+      totalInterview
+    </if>
+    desc
+  </select>
+  <select id="provinceFollowStatisticsList" resultType="com.goafanti.user.bo.outProvinceFollowStatistic">
+    select x.name,c.nickname ,x.new_user newUser,d.counts interviewCount,x.quantity
+    from (select b.name,a.new_user,a.uid,sum(a.quantity)quantity from public_release_count a left join department b on a.dep_id =b.id
+          where a.date= #{date} and a.province = #{province}
+            <if test="depId !=null">
+            and a.dep_id = #{depId}
+            </if>
+          group by b.name ,a.uid ,a.new_user )x
+           left join `user` c on x.uid =c.id left join (select uid,count(*)counts from public_release group by uid) d on x.uid =d.uid
+    order by
+             <if test="sort==0">
+             d.counts
+             </if>
+    <if test="sort==1">
+             x.quantity
+    </if>
+    desc
+  </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 11:08:16 CST 2021.
-    -->
     delete from public_release_count
     where id = #{id,jdbcType=INTEGER}
   </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.PublicReleaseCount">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 11:08:16 CST 2021.
-    -->
-    insert into public_release_count (id, aid, `count`, 
-      `hour`, no_approved, reject, 
-      create_time)
-    values (#{id,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{count,jdbcType=INTEGER}, 
-      #{hour,jdbcType=DOUBLE}, #{noApproved,jdbcType=INTEGER}, #{reject,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP})
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseCount" useGeneratedKeys="true">
+    insert into public_release_count (province, dep_id, `uid`, 
+      quantity, new_user, total, 
+      `date`)
+    values (#{province,jdbcType=INTEGER}, #{depId,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, 
+      #{quantity,jdbcType=INTEGER}, #{newUser,jdbcType=INTEGER}, #{total,jdbcType=DECIMAL}, 
+      #{date,jdbcType=VARCHAR})
   </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.PublicReleaseCount">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 11:08:16 CST 2021.
-    -->
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseCount" useGeneratedKeys="true">
     insert into public_release_count
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
+      <if test="province != null">
+        province,
       </if>
-      <if test="aid != null">
-        aid,
+      <if test="depId != null">
+        dep_id,
       </if>
-      <if test="count != null">
-        `count`,
+      <if test="uid != null">
+        `uid`,
       </if>
-      <if test="hour != null">
-        `hour`,
+      <if test="quantity != null">
+        quantity,
       </if>
-      <if test="noApproved != null">
-        no_approved,
+      <if test="newUser != null">
+        new_user,
       </if>
-      <if test="reject != null">
-        reject,
+      <if test="total != null">
+        total,
       </if>
-      <if test="createTime != null">
-        create_time,
+      <if test="date != null">
+        `date`,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
+      <if test="province != null">
+        #{province,jdbcType=INTEGER},
       </if>
-      <if test="aid != null">
-        #{aid,jdbcType=VARCHAR},
+      <if test="depId != null">
+        #{depId,jdbcType=VARCHAR},
       </if>
-      <if test="count != null">
-        #{count,jdbcType=INTEGER},
+      <if test="uid != null">
+        #{uid,jdbcType=VARCHAR},
       </if>
-      <if test="hour != null">
-        #{hour,jdbcType=DOUBLE},
+      <if test="quantity != null">
+        #{quantity,jdbcType=INTEGER},
       </if>
-      <if test="noApproved != null">
-        #{noApproved,jdbcType=INTEGER},
+      <if test="newUser != null">
+        #{newUser,jdbcType=INTEGER},
       </if>
-      <if test="reject != null">
-        #{reject,jdbcType=INTEGER},
+      <if test="total != null">
+        #{total,jdbcType=DECIMAL},
       </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
+      <if test="date != null">
+        #{date,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
+  <insert id="insertBatch">
+    insert into public_release_count (province, dep_id, `uid`,
+                                      quantity, new_user, total,
+                                      `date`)
+    values
+    <foreach collection="list" index="index" item="item" separator=",">
+           (#{item.province,jdbcType=INTEGER}, #{item.depId,jdbcType=VARCHAR}, #{item.uid,jdbcType=VARCHAR},
+            #{item.quantity,jdbcType=INTEGER}, #{item.newUser,jdbcType=INTEGER}, #{item.total,jdbcType=DECIMAL},
+            #{item.date,jdbcType=VARCHAR})
+    </foreach>
+  </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicReleaseCount">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 11:08:16 CST 2021.
-    -->
     update public_release_count
     <set>
-      <if test="aid != null">
-        aid = #{aid,jdbcType=VARCHAR},
+      <if test="province != null">
+        province = #{province,jdbcType=INTEGER},
+      </if>
+      <if test="depId != null">
+        dep_id = #{depId,jdbcType=VARCHAR},
       </if>
-      <if test="count != null">
-        `count` = #{count,jdbcType=INTEGER},
+      <if test="uid != null">
+        `uid` = #{uid,jdbcType=VARCHAR},
       </if>
-      <if test="hour != null">
-        `hour` = #{hour,jdbcType=DOUBLE},
+      <if test="quantity != null">
+        quantity = #{quantity,jdbcType=INTEGER},
       </if>
-      <if test="noApproved != null">
-        no_approved = #{noApproved,jdbcType=INTEGER},
+      <if test="newUser != null">
+        new_user = #{newUser,jdbcType=INTEGER},
       </if>
-      <if test="reject != null">
-        reject = #{reject,jdbcType=INTEGER},
+      <if test="total != null">
+        total = #{total,jdbcType=DECIMAL},
       </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
+      <if test="date != null">
+        `date` = #{date,jdbcType=VARCHAR},
       </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicReleaseCount">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Jun 02 11:08:16 CST 2021.
-    -->
     update public_release_count
-    set aid = #{aid,jdbcType=VARCHAR},
-      `count` = #{count,jdbcType=INTEGER},
-      `hour` = #{hour,jdbcType=DOUBLE},
-      no_approved = #{noApproved,jdbcType=INTEGER},
-      reject = #{reject,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
+    set province = #{province,jdbcType=INTEGER},
+      dep_id = #{depId,jdbcType=VARCHAR},
+      `uid` = #{uid,jdbcType=VARCHAR},
+      quantity = #{quantity,jdbcType=INTEGER},
+      new_user = #{newUser,jdbcType=INTEGER},
+      total = #{total,jdbcType=DECIMAL},
+      `date` = #{date,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  
-  <select id="selectByAid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from public_release_count
-    where aid = #{aid}
-  </select>
 </mapper>

+ 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>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 217 - 591
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml


+ 1 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1854,4 +1854,5 @@
       and u.transfer_time between #{startTime} and #{endTime}
     </if>
   </select>
+
 </mapper>

+ 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;
+    }
+}

+ 7 - 6
src/main/java/com/goafanti/common/model/PublicRelease.java

@@ -5,7 +5,7 @@ import java.util.Date;
 
 /**
  * public_release
- * @author 
+ * @author
  */
 public class PublicRelease implements Serializable {
     private Integer id;
@@ -118,7 +118,7 @@ public class PublicRelease implements Serializable {
     /**
      * 0辅助根据 1主要跟进
      */
-    private Integer mianStatus;
+    private Integer mainStatus;
 
     /**
      * 公出补充
@@ -308,12 +308,13 @@ public class PublicRelease implements Serializable {
         this.signSum = signSum;
     }
 
-    public Integer getMianStatus() {
-        return mianStatus;
+
+    public Integer getMainStatus() {
+        return mainStatus;
     }
 
-    public void setMianStatus(Integer mianStatus) {
-        this.mianStatus = mianStatus;
+    public void setMainStatus(Integer mainStatus) {
+        this.mainStatus = mainStatus;
     }
 
     public String getSupplement() {

+ 51 - 204
src/main/java/com/goafanti/common/model/PublicReleaseCount.java

@@ -1,269 +1,116 @@
 package com.goafanti.common.model;
 
 import java.io.Serializable;
-import java.util.Date;
+import java.math.BigDecimal;
 
+/**
+ * public_release_count
+ * @author 
+ */
 public class PublicReleaseCount implements Serializable {
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column public_release_count.id
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     * 日志编号
      */
     private Integer id;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column public_release_count.aid
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     * 日志编号
      */
-    private String aid;
+    private Integer province;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column public_release_count.count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     * 部门ID
      */
-    private Integer count;
+    private String depId;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column public_release_count.hour
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     * 用户ID
      */
-    private Double hour;
+    private String uid;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column public_release_count.no_approved
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     * 数量
      */
-    private Integer noApproved;
+    private Integer quantity;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column public_release_count.reject
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     * 客户类型 0新客户 1老客户
      */
-    private Integer reject;
+    private Integer newUser;
 
     /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column public_release_count.create_time
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     * 金额
      */
-    private Date createTime;
+    private BigDecimal total;
 
     /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table public_release_count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     * 年月
      */
+    private String date;
+
     private static final long serialVersionUID = 1L;
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column public_release_count.id
-     *
-     * @return the value of public_release_count.id
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 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_count.id
-     *
-     * @param id the value for public_release_count.id
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 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_count.aid
-     *
-     * @return the value of public_release_count.aid
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public String getAid() {
-        return aid;
+    public Integer getProvince() {
+        return province;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column public_release_count.aid
-     *
-     * @param aid the value for public_release_count.aid
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public void setAid(String aid) {
-        this.aid = aid == null ? null : aid.trim();
+    public void setProvince(Integer province) {
+        this.province = province;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column public_release_count.count
-     *
-     * @return the value of public_release_count.count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public Integer getCount() {
-        return count;
+    public String getDepId() {
+        return depId;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column public_release_count.count
-     *
-     * @param count the value for public_release_count.count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public void setCount(Integer count) {
-        this.count = count;
+    public void setDepId(String depId) {
+        this.depId = depId;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column public_release_count.hour
-     *
-     * @return the value of public_release_count.hour
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public Double getHour() {
-        return hour;
+    public String getUid() {
+        return uid;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column public_release_count.hour
-     *
-     * @param hour the value for public_release_count.hour
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public void setHour(Double hour) {
-        this.hour = hour;
+    public void setUid(String uid) {
+        this.uid = uid;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column public_release_count.no_approved
-     *
-     * @return the value of public_release_count.no_approved
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public Integer getNoApproved() {
-        return noApproved;
+    public Integer getQuantity() {
+        return quantity;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column public_release_count.no_approved
-     *
-     * @param noApproved the value for public_release_count.no_approved
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public void setNoApproved(Integer noApproved) {
-        this.noApproved = noApproved;
+    public void setQuantity(Integer quantity) {
+        this.quantity = quantity;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column public_release_count.reject
-     *
-     * @return the value of public_release_count.reject
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public Integer getReject() {
-        return reject;
+    public Integer getNewUser() {
+        return newUser;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column public_release_count.reject
-     *
-     * @param reject the value for public_release_count.reject
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public void setReject(Integer reject) {
-        this.reject = reject;
+    public void setNewUser(Integer newUser) {
+        this.newUser = newUser;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column public_release_count.create_time
-     *
-     * @return the value of public_release_count.create_time
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public Date getCreateTime() {
-        return createTime;
+    public BigDecimal getTotal() {
+        return total;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column public_release_count.create_time
-     *
-     * @param createTime the value for public_release_count.create_time
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
-     */
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
+    public void setTotal(BigDecimal total) {
+        this.total = total;
     }
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release_count
-     *
-     * @mbg.generated Wed Jun 02 11:08:16 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(", aid=").append(aid);
-        sb.append(", count=").append(count);
-        sb.append(", hour=").append(hour);
-        sb.append(", noApproved=").append(noApproved);
-        sb.append(", reject=").append(reject);
-        sb.append(", createTime=").append(createTime);
-        sb.append(", serialVersionUID=").append(serialVersionUID);
-        sb.append("]");
-        return sb.toString();
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
     }
 }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 514 - 920
src/main/java/com/goafanti/common/model/TOrderNew.java


+ 53 - 0
src/main/java/com/goafanti/common/model/outUserFollowCount.java

@@ -0,0 +1,53 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+
+public class outUserFollowCount {
+
+    private String uid;
+    private Integer province;
+    private Integer newUser;
+    private Integer quantity;
+    private BigDecimal total;
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public Integer getNewUser() {
+        return newUser;
+    }
+
+    public void setNewUser(Integer newUser) {
+        this.newUser = newUser;
+    }
+
+    public Integer getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(Integer quantity) {
+        this.quantity = quantity;
+    }
+
+    public BigDecimal getTotal() {
+        return total;
+    }
+
+    public void setTotal(BigDecimal total) {
+        this.total = total;
+    }
+
+}

+ 3 - 4
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -1,9 +1,6 @@
 package com.goafanti.common.task;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
 import javax.annotation.Resource;
 
@@ -60,11 +57,13 @@ public class ReleaseUserTask {
 			pushUserDays();
 			Thread.sleep(2000);
 			updateUser();
+			Thread.sleep(2000);
 		} catch (InterruptedException e) {
 			e.printStackTrace();
 		}
 
 	}
+
 	@ResponseBody
 	@RequestMapping(value = "/open/remindUser", method = RequestMethod.GET)
 	private void pushUserDays() throws InterruptedException {

+ 112 - 0
src/main/java/com/goafanti/common/task/UserFollowTask.java

@@ -0,0 +1,112 @@
+package com.goafanti.common.task;
+
+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;
+import com.goafanti.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+
+@Component
+@RestController
+public class UserFollowTask {
+
+    @Autowired
+    private PublicReleaseMapper publicReleaseMapper;
+    @Autowired
+    private PublicReleaseCountMapper publicReleaseCountMapper;
+    @Autowired
+    private TOrderNewMapper tOrderNewMapper;
+
+    /**
+     * 	每月1号凌晨5点轮询统计
+     *
+     */
+
+//    @Scheduled(cron = "0 0 5 1 * ?")
+    @RequestMapping(value = "/open/userFollowStatistics", method = RequestMethod.GET)
+    public void 	userFollowStatistics() throws InterruptedException {
+        //获取上月1号到本月1号的外出
+        Calendar now=getNowDate();
+        Calendar date=getNowDate();
+        String ym=getYearMonth();
+
+        date.set(Calendar.MONTH,now.get(Calendar.MONTH)-1);
+        List<OutPublicReleaseCount> list =publicReleaseMapper.getTimeUserFollow(date.getTime(),now.getTime());
+        for (OutPublicReleaseCount out : list) {
+            out.setDate(ym);
+            out.setQuantity(1);
+            List<BigDecimal> aList=tOrderNewMapper.selectByUidAndNewUser(out.getUid(),out.getAid(),out.getNewUser(),date.getTime(),now.getTime());
+            if (aList.isEmpty()){
+                out.setTotal(new BigDecimal(0));
+            }else{
+                out.setQuantity(aList.size());
+                BigDecimal total=new BigDecimal(0);
+                for (BigDecimal bigDecimal : aList) {
+                    total=total.add(bigDecimal);
+                }
+                out.setTotal(total);
+            }
+        }
+        List<PublicReleaseCount> newList=new ArrayList<>();
+        if (list != null && list.size() > 0) {
+            for (int i = 0; i < list.size(); i++) {
+                newList.add((PublicReleaseCount)list.get(i));
+                if (50 == newList.size() || i == list.size() - 1) {
+                    if (newList.size() > 0) {
+                        publicReleaseCountMapper.insertBatch(newList);
+                    }
+                    newList.clear();
+                    Thread.sleep(2000);
+                }
+            }
+        }
+
+
+    }
+
+    public Calendar getNowDate(){
+        Calendar now=Calendar.getInstance();
+        now.set(Calendar.HOUR_OF_DAY, 0);
+        now.clear(Calendar.MINUTE);
+        now.clear(Calendar.SECOND);
+        now.clear(Calendar.MILLISECOND);
+        return now;
+    }
+    public String getYearMonth(){
+        Calendar now=Calendar.getInstance();
+        int y=now.get(Calendar.YEAR);
+        int m=now.get(Calendar.MONTH);
+        if(m<1){
+            m=12;
+            y--;
+        }
+        return y+"-"+m;
+    }
+
+    public static void main(String[] args) {
+        Calendar now=Calendar.getInstance();
+        now.set(2021,0,1);
+        int y=now.get(Calendar.YEAR);
+        int m=now.get(Calendar.MONTH);
+        if(m<1){
+            m=12;
+            y--;
+        }
+        System.out.println(y+"-"+m);
+    }
+}

+ 46 - 8
src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java

@@ -75,6 +75,8 @@ public class NewExcelUtil<T> {
 	public static final int sheetSize = 65536;
 	
 	public  String downloadPath = "";
+
+	public  String screen = "";
 	
 	
 
@@ -165,6 +167,8 @@ public class NewExcelUtil<T> {
 		exportExcel(response);
 		return new Result().data(1);
 	}
+
+
 	
 	
 	/**
@@ -177,6 +181,19 @@ public class NewExcelUtil<T> {
 		this.downloadPath=uploadPath;
 		return exportExcel();
 	}
+	/**
+	 * 	直接导出CXCEL表
+	 * @param list 导出数据集合
+	 * @param sheetName 工作表的名称
+	 * @param uploadPath 导出本地地址
+	 * @param screen 搜索条件
+	 */
+	public Result exportExcel(List<T> list, String sheetName, String uploadPath,String screen) {
+		this.init(list, sheetName);
+		this.downloadPath=uploadPath;
+		this.screen=screen;
+		return exportExcel();
+	}
 
 	private void exportExcel(HttpServletResponse response) {
 		try {
@@ -185,22 +202,32 @@ public class NewExcelUtil<T> {
 				int sheetNo = (int) Math.ceil(list.size() / sheetSize);
 				String dateFilename =DateFilename(sheetName);
 				for (int index = 0; index <= sheetNo; index++) {
+					Integer line=0;
 					createSheet(sheetNo, index);
 					// 产生一行
-					Row title = sheet.createRow(0);
+					Row title = sheet.createRow(line);
 					Cell cell = title.createCell(0);
 					cell.setCellValue(sheetName);
 					CellRangeAddress region = new CellRangeAddress(0, 0, 0, fields.size()-1);
 					sheet.addMergedRegion(region);
 					cell.setCellStyle(styles.get("total"));
-					Row row = sheet.createRow(1);
+					if (StringUtils.isNotNull(screen)){
+						log.debug(screen);
+						Row r = sheet.createRow(++line);
+						Cell c = r.createCell(0);
+						c.setCellValue(screen);
+						CellRangeAddress rg = new CellRangeAddress(line, line, 0, fields.size()-1);
+						sheet.addMergedRegion(rg);
+						c.setCellStyle(styles.get("header"));
+					}
+					Row row = sheet.createRow(++line);
 					int column = 0;
 					// 写入各个字段的列头名称
 					for (Object[] os : fields) {
 						Excel excel = (Excel) os[1];
 						this.createCell(excel, row, column++);
 					}
-					fillExcelData(index, row);
+					fillExcelData(index, row,line);
 					addStatisticsRow();
 				}
 				response.addHeader("Content-Disposition", "attachment;filename="  + new String(dateFilename.getBytes(),"iso-8859-1"));
@@ -254,14 +281,24 @@ public class NewExcelUtil<T> {
 				int sheetNo = (int) Math.ceil(list.size() / sheetSize);
 				for (int index = 0; index <= sheetNo; index++) {
 					createSheet(sheetNo, index);
+					int line=0;
 					// 产生一行
-					Row title = sheet.createRow(0);
+					Row title = sheet.createRow(line);
 					Cell cell = title.createCell(0);
 					cell.setCellValue(sheetName);
 					CellRangeAddress region = new CellRangeAddress(0, 0, 0, fields.size()-1);
 					sheet.addMergedRegion(region);
 					cell.setCellStyle(styles.get("total"));
-					Row row = sheet.createRow(1);
+					if (StringUtils.isNotNull(screen)){
+						log.debug(screen);
+						Row r = sheet.createRow(++line);
+						Cell c = r.createCell(0);
+						c.setCellValue(screen);
+						CellRangeAddress rg = new CellRangeAddress(line, line, 0, fields.size()-1);
+						sheet.addMergedRegion(rg);
+						c.setCellStyle(styles.get("header"));
+					}
+					Row row = sheet.createRow(++line);
 					// 产生一行
 					int column = 0;
 					// 写入各个字段的列头名称
@@ -271,7 +308,7 @@ public class NewExcelUtil<T> {
 					}
 					filename = encodingFilename(sheetName);
 					out = new FileOutputStream(getAbsoluteFile(filename));
-					fillExcelData(index, row);
+					fillExcelData(index, row,++line);
 					addStatisticsRow();
 				}
 				wb.write(out);
@@ -304,11 +341,12 @@ public class NewExcelUtil<T> {
 	 * @param index 序号
 	 * @param row   单元格行
 	 */
-	public void fillExcelData(int index, Row row) {
+	public void fillExcelData(int index, Row row,Integer line) {
 		int startNo = index * sheetSize;
 		int endNo = Math.min(startNo + sheetSize, list.size());
+		if(line==null)line=2;
 		for (int i = startNo; i < endNo; i++) {
-			row = sheet.createRow(i + 2 - startNo);
+			row = sheet.createRow(i + line - startNo);
 			// 得到导出对象.
 			T vo = (T) list.get(i);
 			int column = 0;

+ 1 - 2
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -206,7 +206,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
 		Map<String, Object> params = disposeParams(cli);
-		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)) {
 			params.put("role", 1);
 		} else {
 			params.put("role", 0);
@@ -2079,7 +2079,6 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				y = 100;
 				break;
 			}
-
 		}
 
 		if (i >= y) {

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

@@ -0,0 +1,88 @@
+package com.goafanti.order.bo;
+
+public class InputStatistics {
+    private String depId;
+    private String depName;
+    private Integer province;
+    private String provinceName;
+    private String startCreate;
+    private String endCreate;
+    private String startSign;
+    private String endSign;
+    /**
+     * 0签单量 1签单人数 2年度完成率
+     */
+    private Integer sort;
+
+    public String getProvinceName() {
+        return provinceName;
+    }
+
+    public void setProvinceName(String provinceName) {
+        this.provinceName = provinceName;
+    }
+
+    public String getDepName() {
+        return depName;
+    }
+
+    public void setDepName(String depName) {
+        this.depName = depName;
+    }
+
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public String getStartCreate() {
+        return startCreate;
+    }
+
+    public void setStartCreate(String startCreate) {
+        this.startCreate = startCreate;
+    }
+
+    public String getEndCreate() {
+        return endCreate;
+    }
+
+    public void setEndCreate(String endCreate) {
+        this.endCreate = endCreate;
+    }
+
+    public String getStartSign() {
+        return startSign;
+    }
+
+    public void setStartSign(String startSign) {
+        this.startSign = startSign;
+    }
+
+    public String getEndSign() {
+        return endSign;
+    }
+
+    public void setEndSign(String endSign) {
+        this.endSign = endSign;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+}

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

@@ -0,0 +1,58 @@
+package com.goafanti.order.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+import java.math.BigDecimal;
+
+public class outProvinceStatisticsList {
+
+    private  String aid;
+    @Excel(name = "订单部门")
+    private String depName;
+    @Excel(name = "签单人")
+    private String name;
+    @Excel(name = "总单量(个)")
+    private Integer quantity;
+    @Excel(name = "总签单额(万元)")
+    private BigDecimal total;
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getDepName() {
+        return depName;
+    }
+
+    public void setDepName(String depName) {
+        this.depName = depName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(Integer quantity) {
+        this.quantity = quantity;
+    }
+
+    public BigDecimal getTotal() {
+        return total;
+    }
+
+    public void setTotal(BigDecimal total) {
+        this.total = total;
+    }
+}

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

@@ -0,0 +1,58 @@
+package com.goafanti.order.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+import java.math.BigDecimal;
+
+public class outStatisticsList {
+
+    private  Integer id;
+    @Excel(name = "省")
+    private String province;
+    @Excel(name = "签单人数(人)")
+    private Integer counts;
+    @Excel(name = "总单量(个)")
+    private Integer quantity;
+    @Excel(name = "总签单额(万元)")
+    private BigDecimal total;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public Integer getCounts() {
+        return counts;
+    }
+
+    public void setCounts(Integer counts) {
+        this.counts = counts;
+    }
+
+    public Integer getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(Integer quantity) {
+        this.quantity = quantity;
+    }
+
+    public BigDecimal getTotal() {
+        return total;
+    }
+
+    public void setTotal(BigDecimal total) {
+        this.total = total;
+    }
+}

+ 82 - 14
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -10,6 +10,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.goafanti.order.bo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -24,9 +25,6 @@ import com.goafanti.common.model.TOrderNewWithBLOBs;
 import com.goafanti.common.model.TOrderRefundWithBLOBs;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.utils.excel.NewExcelUtil;
-import com.goafanti.order.bo.InputArrearsDunListBo;
-import com.goafanti.order.bo.OutArrearsDunListBo;
-import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.enums.ApprovalNewState;
 import com.goafanti.order.enums.OrderNewState;
 import com.goafanti.order.service.OrderNewService;
@@ -40,7 +38,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	@Value(value = "${upload.path}")
 	private String	uploadPath			= null;
 	/**
-	 * 创建订单
+	 * 创建订单、开单
 	 * @param uid
 	 * @param orderType
 	 * @return
@@ -239,15 +237,15 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	/**
 	 * 订单列表
 	 * 
-	 *specially  0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询 6客服查询
+	 *specially  0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询 6客服查询 7统计签单订单
 	 *distribution	(咨询师管理列表 0 未分配 1部分 2全部
 	 *amountStatus 0 10万元以下 1 10万~20万 2 20万~30万 3 30万~40万  4 40万以上
 	 */
 	@RequestMapping(value="/orderNewList", method = RequestMethod.GET)
-	public Result orderNewList(String name,String orderNo,String starTime,String endTime ,Integer specially ,Integer approval,
+	public Result orderNewList(String aid,String name,String orderNo,String starTime,String endTime ,Integer specially ,Integer approval,
 			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer amountStatus,Integer pageNo,Integer pageSize){
 		Result res=new Result();
-		res.data(orderNewService.orderNewList(name, orderNo, starTime, endTime, specially ,approval, distribution,depId, 
+		res.data(orderNewService.orderNewList(aid,name, orderNo, starTime, endTime, specially ,approval, distribution,depId,
 				contractNo,outsource, liquidationStatus,amountStatus,pageNo, pageSize));
 		return res;
 	}
@@ -517,20 +515,90 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		NewExcelUtil<TOrderTaskBo>excel=new NewExcelUtil<>(TOrderTaskBo.class);
 		 return  excel.exportExcel(list,"订单项目列表",response);
 	}
-	
-	
+
+
 	/**
 	 * 	催款信息下载 
-	 * @throws IOException 
+	 * @throws IOException
 	 */
 	@RequestMapping(value = "/exportArrearsDunListData", method = RequestMethod.GET)
 	public Result exportArrearsDunListData(InputArrearsDunListBo in,HttpServletResponse response){
 		@SuppressWarnings("unchecked")
 		List<OutArrearsDunListBo> list=(List<OutArrearsDunListBo>) orderNewService.arrearsDunList(in).getList();
 		NewExcelUtil<OutArrearsDunListBo>excel=new NewExcelUtil<>(OutArrearsDunListBo.class);
-		 return  excel.exportExcel(list,"欠款催款列表",response);
+		return  excel.exportExcel(list,"欠款催款列表",response);
 	}
-	
-	
-	
+
+	/**
+	 * 	签单统计表
+	 * @throws IOException
+	 */
+	@RequestMapping(value = "/statisticsList", method = RequestMethod.GET)
+	public Result statisticsList(InputStatistics in){
+		return res().data(orderNewService.statisticsList(in));
+	}
+
+	/**
+	 * 	签单统计表
+	 * @throws IOException
+	 */
+	@RequestMapping(value = "/statisticsListExprot", method = RequestMethod.GET)
+	public Result statisticsListExprot(InputStatistics in){
+		List<outStatisticsList>  list =orderNewService.statisticsList(in);
+		NewExcelUtil<outStatisticsList> excelUtil=new NewExcelUtil<>(outStatisticsList.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));
+	}
+
+	/**
+	 * 	省份签单统计表
+	 * @throws IOException
+	 */
+	@RequestMapping(value = "/provinceStatisticsList", method = RequestMethod.GET)
+	public Result provinceStatisticsList(InputStatistics in){
+		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));
+	}
+
 }

+ 1 - 33
src/main/java/com/goafanti/order/controller/AdminOrderApiController.java

@@ -356,39 +356,7 @@ public class AdminOrderApiController extends CertifyApiController {
 		return res;
 	}
 	
-	/**
-	 * 创建订单
-	 * @param uid
-	 * @param orderType
-	 * @return
-	 */
-	@RequestMapping(value = "/createOrder",method = RequestMethod.POST)
-	public Result createOrder(String uid,Integer orderType,String contractType){
-		Result res = new Result();
-		if(StringUtils.isBlank(uid)){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","客户编号"));
-			return res;
-		}
-		/*if(orderServiceImpl.checkCustomerInformation(uid)){
-			res.getError().add(buildError("","请到客户资料-客户资料维护模块完善您的客户信息!"));
-			return res;
-		}*/
-		if(orderType == null){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单类型"));
-			return res;
-		}
-		if(orderType != CommodityType.SERVICE.getTypeCode()){
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","暂不支持创建该类型订单"));
-			return res;
-		}else {
-			if(StringUtils.isBlank(contractType)) {
-				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","业务品类"));
-				return res;
-			}
-		}
-		orderServiceImpl.createServiceOrder(uid,orderType,contractType);
-		return res;
-	}
+
 	
 
 	/** 图片上传 **/

+ 0 - 2
src/main/java/com/goafanti/order/service/OrderInvoiceService.java

@@ -19,8 +19,6 @@ public interface OrderInvoiceService {
 	
 	/**
 	 * 修改发票申请
-	 * @param uid
-	 * @param orderType
 	 * @return
 	 */
 	int updateServiceOrder(TOrderInvoice t);

+ 7 - 13
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -7,6 +7,7 @@ import javax.mail.MessagingException;
 import javax.servlet.http.HttpServletResponse;
 
 
+import com.goafanti.common.bo.Result;
 import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderNewWithBLOBs;
@@ -14,17 +15,7 @@ import com.goafanti.common.model.TOrderOutsource;
 import com.goafanti.common.model.TOrderRefundWithBLOBs;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.order.bo.InputArrearsDunListBo;
-import com.goafanti.order.bo.OrderDunTaskBo;
-import com.goafanti.order.bo.OrderRefundDetailBo;
-import com.goafanti.order.bo.OutArrearsDunListBo;
-import com.goafanti.order.bo.OutNewOrderDunBo;
-import com.goafanti.order.bo.TDunLogListBo;
-import com.goafanti.order.bo.TOrderLogBo;
-import com.goafanti.order.bo.TOrderNewBo;
-import com.goafanti.order.bo.TOrderRefundBo;
-import com.goafanti.order.bo.TOrderTaskBo;
-import com.goafanti.order.bo.outOrderDunListBo;
+import com.goafanti.order.bo.*;
 
 public interface OrderNewService {
 	
@@ -88,7 +79,7 @@ public interface OrderNewService {
 	 * @param amountStatus 
 	 * @return
 	 */
-	Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer specially ,Integer approval,Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus,Integer pageNo, Integer pageSize);
+	Pagination<TOrderNewBo> orderNewList(String aid,String name, String orderNo, String starTime, String endTime,Integer specially ,Integer approval,Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus,Integer pageNo, Integer pageSize);
 	/**
 	 * 订单审核
 	 * @param orderNo
@@ -202,5 +193,8 @@ public interface OrderNewService {
 	void pushOrderDun(String orderNo);
 	boolean checkOfficialType(TOrderOutsource o);
 	void updateOrderCostAmount(Integer tid,Integer type);
-	
+
+    List<outStatisticsList> statisticsList(InputStatistics in);
+
+	List<outProvinceStatisticsList> provinceStatisticsList(InputStatistics in);
 }

+ 1 - 8
src/main/java/com/goafanti/order/service/OrderService.java

@@ -235,14 +235,7 @@ public interface OrderService {
 	Pagination<OrderListBo> selectApprovalServiceOrder(OrderListBo bo,String startDate,String endDate,
 			String depIds,Integer approvalHistory,Integer pageNo, Integer pageSize);
 
-	/**
-	 * 创建订单
-	 * @param uid
-	 * @param orderType
-	 * @param contractType 合同类型
-	 * @return
-	 */
-	int createServiceOrder(String uid, Integer orderType,String contractType);
+
 
 	/**
 	 * 查询公共订单

+ 1 - 1
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -326,7 +326,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 			TOrderNew record = new TOrderNew();
 			record.setOrderNo(o.getOrderNo());
 			record.setOrderStatus(OrderNewState.YTD.getCode());//7
-			record.setProofCount(0.0f);//订单单量为0
+			record.setProofCount(0.0d);//订单单量为0
 			tOrderNewMapper.updateByPrimaryKeySelective(record);
 			
 			//更新统计表

+ 8 - 0
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -132,6 +132,8 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	private TTaskMidMapper	tTaskMidMapper;
 	@Autowired
 	private UserLockReleaseMapper	userLockReleaseMapper;
+	@Autowired
+	private PushOrderService pushOrderService;
 	
 	Logger							logger	= LoggerFactory.getLogger(OrderChangeServiceImpl.class);
 	
@@ -249,6 +251,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			int isExamine=orderExamineMapper.selectByOrderNoAndAid(noc.getOrderNo(),TokenManager.getAdminId());
 			noc.setConsultantExamine(consultantExamine);
 			noc.setManagerExamine(managerExamine);
+			if (noc.getVoucherUrl()!=null) {
+				noc.setVoucherUrl(pushOrderService.changeProcessStatusConstant(noc.getVoucherUrl(),noc.getProcessState(),noc.getStatus()));
+			}
 			noc.setIsExamine(isExamine);
 		}
 		return list;
@@ -262,6 +267,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		nb.setConsultantExamine(consultantExamine);
 		nb.setManagerExamine(managerExamine);
 		nb.setIsExamine(isExamine);
+		if(nb.getProcessState()!=null){
+			nb.setVoucherUrl(pushOrderService.changeProcessStatusConstant(nb.getVoucherUrl(),nb.getProcessState(),nb.getStatus()));
+		}
 		return nb;
 	}
 	@Override

+ 32 - 17
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -19,6 +19,8 @@ import java.util.UUID;
 
 import javax.mail.MessagingException;
 import javax.servlet.http.HttpServletResponse;
+
+import com.goafanti.order.bo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFRow;
@@ -101,18 +103,6 @@ import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.LockingReleaseBo;
-import com.goafanti.order.bo.InputArrearsDunListBo;
-import com.goafanti.order.bo.OrderDunTaskBo;
-import com.goafanti.order.bo.OrderRefundDetailBo;
-import com.goafanti.order.bo.OutArrearsDunListBo;
-import com.goafanti.order.bo.OutNewOrderDunBo;
-import com.goafanti.order.bo.TDunLogListBo;
-import com.goafanti.order.bo.TOrderLogBo;
-import com.goafanti.order.bo.TOrderNewBo;
-import com.goafanti.order.bo.TOrderRefundBo;
-import com.goafanti.order.bo.TOrderTaskBo;
-import com.goafanti.order.bo.TOrderTaskDetailBo;
-import com.goafanti.order.bo.outOrderDunListBo;
 import com.goafanti.order.enums.ActiveState;
 import com.goafanti.order.enums.ApprovalNewState;
 import com.goafanti.order.enums.LiquidationNewState;
@@ -231,6 +221,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		t.setCreateTime(new Date());
 		t.setUpdateTime(new Date());
 		t.setBuyerId(uid);
+		User u=userMapper.selectByPrimaryKey(uid);
+		if(u.getShareType()!=null&&u.getShareType()==2){
+			t.setNewUser(1);
+		}else {
+			t.setNewUser(0);
+		}
 		TOrderExtend te=new TOrderExtend();
 		te.setOrderNo(orderNo);
 		te.setServiceStatus(0);
@@ -562,9 +558,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Override
 	public TOrderNewBo getOrderNewDetail(String orderNo) {
 		TOrderNewBo tOrder= tOrderNewMapper.getOrderNewDetail(orderNo);
-		String url=pushOrderService.ShiroConstant(tOrder.getContractPictureUrl(),tOrder.getSalesmanId(),tOrder.getApproval(),tOrder.getOrderDep());
+		String url=pushOrderService.processStatusConstant(tOrder.getContractPictureUrl(),tOrder.getSalesmanId(),tOrder.getProcessStatus());
 		tOrder.setContractPictureUrl(url);
-//		tOrder.setContractPictureUrl(pushOrderService.processStatusConstant(tOrder.getContractPictureUrl(),tOrder.getProcessStatus(),tOrder.getApproval()));
 		return tOrder;
 	}
 
@@ -614,15 +609,19 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer specially,Integer approval,
+	public Pagination<TOrderNewBo> orderNewList(String aid,String name, String orderNo, String starTime, String endTime,Integer specially,Integer approval,
 			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
-		if (specially!=null&&(specially==0||specially==1||specially==2||specially==4||specially==5)) {
+		if (specially!=null&&(specially==0||specially==1||specially==2||specially==4||specially==5||specially==7)) {
 			//0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询
 			if (specially!=3&&specially!=4) {
-				params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+				if (aid ==null){
+					params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+				}else{
+					params.put("aid", aid);
+				}
 			}
 			//(咨询师管理列表 0 未分配 1部分   2全部)
 			if(specially==4) params.put("distribution",distribution);
@@ -1396,6 +1395,22 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		tOrderMidMapper.updateCostAmount(tid,oCount,null);
 	}
 
+	@Override
+	public List<outStatisticsList> statisticsList(InputStatistics in) {
+		if(in.getSort()==null)in.setSort(0);
+		if(in.getEndCreate()!=null)in.setEndCreate(in.getEndCreate()+" 23:59:59");
+		if(in.getEndSign()!=null)in.setEndSign(in.getEndSign()+" 23:59:59");
+		return tOrderNewMapper.statisticsList(in);
+	}
+
+	@Override
+	public List<outProvinceStatisticsList> provinceStatisticsList(InputStatistics in) {
+		if(in.getSort()==null)in.setSort(0);
+		if(in.getEndCreate()!=null)in.setEndCreate(in.getEndCreate()+" 23:59:59");
+		if(in.getEndSign()!=null)in.setEndSign(in.getEndSign()+" 23:59:59");
+		return tOrderNewMapper.provinceStatisticsList(in);
+	}
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<OutArrearsDunListBo> arrearsDunList(InputArrearsDunListBo in) {

+ 5 - 27
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -13,6 +13,7 @@ import java.util.UUID;
 
 import javax.mail.MessagingException;
 
+import com.goafanti.common.dao.*;
 import org.apache.commons.collections4.map.HashedMap;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -29,32 +30,6 @@ import com.goafanti.common.bo.UserOrderTask;
 import com.goafanti.common.bo.paymentNodeEmailBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.BusinessProjectMapper;
-import com.goafanti.common.dao.NewOrderDunMapper;
-import com.goafanti.common.dao.OrganizationContactBookMapper;
-import com.goafanti.common.dao.OrganizationIdentityMapper;
-import com.goafanti.common.dao.PaymentNodeMapper;
-import com.goafanti.common.dao.ProjcetCheckLogMapper;
-import com.goafanti.common.dao.TArrearsDunMapper;
-import com.goafanti.common.dao.TOrderBonusMapper;
-import com.goafanti.common.dao.TOrderLogMapper;
-import com.goafanti.common.dao.TOrderMidMapper;
-import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.common.dao.TOrderPaymentMapper;
-import com.goafanti.common.dao.TOrderTaskMapper;
-import com.goafanti.common.dao.TTaskHoursMapper;
-import com.goafanti.common.dao.TTaskLogMapper;
-import com.goafanti.common.dao.TTaskMidMapper;
-import com.goafanti.common.dao.TaskAttributionLogMapper;
-import com.goafanti.common.dao.TaskHoursCountMapper;
-import com.goafanti.common.dao.TaskLogMapper;
-import com.goafanti.common.dao.TaskProgressLogMapper;
-import com.goafanti.common.dao.TaskProgressMapper;
-import com.goafanti.common.dao.UserBusinessMapper;
-import com.goafanti.common.dao.UserChannelMapper;
-import com.goafanti.common.dao.UserLockReleaseMapper;
-import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.ChannelStatus;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrderLogProcess;
@@ -171,6 +146,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	@Autowired
 	private TOrderPaymentMapper	tOrderPaymentMapper;
 	@Autowired
+	private PublicReleaseMapper	publicReleaseMapper;
+	@Autowired
 	private AsyncUtils	asyncUtils;
 	@Value(value = "${upload.path}")
 	private String 					uploadPath 			= null;
@@ -253,13 +230,14 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			ub.setRemarks("派单自动锁定客户");
 			ub.setBusinessProjectId(t.getCommodityId());
 			userBusinessMapper.insertSelective(ub);
-			
 			//如果是渠道客户更新渠道表
 			UserChannel uc=new UserChannel();
 			uc.setUid(tn.getBuyerId());
 			uc.setStatus(ChannelStatus.YQD.getCode());
 			uc.setSignTime(date);
 			userChannelMapper.updateByUid(uc);
+			//标记最新的打卡
+			publicReleaseMapper.updateSignByAidAndUid(tn.getBuyerId(),tn.getSalesmanId());
 	}
 	
 	

+ 1 - 26
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -1323,32 +1323,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				params, pageNo, pageSize);
 	}
 
-	@Override
-	public int createServiceOrder(String uid, Integer orderType,String contractType) {
-		BigDecimal initial = new BigDecimal(0);
-		TOrder tOrder = new TOrder();
-		tOrder.setOrderType(orderType);
-		tOrder.setOrderNo(idGenerator.generateId().toString());	
-		tOrder.setCreater(TokenManager.getAdminId());
-		tOrder.setCreateTime(new Date());
-		tOrder.setBuyerId(uid);
-		tOrder.setSellerId(DEFAULT_PLATFORM_ID);
-		tOrder.setSalesmanId(TokenManager.getAdminId());
-		tOrder.setBrokerageAmount(initial);
-		tOrder.setFirstPayment(initial);
-		tOrder.setOrderAmount(initial);
-		tOrder.setSignBrokerageAmount(initial);
-		tOrder.setSignFirstPayment(initial);
-		tOrder.setSignTotalAmount(initial);
-		tOrder.setSignWithdrawAmount(initial);
-		tOrder.setOrderChannel(OrderChannel.PORTAL.getCode());	
-		tOrder.setDeleteSign(ActiveState.NORMAL.getCode());
-		tOrder.setApproval(ApprovalState.NORMAL.getCode());
-		tOrder.setContractType(contractType);
-		tOrder.setChangeStatus(ChangeState.UNCHANGE.getCode());
-		setOrderState(OrderAction.ADD_INTENTION, new BigDecimal(0), tOrder, false);
-		return tOrderMapper.insert(tOrder);
-	}
+
 
 	@SuppressWarnings("unchecked")
 	@Override

+ 101 - 7
src/main/java/com/goafanti/order/service/impl/PushOrderService.java

@@ -3,12 +3,11 @@ package com.goafanti.order.service.impl;
 
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
+
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+
 import com.goafanti.order.enums.ProcessStatus;
-import groovy.util.logging.Log4j;
-import groovy.util.logging.Log4j2;
-import org.apache.commons.collections4.bag.SynchronizedSortedBag;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -21,6 +20,14 @@ public class PushOrderService {
     @Autowired
     private AdminMapper adminMapper;
 
+    /**
+     * 根据角色判断是否可以查看合同图片
+     * @param url 合同地址
+     * @param aid 营销id
+     * @param approval 特批
+     * @param orderDep 订单编号
+     * @return
+     */
     public  String  ShiroConstant(String url,String aid,Integer approval,String orderDep){
         if (StringUtils.isNotNull(url)) {
             //暂时开放营销管理员可以查看
@@ -76,13 +83,20 @@ public class PushOrderService {
         return null;
     }
 
-    public String processStatusConstant(String url,Integer processStatus,Integer approval){
+    /**
+     * 根据流程与角色判断是否可以查看订单合同
+     * @param url
+     * @param aid
+     * @param processStatus
+     * @return
+     */
+    public String processStatusConstant(String url,String aid,Integer processStatus){
         //流程状态 0-已派营销员,1-已派营销员管理员,2-已派财务管理员,3-已派财务专员,4-已派咨询师管理员,5-已部分派咨询师经理,6-已部全部派咨询师经理
         if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION) ||
-                TokenManager.hasRole(AFTConstants.CUSTOMER_SERVICE) ){
+                TokenManager.hasRole(AFTConstants.CED) ){
             return url;
-        }else if ((TokenManager.hasRole(AFTConstants.SALESMAN)||TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER))
-                &&processStatus== ProcessStatus.YPYXY.getCode()){
+        }else if (((TokenManager.hasRole(AFTConstants.SALESMAN)||TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)))&&
+                TokenManager.getAdminId().equals(aid)){
             return url;
         }else if (TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)&&processStatus== ProcessStatus.YPYXGLY.getCode()){
             return url;
@@ -96,4 +110,84 @@ public class PushOrderService {
     }
 
 
+    /**
+     * 根据变更流程判断是否可以查看
+     *
+     * @param url
+     * @param processStatus
+     * @param status 在流程走完则要财务退票 状态 0草稿 1审核中 2通过 3驳回 4完成 5撤销 2是流程走完但是还停留在财务退票,4才是完全走完流程
+     * @return
+     */
+    public String changeProcessStatusConstant(String url,Integer processStatus,Integer status){
+        boolean flag=false;
+        //流程状态 0营销员 1营销管理员 2技术员 3技术经理 4技术总监 5财务专员(退单) 6财务总监 7总裁 8董事长 9 财务专员(非退单)
+        if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION) ||
+                TokenManager.hasRole(AFTConstants.CED) ){
+            flag=true;
+        }else{
+            switch (processStatus) {
+                case 0:
+                    if(TokenManager.hasRole(AFTConstants.SALESMAN)||TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
+                        flag=true;
+                    }
+                    break;
+                case 1:
+                    if(TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
+                        flag=true;
+                    }
+                    break;
+                case 2:
+                    if(TokenManager.hasRole(AFTConstants.TECH)){
+                        flag=true;
+                    }
+                    break;
+                case 3:
+                    if(TokenManager.hasRole(AFTConstants.TECH_MANAGER)){
+                        flag=true;
+                    }
+                    break;
+                case 4:
+                    if(TokenManager.hasRole(AFTConstants.TECH_ADMIN)){
+                        flag=true;
+                    }
+                    break;
+                case 5:
+                    if(TokenManager.hasRole(AFTConstants.FINANCE)){
+                        flag=true;
+                    }
+                    break;
+                case 6:
+                    if(TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)){
+                        flag=true;
+                    }
+                    break;
+                case 7:
+
+                    if((TokenManager.hasRole(AFTConstants.CED)&&status!=2)||
+                            (TokenManager.hasRole(AFTConstants.FINANCE)&&status==2)){
+                        flag=true;
+                    }
+                    break;
+                case 8:
+                    if((TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)&&status!=2)||
+                            (TokenManager.hasRole(AFTConstants.FINANCE)&&status==2)){
+                        flag=true;
+                    }
+                    break;
+                case 9:
+                    if(TokenManager.hasRole(AFTConstants.FINANCE)){
+                        flag=true;
+                    }
+                    break;
+
+            }
+        }
+        if (flag){
+            return url;
+        }else {
+            return DEFAULTS_URL;
+        }
+    }
+
+
 }

+ 138 - 0
src/main/java/com/goafanti/user/bo/outFollowStatisticsList.java

@@ -0,0 +1,138 @@
+package com.goafanti.user.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+import java.math.BigDecimal;
+
+public class outFollowStatisticsList {
+    @Excel(name = "面谈部门")
+    private String name;
+    @Excel(name = "老客户面谈数")
+    private Integer useInterview;
+    @Excel(name = "老客户签单数")
+    private Integer useQuantity;
+    @Excel(name = "老客户金额")
+    private BigDecimal useTotal;
+    @Excel(name = "老客户面谈率")
+    private String useRatio;
+    @Excel(name = "新客户面谈数")
+    private Integer newInterview;
+    @Excel(name = "新客户签单数")
+    private Integer newQuantity;
+    @Excel(name = "新客户金额")
+    private BigDecimal newTotal;
+    @Excel(name = "新客户面谈率")
+    private String newRatio;
+    @Excel(name = "总面谈数")
+    private Integer totalInterview;
+    @Excel(name = "总签单数")
+    private Integer totalQuantity;
+    @Excel(name = "总金额")
+    private BigDecimal total;
+    @Excel(name = "总面谈率")
+    private String totalRatio;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getUseInterview() {
+        return useInterview;
+    }
+
+    public void setUseInterview(Integer useInterview) {
+        this.useInterview = useInterview;
+    }
+
+    public Integer getUseQuantity() {
+        return useQuantity;
+    }
+
+    public void setUseQuantity(Integer useQuantity) {
+        this.useQuantity = useQuantity;
+    }
+
+    public BigDecimal getUseTotal() {
+        return useTotal;
+    }
+
+    public void setUseTotal(BigDecimal useTotal) {
+        this.useTotal = useTotal;
+    }
+
+    public String getUseRatio() {
+        return useRatio;
+    }
+
+    public void setUseRatio(String useRatio) {
+        this.useRatio = useRatio;
+    }
+
+    public Integer getNewInterview() {
+        return newInterview;
+    }
+
+    public void setNewInterview(Integer newInterview) {
+        this.newInterview = newInterview;
+    }
+
+    public Integer getNewQuantity() {
+        return newQuantity;
+    }
+
+    public void setNewQuantity(Integer newQuantity) {
+        this.newQuantity = newQuantity;
+    }
+
+    public BigDecimal getNewTotal() {
+        return newTotal;
+    }
+
+    public void setNewTotal(BigDecimal newTotal) {
+        this.newTotal = newTotal;
+    }
+
+    public String getNewRatio() {
+        return newRatio;
+    }
+
+    public void setNewRatio(String newRatio) {
+        this.newRatio = newRatio;
+    }
+
+    public Integer getTotalInterview() {
+        return totalInterview;
+    }
+
+    public void setTotalInterview(Integer totalInterview) {
+        this.totalInterview = totalInterview;
+    }
+
+    public Integer getTotalQuantity() {
+        return totalQuantity;
+    }
+
+    public void setTotalQuantity(Integer totalQuantity) {
+        this.totalQuantity = totalQuantity;
+    }
+
+    public BigDecimal getTotal() {
+        return total;
+    }
+
+    public void setTotal(BigDecimal total) {
+        this.total = total;
+    }
+
+    public String getTotalRatio() {
+        return totalRatio;
+    }
+
+    public void setTotalRatio(String totalRatio) {
+        this.totalRatio = totalRatio;
+    }
+}

+ 49 - 0
src/main/java/com/goafanti/user/bo/outProvinceFollowStatistic.java

@@ -0,0 +1,49 @@
+package com.goafanti.user.bo;
+
+public class outProvinceFollowStatistic {
+    private String name;
+    private String nickname;
+    private String newUser;
+    private String interviewCount;
+    private String quantity;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    public String getNewUser() {
+        return newUser;
+    }
+
+    public void setNewUser(String newUser) {
+        this.newUser = newUser;
+    }
+
+    public String getInterviewCount() {
+        return interviewCount;
+    }
+
+    public void setInterviewCount(String interviewCount) {
+        this.interviewCount = interviewCount;
+    }
+
+    public String getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(String quantity) {
+        this.quantity = quantity;
+    }
+}

+ 0 - 2
src/main/java/com/goafanti/user/controller/UserChannelApiController.java

@@ -37,7 +37,6 @@ public class UserChannelApiController  extends CertifyApiController{
 	/**
 	 * 	新增渠道
 	 * 
-	 * @param uid
 	 * @return
 	 */
 	@RequestMapping(value = "/add", method = RequestMethod.POST)
@@ -53,7 +52,6 @@ public class UserChannelApiController  extends CertifyApiController{
 	/**
 	 * 	删除渠道
 	 * 
-	 * @param uid
 	 * @return
 	 */
 	@RequestMapping(value = "/delete", method = RequestMethod.POST)

+ 48 - 0
src/main/java/com/goafanti/user/controller/UserFollowController.java

@@ -4,6 +4,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.user.bo.InputUserFollowList;
+import com.goafanti.user.bo.outFollowStatisticsList;
 import com.goafanti.user.bo.outUserFollowList;
 import com.goafanti.user.service.UserFollowService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,5 +47,52 @@ public class UserFollowController extends BaseApiController {
         NewExcelUtil<outUserFollowList> excel=new NewExcelUtil<>(outUserFollowList.class);
         return excel.exportExcel(list,"客户跟进列表",uploadPath);
     }
+
+    /**
+     * 面谈跟进统计
+     * @return
+     */
+    @RequestMapping(value = "/followStatisticsList", method = RequestMethod.GET)
+    public Result  followStatisticsList(String depId,String date,Integer province,Integer sort){
+        Result res =new Result();
+        return res.data(userFollowService.followStatisticsList(depId,date,province,sort));
+    }
+
+    /**
+     * 面谈跟进统计导出
+     * @return
+     */
+    @RequestMapping(value = "/followStatisticsListExport", method = RequestMethod.GET)
+    public Result  followStatisticsListExport(String depId,String date,Integer province,Integer sort,String depName,String provinceName){
+        Result res =new Result();
+        List<outFollowStatisticsList> list=userFollowService.followStatisticsList(depId,date,province,sort);
+        NewExcelUtil<outFollowStatisticsList>excelUtil =new NewExcelUtil<>(outFollowStatisticsList.class);
+        StringBuffer sb=new StringBuffer("搜索条件=》");
+        if (depName!=null)sb=sb.append("部门:").append(depName).append(",");
+        if(provinceName!=null)sb=sb.append("省份:").append(provinceName).append(",");
+        if(sort!=null){
+            sb=sb.append("排序:");
+            if (sort==0)sb=sb.append("按总数量");
+            else if (sort==1)sb=sb.append("按总金额");
+            else if (sort==2)sb=sb.append("按总面谈");
+            sb=sb.append(",");
+        }
+        if (date!=null){
+            sb=sb.append("时间:").append(date).append(",");
+        }
+        return excelUtil.exportExcel(list,"面谈跟进统计",uploadPath,sb.substring(0,sb.toString().length()-1));
+    }
+
+
+    /**
+     * 省份面谈跟进统计
+     * @return
+     */
+    @RequestMapping(value = "/provinceFollowStatisticsList", method = RequestMethod.GET)
+    public Result  provinceFollowStatisticsList(String depId,String date,Integer province,Integer sort){
+        Result res =new Result();
+        return res.data(userFollowService.provinceFollowStatisticsList(depId,date,province,sort));
+    }
+
 }
 

+ 6 - 0
src/main/java/com/goafanti/user/service/UserFollowService.java

@@ -2,6 +2,8 @@ package com.goafanti.user.service;
 
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.user.bo.InputUserFollowList;
+import com.goafanti.user.bo.outFollowStatisticsList;
+import com.goafanti.user.bo.outProvinceFollowStatistic;
 import com.goafanti.user.bo.outUserFollowList;
 
 import java.util.List;
@@ -10,4 +12,8 @@ public interface UserFollowService {
      Pagination<outUserFollowList> userFollowList(InputUserFollowList in);
 
     List<outUserFollowList> userFollowListExport(InputUserFollowList in);
+
+    List<outFollowStatisticsList> followStatisticsList(String depId, String date,Integer province, Integer sort);
+
+    List<outProvinceFollowStatistic> provinceFollowStatisticsList(String depId, String date, Integer province, Integer sort);
 }

+ 17 - 0
src/main/java/com/goafanti/user/service/impl/UserFollowServiceImpl.java

@@ -1,12 +1,15 @@
 package com.goafanti.user.service.impl;
 
 import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.PublicReleaseCountMapper;
 import com.goafanti.common.dao.UserFollowMapper;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.user.bo.InputUserFollowList;
+import com.goafanti.user.bo.outFollowStatisticsList;
+import com.goafanti.user.bo.outProvinceFollowStatistic;
 import com.goafanti.user.bo.outUserFollowList;
 import com.goafanti.user.service.UserFollowService;
 import jdk.nashorn.internal.parser.Token;
@@ -25,6 +28,8 @@ public class UserFollowServiceImpl extends BaseMybatisDao<UserFollowMapper>  imp
 
     @Autowired
     private AdminMapper adminMapper;
+    @Autowired
+    private PublicReleaseCountMapper publicReleaseCountMapper;
 
 
     @Override
@@ -68,4 +73,16 @@ public class UserFollowServiceImpl extends BaseMybatisDao<UserFollowMapper>  imp
 
         return list;
     }
+
+    @Override
+    public List<outFollowStatisticsList> followStatisticsList(String depId, String date,Integer province, Integer sort) {
+        if(sort==null)sort=0;
+        return publicReleaseCountMapper.followStatisticsList(depId,date,province,sort);
+    }
+
+    @Override
+    public List<outProvinceFollowStatistic> provinceFollowStatisticsList(String depId, String date, Integer province, Integer sort) {
+        if(sort==null)sort=0;
+        return publicReleaseCountMapper.provinceFollowStatisticsList(depId,date,province,sort);
+    }
 }

+ 1 - 1
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -71,7 +71,7 @@ public class AdminReleaseApiController extends CertifyApiController{
 	}
 
 	/**
-	 * 外出打卡
+	 * 外出打卡、公出打卡
 	 * @return
 	 */
 	@RequestMapping(value = "/publicReleaseClockIn", method = RequestMethod.POST)

+ 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="刷新打卡";

+ 2 - 3
src/main/resources/props/config_local.properties

@@ -1,7 +1,6 @@
 dev.name=local
-
 jdbc.driverClassName=com.mysql.jdbc.Driver
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20210820?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=123456
 jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
@@ -48,7 +47,7 @@ avatar.upload.host=//sb.jishutao.com/upload
 #avatar.host=//172.16.0.253
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.93
+static.host=//static.jishutao.com/1.1.94
 
 wx.appId=wxff2f5720ed7d7f63
 wx.appSecret=081744369d42405be58fe37f892631f7

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -41,7 +41,7 @@ user.private.max=1000
 #客户释放提醒
 user_remind_days=15
 
-static.host=//static.jishutao.com/1.1.93
+static.host=//static.jishutao.com/1.1.94
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload