Procházet zdrojové kódy

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

anderx před 3 roky
rodič
revize
8edd178b71
47 změnil soubory, kde provedl 3172 přidání a 1732 odebrání
  1. 2 0
      pack-test.bat
  2. 5 3
      src/main/java/com/goafanti/admin/service/DepartmentService.java
  3. 9 15
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  4. 14 14
      src/main/java/com/goafanti/admin/service/impl/DepartmentServiceImpl.java
  5. 108 0
      src/main/java/com/goafanti/common/dao/DepartmentMapper.java
  6. 0 154
      src/main/java/com/goafanti/common/dao/OrganizationManagementMapper.java
  7. 4 0
      src/main/java/com/goafanti/common/dao/UserMidMapper.java
  8. 543 0
      src/main/java/com/goafanti/common/mapper/DepartmentMapper.xml
  9. 0 696
      src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml
  10. 6 0
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  11. 2 0
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  12. 2 2
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  13. 497 4
      src/main/java/com/goafanti/common/mapper/UserMidMapper.xml
  14. 246 0
      src/main/java/com/goafanti/common/model/Department.java
  15. 0 332
      src/main/java/com/goafanti/common/model/OrganizationManagement.java
  16. 183 0
      src/main/java/com/goafanti/common/model/UserMid.java
  17. 8 3
      src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java
  18. 1 1
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  19. 10 0
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  20. 87 0
      src/main/java/com/goafanti/order/bo/InputSignStatistics.java
  21. 169 0
      src/main/java/com/goafanti/order/bo/InputSignSummary.java
  22. 124 0
      src/main/java/com/goafanti/order/bo/OutSignStatistics.java
  23. 188 0
      src/main/java/com/goafanti/order/bo/OutSignSummary.java
  24. 23 14
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  25. 1 1
      src/main/java/com/goafanti/order/controller/OrderChangeApiController.java
  26. 1 1
      src/main/java/com/goafanti/order/controller/OrderProjectApiController.java
  27. 72 15
      src/main/java/com/goafanti/order/controller/StatisticsApiController.java
  28. 1 1
      src/main/java/com/goafanti/order/service/OrderNewService.java
  29. 2 9
      src/main/java/com/goafanti/order/service/OrderService.java
  30. 5 0
      src/main/java/com/goafanti/order/service/OrderStatisticsService.java
  31. 19 0
      src/main/java/com/goafanti/order/service/UserStaticticsService.java
  32. 3 13
      src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java
  33. 20 8
      src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java
  34. 3 3
      src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java
  35. 419 158
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  36. 20 0
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  37. 123 158
      src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java
  38. 1 22
      src/main/java/com/goafanti/order/service/impl/OrderStatisticsServiceImpl.java
  39. 3 10
      src/main/java/com/goafanti/order/service/impl/OutsourceOrgServiceImpl.java
  40. 100 0
      src/main/java/com/goafanti/order/service/impl/UserStatisticsServiceImpl.java
  41. 24 6
      src/main/java/com/goafanti/organization/bo/OrganizationListOut.java
  42. 16 26
      src/main/java/com/goafanti/organization/controller/AdminOrganizationController.java
  43. 4 3
      src/main/java/com/goafanti/organization/service/OrganizationService.java
  44. 100 58
      src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java
  45. 2 0
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  46. 1 1
      src/main/resources/props/config_local.properties
  47. 1 1
      src/main/resources/props/config_test.properties

+ 2 - 0
pack-test.bat

@@ -0,0 +1,2 @@
+@echo off
+mvn clean install -P aft_test

+ 5 - 3
src/main/java/com/goafanti/admin/service/DepartmentService.java

@@ -1,6 +1,6 @@
 package com.goafanti.admin.service;
 
-import com.goafanti.common.model.OrganizationManagement;
+import com.goafanti.common.model.Department;
 import com.goafanti.common.model.WorkingHours;
 
 import java.util.List;
@@ -24,8 +24,10 @@ public interface DepartmentService {
 	 * 查询分管部门、查询管理部门
 	 * @return
 	 */
-	List<OrganizationManagement> selectMyDeps();
+	List<Department> selectMyDeps();
+
+
+	List<Department> selectSubDeps(String subId);
 
 
-	List<OrganizationManagement> selectSubDeps(String subId);
 }

+ 9 - 15
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -10,8 +10,8 @@ import java.util.UUID;
 import javax.annotation.Resource;
 
 import com.goafanti.admin.service.DepartmentService;
-import com.goafanti.common.model.OrganizationManagement;
-import com.goafanti.order.service.OrderService;
+import com.goafanti.common.dao.*;
+import com.goafanti.common.model.Department;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.Cacheable;
@@ -25,12 +25,6 @@ import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.bo.depCountBo;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.AdminLocationMapper;
-import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.OrganizationManagementMapper;
-import com.goafanti.common.dao.UserBusinessMapper;
-import com.goafanti.common.dao.UserLockReleaseMapper;
-import com.goafanti.common.dao.UserRoleMapper;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.UserBusiness;
 import com.goafanti.common.utils.LoggerUtils;
@@ -55,7 +49,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	@Autowired
 	private UserBusinessMapper	userBusinessMapper;
 	@Autowired
-	private OrganizationManagementMapper	organizationManagementMapper;
+	private DepartmentMapper departmentMapper;
 	@Autowired
 	private DepartmentService departmentService;
 	@Resource(name = "passwordUtil")
@@ -376,18 +370,18 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		depCountBo acb=new depCountBo();
 		if (endTime!=null)endTime=endTime+" 23:59:59";
 		List<depCountBo >deps=new ArrayList<>();
-		List<OrganizationManagement> depIds=new ArrayList<>();
+		List<Department> depIds=new ArrayList<>();
 		if (depId==null) {
 			acb.setName("科德集团");
-			deps=organizationManagementMapper.selectBysuperName("科德集团");
+			deps=departmentMapper.selectBysuperName("科德集团");
 		}else {
-			OrganizationListOut oo=organizationManagementMapper.selectAllById(depId);
+			OrganizationListOut oo=departmentMapper.selectAllById(depId);
 			acb.setName(oo.getName());
 			acb.setId(depId);
-			deps=organizationManagementMapper.selectBysuperId(oo.getId());
+			deps=departmentMapper.selectBysuperId(oo.getId());
 			depIds =departmentService.selectSubDeps(depId);
 		}
-		List<AdminCustomerBo> list =organizationManagementMapper.AlldepCount(depIds,startTime,  endTime);
+		List<AdminCustomerBo> list =departmentMapper.AlldepCount(depIds,startTime,  endTime);
 		for (AdminCustomerBo ad : list) {
 			if (acb.getId().equals(ad.getDepId())){
 				acb.getaList().add(ad);
@@ -409,7 +403,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	//迭代获取所有部门与部门员工并计算出部门数量
 	private List<depCountBo> iterationDeps(String id,List<AdminCustomerBo> list) {
-		List<depCountBo>  deps =organizationManagementMapper.selectBysuperId(id);
+		List<depCountBo>  deps =departmentMapper.selectBysuperId(id);
 		for (depCountBo dep : deps) {
 			dep.setList(iterationDeps(dep.getId(),list));
 			for (AdminCustomerBo ad : list) {

+ 14 - 14
src/main/java/com/goafanti/admin/service/impl/DepartmentServiceImpl.java

@@ -4,8 +4,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.OrganizationManagementMapper;
-import com.goafanti.common.model.OrganizationManagement;
+import com.goafanti.common.dao.DepartmentMapper;
+import com.goafanti.common.model.Department;
 import com.goafanti.core.shiro.token.TokenManager;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,7 +22,7 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 	@Autowired
 	private WorkingHoursMapper	workingHoursMapper;
 	@Autowired
-	private OrganizationManagementMapper departmentMapper;
+	private DepartmentMapper departmentMapper;
 
 
 	@Override
@@ -64,7 +64,7 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 	}
 
 	@Override
-	public List<OrganizationManagement> selectMyDeps() {
+	public List<Department> selectMyDeps() {
 		if(TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION))
 			return departmentMapper.selectAllDeps();
 		else
@@ -72,20 +72,20 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 	}
 
 	@Override
-	public List<OrganizationManagement> selectSubDeps(String subId) {
-		List<OrganizationManagement>  list =departmentMapper.selectSubDeps(subId);
-		List<OrganizationManagement>  all=new ArrayList<>();
+	public List<Department> selectSubDeps(String subId) {
+		List<Department>  list =departmentMapper.selectSubDeps(subId);
+		List<Department>  all=new ArrayList<>();
 		all.add(departmentMapper.selectByPrimaryKey(subId));
 		all.addAll(list);
-		for (OrganizationManagement dep : list) {
+		for (Department dep : list) {
 			all.addAll(selectSubDeps(dep.getId()));
 		}
 		return all;
 	}
 
-	private List<OrganizationManagement> selectCurrentDep(String managerId){
-		List<OrganizationManagement> allData = new ArrayList<OrganizationManagement>();
-		List<OrganizationManagement> superData = departmentMapper.selectCurrentDeps(managerId);
+	private List<Department> selectCurrentDep(String managerId){
+		List<Department> allData = new ArrayList<Department>();
+		List<Department> superData = departmentMapper.selectCurrentDeps(managerId);
 		if(superData != null && superData.size()>0){
 			allData.addAll(superData);
 		}
@@ -93,10 +93,10 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 		return allData;
 	}
 
-	private List<OrganizationManagement> selectSubDeps(List<OrganizationManagement> allData,List<OrganizationManagement> superData){
-		List<OrganizationManagement> subData = new ArrayList<>();
+	private List<Department> selectSubDeps(List<Department> allData,List<Department> superData){
+		List<Department> subData = new ArrayList<>();
 		String superIds = "";
-		for(OrganizationManagement om : superData){
+		for(Department om : superData){
 			if(!om.getId().equals(om.getSuperId())){
 				superIds += om.getId() + ",";
 			}

+ 108 - 0
src/main/java/com/goafanti/common/dao/DepartmentMapper.java

@@ -0,0 +1,108 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.admin.bo.AdminCustomerBo;
+import com.goafanti.admin.bo.AdminListBo;
+import com.goafanti.admin.bo.depCountBo;
+import com.goafanti.common.model.Department;
+import com.goafanti.organization.bo.OrganizationListOut;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface DepartmentMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(Department record);
+
+    int insertSelective(Department record);
+
+    Department selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(Department record);
+
+    int updateByPrimaryKey(Department record);
+
+    List<OrganizationListOut> selectSuperId(@Param("hideSign")Integer hideSign);
+    /**
+     * 根据组织名称查组织编号
+     */
+    String selectDepNoByName(String name);
+
+    /**
+     * 根据上级组织查组织编号
+     */
+    String  selectDepNo(String id);
+    /**
+
+
+     /**
+     * 查询相同上级下编号数量
+     */
+    int selectDepNoCount(String superId);
+    /**
+     * 模糊查询负责人名称
+     */
+    List<AdminListBo> selectName(String name);
+
+    OrganizationListOut selectAllById(String id);
+
+    int deleteById(String id);
+
+    String selectAdminNameById(String name);
+
+    String selectIdByDepNo(String depNo);
+    /**
+     * 查询有相同上级组织的信息
+     * @param superId
+     * @return
+     */
+    List<OrganizationListOut> selectIDNBySuperId(String superId);
+
+    int updateByNumber(OrganizationListOut olo);
+
+    int selectCountBySuperId(String superId);
+
+    String selectIdByName(String name);
+
+    String selectNameById(String id);
+
+    String selectDepNoById(String id);
+
+    int selectUserById(String id);
+
+    /**
+     * 查询下级集合
+     * @param superIds
+     * @return
+     */
+    List<Department> selectSubDeps(@Param("superIds")String superIds);
+
+    List<depCountBo> selectBysuperId(String id);
+
+    List<depCountBo> selectBysuperName(String name);
+    /**
+     * 查询当前集合
+     * @return
+     */
+    List<Department> selectCurrentDeps(@Param("aid")String aid);
+
+    /**
+     * 查询所有部门
+     * @return
+     */
+    List<Department> selectAllDeps();
+    /**
+     * 查询最大编号
+     * @param abbreviation
+     * @return
+     */
+    String getMaxAbbreviation(String abbreviation);
+
+    List<AdminCustomerBo> getDepAll(@Param("depId")String depId,
+                                    @Param("adminName")String adminName, @Param("startTime")String startTime, @Param("endTime")String endTime);
+
+
+    List<AdminCustomerBo> AlldepCount(@Param("depIds")List<Department> depIds ,@Param("startTime")String startTime, @Param("endTime")String endTime);
+
+    Department selectByDepNo(String superId);
+}

+ 0 - 154
src/main/java/com/goafanti/common/dao/OrganizationManagementMapper.java

@@ -1,154 +0,0 @@
-package com.goafanti.common.dao;
-
-import java.util.List;
-
-import com.goafanti.organization.bo.OrganizationListOut;
-import com.goafanti.admin.bo.AdminCustomerBo;
-import com.goafanti.admin.bo.AdminListBo;
-import com.goafanti.admin.bo.depCountBo;
-import com.goafanti.common.model.OrganizationManagement;
-import com.goafanti.common.model.OrganizationManagementExample;
-
-import org.apache.ibatis.annotations.Param;
-
-public interface OrganizationManagementMapper {
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	long countByExample(OrganizationManagementExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	int deleteByExample(OrganizationManagementExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	int deleteByPrimaryKey(String id);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	int insert(OrganizationManagement record);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	int insertSelective(OrganizationManagement record);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	List<OrganizationManagement> selectByExample(OrganizationManagementExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	OrganizationManagement selectByPrimaryKey(String id);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	int updateByExampleSelective(@Param("record") OrganizationManagement record,
-			@Param("example") OrganizationManagementExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	int updateByExample(@Param("record") OrganizationManagement record,
-			@Param("example") OrganizationManagementExample example);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	int updateByPrimaryKeySelective(OrganizationManagement record);
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	int updateByPrimaryKey(OrganizationManagement record);
-	List<OrganizationListOut> selectSuperId(@Param("sort")int sort);
-	/**
-	 * 根据组织名称查组织编号
-	 */
-	String selectDepNoByName(String name);
-
-	/**
-	 * 根据上级组织查组织编号
-	 */
-	String  selectDepNo(String id);
-	/**
-
-
-	/**
-	 * 查询相同上级下编号数量
-	 */
-	int selectDepNoCount(String superId);
-	/**
-	 * 模糊查询负责人名称
-	 */
-	List<AdminListBo> selectName(String name);
-
-	OrganizationListOut selectAllById(String id);
-
-	int deleteById(String id);
-
-	String selectAdminNameById(String name);
-
-	String selectIdByDepNo(String depNo);
-	/**
-	 * 查询有相同上级组织的信息
-	 * @param superId
-	 * @return
-	 */
-	List<OrganizationListOut> selectIDNBySuperId(String superId);
-
-	int updateByNumber(OrganizationListOut olo);
-
-	int selectCountBySuperId(String superId);
-
-	String selectIdByName(String name);
-
-	String selectNameById(String id);
-
-	String selectDepNoById(String id);
-
-	int selectUserById(String id);
-
-	/**
-	 * 查询下级集合
-	 * @param superIds
-	 * @return
-	 */
-	List<OrganizationManagement> selectSubDeps(@Param("superIds")String superIds);
-
-	List<depCountBo> selectBysuperId(String id);
-
-	List<depCountBo> selectBysuperName(String name);
-	/**
-	 * 查询当前集合
-	 * @param adminId
-	 * @return
-	 */
-	List<OrganizationManagement> selectCurrentDeps(@Param("aid")String aid);
-
-	/**
-	 * 查询所有部门
-	 * @return
-	 */
-	List<OrganizationManagement> selectAllDeps();
-	/**
-	 * 查询最大编号
-	 * @param abbreviation
-	 * @return
-	 */
-	String getMaxAbbreviation(String abbreviation);
-
-	List<AdminCustomerBo> getDepAll(@Param("depId")String depId,
-			@Param("adminName")String adminName,@Param("startTime")String startTime, @Param("endTime")String endTime);
-
-
-	List<AdminCustomerBo> AlldepCount(@Param("depIds")List<OrganizationManagement> depIds ,@Param("startTime")String startTime, @Param("endTime")String endTime);
-}

+ 4 - 0
src/main/java/com/goafanti/common/dao/UserMidMapper.java

@@ -21,4 +21,8 @@ public interface UserMidMapper {
     int updateByUid(UserMid um);
 
     void updateListByUid(@Param("aid") String aid,@Param("updateFollow") Integer updateFollow, @Param("list")List<String> list);
+
+    String getUserTaskNames(String uid) ;
+
+    UserMid getUserDtails(String buyerId);
 }

+ 543 - 0
src/main/java/com/goafanti/common/mapper/DepartmentMapper.xml

@@ -0,0 +1,543 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.DepartmentMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.Department">
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="create_id" jdbcType="VARCHAR" property="createId" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="deleted_sign" jdbcType="INTEGER" property="deletedSign" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="type" jdbcType="VARCHAR" property="type" />
+    <result column="manager_id" jdbcType="VARCHAR" property="managerId" />
+    <result column="dep_no" jdbcType="VARCHAR" property="depNo" />
+    <result column="super_id" jdbcType="VARCHAR" property="superId" />
+    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+    <result column="status" jdbcType="VARCHAR" property="status" />
+    <result column="abbreviation" jdbcType="VARCHAR" property="abbreviation" />
+    <result column="finance_id" jdbcType="VARCHAR" property="financeId" />
+    <result column="province" jdbcType="INTEGER" property="province" />
+    <result column="working_hours_type" jdbcType="INTEGER" property="workingHoursType" />
+    <result column="hide_sign" jdbcType="INTEGER" property="hideSign" />
+    <result column="lvl" jdbcType="INTEGER" property="lvl" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, create_id, create_time, update_time, deleted_sign, `name`, `type`, manager_id,
+    dep_no, super_id, remarks, `status`, abbreviation, finance_id, province, working_hours_type,
+    hide_sign, lvl
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from department
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from department
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.Department">
+    insert into department (id, create_id, create_time,
+      update_time, deleted_sign, `name`,
+      `type`, manager_id, dep_no,
+      super_id, remarks, `status`,
+      abbreviation, finance_id, province,
+      working_hours_type, hide_sign, lvl
+      )
+    values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
+      #{type,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR},
+      #{superId,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
+      #{abbreviation,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER},
+      #{workingHoursType,jdbcType=INTEGER}, #{hideSign,jdbcType=INTEGER}, #{lvl,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.Department">
+    insert into department
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="createId != null">
+        create_id,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="deletedSign != null">
+        deleted_sign,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="managerId != null">
+        manager_id,
+      </if>
+      <if test="depNo != null">
+        dep_no,
+      </if>
+      <if test="superId != null">
+        super_id,
+      </if>
+      <if test="remarks != null">
+        remarks,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="abbreviation != null">
+        abbreviation,
+      </if>
+      <if test="financeId != null">
+        finance_id,
+      </if>
+      <if test="province != null">
+        province,
+      </if>
+      <if test="workingHoursType != null">
+        working_hours_type,
+      </if>
+      <if test="hideSign != null">
+        hide_sign,
+      </if>
+      <if test="lvl != null">
+        lvl,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="createId != null">
+        #{createId,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="deletedSign != null">
+        #{deletedSign,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=VARCHAR},
+      </if>
+      <if test="managerId != null">
+        #{managerId,jdbcType=VARCHAR},
+      </if>
+      <if test="depNo != null">
+        #{depNo,jdbcType=VARCHAR},
+      </if>
+      <if test="superId != null">
+        #{superId,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=VARCHAR},
+      </if>
+      <if test="abbreviation != null">
+        #{abbreviation,jdbcType=VARCHAR},
+      </if>
+      <if test="financeId != null">
+        #{financeId,jdbcType=VARCHAR},
+      </if>
+      <if test="province != null">
+        #{province,jdbcType=INTEGER},
+      </if>
+      <if test="workingHoursType != null">
+        #{workingHoursType,jdbcType=INTEGER},
+      </if>
+      <if test="hideSign != null">
+        #{hideSign,jdbcType=INTEGER},
+      </if>
+      <if test="lvl != null">
+        #{lvl,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Department">
+    update department
+    <set>
+      <if test="createId != null">
+        create_id = #{createId,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="deletedSign != null">
+        deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=VARCHAR},
+      </if>
+      <if test="managerId != null">
+        manager_id = #{managerId,jdbcType=VARCHAR},
+      </if>
+      <if test="depNo != null">
+        dep_no = #{depNo,jdbcType=VARCHAR},
+      </if>
+      <if test="superId != null">
+        super_id = #{superId,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        remarks = #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=VARCHAR},
+      </if>
+      <if test="abbreviation != null">
+        abbreviation = #{abbreviation,jdbcType=VARCHAR},
+      </if>
+      <if test="financeId != null">
+        finance_id = #{financeId,jdbcType=VARCHAR},
+      </if>
+      <if test="province != null">
+        province = #{province,jdbcType=INTEGER},
+      </if>
+      <if test="workingHoursType != null">
+        working_hours_type = #{workingHoursType,jdbcType=INTEGER},
+      </if>
+      <if test="hideSign != null">
+        hide_sign = #{hideSign,jdbcType=INTEGER},
+      </if>
+      <if test="lvl != null">
+        lvl = #{lvl,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Department">
+    update department
+    set create_id = #{createId,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      `name` = #{name,jdbcType=VARCHAR},
+      `type` = #{type,jdbcType=VARCHAR},
+      manager_id = #{managerId,jdbcType=VARCHAR},
+      dep_no = #{depNo,jdbcType=VARCHAR},
+      super_id = #{superId,jdbcType=VARCHAR},
+      remarks = #{remarks,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=VARCHAR},
+      abbreviation = #{abbreviation,jdbcType=VARCHAR},
+      finance_id = #{financeId,jdbcType=VARCHAR},
+      province = #{province,jdbcType=INTEGER},
+      working_hours_type = #{workingHoursType,jdbcType=INTEGER},
+      hide_sign = #{hideSign,jdbcType=INTEGER},
+      lvl = #{lvl,jdbcType=INTEGER}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+
+
+  <select id="selectOrganizationList" parameterType="String" resultType="com.goafanti.organization.bo.OrganizationListOut">
+    select
+    om.id,om.create_id as createId,om.create_time as createTime,
+    om.update_time as updateTime,om.deleted_sign as deletedSign,
+    om.name,om.type,
+    om.dep_no as depNo,
+    om.remarks,
+    om.status,
+    om.hide_sign hideSign ,
+    dm.name as superName,
+    wh.name as workingHoursName,
+    x.name as managerName
+    from department om
+    left join department dm on om.super_id = dm.id
+    left join admin x on om.manager_id = x.id
+    left join working_hours wh  on om.working_hours_type =wh.`type`
+    where 	om.deleted_sign = 0
+    <if test="name !=null">
+      AND om.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="superId !=null">
+      AND om.super_id=#{superId,jdbcType=VARCHAR}
+    </if>
+    <if test="type !=null">
+      AND om.type=#{type,jdbcType=VARCHAR}
+    </if>
+    <if test="depNo !=null">
+      AND om.dep_no=#{depNo,jdbcType=VARCHAR}
+    </if>
+    <if test="page_sql != null">
+      ${page_sql}
+    </if>
+  </select>
+  <select id="selectOrganizationCount" resultType="java.lang.Integer">
+    select
+    count(0)
+    from department om
+    left join department dm on om.super_id = dm.id
+    left join admin x on om.manager_id = x.id
+    where om.deleted_sign = 0
+    <if test="name !=null">
+      AND om.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="superId !=null">
+      AND om.super_id=#{superId,jdbcType=VARCHAR}
+    </if>
+    <if test="type !=null">
+      AND om.type=#{type,jdbcType=VARCHAR}
+    </if>
+    <if test="depNo !=null">
+      AND om.dep_no=#{depNo,jdbcType=VARCHAR}
+    </if>
+  </select>
+  <select id="selectSuperId"  resultType="com.goafanti.organization.bo.OrganizationListOut">
+    select
+    id,name,dep_no as depNo
+    from department
+    where
+    status ='0'
+      <if test="hideSign != null ">
+    and hide_sign= #{hideSign}
+      </if>
+    order by CONVERT (name USING gbk)
+
+  </select>
+  <insert id="insert1" parameterType="com.goafanti.organization.bo.OrganizationListOut">
+    insert into department(
+      id,create_id,create_time,update_time,deleted_sign,
+      name,type,manager_id,dep_no,super_id,desc,status)
+    values(#{id,jdbcType=VARCHAR},#{createId,jdbcType=VARCHAR},
+           #{createTime,jdbcType=VARCHAR},#{updateTime,jdbcType=VARCHAR},
+           #{deletedSign,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},
+           #{type,jdbcType=VARCHAR},#{managerId,jdbcType=VARCHAR},
+           #{depNo,jdbcType=VARCHAR},#{superId,jdbcType=VARCHAR},
+           #{desc,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR})
+  </insert>
+  <!-- 得到上级 -->
+  <select id="selectDepNo" resultType="String">
+    select
+      dep_no as depNo
+    from department
+    where
+      id=#{superId,jdbcType=VARCHAR}
+  </select>
+
+  <select id="selectDepNoByName" resultType="String">
+    select
+      dep_no as depNo
+    from department
+    where
+      name=#{name,jdbcType=VARCHAR}
+  </select>
+  <select id="selectDepNoCount" parameterType="String" resultType="java.lang.Integer">
+    select
+    count(0)
+    from department
+    where
+    <!-- dep_no like concat(#{depNo,jdbcType=VARCHAR},'%') -->
+    super_id=#{superId,jdbcType=VARCHAR}
+  </select>
+  <select id="selectName" resultType="com.goafanti.admin.bo.AdminListBo">
+    select
+      name,id
+    from admin
+    where status='正常'
+      and name  like concat('%',#{name,jdbcType=VARCHAR},'%')
+  </select>
+  <select id="selectAllById" resultType="com.goafanti.organization.bo.OrganizationListOut">
+    select a.id, a.create_id as createId, a.create_time as createTime, a.update_time as updateTime,
+           a.deleted_sign as deletedSign, a.name, a.type, a.manager_id as managerId, a.dep_no as depNo,
+           a.super_id as superId, a.remarks, a.status, a.abbreviation, a.finance_id financeId,a.hide_sign hideSign,
+           a.province, c.name financeName, a.working_hours_type workingHoursType, b.name as managerName
+    from department a
+           left join admin b on a.manager_id = b.id left join admin c on a.finance_id = c.id
+    where a.id=#{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteById" parameterType="java.lang.String">
+    delete from department
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <select id="selectAdminNameById" parameterType="java.lang.String" resultType="java.lang.String">
+    select
+      name
+    from admin
+    where
+      id=#{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectIdByDepNo" parameterType="java.lang.String" resultType="java.lang.String">
+    select
+      id
+    from department
+    where
+      dep_no=#{depNo,jdbcType=VARCHAR}
+  </select>
+  <select id="selectIDNBySuperId" parameterType="java.lang.String" resultType="com.goafanti.organization.bo.OrganizationListOut">
+    select
+      id,create_id as createId,create_time as createTime,
+      update_time as updateTime,deleted_sign as deletedSign,
+      name,type,manager_id as managerId,
+      dep_no as depNo,
+      super_id as superId,
+      remarks,status
+    from department
+    where
+      super_id=#{id,jdbcType=VARCHAR}
+    order by dep_no
+  </select>
+  <update id="updateByNumber" parameterType="com.goafanti.organization.bo.OrganizationListOut">
+    update department
+    <set>
+      dep_no = #{depNo,jdbcType=VARCHAR},
+        lvl= #{lvl}
+    </set>
+    where
+    id=#{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectCountBySuperId" parameterType="String" resultType="java.lang.Integer">
+    select
+      count(0)
+    from department
+    where
+      super_id=#{superId,jdbcType=VARCHAR}
+  </select>
+  <select id="selectIdByName" parameterType="java.lang.String" resultType="java.lang.String">
+    select
+      id
+    from department
+    where
+      name=#{name,jdbcType=VARCHAR}
+  </select>
+  <select id="selectNameById" parameterType="java.lang.String" resultType="java.lang.String">
+    select
+      name
+    from department
+    where
+      id=#{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectDepNoById" resultType="String">
+    select
+      dep_no as depNo
+    from department
+    where
+      id=#{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectUserById" parameterType="java.lang.String" resultType="java.lang.Integer">
+    select
+      count(0)
+    from admin
+    where
+      department_id=#{id,jdbcType=VARCHAR}
+  </select>
+  <!-- 查询当前层级 -->
+  <select id="selectCurrentDeps" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select id,name,dep_no,super_id from department where manager_id = #{aid,jdbcType=VARCHAR}
+    union all
+    select id,name,dep_no,super_id from department where id = (select department_id from admin where id = #{aid,jdbcType=VARCHAR})
+  </select>
+  <!-- 查询下一层级  -->
+  <select id="selectSubDeps"  parameterType="java.lang.String" resultMap="BaseResultMap">
+    select id,name,dep_no from department where super_id in (#{superIds,jdbcType=VARCHAR})
+  </select>
+
+  <select id="selectBysuperId"  resultType="com.goafanti.admin.bo.depCountBo">
+    select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
+    from department a  where a.super_id= #{id}
+  </select>
+
+  <select id="selectBysuperName" resultType="com.goafanti.admin.bo.depCountBo">
+    select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
+    from department a left join department b on a.super_id=b.id where b.name= #{name}
+  </select>
+
+  <!-- 查询所有 -->
+  <select id="selectAllDeps" resultMap="BaseResultMap">
+    select id,name,dep_no from department
+  </select>
+  <select id="getMaxAbbreviation"  parameterType="java.lang.String" resultType="java.lang.String">
+    select max(contract_no) as maxNo from t_order_new
+    where create_time > '2019-5-31'
+      and contract_no like  concat(#{abbreviation,jdbcType=VARCHAR},'%')
+  </select>
+
+  <select id="getDepAll" resultType="com.goafanti.admin.bo.AdminCustomerBo">
+    select a.id aid,a.name aName,d.id depId,d.name depName,ifnull(b.userCount,0)userCount,ifnull(b.channelCount,0)channelCount,
+    ifnull(b.signCount,0)signCount,ifnull(b.newCount,0)newCount,ifnull(b.channelNewCount,0)channelNewCount,ifnull( b.receiveCount,0)receiveCount,
+    ifnull( b.completeCount,0)completeCount,ifnull(b.channelCompleteCount,0)channelCompleteCount
+    from admin a left join (select x.aid,x.userCount,x.channelCount,signCount,x.newCount,x.channelNewCount,x.receiveCount,
+    ifnull(y.completeCount,0)completeCount,ifnull(y.channelCompleteCount,0)channelCompleteCount
+    from (select aid,sum(if( share_type=0 and channel=0,1,0))userCount,
+    sum(if(share_type=3 and  channel=1,1,0))channelCount,
+    sum(if( share_type=2 ,1,0))signCount,
+    sum(if(share_type=0 and source =1  and channel=0,1,0))newCount,
+    sum(if(share_type=0 and source =1  and channel=1,1,0))channelNewCount,
+    sum(if(share_type=0 and source =2  and channel=0,1,0))receiveCount
+    from `user` where `type` =1 and new_channel=0
+    <if test="startTime != null and endTime != null">
+      and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+    </if>
+    group by aid)x left join (select a.aid,sum(if(b.channel=0,1,0))completeCount,
+    sum(if(b.channel=1,1,0))channelCompleteCount from public_release a left join `user` b on a.uid =b.id
+    where a.clock_in =1
+    <if test="startTime != null and endTime != null">
+      and clock_in_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+    </if>
+    group by a.aid ) y on x.aid=y.aid)b on a.id=b.aid
+    left join department d on a.department_id=d.id
+    where  a.status='正常'  and a.type=1
+    <if test="adminName !=null">
+      and a.name  like concat('%',#{adminName},'%')
+    </if>
+    <if test="depId !=null">
+      and d.id= #{depId}
+    </if>
+  </select>
+  <select id="AlldepCount" resultType="com.goafanti.admin.bo.AdminCustomerBo">
+    select a.id aid,a.name aName ,a.department_id depId,c.name depName,ifnull(userCount,0)userCount,
+    ifnull(channelCount,0)channelCount,ifnull(signCount,0)signCount,ifnull(newCount,0)newCount,
+    ifnull(channelNewCount,0)channelNewCount,ifnull(receiveCount,0)receiveCount,ifnull(completeCount,0)completeCount,
+    ifnull(channelCompleteCount,0)channelCompleteCount
+    from admin a left join (select aid,sum(if( share_type=0 and channel=0,1,0))userCount,
+    sum(if(share_type=3 and  channel=1,1,0))channelCount,
+    sum(if( share_type=2 ,1,0))signCount,
+    sum(if(share_type=0 and source =1  and channel=0,1,0))newCount,
+    sum(if(share_type=0 and source =1  and channel=1,1,0))channelNewCount,
+    sum(if(share_type=0 and source =2  and channel=0,1,0))receiveCount
+    from `user` where `type` =1 and new_channel=0
+    <if test="startTime != null and endTime != null">
+      and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+    </if>
+    group by aid)b on a.id=b.aid
+    left join (select a.aid,sum(if(b.channel=0,1,0))completeCount,
+    sum(if(b.channel=1,1,0))channelCompleteCount from public_release a left join `user` b on a.uid =b.id
+    where a.clock_in =1
+    <if test="startTime != null and endTime != null">
+      and clock_in_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+    </if>
+    group by a.aid ) y on a.id=y.aid
+    left join department c on a.department_id =c.id
+    where  a.status='正常'  and a.type=1
+    <if test="depIds!= null">
+      and a.department_id in
+      <foreach close=")" collection="depIds" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
+    </if>
+  </select>
+  <select id="selectByDepNo" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List"/>
+    from department where super_id=  #{superId}
+    order by dep_no desc limit 1
+  </select>
+
+</mapper>

+ 0 - 696
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml

@@ -1,696 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.goafanti.common.dao.OrganizationManagementMapper">
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrganizationManagement">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    <id column="id" jdbcType="VARCHAR" property="id" />
-    <result column="create_id" jdbcType="VARCHAR" property="createId" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="deleted_sign" jdbcType="VARCHAR" property="deletedSign" />
-    <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="type" jdbcType="VARCHAR" property="type" />
-    <result column="manager_id" jdbcType="VARCHAR" property="managerId" />
-    <result column="dep_no" jdbcType="VARCHAR" property="depNo" />
-    <result column="super_id" jdbcType="VARCHAR" property="superId" />
-    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
-    <result column="status" jdbcType="VARCHAR" property="status" />
-    <result column="abbreviation" jdbcType="VARCHAR" property="abbreviation" />
-    <result column="finance_id" jdbcType="VARCHAR" property="financeId" />
-  </resultMap>
-  <sql id="Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    id, create_id, create_time, update_time, deleted_sign, name, type, manager_id, dep_no,
-    super_id, remarks, status,abbreviation,finance_id
-  </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.OrganizationManagementExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from department
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    select
-    <include refid="Base_Column_List" />
-    from department
-    where id = #{id,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    delete from department
-    where id = #{id,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.OrganizationManagementExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    delete from department
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.OrganizationManagement">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    insert into department (id, create_id, create_time,
-      update_time, deleted_sign, name,
-      type, manager_id, dep_no, working_hours_type,
-      super_id, remarks, status
-      )
-    values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
-      #{updateTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
-      #{type,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR}, #{workingHoursType,jdbcType=INTEGER},
-      #{superId,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.OrganizationManagement">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    insert into department
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="createId != null">
-        create_id,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="deletedSign != null">
-        deleted_sign,
-      </if>
-      <if test="name != null">
-        name,
-      </if>
-      <if test="type != null">
-        type,
-      </if>
-      <if test="managerId != null">
-        manager_id,
-      </if>
-      <if test="depNo != null">
-        dep_no,
-      </if>
-      <if test="superId != null">
-        super_id,
-      </if>
-      <if test="remarks != null">
-        remarks,
-      </if>
-      <if test="status != null">
-        status,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=VARCHAR},
-      </if>
-      <if test="createId != null">
-        #{createId,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deletedSign != null">
-        #{deletedSign,jdbcType=VARCHAR},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null">
-        #{type,jdbcType=VARCHAR},
-      </if>
-      <if test="managerId != null">
-        #{managerId,jdbcType=VARCHAR},
-      </if>
-      <if test="depNo != null">
-        #{depNo,jdbcType=VARCHAR},
-      </if>
-      <if test="superId != null">
-        #{superId,jdbcType=VARCHAR},
-      </if>
-      <if test="remarks != null">
-        #{remarks,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.OrganizationManagementExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    select count(*) from department
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    update department
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=VARCHAR},
-      </if>
-      <if test="record.createId != null">
-        create_id = #{record.createId,jdbcType=VARCHAR},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.updateTime != null">
-        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.deletedSign != null">
-        deleted_sign = #{record.deletedSign,jdbcType=VARCHAR},
-      </if>
-      <if test="record.name != null">
-        name = #{record.name,jdbcType=VARCHAR},
-      </if>
-      <if test="record.type != null">
-        type = #{record.type,jdbcType=VARCHAR},
-      </if>
-      <if test="record.managerId != null">
-        manager_id = #{record.managerId,jdbcType=VARCHAR},
-      </if>
-      <if test="record.depNo != null">
-        dep_no = #{record.depNo,jdbcType=VARCHAR},
-      </if>
-      <if test="record.superId != null">
-        super_id = #{record.superId,jdbcType=VARCHAR},
-      </if>
-      <if test="record.remarks != null">
-        remarks = #{record.remarks,jdbcType=VARCHAR},
-      </if>
-      <if test="record.status != null">
-        status = #{record.status,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    update department
-    set id = #{record.id,jdbcType=VARCHAR},
-      create_id = #{record.createId,jdbcType=VARCHAR},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
-      deleted_sign = #{record.deletedSign,jdbcType=VARCHAR},
-      name = #{record.name,jdbcType=VARCHAR},
-      type = #{record.type,jdbcType=VARCHAR},
-      manager_id = #{record.managerId,jdbcType=VARCHAR},
-      dep_no = #{record.depNo,jdbcType=VARCHAR},
-      super_id = #{record.superId,jdbcType=VARCHAR},
-      remarks = #{record.remarks,jdbcType=VARCHAR},
-      status = #{record.status,jdbcType=VARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrganizationManagement">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    update department
-    <set>
-      <if test="createId != null">
-        create_id = #{createId,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deletedSign != null">
-        deleted_sign = #{deletedSign,jdbcType=VARCHAR},
-      </if>
-      <if test="name != null">
-        name = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null">
-        type = #{type,jdbcType=VARCHAR},
-      </if>
-      <if test="managerId != null">
-        manager_id = #{managerId,jdbcType=VARCHAR},
-      </if>
-      <if test="depNo != null">
-        dep_no = #{depNo,jdbcType=VARCHAR},
-      </if>
-      <if test="superId != null">
-        super_id = #{superId,jdbcType=VARCHAR},
-      </if>
-      <if test="remarks != null">
-        remarks = #{remarks,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        status = #{status,jdbcType=VARCHAR},
-      </if>
-      <if test="abbreviation != null">
-        abbreviation = #{abbreviation,jdbcType=VARCHAR},
-      </if>
-      <if test="financeId != null">
-        finance_id = #{financeId,jdbcType=VARCHAR},
-      </if>
-      <if test="province != null">
-        province = #{province},
-      </if>
-      <if test="workingHoursType !=null">
-      	working_hours_type= #{workingHoursType},
-      </if>
-    </set>
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrganizationManagement">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 30 11:09:29 CST 2017.
-    -->
-    update department
-    set create_id = #{createId,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      deleted_sign = #{deletedSign,jdbcType=VARCHAR},
-      name = #{name,jdbcType=VARCHAR},
-      type = #{type,jdbcType=VARCHAR},
-      manager_id = #{managerId,jdbcType=VARCHAR},
-      dep_no = #{depNo,jdbcType=VARCHAR},
-      super_id = #{superId,jdbcType=VARCHAR},
-      remarks = #{remarks,jdbcType=VARCHAR},
-      status = #{status,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-	<select id="selectOrganizationList" parameterType="String" resultType="com.goafanti.organization.bo.OrganizationListOut">
-		select
-			om.id,om.create_id as createId,om.create_time as createTime,
-			om.update_time as updateTime,om.deleted_sign as deletedSign,
-			om.name,om.type,
-			om.dep_no as depNo,
-			om.remarks,
-			om.status,
-			dm.name as superName,
-			wh.name as workingHoursName,
-			x.name as managerName
-		from department om
-		left join department dm on om.super_id = dm.id
-		left join admin x on om.manager_id = x.id
-		left join working_hours wh  on om.working_hours_type =wh.`type`
-		where 	om.deleted_sign = 0
-		<if test="name !=null">
-			AND om.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
-		</if>
-		<if test="superId !=null">
-			AND om.super_id=#{superId,jdbcType=VARCHAR}
-		</if>
-		<if test="type !=null">
-			AND om.type=#{type,jdbcType=VARCHAR}
-		</if>
-		<if test="depNo !=null">
-			AND om.dep_no=#{depNo,jdbcType=VARCHAR}
-		</if>
-		<if test="page_sql != null">
-    		${page_sql}
-   		</if>
-	</select>
-	<select id="selectOrganizationCount" resultType="java.lang.Integer">
-		select
-			count(0)
-		from department om
-		left join department dm on om.super_id = dm.id
-		left join admin x on om.manager_id = x.id
-		where om.deleted_sign = 0
-		<if test="name !=null">
-			AND om.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
-		</if>
-		<if test="superId !=null">
-			AND om.super_id=#{superId,jdbcType=VARCHAR}
-		</if>
-		<if test="type !=null">
-			AND om.type=#{type,jdbcType=VARCHAR}
-		</if>
-		<if test="depNo !=null">
-			AND om.dep_no=#{depNo,jdbcType=VARCHAR}
-		</if>
-	</select>
-	<select id="selectSuperId"  resultType="com.goafanti.organization.bo.OrganizationListOut">
-		select
-		id,name,dep_no as depNo
-		from department
-		where
-		status ='0'
-		order by CONVERT (name USING gbk)
-		<if test="sort ==1" >
-		limit 10
-		</if>
-	</select>
-	<insert id="insert1" parameterType="com.goafanti.organization.bo.OrganizationListOut">
-		insert into department(
-		id,create_id,create_time,update_time,deleted_sign,
-		name,type,manager_id,dep_no,super_id,desc,status)
-		values(#{id,jdbcType=VARCHAR},#{createId,jdbcType=VARCHAR},
-		#{createTime,jdbcType=VARCHAR},#{updateTime,jdbcType=VARCHAR},
-		#{deletedSign,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},
-		#{type,jdbcType=VARCHAR},#{managerId,jdbcType=VARCHAR},
-		#{depNo,jdbcType=VARCHAR},#{superId,jdbcType=VARCHAR},
-		#{desc,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR})
-	</insert>
-	<!-- 得到上级 -->
-	<select id="selectDepNo" resultType="String">
-	select
-	dep_no as depNo
-		from department
-		where
-		id=#{superId,jdbcType=VARCHAR}
-	</select>
-
-	<select id="selectDepNoByName" resultType="String">
-		select
-		dep_no as depNo
-		from department
-		where
-		name=#{name,jdbcType=VARCHAR}
-	</select>
-	<select id="selectDepNoCount" parameterType="String" resultType="java.lang.Integer">
-		select
-		count(0)
-		from department
-		where
-		<!-- dep_no like concat(#{depNo,jdbcType=VARCHAR},'%') -->
-		super_id=#{superId,jdbcType=VARCHAR}
-	</select>
-	<select id="selectName" resultType="com.goafanti.admin.bo.AdminListBo">
-		select
-		name,id
-		from admin
-		where status='正常'
-		and name  like concat('%',#{name,jdbcType=VARCHAR},'%')
-	</select>
-	<select id="selectAllById" resultType="com.goafanti.organization.bo.OrganizationListOut">
-        select a.id, a.create_id as createId, a.create_time as createTime, a.update_time as updateTime,
-               a.deleted_sign as deletedSign, a.name, a.type, a.manager_id as managerId, a.dep_no as depNo,
-               a.super_id as superId, a.remarks, a.status, a.abbreviation, a.finance_id financeId,
-               a.province, c.name financeName, a.working_hours_type workingHoursType, b.name as managerName
-        from department a
-        left join admin b on a.manager_id = b.id left join admin c on a.finance_id = c.id
-	where a.id=#{id,jdbcType=VARCHAR}
-	</select>
-	<delete id="deleteById" parameterType="java.lang.String">
-	    delete from department
-	    where id = #{id,jdbcType=VARCHAR}
-  	</delete>
-  	<select id="selectAdminNameById" parameterType="java.lang.String" resultType="java.lang.String">
-  		select
-  		name
-  		from admin
-  		where
-  		id=#{id,jdbcType=VARCHAR}
-  	</select>
-  	<select id="selectIdByDepNo" parameterType="java.lang.String" resultType="java.lang.String">
-  		select
-  		id
-  		from department
-  		where
-  		dep_no=#{depNo,jdbcType=VARCHAR}
-  	</select>
-  	<select id="selectIDNBySuperId" parameterType="java.lang.String" resultType="com.goafanti.organization.bo.OrganizationListOut">
-  		select
-  		id,create_id as createId,create_time as createTime,
-		update_time as updateTime,deleted_sign as deletedSign,
-		name,type,manager_id as managerId,
-		dep_no as depNo,
-		super_id as superId,
-		remarks,status
-  		from department
-  		where
-  		super_id=#{id,jdbcType=VARCHAR}
-  		order by dep_no
-  	</select>
-  	<update id="updateByNumber" parameterType="com.goafanti.organization.bo.OrganizationListOut">
-  		update department
-	    <set>
-	    	dep_no = #{depNo,jdbcType=VARCHAR}
-	    </set>
-	    where
-	    id=#{id,jdbcType=VARCHAR}
-  	</update>
-  	<select id="selectCountBySuperId" parameterType="String" resultType="java.lang.Integer">
-  		select
-		count(0)
-		from department
-		where
-		super_id=#{superId,jdbcType=VARCHAR}
-  	</select>
-  	<select id="selectIdByName" parameterType="java.lang.String" resultType="java.lang.String">
-  		select
-  		id
-  		from department
-  		where
-  		name=#{name,jdbcType=VARCHAR}
-  	</select>
-  	<select id="selectNameById" parameterType="java.lang.String" resultType="java.lang.String">
-  		select
-  		name
-  		from department
-  		where
-  		id=#{id,jdbcType=VARCHAR}
-  	</select>
-  	<select id="selectDepNoById" resultType="String">
-		select
-		dep_no as depNo
-		from department
-		where
-		id=#{id,jdbcType=VARCHAR}
-	</select>
-	<select id="selectUserById" parameterType="java.lang.String" resultType="java.lang.Integer">
-		select
-		count(0)
-		from admin
-		where
-		department_id=#{id,jdbcType=VARCHAR}
-	</select>
-	<!-- 查询当前层级 -->
-	<select id="selectCurrentDeps" parameterType="java.lang.String" resultMap="BaseResultMap">
-		select id,name,dep_no,super_id from department where manager_id = #{aid,jdbcType=VARCHAR}
-			union all
-		select id,name,dep_no,super_id from department where id = (select department_id from admin where id = #{aid,jdbcType=VARCHAR})
-	</select>
-	<!-- 查询下一层级  -->
-	<select id="selectSubDeps"  parameterType="java.lang.String" resultMap="BaseResultMap">
-		select id,name,dep_no from department where super_id in (#{superIds,jdbcType=VARCHAR})
-	</select>
-
-		<select id="selectBysuperId"  resultType="com.goafanti.admin.bo.depCountBo">
-		select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
-        from department a  where a.super_id= #{id}
-	</select>
-
-    <select id="selectBysuperName" resultType="com.goafanti.admin.bo.depCountBo">
-        select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
-        from department a left join department b on a.super_id=b.id where b.name= #{name}
-    </select>
-
-	<!-- 查询所有 -->
-	<select id="selectAllDeps" resultMap="BaseResultMap">
-		select id,name,dep_no from department
-	</select>
-	<select id="getMaxAbbreviation"  parameterType="java.lang.String" resultType="java.lang.String">
-	select max(contract_no) as maxNo from t_order_new
-	where create_time > '2019-5-31'
-	and contract_no like  concat(#{abbreviation,jdbcType=VARCHAR},'%')
-	</select>
-
-	<select id="getDepAll" resultType="com.goafanti.admin.bo.AdminCustomerBo">
-        select a.id aid,a.name aName,d.id depId,d.name depName,ifnull(b.userCount,0)userCount,ifnull(b.channelCount,0)channelCount,
-        ifnull(b.signCount,0)signCount,ifnull(b.newCount,0)newCount,ifnull(b.channelNewCount,0)channelNewCount,ifnull( b.receiveCount,0)receiveCount,
-        ifnull( b.completeCount,0)completeCount,ifnull(b.channelCompleteCount,0)channelCompleteCount
-        from admin a left join (select x.aid,x.userCount,x.channelCount,signCount,x.newCount,x.channelNewCount,x.receiveCount,
-        ifnull(y.completeCount,0)completeCount,ifnull(y.channelCompleteCount,0)channelCompleteCount
-        from (select aid,sum(if( share_type=0 and channel=0,1,0))userCount,
-        sum(if(share_type=3 and  channel=1,1,0))channelCount,
-        sum(if( share_type=2 ,1,0))signCount,
-        sum(if(share_type=0 and source =1  and channel=0,1,0))newCount,
-        sum(if(share_type=0 and source =1  and channel=1,1,0))channelNewCount,
-        sum(if(share_type=0 and source =2  and channel=0,1,0))receiveCount
-        from `user` where `type` =1 and new_channel=0
-        <if test="startTime != null and endTime != null">
-        and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-        </if>
-        group by aid)x left join (select a.aid,sum(if(b.channel=0,1,0))completeCount,
-        sum(if(b.channel=1,1,0))channelCompleteCount from public_release a left join `user` b on a.uid =b.id
-        where a.clock_in =1
-        <if test="startTime != null and endTime != null">
-        and clock_in_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-        </if>
-        group by a.aid ) y on x.aid=y.aid)b on a.id=b.aid
-        left join department d on a.department_id=d.id
-        where  a.status='正常'  and a.type=1
-        <if test="adminName !=null">
-	and a.name  like concat('%',#{adminName},'%')
-	</if>
-	<if test="depId !=null">
-	and d.id= #{depId}
-	</if>
-	</select>
-    <select id="AlldepCount" resultType="com.goafanti.admin.bo.AdminCustomerBo">
-        select a.id aid,a.name aName ,a.department_id depId,c.name depName,ifnull(userCount,0)userCount,
-        ifnull(channelCount,0)channelCount,ifnull(signCount,0)signCount,ifnull(newCount,0)newCount,
-        ifnull(channelNewCount,0)channelNewCount,ifnull(receiveCount,0)receiveCount,ifnull(completeCount,0)completeCount,
-        ifnull(channelCompleteCount,0)channelCompleteCount
-        from admin a left join (select aid,sum(if( share_type=0 and channel=0,1,0))userCount,
-        sum(if(share_type=3 and  channel=1,1,0))channelCount,
-        sum(if( share_type=2 ,1,0))signCount,
-        sum(if(share_type=0 and source =1  and channel=0,1,0))newCount,
-        sum(if(share_type=0 and source =1  and channel=1,1,0))channelNewCount,
-        sum(if(share_type=0 and source =2  and channel=0,1,0))receiveCount
-        from `user` where `type` =1 and new_channel=0
-            <if test="startTime != null and endTime != null">
-                and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-            </if>
-            group by aid)b on a.id=b.aid
-        left join (select a.aid,sum(if(b.channel=0,1,0))completeCount,
-        sum(if(b.channel=1,1,0))channelCompleteCount from public_release a left join `user` b on a.uid =b.id
-        where a.clock_in =1
-        <if test="startTime != null and endTime != null">
-            and clock_in_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-        </if>
-        group by a.aid ) y on a.id=y.aid
-                     left join department c on a.department_id =c.id
-        where  a.status='正常'  and a.type=1
-        <if test="depIds!= null">
-            and a.department_id in
-            <foreach close=")" collection="depIds" item="deps" open="(" separator=",">
-                #{deps.id}
-            </foreach>
-        </if>
-    </select>
-
-</mapper>

+ 6 - 0
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -551,6 +551,9 @@
         <if test="aid !=null">
         and a.aid= #{aid}
         </if>
+      <if test="statusType ==1">
+        and a.status in (0,1,2,4)
+      </if>
 	</if>
 	<if test="type==1">
       and a.assist in(0,1)
@@ -620,6 +623,9 @@
       <if test="aid !=null">
         and a.aid= #{aid}
       </if>
+      <if test="statusType ==1">
+        and a.status in (0,1,2,4)
+      </if>
     </if>
     <if test="type==1">
       and a.assist in(0,1)

+ 2 - 0
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1819,6 +1819,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="amountStatus == 4">
       and a.total_amount  &gt; 40
     </if>
+
     order by a.create_time desc
     <if test="page_sql!=null">
       ${page_sql}
@@ -1874,6 +1875,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="amountStatus == 4">
       and a.total_amount  &gt; 40
     </if>
+
   </select>
 
 </mapper>

+ 2 - 2
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1319,7 +1319,7 @@
       and b.contract_no = #{contractNo}
     </if>
     <if test="userName !=null">
-      and e.buyer_name like concat( #{userName},'%')
+      and e.buyer_name like concat('%', #{userName},'%')
     </if>
     <if test="declarationBatch !=null">
       and a.declaration_batch = #{declarationBatch}
@@ -1424,7 +1424,7 @@
       and b.contract_no = #{contractNo}
     </if>
     <if test="userName !=null">
-      and e.buyer_name like concat( #{userName},'%')
+      and e.buyer_name like concat('%', #{userName},'%')
     </if>
     <if test="declarationBatch !=null">
       and a.declaration_batch = #{declarationBatch}

+ 497 - 4
src/main/java/com/goafanti/common/mapper/UserMidMapper.xml

@@ -13,10 +13,26 @@
     <result column="update_name" jdbcType="VARCHAR" property="updateName" />
     <result column="date_update_time" jdbcType="TIMESTAMP" property="dateUpdateTime" />
     <result column="channel_type" jdbcType="INTEGER" property="channelType" />
+    <result column="chargeback" jdbcType="INTEGER" property="chargeback" />
+    <result column="member" jdbcType="INTEGER" property="member" />
+    <result column="last_sales_type" jdbcType="INTEGER" property="lastSalesType" />
+    <result column="last_follow_type" jdbcType="INTEGER" property="lastFollowType" />
+    <result column="follow_number" jdbcType="INTEGER" property="followNumber" />
+    <result column="task_names" jdbcType="VARCHAR" property="taskNames" />
+    <result column="sign_number" jdbcType="INTEGER" property="signNumber" />
+    <result column="sign_amount" jdbcType="DECIMAL" property="signAmount" />
+    <result column="last_signing_time" jdbcType="DATE" property="lastSigningTime" />
+    <result column="first_signing_time" jdbcType="DATE" property="firstSigningTime" />
+    <result column="follow_dep" jdbcType="VARCHAR" property="followDep" />
+    <result column="follow_explain" jdbcType="VARCHAR" property="followExplain" />
+    <result column="follow_aname" jdbcType="VARCHAR" property="followAname" />
+    <result column="follow_aid" jdbcType="VARCHAR" property="followAid" />
   </resultMap>
   <sql id="Base_Column_List">
     id, `uid`, aid, last_follow_time, last_sign_time, create_time, big_customer, update_aid,
-    update_name, date_update_time, channel_type
+    update_name, date_update_time, channel_type, chargeback, `member`, last_sales_type,
+    last_follow_type, follow_number, task_names, sign_number, sign_amount, last_signing_time,
+    first_signing_time, follow_dep, follow_explain, follow_aname, follow_aid
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -32,11 +48,21 @@
     insert into user_mid (id, `uid`, aid,
       last_follow_time, last_sign_time, create_time,
       big_customer, update_aid, update_name,
-      date_update_time, channel_type)
+      date_update_time, channel_type, chargeback,
+      `member`, last_sales_type, last_follow_type,
+      follow_number, task_names, sign_number,
+      sign_amount, last_signing_time, first_signing_time,
+      follow_dep, follow_explain, follow_aname,
+      follow_aid)
     values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
       #{lastFollowTime,jdbcType=TIMESTAMP}, #{lastSignTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
       #{bigCustomer,jdbcType=INTEGER}, #{updateAid,jdbcType=VARCHAR}, #{updateName,jdbcType=VARCHAR},
-      #{dateUpdateTime,jdbcType=TIMESTAMP}, #{channelType,jdbcType=INTEGER})
+      #{dateUpdateTime,jdbcType=TIMESTAMP}, #{channelType,jdbcType=INTEGER}, #{chargeback,jdbcType=INTEGER},
+      #{member,jdbcType=INTEGER}, #{lastSalesType,jdbcType=INTEGER}, #{lastFollowType,jdbcType=INTEGER},
+      #{followNumber,jdbcType=INTEGER}, #{taskNames,jdbcType=VARCHAR}, #{signNumber,jdbcType=INTEGER},
+      #{signAmount,jdbcType=DECIMAL}, #{lastSigningTime,jdbcType=DATE}, #{firstSigningTime,jdbcType=DATE},
+      #{followDep,jdbcType=VARCHAR}, #{followExplain,jdbcType=VARCHAR}, #{followAname,jdbcType=VARCHAR},
+      #{followAid,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.UserMid">
     insert into user_mid
@@ -74,6 +100,48 @@
       <if test="channelType != null">
         channel_type,
       </if>
+      <if test="chargeback != null">
+        chargeback,
+      </if>
+      <if test="member != null">
+        `member`,
+      </if>
+      <if test="lastSalesType != null">
+        last_sales_type,
+      </if>
+      <if test="lastFollowType != null">
+        last_follow_type,
+      </if>
+      <if test="followNumber != null">
+        follow_number,
+      </if>
+      <if test="taskNames != null">
+        task_names,
+      </if>
+      <if test="signNumber != null">
+        sign_number,
+      </if>
+      <if test="signAmount != null">
+        sign_amount,
+      </if>
+      <if test="lastSigningTime != null">
+        last_signing_time,
+      </if>
+      <if test="firstSigningTime != null">
+        first_signing_time,
+      </if>
+      <if test="followDep != null">
+        follow_dep,
+      </if>
+      <if test="followExplain != null">
+        follow_explain,
+      </if>
+      <if test="followAname != null">
+        follow_aname,
+      </if>
+      <if test="followAid != null">
+        follow_aid,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -109,6 +177,48 @@
       <if test="channelType != null">
         #{channelType,jdbcType=INTEGER},
       </if>
+      <if test="chargeback != null">
+        #{chargeback,jdbcType=INTEGER},
+      </if>
+      <if test="member != null">
+        #{member,jdbcType=INTEGER},
+      </if>
+      <if test="lastSalesType != null">
+        #{lastSalesType,jdbcType=INTEGER},
+      </if>
+      <if test="lastFollowType != null">
+        #{lastFollowType,jdbcType=INTEGER},
+      </if>
+      <if test="followNumber != null">
+        #{followNumber,jdbcType=INTEGER},
+      </if>
+      <if test="taskNames != null">
+        #{taskNames,jdbcType=VARCHAR},
+      </if>
+      <if test="signNumber != null">
+        #{signNumber,jdbcType=INTEGER},
+      </if>
+      <if test="signAmount != null">
+        #{signAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="lastSigningTime != null">
+        #{lastSigningTime,jdbcType=DATE},
+      </if>
+      <if test="firstSigningTime != null">
+        #{firstSigningTime,jdbcType=DATE},
+      </if>
+      <if test="followDep != null">
+        #{followDep,jdbcType=VARCHAR},
+      </if>
+      <if test="followExplain != null">
+        #{followExplain,jdbcType=VARCHAR},
+      </if>
+      <if test="followAname != null">
+        #{followAname,jdbcType=VARCHAR},
+      </if>
+      <if test="followAid != null">
+        #{followAid,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserMid">
@@ -144,6 +254,48 @@
       <if test="channelType != null">
         channel_type = #{channelType,jdbcType=INTEGER},
       </if>
+      <if test="chargeback != null">
+        chargeback = #{chargeback,jdbcType=INTEGER},
+      </if>
+      <if test="member != null">
+        `member` = #{member,jdbcType=INTEGER},
+      </if>
+      <if test="lastSalesType != null">
+        last_sales_type = #{lastSalesType,jdbcType=INTEGER},
+      </if>
+      <if test="lastFollowType != null">
+        last_follow_type = #{lastFollowType,jdbcType=INTEGER},
+      </if>
+      <if test="followNumber != null">
+        follow_number = #{followNumber,jdbcType=INTEGER},
+      </if>
+      <if test="taskNames != null">
+        task_names = #{taskNames,jdbcType=VARCHAR},
+      </if>
+      <if test="signNumber != null">
+        sign_number = #{signNumber,jdbcType=INTEGER},
+      </if>
+      <if test="signAmount != null">
+        sign_amount = #{signAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="lastSigningTime != null">
+        last_signing_time = #{lastSigningTime,jdbcType=DATE},
+      </if>
+      <if test="firstSigningTime != null">
+        first_signing_time = #{firstSigningTime,jdbcType=DATE},
+      </if>
+      <if test="followDep != null">
+        follow_dep = #{followDep,jdbcType=VARCHAR},
+      </if>
+      <if test="followExplain != null">
+        follow_explain = #{followExplain,jdbcType=VARCHAR},
+      </if>
+      <if test="followAname != null">
+        follow_aname = #{followAname,jdbcType=VARCHAR},
+      </if>
+      <if test="followAid != null">
+        follow_aid = #{followAid,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -158,9 +310,24 @@
       update_aid = #{updateAid,jdbcType=VARCHAR},
       update_name = #{updateName,jdbcType=VARCHAR},
       date_update_time = #{dateUpdateTime,jdbcType=TIMESTAMP},
-      channel_type = #{channelType,jdbcType=INTEGER}
+      channel_type = #{channelType,jdbcType=INTEGER},
+      chargeback = #{chargeback,jdbcType=INTEGER},
+      `member` = #{member,jdbcType=INTEGER},
+      last_sales_type = #{lastSalesType,jdbcType=INTEGER},
+      last_follow_type = #{lastFollowType,jdbcType=INTEGER},
+      follow_number = #{followNumber,jdbcType=INTEGER},
+      task_names = #{taskNames,jdbcType=VARCHAR},
+      sign_number = #{signNumber,jdbcType=INTEGER},
+      sign_amount = #{signAmount,jdbcType=DECIMAL},
+      last_signing_time = #{lastSigningTime,jdbcType=DATE},
+      first_signing_time = #{firstSigningTime,jdbcType=DATE},
+      follow_dep = #{followDep,jdbcType=VARCHAR},
+      follow_explain = #{followExplain,jdbcType=VARCHAR},
+      follow_aname = #{followAname,jdbcType=VARCHAR},
+      follow_aid = #{followAid,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
+
   <update id="updateByUid" parameterType="com.goafanti.common.model.UserMid">
     update user_mid
     <set>
@@ -191,6 +358,48 @@
       <if test="channelType != null">
         channel_type = #{channelType,jdbcType=INTEGER},
       </if>
+      <if test="chargeback != null">
+        chargeback = #{chargeback,jdbcType=INTEGER},
+      </if>
+      <if test="member != null">
+        `member` = #{member,jdbcType=INTEGER},
+      </if>
+      <if test="lastSalesType != null">
+        last_sales_type = #{lastSalesType,jdbcType=INTEGER},
+      </if>
+      <if test="lastFollowType != null">
+        last_follow_type = #{lastFollowType,jdbcType=INTEGER},
+      </if>
+      <if test="followNumber != null">
+        follow_number = #{followNumber,jdbcType=INTEGER},
+      </if>
+      <if test="taskNames != null">
+        task_names = #{taskNames,jdbcType=VARCHAR},
+      </if>
+      <if test="signNumber != null">
+        sign_number = #{signNumber,jdbcType=INTEGER},
+      </if>
+      <if test="signAmount != null">
+        sign_amount = #{signAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="lastSigningTime != null">
+        last_signing_time = #{lastSigningTime,jdbcType=DATE},
+      </if>
+      <if test="firstSigningTime != null">
+        first_signing_time = #{firstSigningTime,jdbcType=DATE},
+      </if>
+      <if test="followDep != null">
+        follow_dep = #{followDep,jdbcType=VARCHAR},
+      </if>
+      <if test="followExplain != null">
+        follow_explain = #{followExplain,jdbcType=VARCHAR},
+      </if>
+      <if test="followAname != null">
+        follow_aname = #{followAname,jdbcType=VARCHAR},
+      </if>
+      <if test="followAid != null">
+        follow_aid = #{followAid,jdbcType=VARCHAR},
+      </if>
     </set>
     where `uid` = #{uid,jdbcType=VARCHAR}
   </update>
@@ -229,4 +438,288 @@
       #{item}
     </foreach>
   </update>
+
+  <select id="getUserTaskNames" resultType="java.lang.String">
+    select group_concat(distinct b.commodity_name)task_names from t_order_new a
+    left join t_order_task b on a.order_no =b.order_no
+    where a.buyer_id = #{uid}
+    group by  a.buyer_id
+  </select>
+  <select id="getUserDtails" resultType="com.goafanti.common.model.UserMid">
+    select a.buyer_id uid,min(a.sign_time)firstSigningTime,max(a.sign_time)lastSigningTime,
+           sum(a.total_amount)signAmount,count(*)signNumber
+    from t_order_new a
+    where a.delete_sign in (0,2) and a.process_status >4
+    and a.buyer_id= #{uid}
+    group by a.buyer_id
+  </select>
+
+  <select id="selectSignSummaryList" resultType="com.goafanti.order.bo.OutSignSummary">
+    select a.id ,a.nickname ,b.sign_number signNumber,b.sign_amount signAmount,
+    date_format(b.first_signing_time ,'%Y-%m-%d') firstSigningTime,
+    date_format(b.last_signing_time  ,'%Y-%m-%d') lastSigningTime ,
+    b.last_sales_type  lastSalesType,c.name,d.name depName,
+    b.last_follow_type lastFollowType,b.follow_explain followExplain ,b.follow_number followNumber ,
+    date_format(b.last_follow_time ,'%Y-%m-%d %H:%i:%S') lastFollowTime ,b.task_names taskNames ,
+    b.`member` ,b.chargeback ,b.big_customer bigCustomer,b.follow_aname followAname
+    from user a left join user_mid b on a.id=b.uid  left join admin c on a.aid=c.id
+    left join department d on c.department_id =d.id
+    where a.share_type =2
+      <if test="userName != null">
+        and a.nickname like concat('%',#{userName},'%')
+      </if>
+    <if test="aid != null">
+      and c.id =#{aid}
+    </if>
+    <if test="followAid != null">
+      and b.follow_aid =#{followAid}
+    </if>
+    <if test="member != null">
+      and b.`member` = #{member}
+    </if>
+    <if test="chargeback != null">
+      and b.chargeback = #{chargeback}
+    </if>
+    <if test="bigCustomer != null">
+      and b.big_customer = #{bigCustomer}
+    </if>
+    <if test="lastFollowType != null">
+      and b.last_follow_type = #{lastFollowType}
+    </if>
+    <if test="followDep != null">
+      and b.follow_dep = #{followDep}
+    </if>
+    <if test="lastFollowTimeStart != null and lastFollowTimeEnd !=null">
+      and b.last_follow_time BETWEEN #{lastFollowTimeStart} and #{lastFollowTimeEnd}
+    </if>
+    <if test="firstSigningTimeStart != null and firstSigningTimeEnd !=null">
+      and b.first_signing_time BETWEEN #{firstSigningTimeStart} and #{firstSigningTimeEnd}
+    </if>
+    <if test="lastSigningTimeStart != null and lastSigningTimeStart !=null">
+      and b.last_signing_time BETWEEN #{lastSigningTimeStart} and #{lastSigningTimeEnd}
+    </if>
+    <if test="signNumber != null">
+      and b.sign_number = #{signNumber}
+    </if>
+    <if test="lastSalesType != null">
+      and b.last_sales_type = #{lastSalesType}
+    </if>
+    <if test="page_sql!=null">
+      ${page_sql}
+    </if>
+  </select>
+  <select id="selectSignSummaryCount" resultType="integer">
+    select count(*)
+    from user a left join user_mid b on a.id=b.uid  left join admin c on a.aid=c.id
+    where a.share_type = 2
+    <if test="userName != null">
+      and a.nickname like concat('%',#{userName},'%')
+    </if>
+    <if test="aid != null">
+      and c.id =#{aid}
+    </if>
+    <if test="followAid != null">
+      and b.follow_aid =#{followAid}
+    </if>
+    <if test="member != null">
+      and b.`member` = #{member}
+    </if>
+    <if test="chargeback != null">
+      and b.chargeback = #{chargeback}
+    </if>
+    <if test="bigCustomer != null">
+      and b.big_customer = #{bigCustomer}
+    </if>
+    <if test="lastFollowType != null">
+      and b.last_follow_type = #{lastFollowType}
+    </if>
+    <if test="followDep != null">
+      and b.follow_dep = #{followDep}
+    </if>
+    <if test="lastFollowTimeStart != null and lastFollowTimeEnd !=null">
+      and b.last_follow_time BETWEEN #{lastFollowTimeStart} and #{lastFollowTimeEnd}
+    </if>
+    <if test="firstSigningTimeStart != null and firstSigningTimeEnd !=null">
+      and b.first_signing_time BETWEEN #{firstSigningTimeStart} and #{firstSigningTimeEnd}
+    </if>
+    <if test="lastSigningTimeStart != null and lastSigningTimeStart !=null">
+      and b.last_signing_time BETWEEN #{lastSigningTimeStart} and #{lastSigningTimeEnd}
+    </if>
+    <if test="signNumber != null">
+      and b.sign_number = #{signNumber}
+    </if>
+    <if test="lastSalesType != null">
+      and b.last_sales_type = #{lastSalesType}
+    </if>
+  </select>
+
+  <select id="selectsignStatisticsList" resultType="com.goafanti.order.bo.OutSignStatistics">
+    select a.id, a.name,  userCount, orderCount, totalAmount, newSignNumber, repeatSignNumber, channelSignNumber,
+    (newSignNumber/orderCount)newRatio,(repeatSignNumber/orderCount)repeatRatio,(channelSignNumber/orderCount)channelRatio
+    from  admin a
+    left join user_role ur on ur.uid =a.id left join `role` r on r.id=ur.rid
+    left join ( select x.aid,count(id) userCount, sum(x.orderCount)orderCount,sum(x.totalAmount)totalAmount,
+    sum(x.newSignNumber)newSignNumber,sum(x.repeatSignNumber)repeatSignNumber,
+    sum(x.channelSignNumber)channelSignNumber
+    from ( select b.aid,b.id,count(*)orderCount ,sum(a.total_amount) totalAmount ,
+    sum(if(a.sales_type &lt; 3 || (a.sales_type &gt; 3 &amp;&amp; a.sales_type &lt; 6),1,0 ))newSignNumber,
+    sum(if(a.sales_type=3,1,0 ))channelSignNumber,sum(if(a.sales_type &gt; 5,1,0 ))repeatSignNumber
+    from t_order_new a left join user b on b.id=a.buyer_id
+    where a.process_status &gt;4 and b.share_type =2 and a.delete_sign in(0,2)
+    <if test="signTimeStart != null and signTimeEnd!=null">
+      and a.sign_time BETWEEN #{signTimeStart} and #{signTimeEnd}
+    </if>
+    group by b.aid,b.id)x group by x.aid)y on y.aid=a.id
+    where a.status='正常' and r.role_type in (96,996)
+    <if test="aid != null">
+      and a.id= #{aid}
+    </if>
+    <if test="deps != null">
+      and a.department_id in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
+    </if>
+    <if test="amountType != null">
+      <if test="amountType == 1">
+        and  ( totalAmount &lt; 10 or totalAmount is null)
+      </if>
+      <if test="amountType == 2">
+        and  totalAmount BETWEEN 10 and 20
+      </if>
+      <if test="amountType == 3">
+        and  totalAmount BETWEEN 20 and 30
+      </if>
+      <if test="amountType == 4">
+        and  totalAmount &gt; 30
+      </if>
+    </if>
+    <if test="page_sql!=null">
+      ${page_sql}
+    </if>
+  </select>
+
+  <select id="selectsignStatisticsCount" resultType="integer">
+    select count(*)
+    from  admin a left join user_role ur on ur.uid =a.id left join `role` r on r.id=ur.rid
+    left join (select b.aid,sum(a.total_amount) totalAmount
+    from t_order_new a left join user b on b.id=a.buyer_id
+    where a.process_status >4 and b.share_type =2 and a.delete_sign in(0,2)
+    group by b.aid)x on a.id=x.aid
+    where a.status='正常' and r.role_type in (96,996)
+    <if test="aid != null">
+      and a.id= #{aid}
+    </if>
+    <if test="deps != null">
+      and a.department_id in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
+    </if>
+    <if test="amountType != null">
+      <if test="amountType == 1">
+        and ( totalAmount &lt; 10 or totalAmount is null)
+      </if>
+      <if test="amountType == 2">
+        and  totalAmount BETWEEN 10 and 20
+      </if>
+      <if test="amountType == 3">
+        and  totalAmount BETWEEN 20 and 30
+      </if>
+      <if test="amountType == 4">
+        and  totalAmount &gt; 30
+      </if>
+    </if>
+  </select>
+
+  <select id="selectsignStatisticsOrderList" resultType="com.goafanti.order.bo.TOrderNewBo">
+    select a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,a.delete_sign deleteSign,
+           a.contract_no as contractNo, b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,
+           a.order_status as orderStatus, a.liquidation_status as liquidationStatus,a.approval,c.salesman_name as salesmanName,c.project_type projectType,
+           dep.name as depName,c.finance_name as financeName,c.invoice_amount invoiceAmount,a.settlement_amount settlementAmount,
+           a.sales_type salesType, a.channel_id channelId ,a.other
+    from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
+                        left join department dep on a.order_dep=dep.id
+    where a.process_status &gt;4 and b.share_type =2 and a.delete_sign in(0,2)
+    <if test="amountType != null">
+      <if test="amountType == 1">
+        and  a.total_amount &lt; 10
+      </if>
+      <if test="amountType == 2">
+        and  a.total_amount BETWEEN 10 and 20
+      </if>
+      <if test="amountType == 3">
+        and  a.total_amount BETWEEN 20 and 30
+      </if>
+      <if test="amountType == 4">
+        and  a.total_amount &gt; 30
+      </if>
+    </if>
+    <if test="signTimeStart != null and signTimeEnd!=null">
+      and a.sign_time BETWEEN #{signTimeStart} and #{signTimeEnd}
+    </if>
+    <if test="aid !=null">
+      and  b.aid= #{aid}
+    </if>
+
+    <if test="uid !=null">
+      and  b.id= #{uid}
+    </if>
+    <if test="orderType !=null">
+      <if test="orderType ==1">
+        and(a.sales_type &lt; 3 or (a.sales_type &gt; 3 and a.sales_type &lt; 6))
+      </if>
+      <if test="orderType ==2">
+        and a.sales_type &gt; 5
+      </if>
+      <if test="orderType ==3">
+        and a.sales_type=3
+      </if>
+    </if>
+    order by a.create_time desc
+    <if test="page_sql!=null">
+      ${page_sql}
+    </if>
+  </select>
+
+  <select id="selectsignStatisticsOrderCount" resultType="integer">
+    select count(*)
+    from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
+    left join department dep on a.order_dep=dep.id
+    where a.process_status &gt;4 and b.share_type =2 and a.delete_sign in(0,2)
+    <if test="amountType != null">
+      <if test="amountType == 1">
+        and  a.total_amount &lt; 10
+      </if>
+      <if test="amountType == 2">
+        and  a.total_amount BETWEEN 10 and 20
+      </if>
+      <if test="amountType == 3">
+        and  a.total_amount BETWEEN 20 and 30
+      </if>
+      <if test="amountType == 4">
+        and  a.total_amount &gt; 30
+      </if>
+    </if>
+    <if test="signTimeStart != null and signTimeEnd!=null">
+      and a.sign_time BETWEEN #{signTimeStart} and #{signTimeEnd}
+    </if>
+    <if test="aid !=null">
+      and  b.aid= #{aid}
+    </if>
+    <if test="uid !=null">
+      and  b.id= #{uid}
+    </if>
+    <if test="orderType !=null">
+      <if test="orderType ==1">
+        and(a.sales_type &lt; 3 or (a.sales_type &gt; 3 and a.sales_type &lt; 6))
+      </if>
+      <if test="orderType ==2">
+        and a.sales_type &gt; 5
+      </if>
+      <if test="orderType ==3">
+        and a.sales_type=3
+      </if>
+    </if>
+  </select>
 </mapper>

+ 246 - 0
src/main/java/com/goafanti/common/model/Department.java

@@ -0,0 +1,246 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * department
+ * @author 
+ */
+public class Department implements Serializable {
+    /**
+     * 组织ID
+     */
+    private String id;
+
+    /**
+     * 创建人
+     */
+    private String createId;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 删除标识
+     */
+    private Integer deletedSign;
+
+    /**
+     * 组织名称
+     */
+    private String name;
+
+    /**
+     * 组织类型
+     */
+    private String type;
+
+    /**
+     * 组织负责人ID
+     */
+    private String managerId;
+
+    /**
+     * 组织编号
+     */
+    private String depNo;
+
+    /**
+     * 上级组织
+     */
+    private String superId;
+
+    /**
+     * 组织职能说明
+     */
+    private String remarks;
+
+    /**
+     * 组织状态
+     */
+    private String status;
+
+    /**
+     * 缩写
+     */
+    private String abbreviation;
+
+    /**
+     * 财务id(指定跳转的财务)
+     */
+    private String financeId;
+
+    /**
+     * 所在省份
+     */
+    private Integer province;
+
+    /**
+     * 工作时间
+     */
+    private Integer workingHoursType;
+
+    /**
+     * 隐藏 0否 1是
+     */
+    private Integer hideSign;
+
+    /**
+     * 层级
+     */
+    private Integer lvl;
+
+    private static final long serialVersionUID = 1L;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(String createId) {
+        this.createId = createId;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Integer getDeletedSign() {
+        return deletedSign;
+    }
+
+    public void setDeletedSign(Integer deletedSign) {
+        this.deletedSign = deletedSign;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getManagerId() {
+        return managerId;
+    }
+
+    public void setManagerId(String managerId) {
+        this.managerId = managerId;
+    }
+
+    public String getDepNo() {
+        return depNo;
+    }
+
+    public void setDepNo(String depNo) {
+        this.depNo = depNo;
+    }
+
+    public String getSuperId() {
+        return superId;
+    }
+
+    public void setSuperId(String superId) {
+        this.superId = superId;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getAbbreviation() {
+        return abbreviation;
+    }
+
+    public void setAbbreviation(String abbreviation) {
+        this.abbreviation = abbreviation;
+    }
+
+    public String getFinanceId() {
+        return financeId;
+    }
+
+    public void setFinanceId(String financeId) {
+        this.financeId = financeId;
+    }
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public Integer getWorkingHoursType() {
+        return workingHoursType;
+    }
+
+    public void setWorkingHoursType(Integer workingHoursType) {
+        this.workingHoursType = workingHoursType;
+    }
+
+    public Integer getHideSign() {
+        return hideSign;
+    }
+
+    public void setHideSign(Integer hideSign) {
+        this.hideSign = hideSign;
+    }
+
+    public Integer getLvl() {
+        return lvl;
+    }
+
+    public void setLvl(Integer lvl) {
+        this.lvl = lvl;
+    }
+}

+ 0 - 332
src/main/java/com/goafanti/common/model/OrganizationManagement.java

@@ -1,332 +0,0 @@
-package com.goafanti.common.model;
-
-import java.util.Date;
-
-public class OrganizationManagement {
-
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String id;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.create_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String createId;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.create_time
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private Date createTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.update_time
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private Date updateTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.deleted_sign
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String deletedSign;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.name
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String name;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.type
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String type;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.manager_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String managerId;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.dep_no
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String depNo;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.super_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String superId;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.remarks
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String remarks;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_management.status
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	private String status;
-	/**
-	 * 缩写
-	 */
-	private String abbreviation;
-	
-	/**
-	 * 负责财务id
-	 */
-	private String financeId;
-	
-	
-	/**
-	 * 	省份
-	 */
-	private Integer province;
-	
-	private Integer workingHoursType;
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.id
-	 * @return  the value of organization_management.id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	
-	public String getId() {
-		return id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.id
-	 * @param id  the value for organization_management.id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.create_id
-	 * @return  the value of organization_management.create_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getCreateId() {
-		return createId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.create_id
-	 * @param createId  the value for organization_management.create_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setCreateId(String createId) {
-		this.createId = createId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.create_time
-	 * @return  the value of organization_management.create_time
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.create_time
-	 * @param createTime  the value for organization_management.create_time
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.update_time
-	 * @return  the value of organization_management.update_time
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public Date getUpdateTime() {
-		return updateTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.update_time
-	 * @param updateTime  the value for organization_management.update_time
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setUpdateTime(Date updateTime) {
-		this.updateTime = updateTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.deleted_sign
-	 * @return  the value of organization_management.deleted_sign
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getDeletedSign() {
-		return deletedSign;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.deleted_sign
-	 * @param deletedSign  the value for organization_management.deleted_sign
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setDeletedSign(String deletedSign) {
-		this.deletedSign = deletedSign;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.name
-	 * @return  the value of organization_management.name
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.name
-	 * @param name  the value for organization_management.name
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.type
-	 * @return  the value of organization_management.type
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getType() {
-		return type;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.type
-	 * @param type  the value for organization_management.type
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.manager_id
-	 * @return  the value of organization_management.manager_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getManagerId() {
-		return managerId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.manager_id
-	 * @param managerId  the value for organization_management.manager_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setManagerId(String managerId) {
-		this.managerId = managerId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.dep_no
-	 * @return  the value of organization_management.dep_no
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getDepNo() {
-		return depNo;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.dep_no
-	 * @param depNo  the value for organization_management.dep_no
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setDepNo(String depNo) {
-		this.depNo = depNo;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.super_id
-	 * @return  the value of organization_management.super_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getSuperId() {
-		return superId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.super_id
-	 * @param superId  the value for organization_management.super_id
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setSuperId(String superId) {
-		this.superId = superId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.remarks
-	 * @return  the value of organization_management.remarks
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getRemarks() {
-		return remarks;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.remarks
-	 * @param remarks  the value for organization_management.remarks
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setRemarks(String remarks) {
-		this.remarks = remarks;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_management.status
-	 * @return  the value of organization_management.status
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public String getStatus() {
-		return status;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_management.status
-	 * @param status  the value for organization_management.status
-	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
-	 */
-	public void setStatus(String status) {
-		this.status = status;
-	}
-
-	public String getAbbreviation() {
-		return abbreviation;
-	}
-
-	public void setAbbreviation(String abbreviation) {
-		this.abbreviation = abbreviation;
-	}
-
-	public String getFinanceId() {
-		return financeId;
-	}
-
-	public void setFinanceId(String financeId) {
-		this.financeId = financeId;
-	}
-
-	public Integer getProvince() {
-		return province;
-	}
-
-	public void setProvince(Integer province) {
-		this.province = province;
-	}
-
-	public Integer getWorkingHoursType() {
-		return workingHoursType;
-	}
-
-	public void setWorkingHoursType(Integer workingHoursType) {
-		this.workingHoursType = workingHoursType;
-	}
-}

+ 183 - 0
src/main/java/com/goafanti/common/model/UserMid.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.model;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -63,6 +64,76 @@ public class UserMid implements Serializable {
      */
     private Integer channelType;
 
+    /**
+     * 退单标识
+     */
+    private Integer chargeback;
+
+    /**
+     * 会员标识
+     */
+    private Integer member;
+
+    /**
+     * 最后销售类型
+     */
+    private Integer lastSalesType;
+
+    /**
+     * 最后跟进方式
+     */
+    private Integer lastFollowType;
+
+    /**
+     * 跟进次数
+     */
+    private Integer followNumber;
+
+    /**
+     * 已签项目
+     */
+    private String taskNames;
+
+    /**
+     * 签单次数
+     */
+    private Integer signNumber;
+
+    /**
+     * 签单金额
+     */
+    private BigDecimal signAmount;
+
+    /**
+     * 最新签单时间
+     */
+    private Date lastSigningTime;
+
+    /**
+     * 第一次签单时间
+     */
+    private Date firstSigningTime;
+
+    /**
+     * 跟进部门
+     */
+    private String followDep;
+
+    /**
+     * 跟进说明
+     */
+    private String followExplain;
+
+    /**
+     * 跟进人
+     */
+    private String followAname;
+
+    /**
+     * 跟进人编号
+     */
+    private String followAid;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -152,4 +223,116 @@ public class UserMid implements Serializable {
     public void setChannelType(Integer channelType) {
         this.channelType = channelType;
     }
+
+    public Integer getChargeback() {
+        return chargeback;
+    }
+
+    public void setChargeback(Integer chargeback) {
+        this.chargeback = chargeback;
+    }
+
+    public Integer getMember() {
+        return member;
+    }
+
+    public void setMember(Integer member) {
+        this.member = member;
+    }
+
+    public Integer getLastSalesType() {
+        return lastSalesType;
+    }
+
+    public void setLastSalesType(Integer lastSalesType) {
+        this.lastSalesType = lastSalesType;
+    }
+
+    public Integer getLastFollowType() {
+        return lastFollowType;
+    }
+
+    public void setLastFollowType(Integer lastFollowType) {
+        this.lastFollowType = lastFollowType;
+    }
+
+    public Integer getFollowNumber() {
+        return followNumber;
+    }
+
+    public void setFollowNumber(Integer followNumber) {
+        this.followNumber = followNumber;
+    }
+
+    public String getTaskNames() {
+        return taskNames;
+    }
+
+    public void setTaskNames(String taskNames) {
+        this.taskNames = taskNames;
+    }
+
+    public Integer getSignNumber() {
+        return signNumber;
+    }
+
+    public void setSignNumber(Integer signNumber) {
+        this.signNumber = signNumber;
+    }
+
+    public BigDecimal getSignAmount() {
+        return signAmount;
+    }
+
+    public void setSignAmount(BigDecimal signAmount) {
+        this.signAmount = signAmount;
+    }
+
+    public Date getLastSigningTime() {
+        return lastSigningTime;
+    }
+
+    public void setLastSigningTime(Date lastSigningTime) {
+        this.lastSigningTime = lastSigningTime;
+    }
+
+    public Date getFirstSigningTime() {
+        return firstSigningTime;
+    }
+
+    public void setFirstSigningTime(Date firstSigningTime) {
+        this.firstSigningTime = firstSigningTime;
+    }
+
+    public String getFollowDep() {
+        return followDep;
+    }
+
+    public void setFollowDep(String followDep) {
+        this.followDep = followDep;
+    }
+
+    public String getFollowExplain() {
+        return followExplain;
+    }
+
+    public void setFollowExplain(String followExplain) {
+        this.followExplain = followExplain;
+    }
+
+    public String getFollowAname() {
+        return followAname;
+    }
+
+    public void setFollowAname(String followAname) {
+        this.followAname = followAname;
+    }
+
+    public String getFollowAid() {
+        return followAid;
+    }
+
+    public void setFollowAid(String followAid) {
+        this.followAid = followAid;
+    }
 }

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

@@ -463,8 +463,13 @@ public class NewExcelUtil<T> {
 	public void setCellVo(Object value, Excel attr, Cell cell) {
 		if (ColumnType.STRING == attr.cellType()) {
 			if (attr.percentage()==1){
-				BigDecimal v=new BigDecimal(value.toString());
-				value=v.multiply(new BigDecimal(100)).stripTrailingZeros().toPlainString()+"%";
+				if (value!=null){
+					BigDecimal v=new BigDecimal(value.toString());
+					value=v.multiply(new BigDecimal(100)).stripTrailingZeros().toPlainString()+"%";
+				}else {
+					value="0%";
+				}
+
 			}
 			cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix());
 		} else if (ColumnType.NUMERIC == attr.cellType()) {
@@ -727,7 +732,7 @@ public class NewExcelUtil<T> {
 	 * 编码文件名
 	 */
 	public String encodingFilename(String filename) {
-		filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx";
+		filename = filename + "_" +UUID.randomUUID().toString()  + ".xlsx";
 		return filename;
 	}
 

+ 1 - 1
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -493,7 +493,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 
-	/** 添加拜访记录
+	/** 添加拜访记录、客户跟进
 	 * @throws ParseException
 	 * @throws Exception **/
 	@RequestMapping(value = "/addFollow", method = RequestMethod.POST)

+ 10 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -692,6 +692,16 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		userFollow.setUid(fbb.getUid());
 		int followCount = userBusinessMapper.selectFollowCountByUAid(fbb.getUid(), null) + 1;
 		userFollow.setFollowCount(followCount);
+		//处理中间表
+		UserMid um =new UserMid();
+		um.setUid(userFollow.getUid());
+		um.setLastFollowTime(userFollow.getCreateTime());
+		um.setFollowNumber(followCount);
+		um.setFollowExplain(userFollow.getResult());
+		um.setFollowDep(userFollow.getFollowDep());
+		um.setLastFollowType(userFollow.getContactType());
+		um.setFollowAname(a.getName());
+		userMidMapper.updateByUid(um);
 		userFollowMapper.insert(userFollow);
 		// 检查客户锁定情况
 		if (fbb.getUserBusinessList()!=null&&fbb.getUserBusinessList().size() > 0) {

+ 87 - 0
src/main/java/com/goafanti/order/bo/InputSignStatistics.java

@@ -0,0 +1,87 @@
+package com.goafanti.order.bo;
+
+public class InputSignStatistics {
+
+    private String depId;
+    private String aid;
+    private String uid;
+    private Integer amountType;
+    private String signTimeStart;
+    private String signTimeEnd;
+
+    private Integer orderType;
+    private Integer pageSize;
+    private Integer pageNo;
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Integer getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(Integer orderType) {
+        this.orderType = orderType;
+    }
+
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Integer getAmountType() {
+        return amountType;
+    }
+
+    public void setAmountType(Integer amountType) {
+        this.amountType = amountType;
+    }
+
+    public String getSignTimeStart() {
+        return signTimeStart;
+    }
+
+    public void setSignTimeStart(String signTimeStart) {
+        this.signTimeStart = signTimeStart;
+    }
+
+    public String getSignTimeEnd() {
+        return signTimeEnd;
+    }
+
+    public void setSignTimeEnd(String signTimeEnd) {
+        this.signTimeEnd = signTimeEnd;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+}

+ 169 - 0
src/main/java/com/goafanti/order/bo/InputSignSummary.java

@@ -0,0 +1,169 @@
+package com.goafanti.order.bo;
+
+public class InputSignSummary {
+
+    private String userName;
+    private String aid;
+    private String followAid;
+    private Integer member;
+    private Integer chargeback;
+    private Integer bigCustomer;
+    private Integer lastFollowType;
+    private String followDep;
+    private String lastFollowTimeStart;
+    private String lastFollowTimeEnd;
+    private String firstSigningTimeStart;
+    private String firstSigningTimeEnd;
+    private String lastSigningTimeStart;
+    private String lastSigningTimeEnd;
+    /** 签单次数 0=全部 1=1次,2=2次,3=3次,4=3次以上 **/
+    private Integer signNumber;
+    private Integer lastSalesType;
+    private Integer pageNo;
+    private Integer pageSize;
+
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getFollowAid() {
+        return followAid;
+    }
+
+    public void setFollowAid(String followAid) {
+        this.followAid = followAid;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Integer getMember() {
+        return member;
+    }
+
+    public void setMember(Integer member) {
+        this.member = member;
+    }
+
+    public Integer getChargeback() {
+        return chargeback;
+    }
+
+    public void setChargeback(Integer chargeback) {
+        this.chargeback = chargeback;
+    }
+
+    public Integer getBigCustomer() {
+        return bigCustomer;
+    }
+
+    public void setBigCustomer(Integer bigCustomer) {
+        this.bigCustomer = bigCustomer;
+    }
+
+    public Integer getLastFollowType() {
+        return lastFollowType;
+    }
+
+    public void setLastFollowType(Integer lastFollowType) {
+        this.lastFollowType = lastFollowType;
+    }
+
+    public String getFollowDep() {
+        return followDep;
+    }
+
+    public void setFollowDep(String followDep) {
+        this.followDep = followDep;
+    }
+
+    public String getLastFollowTimeStart() {
+        return lastFollowTimeStart;
+    }
+
+    public void setLastFollowTimeStart(String lastFollowTimeStart) {
+        this.lastFollowTimeStart = lastFollowTimeStart;
+    }
+
+    public String getLastFollowTimeEnd() {
+        return lastFollowTimeEnd;
+    }
+
+    public void setLastFollowTimeEnd(String lastFollowTimeEnd) {
+        this.lastFollowTimeEnd = lastFollowTimeEnd;
+    }
+
+    public String getFirstSigningTimeStart() {
+        return firstSigningTimeStart;
+    }
+
+    public void setFirstSigningTimeStart(String firstSigningTimeStart) {
+        this.firstSigningTimeStart = firstSigningTimeStart;
+    }
+
+    public String getFirstSigningTimeEnd() {
+        return firstSigningTimeEnd;
+    }
+
+    public void setFirstSigningTimeEnd(String firstSigningTimeEnd) {
+        this.firstSigningTimeEnd = firstSigningTimeEnd;
+    }
+
+    public String getLastSigningTimeStart() {
+        return lastSigningTimeStart;
+    }
+
+    public void setLastSigningTimeStart(String lastSigningTimeStart) {
+        this.lastSigningTimeStart = lastSigningTimeStart;
+    }
+
+    public String getLastSigningTimeEnd() {
+        return lastSigningTimeEnd;
+    }
+
+    public void setLastSigningTimeEnd(String lastSigningTimeEnd) {
+        this.lastSigningTimeEnd = lastSigningTimeEnd;
+    }
+
+    public Integer getSignNumber() {
+        return signNumber;
+    }
+
+    public void setSignNumber(Integer signNumber) {
+        this.signNumber = signNumber;
+    }
+
+    public Integer getLastSalesType() {
+        return lastSalesType;
+    }
+
+    public void setLastSalesType(Integer lastSalesType) {
+        this.lastSalesType = lastSalesType;
+    }
+}

+ 124 - 0
src/main/java/com/goafanti/order/bo/OutSignStatistics.java

@@ -0,0 +1,124 @@
+package com.goafanti.order.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+import java.math.BigDecimal;
+
+public class OutSignStatistics {
+
+    private String id;
+    @Excel(name = "营销员")
+    private String name;
+    @Excel(name = "签单客户",width = 8,defaultValue="0")
+    private Integer userCount;
+    @Excel(name = "签单个数",width = 8,defaultValue="0")
+    private Integer orderCount;
+    @Excel(name = "签单总金额",defaultValue="0",scale = 6)
+    private BigDecimal totalAmount;
+    @Excel(name = "新签数",width = 8,defaultValue="0")
+    private Integer newSignNumber;
+    @Excel(name = "新签率",width = 8,percentage=1 ,defaultValue="0")
+    private BigDecimal newRatio;
+    @Excel(name = "复购数",width = 8,defaultValue="0")
+    private Integer repeatSignNumber;
+    @Excel(name = "复购率",width = 8,percentage=1 ,defaultValue="0")
+    private BigDecimal repeatRatio;
+    @Excel(name = "渠道签单数",width = 8,defaultValue="0")
+    private Integer channelSignNumber;
+    @Excel(name = "渠道签单率",width = 8,percentage=1 ,defaultValue="0")
+    private BigDecimal channelRatio;
+
+    public Integer getUserCount() {
+        if (userCount == null) return 0;
+        return userCount;
+    }
+
+    public void setUserCount(Integer userCount) {
+        this.userCount = userCount;
+    }
+
+    public Integer getOrderCount() {
+        if (orderCount == null) return 0;
+        return orderCount;
+    }
+
+    public void setOrderCount(Integer orderCount) {
+        this.orderCount = orderCount;
+    }
+
+    public BigDecimal getNewRatio() {
+        return newRatio;
+    }
+
+    public void setNewRatio(BigDecimal newRatio) {
+        this.newRatio = newRatio;
+    }
+
+    public BigDecimal getRepeatRatio() {
+        return repeatRatio;
+    }
+
+    public void setRepeatRatio(BigDecimal repeatRatio) {
+        this.repeatRatio = repeatRatio;
+    }
+
+    public BigDecimal getChannelRatio() {
+        return channelRatio;
+    }
+
+    public void setChannelRatio(BigDecimal channelRatio) {
+        this.channelRatio = channelRatio;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public BigDecimal getTotalAmount() {
+        if (totalAmount == null) return new BigDecimal(0);
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Integer getNewSignNumber() {
+        if (newSignNumber == null) return 0;
+        return newSignNumber;
+    }
+
+    public void setNewSignNumber(Integer newSignNumber) {
+        this.newSignNumber = newSignNumber;
+    }
+
+    public Integer getRepeatSignNumber() {
+        if (repeatSignNumber == null) return 0;
+        return repeatSignNumber;
+    }
+
+    public void setRepeatSignNumber(Integer repeatSignNumber) {
+        this.repeatSignNumber = repeatSignNumber;
+    }
+
+    public Integer getChannelSignNumber() {
+        if (channelSignNumber == null) return 0;
+        return channelSignNumber;
+    }
+
+    public void setChannelSignNumber(Integer channelSignNumber) {
+        this.channelSignNumber = channelSignNumber;
+    }
+}

+ 188 - 0
src/main/java/com/goafanti/order/bo/OutSignSummary.java

@@ -0,0 +1,188 @@
+package com.goafanti.order.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+import java.math.BigDecimal;
+
+public class OutSignSummary {
+
+    private String id;
+    @Excel(name = "客户名称")
+    private String nickname;
+    @Excel(name = "签单次数",width = 8)
+    private Integer signNumber;
+    @Excel(name = "签单金额",width = 10,scale = 6)
+    private BigDecimal signAmount;
+    @Excel(name = "首次签单时间",width = 8)
+    private String firstSigningTime;
+    @Excel(name = "最新签单时间",width = 8)
+    private String lastSigningTime;
+    @Excel(name = "签单类型" ,readConverterExp = "0=电话新开发,1=电话自带资源,2=网络,3=渠道,4=转介绍,5=其他,6=高新复购,7=其他复购",width = 8)
+    private Integer lastSalesType;
+    @Excel(name = "客户所属人")
+    private String name;
+    @Excel(name = "客户归属人部门")
+    private String depName;
+    @Excel(name = "跟进人")
+    private String followAname;
+    @Excel(name = "跟进类型",readConverterExp = "0=外出,1=电话,2=QQ,3=微信,4=邮件,5=公出打卡,6=来访面谈",width =8)
+    private Integer lastFollowType;
+    @Excel(name = "跟进说明",width = 32)
+    private String followExplain;
+    @Excel(name = "跟进次数",width = 8)
+    private Integer followNumber;
+    @Excel(name = "最新跟进时间")
+    private String lastFollowTime;
+    @Excel(name = "已签项目",width = 32)
+    private String taskNames;
+    @Excel(name = "会员",readConverterExp = "0=否,1=是",width = 8)
+    private Integer member;
+    @Excel(name = "退单",readConverterExp = "0=否,1=是",width = 8)
+    private Integer chargeback;
+    @Excel(name = "大客户",readConverterExp = "0=否,1=是",width = 8)
+    private Integer bigCustomer;
+
+    public String getFollowAname() {
+        return followAname;
+    }
+
+    public void setFollowAname(String followAname) {
+        this.followAname = followAname;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    public Integer getSignNumber() {
+        return signNumber;
+    }
+
+    public void setSignNumber(Integer signNumber) {
+        this.signNumber = signNumber;
+    }
+
+    public BigDecimal getSignAmount() {
+        return signAmount;
+    }
+
+    public void setSignAmount(BigDecimal signAmount) {
+        this.signAmount = signAmount;
+    }
+
+    public String getFirstSigningTime() {
+        return firstSigningTime;
+    }
+
+    public void setFirstSigningTime(String firstSigningTime) {
+        this.firstSigningTime = firstSigningTime;
+    }
+
+    public String getLastSigningTime() {
+        return lastSigningTime;
+    }
+
+    public void setLastSigningTime(String lastSigningTime) {
+        this.lastSigningTime = lastSigningTime;
+    }
+
+    public Integer getLastSalesType() {
+        return lastSalesType;
+    }
+
+    public void setLastSalesType(Integer lastSalesType) {
+        this.lastSalesType = lastSalesType;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDepName() {
+        return depName;
+    }
+
+    public void setDepName(String depName) {
+        this.depName = depName;
+    }
+
+    public Integer getLastFollowType() {
+        return lastFollowType;
+    }
+
+    public void setLastFollowType(Integer lastFollowType) {
+        this.lastFollowType = lastFollowType;
+    }
+
+    public String getFollowExplain() {
+        return followExplain;
+    }
+
+    public void setFollowExplain(String followExplain) {
+        this.followExplain = followExplain;
+    }
+
+    public Integer getFollowNumber() {
+        return followNumber;
+    }
+
+    public void setFollowNumber(Integer followNumber) {
+        this.followNumber = followNumber;
+    }
+
+    public String getLastFollowTime() {
+        return lastFollowTime;
+    }
+
+    public void setLastFollowTime(String lastFollowTime) {
+        this.lastFollowTime = lastFollowTime;
+    }
+
+    public String getTaskNames() {
+        return taskNames;
+    }
+
+    public void setTaskNames(String taskNames) {
+        this.taskNames = taskNames;
+    }
+
+    public Integer getMember() {
+        return member;
+    }
+
+    public void setMember(Integer member) {
+        this.member = member;
+    }
+
+    public Integer getChargeback() {
+        return chargeback;
+    }
+
+    public void setChargeback(Integer chargeback) {
+        this.chargeback = chargeback;
+    }
+
+    public Integer getBigCustomer() {
+        return bigCustomer;
+    }
+
+    public void setBigCustomer(Integer bigCustomer) {
+        this.bigCustomer = bigCustomer;
+    }
+}

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

@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.model.*;
+import com.goafanti.common.utils.DateUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.enums.SalesTypes;
@@ -176,29 +177,42 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res;
 	}
 	/**
+	 * 提交订单、发起订单
+	 */
+	@RequestMapping(value = "/submitOrder",method = RequestMethod.POST)
+	public Result SubmitOrder(TOrderNewWithBLOBs t,String signDate){
+		Result res = new Result();
+		if(orderNewService.chekeProcessStatus(t.getOrderNo())){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "审核状态错误","审核状态错误"));
+			return res;
+		}
+		return updateServiceOrder( t, 1, signDate);
+	}
+
+
+	/**
 	 * 修改订单
 	 */
 	@RequestMapping(value = "/updateServiceOrderNew",method = RequestMethod.POST)
-	public Result updateServiceOrder(TOrderNewWithBLOBs t,String isSubmit,String signDate){
+	public Result updateServiceOrder(TOrderNewWithBLOBs t,Integer isSubmit,String signDate){
 		Result res = new Result();
-		if(StringUtils.isBlank(t.getOrderNo())){
+		if (StringUtils.isBlank(t.getOrderNo())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "订单编号"));
 			return res;
 		}
-		if(null==t.getTotalAmount() || null==t.getFirstAmount()){
+		if (null == t.getTotalAmount() || null == t.getFirstAmount()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "订单金额 和 首付金额"));
 			return res;
 		}
-		if(StringUtils.isBlank(t.getContractPictureUrl())){
+		if (StringUtils.isBlank(t.getContractPictureUrl())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "合同图片"));
 			return res;
 		}
-		if(null==isSubmit){
+		if (null == isSubmit) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "提交状态"));
 			return res;
 		}
-		int i=Integer.valueOf(isSubmit);
-		if (i==1) {
+		if (isSubmit == 1) {
 			if (orderNewService.checkORderTask(t.getOrderNo())) {
 				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "主项目"));
 				return res;
@@ -209,14 +223,9 @@ public class AdminNewOrderApiController extends CertifyApiController {
 			}
 		}
 		if (StringUtils.isNotBlank(signDate)) {
-			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-			try {
-				t.setSignTime(sdf.parse(signDate));
-			} catch (ParseException e) {
-				e.printStackTrace();
-			}
+			t.setSignTime(DateUtils.StringToDate(signDate,"yyyy-MM-dd"));
 		}
-		res.setData(orderNewService.updateServiceOrder(t,i));
+		res.setData(orderNewService.updateServiceOrder(t,isSubmit));
 		return res;
 	}
 

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

@@ -361,7 +361,7 @@ public class OrderChangeApiController extends CertifyApiController {
 		return res;
 	}
 	/**
-	 * 完成变更
+	 * 完成变更、完成变更
 	 */
 	@RequestMapping(value ="/completeOrderChange",method = RequestMethod.GET)
 	public Result completeOrderChange(NewOrderChangeBo nb) {

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

@@ -43,7 +43,7 @@ public class OrderProjectApiController extends CertifyApiController {
 	private String	uploadPath			= null;
 
 	/**
-	 * 项目分配
+	 * 项目分配、项目派单
 	 * taskId 项目ID
 	 * taskReceiverId 受理人ID
 	 * type 0管理员派单 1经理转交 2经理派单 3咨询师转交 4回退

+ 72 - 15
src/main/java/com/goafanti/order/controller/StatisticsApiController.java

@@ -8,9 +8,9 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import com.goafanti.common.utils.excel.NewExcelUtil;
-import com.goafanti.order.bo.InputOrderSalesSource;
-import com.goafanti.order.bo.OutOrderSalesSource;
+import com.goafanti.order.bo.*;
 import com.goafanti.order.service.OrderStatisticsService;
+import com.goafanti.order.service.UserStaticticsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -19,8 +19,6 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.order.bo.InputProjectStatistics;
-import com.goafanti.order.bo.InputProvincialStatistics;
 import com.goafanti.order.service.ProjectStatisticsService;
 
 @RestController
@@ -33,6 +31,8 @@ public class StatisticsApiController extends CertifyApiController {
 	private ProjectStatisticsService	projectStatisticsService;
 	@Autowired
 	private OrderStatisticsService orderStatisticsService;
+	@Autowired
+	private UserStaticticsService userStaticticsService;
 
 
 
@@ -42,7 +42,7 @@ public class StatisticsApiController extends CertifyApiController {
 	@RequestMapping(value="/selectTaskList" ,method = RequestMethod.GET)
 	public Result selectTaskList(InputProjectStatistics ps){
 		Result res=new Result();
-		res.setData(projectStatisticsService.selectTaskList( ps));
+		res.setData(projectStatisticsService.selectTaskList(ps));
 		return res;
 	}
 
@@ -54,7 +54,7 @@ public class StatisticsApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/exporTaskList", method = RequestMethod.GET)
 	public Result exporTaskList(InputProjectStatistics ib,HttpServletResponse response) {
-			return projectStatisticsService.exporTaskList(  ib,response);
+			return projectStatisticsService.exporTaskList(ib,response);
 	}
 
 
@@ -64,7 +64,7 @@ public class StatisticsApiController extends CertifyApiController {
 	@RequestMapping(value="/selectProvincialStatistics" ,method = RequestMethod.GET)
 	public Result selectProvincialStatistics(InputProvincialStatistics is){
 		Result res=new Result();
-		res.setData(projectStatisticsService.selectProvincialStatistics( is));
+		res.setData(projectStatisticsService.selectProvincialStatistics(is));
 		return res;
 	}
 
@@ -76,7 +76,7 @@ public class StatisticsApiController extends CertifyApiController {
 	@RequestMapping(value = "/exporProvincialList", method = RequestMethod.GET)
 	public Result exporProvincialList(InputProvincialStatistics ib){
 		Result res=new Result();
-		return projectStatisticsService.exporProvincialList( ib);
+		return projectStatisticsService.exporProvincialList(ib);
 		}
 
 	/**
@@ -85,7 +85,7 @@ public class StatisticsApiController extends CertifyApiController {
 	@RequestMapping(value="/orderSalesSource" ,method = RequestMethod.GET)
 	public Result orderSalesSource(InputOrderSalesSource in){
 		Result res=new Result();
-		res.setData(orderStatisticsService.orderSalesSource( in));
+		res.setData(orderStatisticsService.orderSalesSource(in));
 		return res;
 	}
 
@@ -94,17 +94,74 @@ public class StatisticsApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value="/orderSalesSource/export" ,method = RequestMethod.GET)
 	public Result orderSalesSourceExport(InputOrderSalesSource in){
-		List<OutOrderSalesSource>  list =orderStatisticsService.orderSalesSource( in);
+		List<OutOrderSalesSource>  list =orderStatisticsService.orderSalesSource(in);
 		NewExcelUtil<OutOrderSalesSource> excelUtil=new NewExcelUtil<>(OutOrderSalesSource.class);
 		StringBuffer str=new StringBuffer("搜索条件=》");
-		if (in.getDepName()!=null)str=str.append("部门:").append(in.getDepName()).append(";");
-		if(in.getProvinceName()!=null)str=str.append("省份:").append(in.getProvinceName()).append(";");
-		if (in.getSort()!=null)str=str.append("排序:").append(in.getSort()==1?"签单数":"签单金额").append(";");
-		if (in.getStartDate()!=null &&in.getEndDate()!=null)str=str.append("时间:").append(in.getStartDate()).append("~")
-				.append(in.getEndDate()).append(";");
+		if (in.getDepName()!=null){
+			str=str.append("部门:").append(in.getDepName()).append(";");
+		}
+		if(in.getProvinceName()!=null){
+			str=str.append("省份:").append(in.getProvinceName()).append(";");
+		}
+		if (in.getSort()!=null){
+			str=str.append("排序:").append(in.getSort()==1?"签单数":"签单金额").append(";");
+		}
+		if (in.getStartDate()!=null &&in.getEndDate()!=null){
+			str=str.append("时间:").append(in.getStartDate()).append("~")
+					.append(in.getEndDate()).append(";");
+		}
 		return excelUtil.exportExcel(list,"订单销售来源统计表",uploadPath,str.toString());
 	}
 
+	/**
+	 * 签单客户汇总
+	 */
+	@RequestMapping(value = "/signSummary",method = RequestMethod.GET)
+	public Result signSummary(InputSignSummary in){
+		Result res = new Result();
+		res.data(userStaticticsService.signSummary(in));
+		return res;
+	}
+
+	/**
+	 * 签单客户汇总导出
+	 */
+	@RequestMapping(value = "/signSummary/export",method = RequestMethod.GET)
+	public Result signSummaryExport(InputSignSummary in){
+		List<OutSignSummary>  list = userStaticticsService.signSummaryList(in);
+		NewExcelUtil<OutSignSummary> excelUtil=new NewExcelUtil<>(OutSignSummary.class);
+		return excelUtil.exportExcel(list,"签单客户汇总表",uploadPath);
+	}
+
+	/**
+	 * 签单客户统计表
+	 */
+	@RequestMapping(value = "/signStatistics",method = RequestMethod.GET)
+	public Result signStatistics(InputSignStatistics in){
+		Result res = new Result();
+		res.data(userStaticticsService.signStatistics(in));
+		return res;
+	}
 
+	/**
+	 * 签单客户统计表导出
+	 */
+	@RequestMapping(value = "/signStatistics/export",method = RequestMethod.GET)
+	public Result signStatisticsExport(InputSignStatistics in){
+		List<OutSignStatistics> list = userStaticticsService.signStatisticsGetList(in);
+		NewExcelUtil<OutSignStatistics> excelUtil=new NewExcelUtil<>(OutSignStatistics.class);
+		return excelUtil.exportExcel(list,"签单客户统计表",uploadPath);
+	}
 
+	/**
+	 * 销售来源订单列表
+	 * @param in
+	 * @return
+	 */
+	@RequestMapping(value="/signStatistics/orderList", method = RequestMethod.GET)
+	public Result orderNewList(InputSignStatistics in ){
+		Result res=new Result();
+		res.data(userStaticticsService.signStatisticsOrderList(in));
+		return res;
+	}
 }

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

@@ -146,7 +146,7 @@ public interface OrderNewService {
 
 	boolean checkORderTask(String orderNo);
 
-
+	boolean chekeProcessStatus(String orderNo);
 
 	int updateOrderOver(String orderNo);
 

+ 2 - 9
src/main/java/com/goafanti/order/service/OrderService.java

@@ -4,7 +4,7 @@ import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.List;
 
-import com.goafanti.common.model.OrganizationManagement;
+import com.goafanti.common.model.Department;
 import com.goafanti.common.model.TOrderDetail;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.FollowBusinessBo;
@@ -115,8 +115,6 @@ public interface OrderService {
 	 * @param endDate 结束时间
 	 * @param intention 是否包含意向
 	 * @param formal 是否包含正式
-	 * @param depId 部门id
-	 * @param history 是否包含历史
 	 * @param pageNo
 	 * @param pageSize
 	 * @return
@@ -136,8 +134,6 @@ public interface OrderService {
 	/**
 	 * 更新订单
 	 * @param orderNo
-	 * @param firstPayment
-	 * @param orderAmount
 	 * @param signFirstPayment
 	 * @param signTotalAmount
 	 * @param orderRemarks
@@ -149,8 +145,6 @@ public interface OrderService {
 	/**
 	 * 签单
 	 * @param orderNo
-	 * @param firstPayment
-	 * @param orderAmount
 	 * @param signFirstPayment
 	 * @param signTotalAmount
 	 * @param approval
@@ -184,7 +178,6 @@ public interface OrderService {
 	/**
 	 * 修改商品信息
 	 * @param detailId
-	 * @param orderNo
 	 * @param discountPrice
 	 * @param discountFirstPayment
 	 * @param remarks
@@ -203,7 +196,7 @@ public interface OrderService {
 	 * 查询分管部门、查询管理部门
 	 * @return
 	 */
-	List<OrganizationManagement> selectMyDeps();
+	List<Department> selectMyDeps();
 
 	/**
 	 *

+ 5 - 0
src/main/java/com/goafanti/order/service/OrderStatisticsService.java

@@ -1,8 +1,11 @@
 package com.goafanti.order.service;
 
 
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.order.bo.InputOrderSalesSource;
+import com.goafanti.order.bo.InputSignSummary;
 import com.goafanti.order.bo.OutOrderSalesSource;
+import com.goafanti.order.bo.OutSignSummary;
 
 import java.util.List;
 
@@ -10,4 +13,6 @@ public interface OrderStatisticsService {
 
 
 	List<OutOrderSalesSource> orderSalesSource(InputOrderSalesSource in);
+
+
 }

+ 19 - 0
src/main/java/com/goafanti/order/service/UserStaticticsService.java

@@ -0,0 +1,19 @@
+package com.goafanti.order.service;
+
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.*;
+
+import java.util.List;
+
+public interface UserStaticticsService {
+
+    Pagination<OutSignSummary> signSummary(InputSignSummary in);
+
+    List<OutSignSummary> signSummaryList(InputSignSummary in);
+
+    Pagination<OutSignStatistics> signStatistics(InputSignStatistics in);
+
+    Pagination<TOrderNewBo> signStatisticsOrderList(InputSignStatistics in);
+
+    List<OutSignStatistics> signStatisticsGetList(InputSignStatistics in);
+}

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

@@ -10,6 +10,7 @@ import java.util.Map;
 import java.util.UUID;
 
 
+import com.goafanti.common.dao.*;
 import com.goafanti.order.bo.TOrderTaskBo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -20,16 +21,6 @@ import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.OrganizationManagementMapper;
-import com.goafanti.common.dao.TOrderBackMapper;
-import com.goafanti.common.dao.TOrderBillNewMapper;
-import com.goafanti.common.dao.TOrderBonusMapper;
-import com.goafanti.common.dao.TOrderLogMapper;
-import com.goafanti.common.dao.TOrderMonthReportMapper;
-import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.common.dao.TOrderRefundMapper;
-import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
@@ -40,7 +31,6 @@ import com.goafanti.common.model.TOrderBonus;
 import com.goafanti.common.model.TOrderLog;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderRefund;
-import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
@@ -82,7 +72,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 	@Autowired
 	private OrderNewService orderNewService;
 	@Autowired
-	private OrganizationManagementMapper	organizationManagementMapper;
+	private DepartmentMapper departmentMapper;
 	@Autowired
 	private AsyncUtils	asyncUtils;
 
@@ -497,7 +487,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 			}
 		}else {
 			t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
-			OrganizationListOut oo=organizationManagementMapper.selectAllById(new1.getOrderDep());
+			OrganizationListOut oo=departmentMapper.selectAllById(new1.getOrderDep());
 			t.setFinanceId(oo.getFinanceId());
 			for (Admin admin : adminMapper.getAdminRoleList("咨询师管理员")) {
 				aids.add(admin.getId());

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

@@ -78,7 +78,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	@Autowired
 	private OrderRefundInvoiceMapper	orderRefundInvoiceMapper;
 	@Autowired
-	private OrganizationManagementMapper	organizationManagementMapper;
+	private DepartmentMapper	departmentMapper;
 	@Autowired
 	private NewOrderRefundMapper	newOrderRefundMapper;
 	@Autowired
@@ -109,6 +109,8 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	private PushOrderService pushOrderService;
 	@Autowired
 	private TOrderMidMapper tOrderMidMapper;
+	@Autowired
+	private UserMidMapper userMidMapper;
 
 	Logger							logger	= LoggerFactory.getLogger(OrderChangeServiceImpl.class);
 
@@ -274,7 +276,8 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 						nb.setStatus(2);
 						}
 				}
-				 if(nb.getProcessState()==1){//营销管理通过则设置技术管理员通过表
+				 	//营销管理通过则设置技术管理员通过表
+				 if(nb.getProcessState()==1){
 					 if (orderExamineMapper.checkCountStatus(orderNo,null,null)<1) {
 						 insertOrderExamine(orderNo);
 					 } else {
@@ -678,17 +681,17 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		if (nob.getType()==OrderChangeType.XMJJEBG.getCode()) {
 			o.setTotalAmount(nob.getTotalAmount());
 			//处理项目及催款
-			pushTaskAndDun(nob.getId(),nob.getOrderNo());
+			pushTaskAndDun(nob.getId(),o);
 		}else if (nob.getType()==OrderChangeType.JXMBG.getCode()) {
-			pushTaskAndDun(nob.getId(),nob.getOrderNo());
+			pushTaskAndDun(nob.getId(),o);
 		}else if (nob.getType()==OrderChangeType.JJEBG.getCode()) {
 			o.setTotalAmount(nob.getTotalAmount());
-			pushTaskAndDun(nob.getId(),nob.getOrderNo());
+			pushTaskAndDun(nob.getId(),o);
 		}else if (nob.getType()==OrderChangeType.CB.getCode()){
 			o.setTotalAmount(nob.getTotalAmount());
-			pushTaskAndDun(nob.getId(),nob.getOrderNo());
+			pushTaskAndDun(nob.getId(),o);
 		}else if (nob.getType()==OrderChangeType.ZS.getCode()) {
-			pushTaskAndDun(nob.getId(),nob.getOrderNo());
+			pushTaskAndDun(nob.getId(),o);
 		}else if(nob.getType()==OrderChangeType.TDTK.getCode()) {
 			//先将业务锁关闭
 			List<String> list=tOrderTaskMapper.getLockId(nb.getOrderNo(),o.getSalesmanId(),o.getBuyerId());
@@ -713,11 +716,19 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			o.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
 		}
 		o.setDeleteSign(0);
+		//处理客户中间表退单标识
+		//处理客户已派项目
+		UserMid um=new UserMid();
+		String taskNames=userMidMapper.getUserTaskNames(o.getBuyerId());
+		um.setUid(o.getBuyerId());
+		um.setTaskNames(taskNames);
+		if (nb.getType()==0)um.setChargeback(1);
+		userMidMapper.updateByUid(um);
 		tOrderNewMapper.updateByPrimaryKeySelective(o);
 		return o;
 	}
 
-	private void pushTaskAndDun(Integer id,String orderNo) {
+	private void pushTaskAndDun(Integer id,TOrderNew o) {
 		List<TChangeTaskOut> listct=tChangeTaskMapper.selectByCid(id,null);
 		for (TChangeTaskOut cd : listct) {
 			TOrderTask ot=new TOrderTask();
@@ -744,6 +755,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 				tOrderTaskMapper.deleteByPrimaryKey(cd.getTid());
 			}
 		}
+
 		List<TChangeDunOut> listcd=tChangeDunMapper.selectByCid(id);
 		for (TChangeDunOut cd : listcd) {
 			NewOrderDun nd=new NewOrderDun();

+ 3 - 3
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -34,7 +34,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 	@Autowired
 	private TOrderNewMapper		tOrderNewMapper;
 	@Autowired
-	private OrganizationManagementMapper	organizationManagementMapper;
+	private DepartmentMapper	departmentMapper;
 	@Autowired
 	private AdminMapper	adminMapper;
 	@Autowired
@@ -84,7 +84,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 			TOrderNew t=tOrderNewMapper.selectByPrimaryKey(o.getOrderNo());
 			if (o.getType()==0) {//省内
 				if(o.getApproval()==0) {
-					aids.add(organizationManagementMapper.selectByPrimaryKey(t.getOrderDep()).getFinanceId());
+					aids.add(departmentMapper.selectByPrimaryKey(t.getOrderDep()).getFinanceId());
 				}else {
 					for (Admin admin : adminMapper.getAdminRoleList("湖南特批开票")) {
 						aids.add(admin.getId());
@@ -264,7 +264,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 			addInvoiceLog(id,3);
 			type= NoticeStatus.ORDER_INVPICE_APPROVA_YES.getCode();
 			if (o.getType()==0) {
-				aids.add(organizationManagementMapper.selectByPrimaryKey(ts.getOrderDep()).getFinanceId());
+				aids.add(departmentMapper.selectByPrimaryKey(ts.getOrderDep()).getFinanceId());
 			}else if(o.getType()==1) {
 				aids.addAll(adminMapper.listNameByDepAndName(ts.getOrderDep(), "营销管理员"));
 			}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 419 - 158
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java


+ 20 - 0
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -109,6 +109,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	@Autowired
 	private MemberLogMapper memberLogMapper;
 	@Autowired
+	private UserMidMapper userMidMapper;
+	@Autowired
 	private AsyncUtils	asyncUtils;
 	@Value(value = "${upload.path}")
 	private String 					uploadPath 			= null;
@@ -139,6 +141,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			orderNewService.pushOrderDun(t.getOrderNo());
 			//未锁定客户就锁定客户
 			pushUser(t, tn, date);
+			//处理客户已派项目
+			projectDistributionPushUserMid(tn);
 		}else if(type==1) {
 			t.setManagerId(taskReceiverId);
 			t.setConsultantId(null);
@@ -159,6 +163,22 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		return 1;
 	}
 
+	private void projectDistributionPushUserMid(TOrderNew tn) {
+		if (tn.getProcessStatus()==4){
+			UserMid um=new UserMid();
+			String taskNames=userMidMapper.getUserTaskNames(tn.getBuyerId());
+			UserMid use=userMidMapper.getUserDtails(tn.getBuyerId());
+			um.setUid(tn.getBuyerId());
+			um.setTaskNames(taskNames);
+			um.setLastSigningTime(tn.getCreateTime());
+			um.setLastSalesType(tn.getSalesType());
+			um.setFirstSigningTime(use.getFirstSigningTime());
+			um.setSignAmount(use.getSignAmount().add(tn.getTotalAmount()));
+			um.setSignNumber(use.getSignNumber()+1);
+			userMidMapper.updateByUid(um);
+		}
+	}
+
 
 	/**
 	 * 	推动客户、业务渠道的锁定

+ 123 - 158
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -13,6 +13,9 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+
+import com.goafanti.common.dao.*;
+import com.goafanti.common.model.*;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,46 +26,12 @@ import org.springframework.transaction.annotation.Transactional;
 import com.goafanti.common.bo.Error;
 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.ContractMapper;
-import com.goafanti.common.dao.ContractTaskLogMapper;
-import com.goafanti.common.dao.ContractTaskMapper;
-import com.goafanti.common.dao.OrganizationManagementMapper;
-import com.goafanti.common.dao.TOrderBillMapper;
-import com.goafanti.common.dao.TOrderChangeMapper;
-import com.goafanti.common.dao.TOrderDetailMapper;
-import com.goafanti.common.dao.TOrderMapper;
-import com.goafanti.common.dao.TmpTableMapper;
-import com.goafanti.common.dao.UserBusinessMapper;
-import com.goafanti.common.dao.UserFollowBusinessMapper;
-import com.goafanti.common.dao.UserFollowMapper;
-import com.goafanti.common.dao.UserLockReleaseMapper;
-import com.goafanti.common.dao.UserMapper;
-import com.goafanti.common.dao.UserRoleMapper;
 import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.NoticeReadStatus;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrderFlowState;
 import com.goafanti.common.enums.UserLockReleaseStatus;
 import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.model.Admin;
-import com.goafanti.common.model.Contract;
-import com.goafanti.common.model.ContractTask;
-import com.goafanti.common.model.ContractTaskLog;
-import com.goafanti.common.model.Notice;
-import com.goafanti.common.model.OrganizationManagement;
-import com.goafanti.common.model.TOrder;
-import com.goafanti.common.model.TOrderBill;
-import com.goafanti.common.model.TOrderChange;
-import com.goafanti.common.model.TOrderDetail;
-import com.goafanti.common.model.TmpTable;
-import com.goafanti.common.model.User;
-import com.goafanti.common.model.UserBusiness;
-import com.goafanti.common.model.UserFollow;
-import com.goafanti.common.model.UserFollowBusiness;
-import com.goafanti.common.model.UserLockRelease;
-import com.goafanti.common.model.UserRole;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.BeanUtilsExt;
 import com.goafanti.common.utils.DateUtils;
@@ -115,10 +84,10 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	@Autowired
 	private TOrderBillMapper tOrderBillMapper;
 	@Autowired
-	private OrganizationManagementMapper organizationManagementMapper;
+	private DepartmentMapper departmentMapper;
 	@Autowired
 	private ContractMapper contractMapper;
-	@Autowired 
+	@Autowired
 	private ContractTaskMapper contractTaskMapper;
 	@Autowired
 	private TOrderChangeMapper tOrderChangeMapper;
@@ -142,16 +111,16 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	private UserFollowMapper	userFollowMapper;
 	@Autowired
 	private UserFollowBusinessMapper	userFollowBusinessMapper;
-	
+
 	@Value(value = "${mobileRemindCodeTemplate}")
 	private String					mobileRemindCodeTemplate	= null;
-	
+
 	@Value(value = "${accessKey}")
 	private String					accessKey			= null;
 
 	@Value(value = "${accessSecret}")
 	private String					accessSecret		= null;
-	
+
 	private final BigDecimal DEFAULT_FIRST_PAYMENT = new BigDecimal(0);//默认首付价格
 	private final BigDecimal DEFAULT_COMMODITY_PRICE = new BigDecimal(0);//默认单价
 	private final String DEFAULT_PLATFORM_ID = "0"; //平台默认id
@@ -160,7 +129,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	private final double DEFAULT_COMMODITY_DISCOUNT = 1; //折扣比例
 	private final String DEFAULT_COMMODITY_MODE = "NO_MODE"; //暂无规格
 	private final String DEFUALT_SET_UP_COMMENT = "系统自动生产立项信息,请自行修改或补充";
-	
+
 	/*
 	 * -------------------------------------------------- APP管理端 --------------------------------------------------------
 	 */
@@ -177,9 +146,9 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				bo.setCommodityPrice("面议");
 			else
 				bo.setCommodityPrice(bo.getCommodityPrice()+" 万");
-			if(StringUtils.isBlank(bo.getFirstPayment())) 
+			if(StringUtils.isBlank(bo.getFirstPayment()))
 				bo.setFirstPayment("面议");
-			else 
+			else
 				bo.setFirstPayment(bo.getFirstPayment()+" 万");
 		} catch (IllegalAccessException | InvocationTargetException e) {
 			e.printStackTrace();
@@ -192,17 +161,17 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	 * 后期规则:自营服务订单 、需求订单、其他订单不能同时加入购物车
 	 */
 	@Override
-	public int addIntention(String orderNo, String commodityId, String commodityMode, Integer commodityQuantity,Integer commodityType, 
+	public int addIntention(String orderNo, String commodityId, String commodityMode, Integer commodityQuantity,Integer commodityType,
 			String createTime,String remarks) throws ParseException {
 		CommodityDetailBo bo =  tOrderMapper.selectCommodityDetail(commodityId,commodityType);
-		BigDecimal commodityPrice = StringUtils.isBlank(bo.getCommodityPrice()) ? DEFAULT_COMMODITY_PRICE 
+		BigDecimal commodityPrice = StringUtils.isBlank(bo.getCommodityPrice()) ? DEFAULT_COMMODITY_PRICE
 				: new BigDecimal(Double.valueOf(bo.getCommodityPrice()));
-		BigDecimal commodityFirstPayment = StringUtils.isBlank(bo.getCommodityFirstPayment()) ? DEFAULT_FIRST_PAYMENT 
+		BigDecimal commodityFirstPayment = StringUtils.isBlank(bo.getCommodityFirstPayment()) ? DEFAULT_FIRST_PAYMENT
 				: new BigDecimal(Double.valueOf(bo.getCommodityFirstPayment()));
 		BigDecimal discountPrice = commodityPrice.multiply(new BigDecimal(DEFAULT_COMMODITY_DISCOUNT));
 		BigDecimal discountFirstPayment = commodityFirstPayment.multiply(new BigDecimal(DEFAULT_COMMODITY_DISCOUNT));
 		TOrder tOrder = new TOrder();
-		tOrder.setOrderNo(orderNo);	
+		tOrder.setOrderNo(orderNo);
 		tOrder.setCreater(DEFAULT_ADMIN_ID);
 		tOrder.setCreateTime(DateUtils.parseDate(createTime, AFTConstants.YYYYMMDDHHMMSS));
 		if(commodityType == CommodityType.DEMAND.getTypeCode()){
@@ -228,7 +197,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrder.setOrderRemarks(remarks);
 		tOrder.setContractType(bo.getCommodityClassify());
 		setOrderState(OrderAction.ADD_INTENTION, new BigDecimal(0), tOrder, false);
-		
+
 		TOrderDetail tOrderDetail = new TOrderDetail();
 		tOrderDetail.setId(UUID.randomUUID().toString());
 		tOrderDetail.setOrderNo(orderNo);
@@ -246,7 +215,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrderMapper.insert(tOrder);
 		return 1;
 	}
-	
+
 	/**
 	 * 订单状态流转
 	 * @param orderAction
@@ -320,15 +289,15 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				tOrder.setActuallyTotalAmount(tOrder.getSignTotalAmount());
 				tOrder.setLiquidationStatus(LiquidationState.ALREADY_PAY.getCode());
 			}
-		}else if(orderAction == OrderAction.APPLY_FOR_WITHDRAW){ //提现申请 
-			if(tOrder.getOrderStatus() != OrderState.ALREADY_SIGN.getCode() 
+		}else if(orderAction == OrderAction.APPLY_FOR_WITHDRAW){ //提现申请
+			if(tOrder.getOrderStatus() != OrderState.ALREADY_SIGN.getCode()
 					|| tOrder.getLiquidationStatus() != LiquidationState.ALREADY_PAY.getCode()
 					|| tOrder.getActuallyTotalAmount().doubleValue() <= 0){
 				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"等待提现"));
 			}
 			tOrder.setLiquidationStatus(LiquidationState.WAIT_FOR_WITHDRAW.getCode());
 		}else if(orderAction == OrderAction.CONFIRM_WITHDRAW){ //提现确认 (审核员先审核流水)
-			if(tOrder.getOrderStatus() != OrderState.ALREADY_SIGN.getCode() 
+			if(tOrder.getOrderStatus() != OrderState.ALREADY_SIGN.getCode()
 					|| tOrder.getLiquidationStatus() != LiquidationState.WAIT_FOR_WITHDRAW.getCode()
 					|| tOrder.getActuallyTotalAmount().doubleValue() <= 0){
 				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"确认提现"));
@@ -348,7 +317,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			}
 			if(!flag) throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"取消订单"));
 			if(TokenManager.getToken() instanceof Admin){
-				if(!tOrder.getSellerId().equals(DEFAULT_PLATFORM_ID)) 
+				if(!tOrder.getSellerId().equals(DEFAULT_PLATFORM_ID))
 					throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"取消订单"));
 				if(tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode())
 					tOrder.setOrderStatus(OrderState.SELLER_REFUSE_BEFORE_SIGNL.getCode());
@@ -366,7 +335,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					if( tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode())
 						tOrder.setOrderStatus(OrderState.BUYER_CANCEL_AFTER_SIGN.getCode());
 				}
-			}		
+			}
 		}else if(orderAction == OrderAction.APPLY_FOR_REFUND){ //退款申请
 			boolean	flag = true;
 			if(tOrder.getOrderStatus() != OrderState.BUYER_CANCEL_BEFORE_SIGN.getCode()
@@ -375,7 +344,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 				flag = false;
 			}
-			if(tOrder.getChangeStatus() == ChangeState.CHANGING.getCode()) flag = true; // Add 2018/4/9 if normal order in changing can refund 
+			if(tOrder.getChangeStatus() == ChangeState.CHANGING.getCode()) flag = true; // Add 2018/4/9 if normal order in changing can refund
 			if(tOrder.getLiquidationStatus() == LiquidationState.WAIT_FOR_REFUND_CONFIRM.getCode()
 					|| tOrder.getLiquidationStatus() == LiquidationState.REFUSE_REFUND.getCode()
 					|| tOrder.getLiquidationStatus() == LiquidationState.AGREE_REFUND.getCode()
@@ -394,18 +363,18 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 				flag = false;
 			}
-			if(tOrder.getChangeStatus() == ChangeState.CHANGING.getCode()) flag = true; // Add 2018/4/9 if normal order in changing can refund 
+			if(tOrder.getChangeStatus() == ChangeState.CHANGING.getCode()) flag = true; // Add 2018/4/9 if normal order in changing can refund
 			if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_FOR_REFUND_CONFIRM.getCode())
 				flag = false;
 			if(tOrder.getActuallyTotalAmount().doubleValue() <= 0)
 				flag = false;
 			if(confrim) {
-				if(!flag) throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"同意退款")); 
+				if(!flag) throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"同意退款"));
 				tOrder.setLiquidationStatus(LiquidationState.AGREE_REFUND.getCode());
 			}else{
 				if(!flag) throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"拒绝退款"));
 				tOrder.setLiquidationStatus(LiquidationState.REFUSE_REFUND.getCode());
-			}	
+			}
 		}else if(orderAction == OrderAction.COMPLETE_REFUND){ //完成退款
 			boolean flag = true;
 			if(tOrder.getOrderStatus() != OrderState.BUYER_CANCEL_BEFORE_SIGN.getCode()
@@ -414,7 +383,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 				flag = false;
 			}
-			if(tOrder.getChangeStatus() == ChangeState.CHANGING.getCode()) flag = true; // Add 2018/4/9 if normal order in changing can refund 
+			if(tOrder.getChangeStatus() == ChangeState.CHANGING.getCode()) flag = true; // Add 2018/4/9 if normal order in changing can refund
 			if(tOrder.getLiquidationStatus() != LiquidationState.AGREE_REFUND.getCode())
 				flag = false;
 			if(tOrder.getActuallyTotalAmount().doubleValue() <= 0)
@@ -431,8 +400,8 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			}
 		}
 	}
-	
-	
+
+
 	/**
 	 * 设置按钮状态
 	 * @param tOrder
@@ -440,7 +409,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	 */
 	private OperatorActive setOperatorActive(TOrder tOrder){
 		OperatorActive active = new OperatorActive();
-		if(tOrder.getDeleteSign() == ActiveState.ABOLISH.getCode()) 
+		if(tOrder.getDeleteSign() == ActiveState.ABOLISH.getCode())
 			return active;
 		if(tOrder.getDeleteSign() == ActiveState.LOCKING.getCode()) {
 			active.setApplyUnLock(true);
@@ -460,10 +429,10 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()) {
 					/** 需求订单 开始 **/
 					if (tOrder.getOrderType() == CommodityType.DEMAND.getTypeCode()) {
-						active.setConfirmIntention(true); 
-						active.setRefuseIntention(true); 
+						active.setConfirmIntention(true);
+						active.setRefuseIntention(true);
 					} else {
-						active.setConfirmIntention(false); 
+						active.setConfirmIntention(false);
 						active.setRefuseIntention(false);
 					}
 					/** 需求订单 结束 **/
@@ -509,7 +478,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				}
 				if(tOrder.getActuallyTotalAmount().doubleValue() <= 0)
 					flag = false;
-				active.setApplyForRefund(flag); //申请退款		
+				active.setApplyForRefund(flag); //申请退款
 			}else if(TokenManager.getUserId().equals(tOrder.getSellerId())){ //卖方
 				active.setPayForFirst(false);
 				active.setPayForLast(false);
@@ -517,16 +486,16 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()) {
 					/** 需求订单 开始 **/
 					if (tOrder.getOrderType() == CommodityType.DEMAND.getTypeCode()) {
-						active.setConfirmIntention(false); 
-						active.setRefuseIntention(false); 
+						active.setConfirmIntention(false);
+						active.setRefuseIntention(false);
 					} else {
-						active.setConfirmIntention(true); 
-						active.setRefuseIntention(true); 
+						active.setConfirmIntention(true);
+						active.setRefuseIntention(true);
 					}
 					/** 需求订单 结束 **/
 				} else {
-					active.setConfirmIntention(false); 
-					active.setRefuseIntention(false); 
+					active.setConfirmIntention(false);
+					active.setRefuseIntention(false);
 				}
 				boolean flag = true;
 				if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
@@ -551,7 +520,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					flag = false;
 				active.setAgreeRefund(flag); //同意退款
 				active.setRefuseRefund(flag); //拒绝退款
-				if (tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode() 
+				if (tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode()
 						&& tOrder.getLiquidationStatus() == LiquidationState.ALREADY_PAY.getCode()
 						&& tOrder.getActuallyTotalAmount().doubleValue() > 0) {
 					active.setApplyForWithdraw(true); //申请提现
@@ -586,7 +555,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				boolean flag = true;
 				if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
 					flag = false;
-				}			
+				}
 				if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.ALREADY_PAY.getCode()){
@@ -612,7 +581,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				active.setApplyForCancel(false); //申请取消
 				active.setAgreeRefund(false); //同意退款
 				active.setRefuseRefund(false); //拒绝退款
-			}	
+			}
 		}
 		//平台方作为中间方 确认首付 - 尾款 - 提现 - 退款
 		if(tOrder.getOrderStatus() == OrderState.WAIT_FOR_SIGN.getCode()
@@ -640,7 +609,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 			flag = false;
 		}
-		if(flag && tOrder.getActuallyTotalAmount().doubleValue() == 0 
+		if(flag && tOrder.getActuallyTotalAmount().doubleValue() == 0
 				&& tOrder.getDeleteSign() == DeleteStatus.UNDELETE.getCode()){
 			active.setApplyRevoke(true); //作废
 		}else{
@@ -679,7 +648,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	 * @param transactionSubject 交易科目
 	 * @param payChannel 支付渠道
 	 * @param transactionMode 支付方式
-	 * @param FundAudit 流水审核
 	 * @return
 	 */
 	public int addFundRecord(String orderNo,String creater,String payeeId,String payerId,String remarks,TransactionSubject transactionSubject,PayChannel payChannel,
@@ -701,11 +669,11 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		bill.setCreateTime(new Date());
 		return tOrderBillMapper.insert(bill);
 	}
-	
+
 	@Override
 	public int updatePayForFirst(String orderNo, BigDecimal fundAmount,String remarks) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
-		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), DEFAULT_PLATFORM_ID, TokenManager.getUserId(), remarks, 
+		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), DEFAULT_PLATFORM_ID, TokenManager.getUserId(), remarks,
 				TransactionSubject.SUPPLY_PAY,PayChannel.UNIONPAY, fundAmount, TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
 		tOrder.setUpdateTime(new Date());
 		return tOrderMapper.updateByPrimaryKeySelective(tOrder);
@@ -714,7 +682,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	@Override
 	public int updatePayForLast(String orderNo, BigDecimal fundAmount, String remarks) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
-		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), DEFAULT_PLATFORM_ID, TokenManager.getUserId(), remarks, 
+		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), DEFAULT_PLATFORM_ID, TokenManager.getUserId(), remarks,
 				TransactionSubject.SUPPLY_PAY,PayChannel.UNIONPAY, fundAmount, TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
 		tOrder.setUpdateTime(new Date());
 		return tOrderMapper.updateByPrimaryKeySelective(tOrder);
@@ -730,7 +698,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		Pagination<TOrder> data = (Pagination<TOrder>)findPage("selectOrderListByPage", "selectOrderListCount", params, pageNo, pageSize);
 		List<TOrder> list = (List<TOrder>)data.getList();
 		C2BOrderDetailBo bo = null;
-		List<C2BOrderDetailBo> boList = new ArrayList<C2BOrderDetailBo>(); 
+		List<C2BOrderDetailBo> boList = new ArrayList<C2BOrderDetailBo>();
 		List<CommodityDetailBo> commoditys = null;
 		CommodityDetailBo cdb = null;
 		if(list.size()>0){
@@ -838,11 +806,9 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	}
 
 	/**
-	 * 
+	 *
 	 * @param transactionSubject 交易科目
 	 * @param transactionAmount 交易金额
-	 * @param payeeId 收款人
-	 * @param payerId 付款人
 	 * @return
 	 */
 	private String setBusinessDesc(Integer transactionSubject,BigDecimal transactionAmount){
@@ -879,7 +845,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}else if(0 == intention && 0 == formal){
 			return new Pagination<OrderListBo>();
 		}
-		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("selectServiceOrderByPage","selectServiceOrderCount", 
+		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("selectServiceOrderByPage","selectServiceOrderCount",
 				params, pageNo, pageSize);
 		TOrder tOrder = null;
 		List<OrderListBo> list = (List<OrderListBo>)data.getList();
@@ -896,7 +862,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		data.setList(list);
 		return data;
 	}
-	
+
 	private Map<String,Object> disposeParams(OrderListBo bo,String startDate,String endDate){
 		Map<String,Object> params = new HashMap<>();
 		if(StringUtils.isNotBlank(bo.getBuyerName())) params.put("buyerName", bo.getBuyerName());
@@ -909,7 +875,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		if(bo.getLiquidationStatus() != null) params.put("liquidationStatus", bo.getLiquidationStatus());
 		if(bo.getProjectStage() != null) params.put("projectStage", bo.getProjectStage());
 		if(bo.getOrderChannel() != null) params.put("orderChannel", bo.getOrderChannel());
-		
+
 		return params;
 	}
 
@@ -963,7 +929,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				if(tOrder.getProjectStage() == ProjectStage.NOT_SATISFY_CONDITION.getCode())
 					tOrder.setProjectStage(ProjectStage.WAIT_SET_UP.getCode());
 			}
-			
+
 		}
 		if (flag && !flag2) { //只有待签单或者变更中可修改
 			throw new BusinessException(new Error(ErrorConstants.ORDER_CAN_NOT_MODIFY, orderNo, ""));
@@ -1030,9 +996,9 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrderMapper.updateByPrimaryKeySelective(tOrder);
 		return 1;
 	}
-	
+
 	public void checkOrder(TOrder tOrder){
-		if(tOrder == null) 
+		if(tOrder == null)
 			 throw new BusinessException(new Error(ErrorConstants.ORDER_NOT_EXIST, "" ,""));
 		if(tOrder.getDeleteSign() == ActiveState.ABOLISH.getCode())
 			 throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_FREEZE, tOrder.getOrderNo(),""));
@@ -1062,7 +1028,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					if(bo.getAid().equals(TokenManager.getAdminId())){
 						isBusinessOwner = true;
 						releaseList.add(bo);
-					} 
+					}
 				}
 				if(!isBusinessOwner) throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_LOCKED,businessName,""));
 			}else{
@@ -1071,14 +1037,14 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}
 		return releaseList;
 	}
-	
+
 	private void lockProject(BusinessListBo ub) {
 		UserLockRelease ulr= new UserLockRelease();
 			ulr.setId(UUID.randomUUID().toString());
 			ulr.setType(1);
 			ulr.setAid(TokenManager.getAdminId());
 			ulr.setBusinessProjectId(ub.getBusinessProjectId());
-			SimpleDateFormat sdf =   new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " ); 
+			SimpleDateFormat sdf =   new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " );
 			try {
 				if (null==ub.getCreateTime()) {
 					ulr.setLockTime(new Date());
@@ -1092,7 +1058,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			ulr.setUid(ub.getUid());
 			userLockReleaseMapper.insert(ulr);
 		}
-	
+
 	@SuppressWarnings("unused")
 	private void releaseProject(List<LockingReleaseBo> releaseList){
 		if(releaseList != null && releaseList.size()>0){
@@ -1103,17 +1069,17 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				ulr.setStatus(UserLockReleaseStatus.RELEASE.getCode());
 				userLockReleaseMapper.updateByPrimaryKeySelective(ulr);
 			}
-			
+
 		}
 	}
-	
+
 	@Override
 	@Transactional
 	public int addOrderCommodity(String orderNo, String commodityId,String commodityName, String commodityMode, Integer commodityQuantity,Integer commodityType,
 			String commodityPrice, String discountPrice,String commodityFirstPayment,String discountFirstPayment, String remarks) {
 			TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
 			checkOrder(tOrder);
-			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode() 
+			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()
 					&& tOrder.getChangeStatus() != ChangeState.CHANGING.getCode()){
 				 throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, orderNo,""));
 			}else{
@@ -1129,7 +1095,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				detail.setDiscountPrice(new BigDecimal(discountPrice));
 				detail.setCommodityFirstPayment(new BigDecimal(commodityFirstPayment));
 				detail.setDiscountFirstPayment(new BigDecimal(discountFirstPayment));
-				detail.setRemarks(remarks);	
+				detail.setRemarks(remarks);
 				detail.setCreateTime(new Date());
 				tOrderDetailMapper.insert(detail);
 				//订单市场价总额
@@ -1223,34 +1189,34 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}
 		return 1;
 	}
-	
+
 	@Override
-	public List<OrganizationManagement> selectMyDeps(){
-		if(TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)) 
-			return organizationManagementMapper.selectAllDeps();
+	public List<Department> selectMyDeps(){
+		if(TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION))
+			return departmentMapper.selectAllDeps();
 		else
 			return selectCurrentDep(TokenManager.getAdminId());
 	}
-	
-	private List<OrganizationManagement> selectSubDeps(List<OrganizationManagement> allData,List<OrganizationManagement> superData){
-		List<OrganizationManagement> subData = new ArrayList<>();
+
+	private List<Department> selectSubDeps(List<Department> allData,List<Department> superData){
+		List<Department> subData = new ArrayList<>();
 		String superIds = "";
-		for(OrganizationManagement om : superData){
+		for(Department om : superData){
 			if(!om.getId().equals(om.getSuperId())){
 				superIds += om.getId() + ",";
 			}
 		}
-		if(StringUtils.isNotBlank(superIds)) subData = organizationManagementMapper.selectSubDeps(superIds.substring(0, superIds.length()-1));
+		if(StringUtils.isNotBlank(superIds)) subData = departmentMapper.selectSubDeps(superIds.substring(0, superIds.length()-1));
 		if(subData != null && subData.size()>0) {
 			allData.addAll(subData);
 			selectSubDeps(allData,subData);
-		} 
+		}
 		return allData;
-	} 
-	
-	private List<OrganizationManagement> selectCurrentDep(String managerId){
-		List<OrganizationManagement> allData = new ArrayList<OrganizationManagement>();
-		List<OrganizationManagement> superData = organizationManagementMapper.selectCurrentDeps(managerId);
+	}
+
+	private List<Department> selectCurrentDep(String managerId){
+		List<Department> allData = new ArrayList<Department>();
+		List<Department> superData = departmentMapper.selectCurrentDeps(managerId);
 		if(superData != null && superData.size()>0){
 			allData.addAll(superData);
 		}
@@ -1269,7 +1235,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			}else{
 				if(!depIds.contains(",")) params.put("depIds","'" + depIds + "'");
 			}
-				
+
 		}else{
 			if(!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.APPROVAL_DECISION))
 				return new Pagination<OrderListBo>();
@@ -1280,7 +1246,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}else if(0 == intention && 0 == formal){
 			return new Pagination<OrderListBo>();
 		}
-		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("selectServiceOrderByPage","selectServiceOrderCount", 
+		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("selectServiceOrderByPage","selectServiceOrderCount",
 				params, pageNo, pageSize);
 		TOrder tOrder = null;
 		List<OrderListBo> list = (List<OrderListBo>)data.getList();
@@ -1319,7 +1285,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		if(StringUtils.isNotBlank(startDate)) params.put("startDate", startDate);
 		if(StringUtils.isNotBlank(endDate)) params.put("endDate", endDate);
 		params.put("deleteStatus", 1);
-		return  (Pagination<OrderListBo>)findPage("selectServiceOrderByPage","selectServiceOrderCount", 
+		return  (Pagination<OrderListBo>)findPage("selectServiceOrderByPage","selectServiceOrderCount",
 				params, pageNo, pageSize);
 	}
 
@@ -1335,7 +1301,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		if(bo.getOrderStatus() != null) params.put("orderStatus", bo.getOrderStatus());
 		if(StringUtils.isNotBlank(startDate)) params.put("startDate", startDate);
 		if(StringUtils.isNotBlank(endDate)) params.put("endDate", endDate);
-		return (Pagination<OrderListBo>)findPage("selectPublicOrderByPage","selectPublicOrderCount", 
+		return (Pagination<OrderListBo>)findPage("selectPublicOrderByPage","selectPublicOrderCount",
 				params, pageNo, pageSize);
 	}
 
@@ -1350,7 +1316,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<OrderListBo> selectSettlementList(String orderNo, String depId,String buyerName,String salesmanName,  
+	public Pagination<OrderListBo> selectSettlementList(String orderNo, String depId,String buyerName,String salesmanName,
 			String financeId,String financeName,Integer orderStatus,Integer liquidationStatus,Integer approval,Integer isDistributionFinance,
 			String startDate,String endDate,Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
@@ -1389,8 +1355,8 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		/** 特殊处理字段结束 **/
 		return (Pagination<BillListBo>)findPage("selectBillByPage","selectBillCount", params, pageNo, pageSize);
 	}
-	
-	
+
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<BillListBo> queryMyBillList(String payeeName, String payerName, String depId,
@@ -1411,7 +1377,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		/** 特殊处理字段结束 **/
 		return (Pagination<BillListBo>)findPage("selectBillByPage","selectBillCount", params, pageNo, pageSize);
 	}
-	
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<BillListBo> queryAllBillList(String payeeName, String payerName, String depId,
@@ -1463,7 +1429,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				checkOrder(order);
 				if(order.getLiquidationStatus() == LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
 						&& bill.getTransactionSubject() == TransactionSubject.SUPPLY_PAY.getCode())	{ //代付+首付状态
-					setOrderState(OrderAction.CONFIRM_PAY_FOR_FIRST, bill.getTransactionAmount(), order, false); 
+					setOrderState(OrderAction.CONFIRM_PAY_FOR_FIRST, bill.getTransactionAmount(), order, false);
 					tOrderMapper.updateByPrimaryKeySelective(order);
 					//如果支付后订单符合待立项,系统自动立项 2018-4-10
 					if(order.getProjectStage() == ProjectStage.WAIT_SET_UP.getCode())
@@ -1481,7 +1447,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					tOrderMapper.updateByPrimaryKeySelective(order);
 				}else if(order.getLiquidationStatus() == LiquidationState.WAIT_FOR_WITHDRAW.getCode()
 						&& bill.getTransactionSubject() == TransactionSubject.SUPPLY_COLLECT.getCode()) { //代收+提现状态
-					setOrderState(OrderAction.CONFIRM_WITHDRAW, bill.getTransactionAmount(), order, false); 
+					setOrderState(OrderAction.CONFIRM_WITHDRAW, bill.getTransactionAmount(), order, false);
 					tOrderMapper.updateByPrimaryKeySelective(order);
 				} else {
 					throw new BusinessException(new Error(ErrorConstants.BILL_ALREADY_EXPIRE, billNo , ""));
@@ -1561,7 +1527,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 			String userName=tOrderMapper.selectByUserName(tOrder.getOrderNo());
 			//String message=noticeType.getDesc() + ": 订单编号-" + tOrder.getOrderNo() + ",变更内容:"+noticeComment+",操作人-" + TokenManager.getAdminToken().getName();
-			String paramString = "{\"number\":\"" + tOrder.getOrderNo() 
+			String paramString = "{\"number\":\"" + tOrder.getOrderNo()
 			+ "\",\"operator\":\"" + TokenManager.getAdminToken().getName()
 			+ "\",\"name\":\"" +  userName
 			+ "\",\"time\":\"" +   sdf.format(new Date())
@@ -1569,7 +1535,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			"\"}";
 			MobileMessageUtils.sendMessage(mobileRemindCodeTemplate, paramString, mobile, accessKey, accessSecret);
 	}
-	
+
 
 	@SuppressWarnings("unchecked")
 	@Override
@@ -1586,7 +1552,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			params.put("depId", depId);
 		if(approval != null)
 			params.put("approval", approval);
-		return  (Pagination<OrderListBo>)findPage("selectSetUpServiceOrderByPage","selectSetUpServiceOrderCount", 
+		return  (Pagination<OrderListBo>)findPage("selectSetUpServiceOrderByPage","selectSetUpServiceOrderCount",
 				params, pageNo, pageSize);
 	}
 
@@ -1600,12 +1566,12 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		if(tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode()){
 			if(tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_LAST_BALANCE.getCode())
 				flag = true;
-			if(tOrder.getLiquidationStatus() == LiquidationState.ALREADY_PAY.getCode()) 
+			if(tOrder.getLiquidationStatus() == LiquidationState.ALREADY_PAY.getCode())
 				flag = true;
 			if(tOrder.getApproval() == ApprovalState.AUDIT_PASS.getCode())
 				flag = true;
-		}	
-		if(!flag) 
+		}
+		if(!flag)
 			throw new BusinessException(new Error(ErrorConstants.ORDER_CAN_NOT_MODIFY, orderNo, ""));
 		tOrder.setProjectStage(ProjectStage.ALREADY_SET_UP.getCode());
 		tOrder.setOrderStage(OrderStage.PROJECT.getCode());
@@ -1673,7 +1639,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
 		if(tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
 				|| tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()){
-			addFundRecord(orderNo, "测试用户", DEFAULT_PLATFORM_ID, TokenManager.getUserId(), "", 
+			addFundRecord(orderNo, "测试用户", DEFAULT_PLATFORM_ID, TokenManager.getUserId(), "",
 					TransactionSubject.SUPPLY_PAY,PayChannel.UNIONPAY, new BigDecimal(payAmount), TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
 			tOrder.setUpdateTime(new Date());
 			tOrderMapper.updateByPrimaryKeySelective(tOrder);
@@ -1687,7 +1653,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	public int updateRefundForTest(String orderNo, String refundAmount) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
 		if(tOrder.getLiquidationStatus() == LiquidationState.AGREE_REFUND.getCode()){
-			addFundRecord(orderNo, "测试用户", DEFAULT_PLATFORM_ID, TokenManager.getUserId(), "", 
+			addFundRecord(orderNo, "测试用户", DEFAULT_PLATFORM_ID, TokenManager.getUserId(), "",
 					TransactionSubject.REFUND,PayChannel.UNIONPAY, new BigDecimal(refundAmount).multiply(new BigDecimal(-1)), TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
 			tOrder.setUpdateTime(new Date());
 			tOrderMapper.updateByPrimaryKeySelective(tOrder);
@@ -1696,7 +1662,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}
 		return 1;
 	}
-	
+
 	@Override
 	public int updateDistributionOrder(String orderNo, String financeId) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
@@ -1736,7 +1702,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				boolean flag = true;
 				if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
 					flag = false;
-				}			
+				}
 				if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.ALREADY_PAY.getCode()){
@@ -1750,8 +1716,8 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}
 		return 1;
 	}
-	
-	
+
+
 	private String getSalesmanIdByUid(String uid){
 		User u = userMapper.selectByPrimaryKey(uid);
 		if(u!=null&&StringUtils.isBlank(u.getAid())){
@@ -1780,7 +1746,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		setOrderState(OrderAction.CONFIRM_REFUND, new BigDecimal(0), tOrder, confirm);
 		tOrder.setUpdateTime(new Date());
 		if(confirm){ //同意退款生成退款流水
-			BigDecimal transactionAmount = tOrder.getActuallyTotalAmount().subtract(tOrder.getActuallyBrokerageAmount()).multiply(new BigDecimal(-1)); 
+			BigDecimal transactionAmount = tOrder.getActuallyTotalAmount().subtract(tOrder.getActuallyBrokerageAmount()).multiply(new BigDecimal(-1));
 			addFundRecord(orderNo, "平台方", DEFAULT_PLATFORM_ID,TokenManager.getUserId(), "同意退款系统生成流水",
 					TransactionSubject.REFUND, PayChannel.UNIONPAY,transactionAmount,TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
 		}
@@ -1797,25 +1763,25 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrder.setUpdateTime(new Date());
 		return tOrderMapper.updateByPrimaryKeySelective(tOrder);
 	}
-	
+
 	/**
 	 * PC端添加意向
 	 * 只能购买一份
 	 * 后期规则:自营服务订单 、需求订单、其他订单不能同时加入购物车
-	 * @throws ParseException 
+	 * @throws ParseException
 	 */
 	@Override
-	public int addPurpose(String orderNo, String commodityId, String commodityMode, Integer commodityQuantity,Integer commodityType, 
+	public int addPurpose(String orderNo, String commodityId, String commodityMode, Integer commodityQuantity,Integer commodityType,
 			String createTime,String remarks) throws ParseException {
 		CommodityDetailBo bo =  tOrderMapper.selectCommodityDetail(commodityId,commodityType);
-		BigDecimal commodityPrice = StringUtils.isBlank(bo.getCommodityPrice()) ? DEFAULT_COMMODITY_PRICE 
+		BigDecimal commodityPrice = StringUtils.isBlank(bo.getCommodityPrice()) ? DEFAULT_COMMODITY_PRICE
 				: new BigDecimal(Double.valueOf(bo.getCommodityPrice()));
-		BigDecimal commodityFirstPayment = StringUtils.isBlank(bo.getCommodityFirstPayment()) ? DEFAULT_FIRST_PAYMENT 
+		BigDecimal commodityFirstPayment = StringUtils.isBlank(bo.getCommodityFirstPayment()) ? DEFAULT_FIRST_PAYMENT
 				: new BigDecimal(Double.valueOf(bo.getCommodityFirstPayment()));
 		BigDecimal discountPrice = commodityPrice.multiply(new BigDecimal(DEFAULT_COMMODITY_DISCOUNT));
 		BigDecimal discountFirstPayment = commodityFirstPayment.multiply(new BigDecimal(DEFAULT_COMMODITY_DISCOUNT));
 		TOrder tOrder = new TOrder();
-		tOrder.setOrderNo(orderNo);	
+		tOrder.setOrderNo(orderNo);
 		tOrder.setCreater(DEFAULT_ADMIN_ID);
 		tOrder.setCreateTime(DateUtils.parseDate(createTime, AFTConstants.YYYYMMDDHHMMSS));
 		if(commodityType == CommodityType.DEMAND.getTypeCode()){
@@ -1837,12 +1803,12 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrder.setOrderChannel(OrderChannel.PORTAL.getCode());
 		tOrder.setApproval(ApprovalState.NORMAL.getCode());
 		tOrder.setChangeStatus(ChangeState.UNCHANGE.getCode());
-		tOrder.setSalesmanId(getSalesmanIdByUid(TokenManager.getAdminId()));			
-		
+		tOrder.setSalesmanId(getSalesmanIdByUid(TokenManager.getAdminId()));
+
 		tOrder.setOrderRemarks(remarks);
 		tOrder.setContractType(bo.getCommodityClassify());
 		setOrderState(OrderAction.ADD_INTENTION, new BigDecimal(0), tOrder, false);
-		
+
 		TOrderDetail tOrderDetail = new TOrderDetail();
 		tOrderDetail.setId(UUID.randomUUID().toString());
 		tOrderDetail.setOrderNo(orderNo);
@@ -1893,10 +1859,9 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrderChangeMapper.updateByPrimaryKeySelective(change);
 		return updateOrderSatusByChange(change.getOrderNo());
 	}
-	
+
 	/**
 	 * 更新变更状态
-	 * @param changeId
 	 * @return
 	 */
 	private int updateOrderSatusByChange(String orderNo){
@@ -1930,7 +1895,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		List<TmpTable> tmpData = tmpTableMapper.selectAll();
 		int taskDistribution = TaskDistributionState.NOT_DISTRIBUTION.getCode();
 		for(TmpTable tt: tmpData){
-			if(tt.getAllCount() == tt.getDisCount()) 
+			if(tt.getAllCount() == tt.getDisCount())
 				taskDistribution = TaskDistributionState.ALL_DISTRIBUTION.getCode();
 			else if(tt.getAllCount() > tt.getDisCount() && tt.getDisCount() != 0)
 				taskDistribution = TaskDistributionState.PART_DISTRIBUTION.getCode();
@@ -1940,7 +1905,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}
 		return 1;
 	}
-	
+
 	private void generatorNoticeData(NoticeStatus noticeType,String noticeComment,TOrder tOrder){
 		if(tOrder == null) return;
 		Notice notice = null;
@@ -1997,8 +1962,8 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 
 
 	private void MobileNotice(List<String> targetIds, TOrder tOrder) {
-		
-		
+
+
 	}
 
 	@Override
@@ -2023,10 +1988,10 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				c.setCreateTime(new Date());
 				contractTaskLogMapper.insert(c);
 			}
-				
+
 		}
-		
-		
+
+
 	}
 
 	@Override
@@ -2086,7 +2051,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					userBusiness.setUid(fbb.getUid());
 					userBusiness.setAid(TokenManager.getAdminId());
 					userBusiness.setRemarks(ub.getRemarks());
-					userBusinessMapper.insert(userBusiness);	
+					userBusinessMapper.insert(userBusiness);
 					//更新业务中间表
 					userFollowBusiness.setBusinessId(ubId);
 					userFollowBusiness.setCustomerStatus(ub.getCustomerStatus());
@@ -2097,12 +2062,12 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					userFollowBusiness.setBusinessProjectId(ub.getBusinessProjectId());
 					userFollowBusinessMapper.insert(userFollowBusiness);
 				}
-				
+
 			}
-		
-		
+
+
 		return 1;
 	}
 
-	
+
 }

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

@@ -1,35 +1,13 @@
 package com.goafanti.order.service.impl;
 
-import com.goafanti.common.bo.Error;
-import com.goafanti.common.bo.Result;
 import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.common.dao.TOrderTaskMapper;
-import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.utils.ExportExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
-import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.order.bo.*;
-import com.goafanti.order.enums.NewProjectStatus;
 import com.goafanti.order.service.OrderStatisticsService;
-import com.goafanti.order.service.ProjectStatisticsService;
 import groovy.util.logging.Log4j;
-import org.apache.commons.collections4.map.HashedMap;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.util.CellRangeAddress;
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
 import java.util.*;
 
 @Service
@@ -44,4 +22,5 @@ public class OrderStatisticsServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 		if(in.getEndDate()!=null)in.setEndDate(in.getEndDate()+" 23:59:59");
 		return tOrderNewMapper.orderSalesSource(in);
 	}
+
 }

+ 3 - 10
src/main/java/com/goafanti/order/service/impl/OutsourceOrgServiceImpl.java

@@ -6,19 +6,12 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.goafanti.common.dao.*;
 import com.goafanti.order.bo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.OrganizationManagementMapper;
-import com.goafanti.common.dao.OutsourceLogMapper;
-import com.goafanti.common.dao.OutsourceOrganizationMapper;
-import com.goafanti.common.dao.TOrderLogMapper;
-import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.common.dao.TOrderOutsourceMapper;
-import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.model.Admin;
@@ -41,7 +34,7 @@ public class OutsourceOrgServiceImpl  extends BaseMybatisDao<TOrderOutsourceMapp
 	@Autowired
 	private OutsourceOrganizationMapper  outsourceOrganizationMapper;
 	@Autowired
-	private OrganizationManagementMapper	organizationManagementMapper;
+	private DepartmentMapper departmentMapper;
 	@Autowired
 	private TOrderOutsourceMapper	tOrderOutsourceMapper;
 	@Autowired
@@ -125,7 +118,7 @@ public class OutsourceOrgServiceImpl  extends BaseMybatisDao<TOrderOutsourceMapp
 				t.setOrderStatus(2);//订单审核标记通过
 				t.setProcessStatus(ProcessStatus.YPCWZY.getCode());
 				addOrderLog(o.getOrderNo(),OrderLogProcess.WBTG.getCode(),o.getRemarks());
-				aids.add(organizationManagementMapper.selectByPrimaryKey(t2.getOrderDep()).getFinanceId());
+				aids.add(departmentMapper.selectByPrimaryKey(t2.getOrderDep()).getFinanceId());
 				type=NoticeStatus.ORDER_OUTSOURCE_YES.getCode();
 			}else {
 				t.setOrderStatus(1);

+ 100 - 0
src/main/java/com/goafanti/order/service/impl/UserStatisticsServiceImpl.java

@@ -0,0 +1,100 @@
+package com.goafanti.order.service.impl;
+
+import com.goafanti.admin.service.DepartmentService;
+import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.dao.UserMidMapper;
+import com.goafanti.common.model.Department;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.*;
+import com.goafanti.order.service.OrderStatisticsService;
+import com.goafanti.order.service.UserStaticticsService;
+import groovy.util.logging.Log4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+@Service
+@Log4j
+public class UserStatisticsServiceImpl extends BaseMybatisDao<UserMidMapper> implements UserStaticticsService {
+
+	@Autowired
+	private DepartmentService departmentService;
+
+	@Override
+	public Pagination<OutSignSummary> signSummary(InputSignSummary in) {
+		Map<String, Object> map = new HashMap<>();
+		addSignSummaryParam(in, map);
+		return (Pagination<OutSignSummary>) findPage("selectSignSummaryList","selectSignSummaryCount",map,in.getPageNo(),in.getPageSize());
+	}
+
+	private void addSignSummaryParam(InputSignSummary in, Map<String, Object> map) {
+		if (in.getUserName()!=null) map.put("userName", in.getUserName());
+		if (StringUtils.isNotBlank(in.getAid())) map.put("aid", in.getAid());
+		if (in.getFollowAid()!=null) map.put("followAid", in.getFollowAid());
+		if (in.getMember()!=null) map.put("member", in.getMember());
+		if (in.getChargeback()!=null) map.put("chargeback", in.getChargeback());
+		if (in.getBigCustomer()!=null) map.put("bigCustomer", in.getBigCustomer());
+		if (in.getLastFollowType()!=null) map.put("lastFollowType", in.getLastFollowType());
+		if (in.getFollowDep()!=null) map.put("followDep", in.getFollowDep());
+		if (in.getLastFollowTimeStart()!=null) map.put("lastFollowTimeStart", in.getLastFollowTimeStart());
+		if (in.getLastFollowTimeEnd()!=null) map.put("lastFollowTimeEnd", in.getLastFollowTimeEnd()+" 23:59:59");
+		if (in.getFirstSigningTimeStart()!=null) map.put("firstSigningTimeStart", in.getFirstSigningTimeStart());
+		if (in.getFirstSigningTimeEnd()!=null) map.put("firstSigningTimeEnd", in.getFirstSigningTimeEnd()+" 23:59:59");
+		if (in.getLastSigningTimeStart()!=null) map.put("lastSigningTimeStart", in.getLastSigningTimeStart());
+		if (in.getLastSigningTimeEnd()!=null) map.put("lastSigningTimeEnd", in.getLastSigningTimeEnd()+" 23:59:59");
+		if (in.getSignNumber()!=null) map.put("signNumber", in.getSignNumber());
+		if (in.getLastSalesType()!=null) map.put("lastSalesType", in.getLastSalesType());
+	}
+
+	@Override
+	public List<OutSignSummary> signSummaryList(InputSignSummary in) {
+		Map<String, Object> map = new HashMap<>();
+		addSignSummaryParam(in, map);
+		return (List<OutSignSummary>) findList("selectSignSummaryList",map,1,9999);
+	}
+
+	@Override
+	public Pagination<OutSignStatistics> signStatistics(InputSignStatistics in) {
+		Map<String, Object> map = new HashMap<>();
+		addsignStatisticsParam(in, map);
+		return (Pagination<OutSignStatistics>) findPage("selectsignStatisticsList","selectsignStatisticsCount",map,in.getPageNo(),in.getPageSize());
+	}
+	@Override
+	public List<OutSignStatistics> signStatisticsGetList(InputSignStatistics in) {
+		Map<String, Object> map = new HashMap<>();
+		addsignStatisticsParam(in, map);
+		return (List<OutSignStatistics>) findList("selectsignStatisticsList",map,1,9999);
+	}
+
+
+	private void addsignStatisticsParam(InputSignStatistics in, Map<String, Object> map) {
+		if (in.getDepId()!=null){
+			String[] ss=in.getDepId().split(",");
+			List<Department> ls=new ArrayList<>();
+			Arrays.stream(ss).forEach(e ->{
+				ls.addAll(departmentService.selectSubDeps(e));
+			});
+			map.put("deps",ls);
+		}
+		if (StringUtils.isNotBlank(in.getAid())) map.put("aid", in.getAid());
+		if (StringUtils.isNotBlank(in.getUid())) map.put("uid", in.getUid());
+		if (in.getAmountType()!=null)map.put("amountType",in.getAmountType());
+		if (in.getSignTimeStart()!=null)map.put("signTimeStart",in.getSignTimeStart());
+		if (in.getSignTimeEnd()!=null)map.put("signTimeEnd",in.getSignTimeEnd()+" 23:59:59");
+		if (in.getOrderType()!=null)map.put("orderType",in.getOrderType());
+	}
+
+	@Override
+	public Pagination<TOrderNewBo> signStatisticsOrderList(InputSignStatistics in) {
+		Map<String, Object> map = new HashMap<>();
+		addsignStatisticsParam(in, map);
+		return (Pagination<TOrderNewBo>) findPage("selectsignStatisticsOrderList","selectsignStatisticsOrderCount",map,in.getPageNo(),in.getPageSize());
+	}
+
+
+
+}
+

+ 24 - 6
src/main/java/com/goafanti/organization/bo/OrganizationListOut.java

@@ -36,12 +36,30 @@ public class OrganizationListOut {
 	 */
 	private String abbreviation;
 	private String financeName;
-	
+
 	private String financeId;
 	private Integer province;
+	private Integer hideSign;
 	private Integer workingHoursType;
 	private String workingHoursName;
-	
+	private Integer lvl;
+
+	public Integer getLvl() {
+		return lvl;
+	}
+
+	public void setLvl(Integer lvl) {
+		this.lvl = lvl;
+	}
+
+	public Integer getHideSign() {
+		return hideSign;
+	}
+
+	public void setHideSign(Integer hideSign) {
+		this.hideSign = hideSign;
+	}
+
 	public String getUid() {
 		return uid;
 	}
@@ -168,9 +186,9 @@ public class OrganizationListOut {
 	public void setWorkingHoursName(String workingHoursName) {
 		this.workingHoursName = workingHoursName;
 	}
-	
-	
-	
-	
+
+
+
+
 
 }

+ 16 - 26
src/main/java/com/goafanti/organization/controller/AdminOrganizationController.java

@@ -2,6 +2,7 @@ package com.goafanti.organization.controller;
 
 import javax.annotation.Resource;
 
+import com.goafanti.common.dao.DepartmentMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -10,7 +11,6 @@ import org.springframework.web.bind.annotation.RestController;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.dao.OrganizationManagementMapper;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.organization.bo.OrganizationListOut;
 import com.goafanti.organization.service.OrganizationService;
@@ -21,7 +21,7 @@ public class AdminOrganizationController extends BaseApiController{
 	@Resource
 	private OrganizationService organizationService;
 	@Autowired
-	private OrganizationManagementMapper organizationManagementMapper;
+	private DepartmentMapper departmentMapper;
 	/**部门组织管理列表 **/
 	@RequestMapping(value = "/listOrganizationManagement" , method = RequestMethod.POST)
 	public Result listOrganizationManagement(OrganizationListOut olo, Integer pageNo,
@@ -32,40 +32,33 @@ public class AdminOrganizationController extends BaseApiController{
 	}
 	/**部门组织管理上级组织查询 **/
 	@RequestMapping(value = "/selectSuperId" , method = RequestMethod.GET)
-	public Result selectsuperId(){
+	public Result selectsuperId(Integer hideSign){
 		Result res = new Result();
-		res.setData(organizationService.selectSuperId(0));
+		res.setData(organizationService.selectSuperId(hideSign));
 		return res;
 	}
 	/**部门组织管理上级组织查询 **/
 	@RequestMapping(value = "/selectSuperIdS" , method = RequestMethod.GET)
 	public Result selectsuperIdS(){
 		Result res = new Result();
-
 		res.setData(organizationService.selectSuperId(1));
 		return res;
 	}
 	/**部门组织管理新增**/
 	@RequestMapping(value = "/addOrganization" , method = RequestMethod.POST)
-	public Result addOrganization(String name, String managerId, String type, String superId, String remarks,Integer workingHoursType) throws Exception{
+	public Result addOrganization(String name, String managerId, String type, String superId, String remarks,
+								  Integer workingHoursType,Integer hideSign) {
 		Result res = new Result();
 		if(StringUtils.isBlank(name) || StringUtils.isBlank(type) || StringUtils.isBlank(superId)){
 			res.getError().add(buildError("","组织名称、组织类型、上级组织不能为空"));
 			return res;
 		}
-		String olo=organizationManagementMapper.selectDepNoByName(name);
+		String olo=departmentMapper.selectDepNoByName(name);
 		if(olo!=null){
 			res.getError().add(buildError("","部门已存在"));
 			return res;
 		}
-		String sdepNo=organizationManagementMapper.selectDepNo(superId);
-		int count=organizationManagementMapper.selectDepNoCount(superId);
-		if((count+1)>99){
-			res.getError().add(buildError("","每层最多存在99个子类"));
-			return res;
-		}
-
-			organizationService.addOrganization(name, managerId, type, superId, remarks,sdepNo,count,workingHoursType);
+		organizationService.addOrganization(name, managerId, type, superId, remarks,workingHoursType,hideSign);
 
 		return res;
 	}
@@ -80,13 +73,13 @@ public class AdminOrganizationController extends BaseApiController{
 	@RequestMapping(value = "/selectAllById" , method = RequestMethod.POST)
 	public Result selectAllById(String id){
 		Result res = new Result();
-		res.data(organizationService.selectAllById(id)) ;
+		res.data(organizationService.selectAllById(id));
 		return res;
 	}
 	/**修改信息**/
 	@RequestMapping(value = "/updateOrganization" , method = RequestMethod.POST)
 	public Result updateOrganization(String name, String type, String managerId, String superId, String status,Integer province,
-			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType){
+			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign){
 		Result res = new Result();
 		if(StringUtils.isBlank(name) || StringUtils.isBlank(type)
 				|| StringUtils.isBlank(managerId)|| StringUtils.isBlank(superId)
@@ -94,15 +87,12 @@ public class AdminOrganizationController extends BaseApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,""));
 			return res;
 		}
-		String sdepNo=organizationManagementMapper.selectDepNo(superId);//No
-		int count=organizationManagementMapper.selectDepNoCount(superId);//14
-		if((count+1)>99){
-			res.getError().add(buildError("","每层最多存在99个子类"));
+		if (id ==superId){
+			res.getError().add(buildError("不能设置自己为上级"));
 			return res;
 		}
-
 		int i=organizationService.updateOrganization(name, type, managerId, superId, status, province,remarks,id,
-				sdepNo,count,abbreviation,financeId,workingHoursType);
+				abbreviation,financeId,workingHoursType,hideSign);
 		return res.data(i);
 	}
 
@@ -115,14 +105,14 @@ public class AdminOrganizationController extends BaseApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "id"));
 			return res;
 		}
-		/*OrganizationListOut olo=organizationManagementMapper.selectAllById(id);
+		/*OrganizationListOut olo=departmentMapper.selectAllById(id);
 		String superId=olo.getName();*/
-		int subordinate=organizationManagementMapper.selectCountBySuperId(id);
+		int subordinate=departmentMapper.selectCountBySuperId(id);
 		if(subordinate>0){
 			res.getError().add(buildError("","存在下级组织不能删除"));
 			return res;
 		}
-		int adminCount=organizationManagementMapper.selectUserById(id);
+		int adminCount=departmentMapper.selectUserById(id);
 		if(adminCount>0){
 			res.getError().add(buildError("","部门被用户选定不能删除"));
 			return res;

+ 4 - 3
src/main/java/com/goafanti/organization/service/OrganizationService.java

@@ -17,7 +17,7 @@ public interface OrganizationService {
 	Pagination<OrganizationListOut>
 	listOrganizationManagement(OrganizationListOut olo,Integer pageNo, Integer pageSize);
 	/**组织名称查上级组织*/
-	List<OrganizationListOut> selectSuperId(Integer i);
+	List<OrganizationListOut> selectSuperId(Integer hideSign);
 	/**
 	 *
 	 * @param name 组织名称
@@ -27,7 +27,8 @@ public interface OrganizationService {
 	 * @param desc 组织职能说明
 	 * @return
 	 */
-	int addOrganization(String name,String managerId,String type,String superId,String desc,String sdepNo,Integer count,Integer workingHoursType);
+	int addOrganization(String name,String managerId,String type,String superId,String desc,
+						Integer workingHoursType,Integer hideSign);
 	/**
 	 * 模糊查询负责人名称
 	 * @param name
@@ -40,6 +41,6 @@ public interface OrganizationService {
 	int deleteById(String id);
 
 	int updateOrganization(String name,String type,String managerId,String superId,String status,Integer province,
-			String remarks,String id,String sdepNo,Integer count,String abbreviation,String financeId,Integer workingHoursType);
+			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign);
 
 }

+ 100 - 58
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -1,12 +1,13 @@
 package com.goafanti.organization.service.impl;
 
-import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import com.goafanti.common.dao.DepartmentMapper;
+import com.goafanti.common.model.Department;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -15,15 +16,13 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.organization.bo.OrganizationListOut;
 import com.goafanti.organization.service.OrganizationService;
 import com.goafanti.admin.bo.AdminListBo;
-import com.goafanti.common.dao.OrganizationManagementMapper;
 import com.goafanti.common.dao.TOrderMidMapper;
-import com.goafanti.common.model.OrganizationManagement;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 @Service
-public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManagementMapper> implements OrganizationService {
+public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> implements OrganizationService {
 	@Autowired
-	private OrganizationManagementMapper organizationManagementMapper;
+	private DepartmentMapper departmentMapper;
 	@Autowired
 	private TOrderMidMapper	tOrderMidMapper;
 
@@ -53,8 +52,15 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 		return params;
 	}
 	@Override
-	public List<OrganizationListOut> selectSuperId(Integer i) {
-		List<OrganizationListOut> depList=organizationManagementMapper.selectSuperId(i);
+	public List<OrganizationListOut> selectSuperId(Integer hideSign) {
+		if(hideSign==null){
+			hideSign=1;
+		}
+		//此处理用于前端不批量改接口
+		if (hideSign>1){
+			hideSign=null;
+		}
+		List<OrganizationListOut> depList=departmentMapper.selectSuperId(hideSign);
 		return depList;
 	}
 	/**
@@ -64,69 +70,104 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 	 *
 	 */
 	@Override
-	public int addOrganization( String name, String managerId, String type, String superId, String remarks,String sdepNo,Integer count,Integer workingHoursType) {
-
+	public int addOrganization( String name, String managerId, String type, String superId, String remarks,Integer workingHoursType,Integer hideSign) {
+		Department superDep=departmentMapper.selectByPrimaryKey(superId);
 		String id = UUID.randomUUID().toString();
 		Date now = new Date();
-		OrganizationManagement om=new OrganizationManagement();
-		om.setId(id);
-		String createId =organizationManagementMapper.selectAdminNameById(TokenManager.getAdminId());
-		om.setCreateId(createId);
-		om.setCreateTime(now);
-		om.setUpdateTime(now);
-		om.setDeletedSign("0");
-		om.setName(name);
-		om.setType(type);
-		om.setManagerId(managerId);
-		om.setDepNo(countDepNo(sdepNo,count));
-	//	superId=organizationManagementMapper.selectIdByName(superId);
-		om.setSuperId(superId);
-		om.setRemarks(remarks);
-		om.setStatus("0");
-		om.setWorkingHoursType(workingHoursType);
-		organizationManagementMapper.insert(om);
+		Department dep=new Department();
+		dep.setId(id);
+		String createId =departmentMapper.selectAdminNameById(TokenManager.getAdminId());
+		dep.setCreateId(createId);
+		dep.setCreateTime(now);
+		dep.setUpdateTime(now);
+		dep.setDeletedSign(0);
+		dep.setName(name);
+		dep.setLvl(superDep.getLvl()+1);
+		dep.setType(type);
+		dep.setManagerId(managerId);
+		String depNo = getMaxDep(superDep);
+		dep.setDepNo(depNo);
+	//	superId=departmentMapper.selectIdByName(superId);
+		dep.setSuperId(superId);
+		dep.setRemarks(remarks);
+		dep.setStatus("0");
+		dep.setHideSign(hideSign);
+		dep.setWorkingHoursType(workingHoursType);
+		departmentMapper.insertSelective(dep);
 		return 1;
 	}
+
+	private String getMaxDep(Department superDep) {
+		String sdepNo=superDep.getDepNo();
+		Department maxDep=departmentMapper.selectByDepNo(superDep.getId());
+		String depNo=new String();
+		if (maxDep==null){
+			depNo= sdepNo +"01";
+		}else {
+			String maxDepNo=maxDep.getDepNo();
+			Integer countNo=Integer.valueOf(maxDepNo.substring(maxDepNo.length()-2));
+			countNo++;
+			if (countNo<10){
+				depNo= sdepNo +"0"+countNo;
+			}else {
+				depNo= sdepNo +countNo;
+			}
+		}
+		return depNo;
+	}
+
+
 	@Override
 	public List<AdminListBo> selectName(String name) {
-		List<AdminListBo> list=organizationManagementMapper.selectName(name);
+		List<AdminListBo> list=departmentMapper.selectName(name);
 		return list;
 	}
 	@Override
 	public OrganizationListOut selectAllById(String id) {
-		OrganizationListOut olo=organizationManagementMapper.selectAllById(id);
-		olo.setSuperId(organizationManagementMapper.selectNameById(olo.getSuperId()));
+		OrganizationListOut olo=departmentMapper.selectAllById(id);
+		olo.setSuperId(departmentMapper.selectNameById(olo.getSuperId()));
 		return olo;
 	}
 	@Override
 	public int deleteById(String id) {
-		organizationManagementMapper.deleteById(id);
+		departmentMapper.deleteById(id);
 		return 1;
 	}
 	@Override
 	public int updateOrganization(String name, String type, String managerId, String superId, String status,Integer province,
-			String remarks,String id,String sdepNo,Integer count,String abbreviation,String financeId,Integer workingHoursType) {
-
-		String dep = countDepNo(sdepNo,count);
-
+			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign) {
+		//获取上级编号
+		Department superDep=departmentMapper.selectByPrimaryKey(superId);
+		Department use =departmentMapper.selectByPrimaryKey(id);
 		Date now=new Date();
-		OrganizationManagement om=new OrganizationManagement();
-		om.setName(name);
-		om.setType(type);
-		om.setUpdateTime(now);
-		om.setManagerId(managerId);
-		om.setDepNo(dep);
-		om.setSuperId(superId);
-		om.setStatus(status);
-		om.setRemarks(remarks);
-		om.setId(id);
-		om.setAbbreviation(abbreviation);
-		om.setFinanceId(financeId);
-		om.setProvince(province);
-		om.setWorkingHoursType(workingHoursType);
+		Department dep=new Department();
+		String deps ="";
+		if (!use.getSuperId().equals(superId)){
+			if(!name.equals("平台超管中心")){
+				deps=getMaxDep(superDep);
+			}else {
+				deps="DP";
+			}
+			dep.setDepNo(deps);
+			dep.setLvl(superDep.getLvl()+1);
+			dep.setSuperId(superId);
+		}
+
+		dep.setName(name);
+		dep.setType(type);
+		dep.setUpdateTime(now);
+		dep.setManagerId(managerId);
+		dep.setStatus(status);
+		dep.setRemarks(remarks);
+		dep.setId(id);
+		dep.setAbbreviation(abbreviation);
+		dep.setFinanceId(financeId);
+		dep.setProvince(province);
+		dep.setHideSign(hideSign);
+		dep.setWorkingHoursType(workingHoursType);
 		tOrderMidMapper.updateFinanceId(id,financeId);
-		int x=organizationManagementMapper.updateByPrimaryKeySelective(om);
-		updateLowerLevelNo(om.getId(),om.getDepNo());
+		int x=departmentMapper.updateByPrimaryKeySelective(dep);
+		updateLowerLevelNo(dep.getId(),dep.getDepNo(),dep.getLvl());
 		return x;
 	}
 
@@ -134,7 +175,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 		String dep=null;
 		if(count<10){
 			dep=sdepNo+"0"+count;
-			String sid=organizationManagementMapper.selectIdByDepNo(dep);
+			String sid=departmentMapper.selectIdByDepNo(dep);
 			while(sid!=null){
 				count=(count+1)%100;
 				if(count>=10){
@@ -142,24 +183,25 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 				}else{
 					dep=sdepNo+"0"+count;
 				}
-				sid=organizationManagementMapper.selectIdByDepNo(dep);
+				sid=departmentMapper.selectIdByDepNo(dep);
 			}
 		}else if(count>=10){
 			dep=sdepNo+count;
-			String sid=organizationManagementMapper.selectIdByDepNo(dep);
+			String sid=departmentMapper.selectIdByDepNo(dep);
 			while(sid!=null){
 				count=(count+1)%100;
 				dep=sdepNo+count;
-				sid=organizationManagementMapper.selectIdByDepNo(dep);
+				sid=departmentMapper.selectIdByDepNo(dep);
 			}
 		}
 		return dep;
 	}
 
-	private void updateLowerLevelNo(String id,String depNo) {
-		List<OrganizationListOut> Nos =organizationManagementMapper.selectIDNBySuperId(id);
+	private void updateLowerLevelNo(String id,String depNo,Integer lvl) {
+		List<OrganizationListOut> Nos =departmentMapper.selectIDNBySuperId(id);
 		int i=1;
 		for (OrganizationListOut o : Nos) {
+			o.setLvl(lvl+1);
 			if(i<10){
 				String dep=depNo+"0"+i;
 				if(i>=10){
@@ -173,8 +215,8 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 				dep=depNo+i;
 				o.setDepNo(dep);
 			}
-			organizationManagementMapper.updateByNumber(o);
-			updateLowerLevelNo(o.getId(),o.getDepNo());
+			departmentMapper.updateByNumber(o);
+			updateLowerLevelNo(o.getId(),o.getDepNo(),o.getLvl());
 			i++;
 		}
 	}

+ 2 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -720,6 +720,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		Map<String, Object> map = new HashMap<>();
 		if (type==null)type=0;
 		map.put("type",type);
+		//statusType=1情况下
+		map.put("statusType",1);
 		if (dateType==1){
 			Date date = new Date();
 			String clockTime=DateUtils.formatDate(date,AFTConstants.YYYYMMDDHHMMSS);

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

@@ -46,7 +46,7 @@ user_remind_days=15
 user_channel_days=90
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.29
+static.host=//static.jishutao.com/1.2.32
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.27
 #static.host=http://172.16.1.187/prod/1.2.25

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

@@ -43,7 +43,7 @@ user_remind_days=15
 #\u63D0\u524D\u63D0\u9192\u5929\u6570
 user_channel_days=90
 
-static.host=//static.jishutao.com/1.2.29
+static.host=//static.jishutao.com/1.2.32
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload