Browse Source

营销统计开发未完成,待继续开发...

Signed-off-by: anderx <312518615@qq.com>
anderx 5 years ago
parent
commit
6dbbbac0f1
22 changed files with 4036 additions and 3739 deletions
  1. 79 47
      src/main/java/com/goafanti/admin/bo/AdminCustomerBo.java
  2. 3 0
      src/main/java/com/goafanti/admin/service/AdminService.java
  3. 38 0
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  4. 2 0
      src/main/java/com/goafanti/common/dao/AdminMapper.java
  5. 145 142
      src/main/java/com/goafanti/common/dao/OrganizationManagementMapper.java
  6. 14 11
      src/main/java/com/goafanti/common/dao/UserFollowMapper.java
  7. 257 255
      src/main/java/com/goafanti/common/dao/UserMapper.java
  8. 672 629
      src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml
  9. 40 20
      src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml
  10. 1623 1620
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  11. 9 8
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  12. 745 736
      src/main/java/com/goafanti/common/model/User.java
  13. 62 39
      src/main/java/com/goafanti/common/model/UserFollow.java
  14. 76 16
      src/main/java/com/goafanti/common/model/UserFollowExample.java
  15. 12 0
      src/main/java/com/goafanti/customer/bo/CustomerListOut.java
  16. 8 0
      src/main/java/com/goafanti/customer/bo/FollowListBo.java
  17. 26 4
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  18. 9 11
      src/main/java/com/goafanti/customer/service/CustomerService.java
  19. 25 10
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  20. 188 188
      src/main/java/com/goafanti/permission/controller/NewRoleApiController.java
  21. 2 2
      src/main/resources/props/config_local.properties
  22. 1 1
      src/main/resources/props/config_test.properties

+ 79 - 47
src/main/java/com/goafanti/admin/bo/AdminCustomerBo.java

@@ -1,47 +1,79 @@
-package com.goafanti.admin.bo;
-
-public class AdminCustomerBo {
-	private String aid;
-	private String aName;
-	private String depName;
-	private String userCount;
-	private String inputCount;
-	private String receiveCount;
-	public String getAid() {
-		return aid;
-	}
-	public void setAid(String aid) {
-		this.aid = aid;
-	}
-	public String getaName() {
-		return aName;
-	}
-	public void setaName(String aName) {
-		this.aName = aName;
-	}
-	public String getDepName() {
-		return depName;
-	}
-	public void setDepName(String depName) {
-		this.depName = depName;
-	}
-	public String getUserCount() {
-		return userCount;
-	}
-	public void setUserCount(String userCount) {
-		this.userCount = userCount;
-	}
-	public String getInputCount() {
-		return inputCount;
-	}
-	public void setInputCount(String inputCount) {
-		this.inputCount = inputCount;
-	}
-	public String getReceiveCount() {
-		return receiveCount;
-	}
-	public void setReceiveCount(String receiveCount) {
-		this.receiveCount = receiveCount;
-	}
-	
-}
+package com.goafanti.admin.bo;
+
+import java.util.List;
+
+public class AdminCustomerBo {
+	private String aid;
+	private String aName;
+	private String depId;
+	private String depName;
+	private Integer userCount;
+	private Integer inputCount;
+	private Integer receiveCount;
+	private Integer completeCount;
+	private Integer interviewCount;
+	
+	private List<AdminCustomerBo > list;
+	
+	public String getAid() {
+		return aid;
+	}
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+	public String getaName() {
+		return aName;
+	}
+	public void setaName(String aName) {
+		this.aName = aName;
+	}
+	public String getDepName() {
+		return depName;
+	}
+	public void setDepName(String depName) {
+		this.depName = depName;
+	}
+	public Integer getUserCount() {
+		return userCount;
+	}
+	public void setUserCount(Integer userCount) {
+		this.userCount = userCount;
+	}
+	public Integer getInputCount() {
+		return inputCount;
+	}
+	public void setInputCount(Integer inputCount) {
+		this.inputCount = inputCount;
+	}
+	public Integer getReceiveCount() {
+		return receiveCount;
+	}
+	public void setReceiveCount(Integer receiveCount) {
+		this.receiveCount = receiveCount;
+	}
+	public List<AdminCustomerBo > getList() {
+		return list;
+	}
+	public void setList(List<AdminCustomerBo > list) {
+		this.list = list;
+	}
+	public Integer getCompleteCount() {
+		return completeCount;
+	}
+	public void setCompleteCount(Integer completeCount) {
+		this.completeCount = completeCount;
+	}
+	public Integer getInterviewCount() {
+		return interviewCount;
+	}
+	public void setInterviewCount(Integer interviewCount) {
+		this.interviewCount = interviewCount;
+	}
+	public String getDepId() {
+		return depId;
+	}
+	public void setDepId(String depId) {
+		this.depId = depId;
+	}
+	
+}

+ 3 - 0
src/main/java/com/goafanti/admin/service/AdminService.java

@@ -85,5 +85,8 @@ public interface AdminService {
 
 	int updatePrivateBusinessTransfer(String inputId, String uid, String pid);
 
+	AdminCustomerBo selectAllUser(String depId, String startTime, String endTime, Integer pageSize, Integer pageNo);
 
+
+	
 }

+ 38 - 0
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -22,6 +22,7 @@ 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;
@@ -47,6 +48,8 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	private UserLockReleaseMapper	userLockReleaseMapper;
 	@Autowired
 	private UserBusinessMapper	userBusinessMapper;
+	@Autowired
+	private OrganizationManagementMapper	organizationManagementMapper;
 	@Resource(name = "passwordUtil")
 	private PasswordUtil					passwordUtil;
 	
@@ -358,6 +361,39 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
 		return (Pagination<AdminCustomerBo>)findPage("selectAdminCustomerList", "selectAdminCustomerCount", params, pageNo, pageSize); 
 	}
+	
+	@Override
+	public AdminCustomerBo selectAllUser(String depId, String startTime, String endTime, Integer pageSize, Integer pageNo) {
+		AdminCustomerBo acb=new AdminCustomerBo();
+		List<AdminCustomerBo >deps=new ArrayList<>();
+		if (depId==null) {
+			acb.setDepName("科德集团");
+			//首先把值全部归零
+			acb.setCompleteCount(0);
+			acb.setInputCount(0);
+			acb.setInterviewCount(0);
+			acb.setReceiveCount(0);
+			acb.setUserCount(0);
+			deps=organizationManagementMapper.getDepAll("科德集团",null,startTime,  endTime);
+			nestingList(deps,startTime,  endTime);
+			acb.setList(deps);
+		}else {
+			
+		}
+		return acb;
+	}
+
+	private void nestingList(List<AdminCustomerBo >deps,String startTime, String endTime) {
+		//循环取出其中
+		for (AdminCustomerBo ab : deps) {
+			//找出每一个部门的直部门,并嵌套下去,先获取然后将
+			List<AdminCustomerBo >deps2=organizationManagementMapper.getDepAll(null,ab.getDepId(),startTime,  endTime);
+			nestingList(deps2,startTime,  endTime);
+			//待继续开发
+		}
+		
+		
+	}
 
 	@SuppressWarnings("unchecked")
 	@Override
@@ -393,5 +429,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		}
 		return i;
 	}
+
+	
 	
 }

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

@@ -197,5 +197,7 @@ public interface AdminMapper {
 	String getPermission(String transferId);
 
 	List<String> selectDepIdWithSpuerId(String superId);
+
+	void getAllDep();
 	
 }

+ 145 - 142
src/main/java/com/goafanti/common/dao/OrganizationManagementMapper.java

@@ -1,142 +1,145 @@
-package com.goafanti.common.dao;
-
-import java.util.List;
-
-import com.goafanti.organization.bo.OrganizationListOut;
-import com.goafanti.admin.bo.AdminListBo;
-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);
-	/**
-	 * 查询当前集合
-	 * @param adminId
-	 * @return
-	 */
-	List<OrganizationManagement> selectCurrentDeps(@Param("aid")String aid);
-	
-	/**
-	 * 查询所有部门
-	 * @return
-	 */
-	List<OrganizationManagement> selectAllDeps();
-	/**
-	 * 查询最大编号
-	 * @param abbreviation
-	 * @return
-	 */
-	String getMaxAbbreviation(String abbreviation);
-}
+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.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);
+	/**
+	 * 查询当前集合
+	 * @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("name")String name,@Param("depId")String depId, @Param("startTime")String startTime, @Param("endTime")String endTime);
+}

+ 14 - 11
src/main/java/com/goafanti/common/dao/UserFollowMapper.java

@@ -9,67 +9,70 @@ public interface UserFollowMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	long countByExample(UserFollowExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	int deleteByExample(UserFollowExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	int deleteByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	int insert(UserFollow record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	int insertSelective(UserFollow record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	List<UserFollow> selectByExample(UserFollowExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	UserFollow selectByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	int updateByExampleSelective(@Param("record") UserFollow record, @Param("example") UserFollowExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	int updateByExample(@Param("record") UserFollow record, @Param("example") UserFollowExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	int updateByPrimaryKeySelective(UserFollow record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	int updateByPrimaryKey(UserFollow record);
+
+
+	int pushUserGuidance(@Param("id")String id, @Param("guidance")Integer guidance);
 }

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

@@ -1,256 +1,258 @@
-package com.goafanti.common.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.ibatis.annotations.Param;
-
-import com.goafanti.app.bo.UserBasicInfo;
-import com.goafanti.common.model.Admin;
-import com.goafanti.common.model.OrganizationContactBook;
-import com.goafanti.common.model.User;
-import com.goafanti.user.bo.OrgPartnerDetailBo;
-import com.goafanti.user.bo.UserDownLoadBo;
-import com.goafanti.user.bo.UserInterestBo;
-import com.goafanti.user.bo.UserPageHomeBo;
-import com.goafanti.user.bo.UserPartnerDetailBo;
-import com.goafanti.common.model.UserExample;
-import com.goafanti.customer.bo.BusinessListBo;
-import com.goafanti.customer.bo.CustomerListOut;
-import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
-import com.goafanti.customer.bo.CustomerPersonalDetailBo;
-import com.goafanti.customer.bo.CustomerSimpleBo;
-import com.goafanti.customer.bo.FollowBusinessBo;
-import com.goafanti.customer.bo.LockingReleaseBo;
-import com.goafanti.report.bo.CountMarketingStatisticsBo;
-import com.goafanti.report.bo.marketingESBo;
-import com.goafanti.report.bo.userDataListBo;
-
-public interface UserMapper {
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	long countByExample(UserExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	int deleteByExample(UserExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	int deleteByPrimaryKey(String id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	int insert(User record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	int insertSelective(User record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	List<User> selectByExample(UserExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	User selectByPrimaryKey(String id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	int updateByExample(@Param("record") User record, @Param("example") UserExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	int updateByPrimaryKeySelective(User record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
-	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
-	 */
-	int updateByPrimaryKey(User record);
-
-	UserPageHomeBo selectUserPageHomeBoByUserId(String uid);
-
-	UserDownLoadBo selectUserDownLoadBoByUserId(String id);
-
-	//List<OrgListBo> selectUserByAid(String aid);
-
-	String findUserByNameAndMobile(@Param("name") String name, @Param("mobile") String mobile);
-
-	String findOrgByNameAndMobile(@Param("name") String name, @Param("mobile") String mobile);
-
-	UserPartnerDetailBo findUserPartnerDetail(String uid);
-
-	OrgPartnerDetailBo findOrgPartnerDetail(String uid);
-
-	Long selectNumberByPrimaryKey(String userId);
-	
-	List<UserPartnerDetailBo> findUserPartner();
-	
-	User selectByMobieAndType(String mobile, Integer type);
-	
-	/**
-	 * 根据客户模糊搜索
-	 * @param name
-	 * @return
-	 */
-	List<CustomerSimpleBo> findCustomerByName(@Param("identifyName")String identifyName);
-
-	/**
-	 * 判断客户是否存在
-	 * @param name
-	 * @return
-	 */
-	int judgeCustomerByName(@Param("identifyName")String identifyName);
-	
-	/**
-	 * 查询单位客户详情
-	 * @param uid 用户ID
-	 * @return
-	 */
-	CustomerPersonalDetailBo findPersonalCustomerDetail(@Param("uid")String uid);
-	
-	
-	/**
-	 * 查询单位客户详情
-	 * @param uid 用户ID
-	 * @return
-	 */
-	CustomerOrganizationDetailBo findOrganizationCustomerDetail(@Param("uid")String uid);
-
-	/**
-	 * 查看客户账户信息
-	 * @param uid
-	 * @return
-	 */
-	User findUserAccountDetail(@Param("uid")String uid);
-
-	/**
-	 * 查看客户联系人列表
-	 * @param uid
-	 * @return
-	 */
-	List<OrganizationContactBook> findCustomerContacts(@Param("uid")String uid,@Param("aid")String aid);
-
-	/**
-	 * 查询拜访详情
-	 * @param followId
-	 * @return
-	 */
-	FollowBusinessBo findFollowById(String followId);
-
-	/**
-	 * 查询单次拜访推进的客户业
-	 * @param followId
-	 * @return
-	 */
-	List<BusinessListBo> findBusinessByFollowId(String followId);
-
-	/**
-	 * 查询客户已有联系人
-	 * @param uid
-	 * @return
-	 */
-	List<OrganizationContactBook> findAllContacts(String uid);
-
-	/**
-	 * 查询用户
-	 * @param id
-	 * @param identifyName 认证用户
-	 * @param mobile 手机号码
-	 * @param type 用户类型 0-个人 1-单位
-	 * @param source 来源 0-注册 1-录入
-	 * @return 
-	 * @param nickname 昵称
-	 */
-	List<User> checkUser(@Param("id")String id,@Param("identifyName")String identifyName, @Param("mobile")String mobile,
-			@Param("type")Integer type,@Param("source") Integer source,@Param("nickname") String nickname);
-
-
-	List<UserInterestBo> userInterest(String uid);
-
-
-	/**
-	 * 查询用户基本信息
-	 * @param id
-	 * @return
-	 */
-	UserBasicInfo selectBaseInfo(@Param("id")String id);
-
-	/**
-	 * 根据用户编号
-	 * @param easemobName
-	 * @return
-	 */
-	User selectByNumber(@Param("easemobName")String easemobName);
-	
-	List<Admin> findAdminName(String aid);
-	
-	int updateEnteringAudit(@Param("id")String id,@Param("auditStatus")Integer auditStatus,@Param("auditOpinion")String auditOpinion);
-
-	int updateRefusedCustomer(@Param("id")String id,  @Param("nickname")String nickname, @Param("mobile")String mobile, @Param("societyTag")String societyTag);
-
-	/**
-	 * 查看客户锁定的业务
-	 * @param uid 客户ID
-	 * @param aid 管理员ID
-	 * @param businessProjectId 业务项目的ID
-	 * @param type 锁定类型  0-客户  1-业务
-	 * @param status 锁定状态 0-锁定 1-待释放 2-已释放
-	 * @return
-	 */
-	List<LockingReleaseBo> selectLockedProject(@Param("uid")String uid,@Param("aid")String aid,@Param("businessProjectId")String businessProjectId, @Param("type")Integer type,@Param("status")Integer status);
-
-	List<CustomerSimpleBo> selectPrivateCustomerByName(@Param("name")String name,@Param("aid")String aid);
-
-	List<CustomerSimpleBo> selectSignedCustomerByName(@Param("name")String name,@Param("aid")String aid);
-	
-	List<User> selectUserByRoleName(@Param("roleName1")String roleName1,@Param("roleName2")String roleName2);
-	
-	void updateReleaseLock(String time);
-
-	marketingESBo marketingStatistics(@Param("id")String id, @Param("dailyStart")String dailyStart, @Param("dailyEnd")String dailyEnd);
-
-	marketingESBo marketingDepStatistics(@Param("depId")String depId, @Param("dailyStart")String dailyStart, @Param("dailyEnd")String dailyEnd);
-
-	CountMarketingStatisticsBo countmarketingDepStatistics(@Param("depId")String depId, @Param("dailyStart")String dailyStart, @Param("dailyEnd")String dailyEnd);
-
-	int checkCustomerInformation(String uid);
-
-	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
-
-	List<userDataListBo> userDataStatistics(@Param("depId")String depId);
-
-	userDataListBo userDataStatisticsCount(@Param("depId")String depId);
-
-	int UserReceiveCount( @Param("aid")String aid);
-
-	int getAidAndUser(@Param("uid")String uid,@Param("aid") String aid);
-
-	 List<CustomerListOut> privateUnitCustomerList(@Param("params")Map<String, Object> params);
-	
+package com.goafanti.common.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.goafanti.app.bo.UserBasicInfo;
+import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.OrganizationContactBook;
+import com.goafanti.common.model.User;
+import com.goafanti.user.bo.OrgPartnerDetailBo;
+import com.goafanti.user.bo.UserDownLoadBo;
+import com.goafanti.user.bo.UserInterestBo;
+import com.goafanti.user.bo.UserPageHomeBo;
+import com.goafanti.user.bo.UserPartnerDetailBo;
+import com.goafanti.common.model.UserExample;
+import com.goafanti.customer.bo.BusinessListBo;
+import com.goafanti.customer.bo.CustomerListOut;
+import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
+import com.goafanti.customer.bo.CustomerPersonalDetailBo;
+import com.goafanti.customer.bo.CustomerSimpleBo;
+import com.goafanti.customer.bo.FollowBusinessBo;
+import com.goafanti.customer.bo.LockingReleaseBo;
+import com.goafanti.report.bo.CountMarketingStatisticsBo;
+import com.goafanti.report.bo.marketingESBo;
+import com.goafanti.report.bo.userDataListBo;
+
+public interface UserMapper {
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	long countByExample(UserExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	int deleteByExample(UserExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	int deleteByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	int insert(User record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	int insertSelective(User record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	List<User> selectByExample(UserExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	User selectByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	int updateByExample(@Param("record") User record, @Param("example") UserExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	int updateByPrimaryKeySelective(User record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
+	 * @mbg.generated  Tue Jun 26 10:23:14 CST 2018
+	 */
+	int updateByPrimaryKey(User record);
+
+	UserPageHomeBo selectUserPageHomeBoByUserId(String uid);
+
+	UserDownLoadBo selectUserDownLoadBoByUserId(String id);
+
+	//List<OrgListBo> selectUserByAid(String aid);
+
+	String findUserByNameAndMobile(@Param("name") String name, @Param("mobile") String mobile);
+
+	String findOrgByNameAndMobile(@Param("name") String name, @Param("mobile") String mobile);
+
+	UserPartnerDetailBo findUserPartnerDetail(String uid);
+
+	OrgPartnerDetailBo findOrgPartnerDetail(String uid);
+
+	Long selectNumberByPrimaryKey(String userId);
+	
+	List<UserPartnerDetailBo> findUserPartner();
+	
+	User selectByMobieAndType(String mobile, Integer type);
+	
+	/**
+	 * 根据客户模糊搜索
+	 * @param name
+	 * @return
+	 */
+	List<CustomerSimpleBo> findCustomerByName(@Param("identifyName")String identifyName);
+
+	/**
+	 * 判断客户是否存在
+	 * @param name
+	 * @return
+	 */
+	int judgeCustomerByName(@Param("identifyName")String identifyName);
+	
+	/**
+	 * 查询单位客户详情
+	 * @param uid 用户ID
+	 * @return
+	 */
+	CustomerPersonalDetailBo findPersonalCustomerDetail(@Param("uid")String uid);
+	
+	
+	/**
+	 * 查询单位客户详情
+	 * @param uid 用户ID
+	 * @return
+	 */
+	CustomerOrganizationDetailBo findOrganizationCustomerDetail(@Param("uid")String uid);
+
+	/**
+	 * 查看客户账户信息
+	 * @param uid
+	 * @return
+	 */
+	User findUserAccountDetail(@Param("uid")String uid);
+
+	/**
+	 * 查看客户联系人列表
+	 * @param uid
+	 * @return
+	 */
+	List<OrganizationContactBook> findCustomerContacts(@Param("uid")String uid,@Param("aid")String aid);
+
+	/**
+	 * 查询拜访详情
+	 * @param followId
+	 * @return
+	 */
+	FollowBusinessBo findFollowById(String followId);
+
+	/**
+	 * 查询单次拜访推进的客户业
+	 * @param followId
+	 * @return
+	 */
+	List<BusinessListBo> findBusinessByFollowId(String followId);
+
+	/**
+	 * 查询客户已有联系人
+	 * @param uid
+	 * @return
+	 */
+	List<OrganizationContactBook> findAllContacts(String uid);
+
+	/**
+	 * 查询用户
+	 * @param id
+	 * @param identifyName 认证用户
+	 * @param mobile 手机号码
+	 * @param type 用户类型 0-个人 1-单位
+	 * @param source 来源 0-注册 1-录入
+	 * @return 
+	 * @param nickname 昵称
+	 */
+	List<User> checkUser(@Param("id")String id,@Param("identifyName")String identifyName, @Param("mobile")String mobile,
+			@Param("type")Integer type,@Param("source") Integer source,@Param("nickname") String nickname);
+
+
+	List<UserInterestBo> userInterest(String uid);
+
+
+	/**
+	 * 查询用户基本信息
+	 * @param id
+	 * @return
+	 */
+	UserBasicInfo selectBaseInfo(@Param("id")String id);
+
+	/**
+	 * 根据用户编号
+	 * @param easemobName
+	 * @return
+	 */
+	User selectByNumber(@Param("easemobName")String easemobName);
+	
+	List<Admin> findAdminName(String aid);
+	
+	int updateEnteringAudit(@Param("id")String id,@Param("auditStatus")Integer auditStatus,@Param("auditOpinion")String auditOpinion);
+
+	int updateRefusedCustomer(@Param("id")String id,  @Param("nickname")String nickname, @Param("mobile")String mobile, @Param("societyTag")String societyTag);
+
+	/**
+	 * 查看客户锁定的业务
+	 * @param uid 客户ID
+	 * @param aid 管理员ID
+	 * @param businessProjectId 业务项目的ID
+	 * @param type 锁定类型  0-客户  1-业务
+	 * @param status 锁定状态 0-锁定 1-待释放 2-已释放
+	 * @return
+	 */
+	List<LockingReleaseBo> selectLockedProject(@Param("uid")String uid,@Param("aid")String aid,@Param("businessProjectId")String businessProjectId, @Param("type")Integer type,@Param("status")Integer status);
+
+	List<CustomerSimpleBo> selectPrivateCustomerByName(@Param("name")String name,@Param("aid")String aid);
+
+	List<CustomerSimpleBo> selectSignedCustomerByName(@Param("name")String name,@Param("aid")String aid);
+	
+	List<User> selectUserByRoleName(@Param("roleName1")String roleName1,@Param("roleName2")String roleName2);
+	
+	void updateReleaseLock(String time);
+
+	marketingESBo marketingStatistics(@Param("id")String id, @Param("dailyStart")String dailyStart, @Param("dailyEnd")String dailyEnd);
+
+	marketingESBo marketingDepStatistics(@Param("depId")String depId, @Param("dailyStart")String dailyStart, @Param("dailyEnd")String dailyEnd);
+
+	CountMarketingStatisticsBo countmarketingDepStatistics(@Param("depId")String depId, @Param("dailyStart")String dailyStart, @Param("dailyEnd")String dailyEnd);
+
+	int checkCustomerInformation(String uid);
+
+	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
+
+	List<userDataListBo> userDataStatistics(@Param("depId")String depId);
+
+	userDataListBo userDataStatisticsCount(@Param("depId")String depId);
+
+	int UserReceiveCount( @Param("aid")String aid);
+
+	int getAidAndUser(@Param("uid")String uid,@Param("aid") String aid);
+
+	 List<CustomerListOut> privateUnitCustomerList(@Param("params")Map<String, Object> params);
+
+	void pushUserGuidance(@Param("id")String id, @Param("guidance")Integer guidance);
+	
 }

File diff suppressed because it is too large
+ 672 - 629
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml


+ 40 - 20
src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="uid" jdbcType="VARCHAR" property="uid" />
@@ -20,12 +20,13 @@
     <result column="time_stamp" jdbcType="TIMESTAMP" property="timeStamp" />
     <result column="follow_count" jdbcType="INTEGER" property="followCount" />
     <result column="guidance" jdbcType="VARCHAR" property="guidance" />
+    <result column="guidance_time" jdbcType="TIMESTAMP" property="guidanceTime" />
   </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 Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -59,7 +60,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -93,16 +94,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     id, uid, aid, paid, result, attachment_url, create_time, ocb_id, contact_type, effective, 
-    time_stamp, follow_count, guidance
+    time_stamp, follow_count, guidance, guidance_time
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.UserFollowExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     select
     <if test="distinct">
@@ -121,7 +122,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -132,7 +133,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     delete from user_follow
     where id = #{id,jdbcType=VARCHAR}
@@ -141,7 +142,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     delete from user_follow
     <if test="_parameter != null">
@@ -152,24 +153,24 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     insert into user_follow (id, uid, aid, 
       paid, result, attachment_url, 
       create_time, ocb_id, contact_type, 
       effective, time_stamp, follow_count, 
-      guidance)
+      guidance, guidance_time)
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
       #{paid,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR}, 
       #{createTime,jdbcType=TIMESTAMP}, #{ocbId,jdbcType=VARCHAR}, #{contactType,jdbcType=INTEGER}, 
       #{effective,jdbcType=INTEGER}, #{timeStamp,jdbcType=TIMESTAMP}, #{followCount,jdbcType=INTEGER}, 
-      #{guidance,jdbcType=VARCHAR})
+      #{guidance,jdbcType=VARCHAR}, #{guidanceTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.UserFollow">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     insert into user_follow
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -212,6 +213,9 @@
       <if test="guidance != null">
         guidance,
       </if>
+      <if test="guidanceTime != null">
+        guidance_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -253,13 +257,16 @@
       <if test="guidance != null">
         #{guidance,jdbcType=VARCHAR},
       </if>
+      <if test="guidanceTime != null">
+        #{guidanceTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.UserFollowExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     select count(*) from user_follow
     <if test="_parameter != null">
@@ -270,7 +277,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     update user_follow
     <set>
@@ -313,6 +320,9 @@
       <if test="record.guidance != null">
         guidance = #{record.guidance,jdbcType=VARCHAR},
       </if>
+      <if test="record.guidanceTime != null">
+        guidance_time = #{record.guidanceTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -322,7 +332,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     update user_follow
     set id = #{record.id,jdbcType=VARCHAR},
@@ -337,7 +347,8 @@
       effective = #{record.effective,jdbcType=INTEGER},
       time_stamp = #{record.timeStamp,jdbcType=TIMESTAMP},
       follow_count = #{record.followCount,jdbcType=INTEGER},
-      guidance = #{record.guidance,jdbcType=VARCHAR}
+      guidance = #{record.guidance,jdbcType=VARCHAR},
+      guidance_time = #{record.guidanceTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -346,7 +357,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     update user_follow
     <set>
@@ -386,6 +397,9 @@
       <if test="guidance != null">
         guidance = #{guidance,jdbcType=VARCHAR},
       </if>
+      <if test="guidanceTime != null">
+        guidance_time = #{guidanceTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -393,7 +407,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Oct 09 14:59:28 CST 2020.
+      This element was generated on Sat Oct 10 10:18:15 CST 2020.
     -->
     update user_follow
     set uid = #{uid,jdbcType=VARCHAR},
@@ -407,7 +421,13 @@
       effective = #{effective,jdbcType=INTEGER},
       time_stamp = #{timeStamp,jdbcType=TIMESTAMP},
       follow_count = #{followCount,jdbcType=INTEGER},
-      guidance = #{guidance,jdbcType=VARCHAR}
+      guidance = #{guidance,jdbcType=VARCHAR},
+      guidance_time = #{guidanceTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+  <update id="pushUserGuidance" >
+  		update   user_follow b, `user` a
+	set a.guidance= #{guidance}
+	where a.id=b.uid and b.id= #{id}
+  </update>
 </mapper>

File diff suppressed because it is too large
+ 1623 - 1620
src/main/java/com/goafanti/common/mapper/UserMapper.xml


+ 9 - 8
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -410,7 +410,7 @@
 		</if>
 	</select>
 	<select id="selectPrivateOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
-			select a.id uid,a.aid,a.identify_name name,a.society_tag societyTag,a.`level`,b.name aName,dg1.name as province,dg2.name as city, 
+			select a.id uid,a.aid,a.identify_name name,a.society_tag societyTag,a.`level`,b.name aName,dg1.name as province,dg2.name as city, a.guidance,
 				dg3.name as area,d.contacts,d.contact_mobile as contactMobile,date_format(t0.last_sign_time,'%Y-%m-%d %H:%i:%S') lastSignTime,
 				date_format(t1.last_follow_time,'%Y-%m-%d %H:%i:%S') lastFollowTime,date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
 			  	date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,if(a.transfer_time &lt; t1.last_follow_time,t1.last_follow_time,a.transfer_time) as orderTime
@@ -419,12 +419,12 @@
 			left join district_glossory dg2 on d.location_city = dg2.id left join district_glossory dg3 on d.location_area = dg3.id
 			left join (select aid,uid,max(lock_time) last_sign_time from user_lock_release group by aid,uid) t0 on a.id=t0.uid and a.aid=t0.aid
 			left join (select uid,aid,max(create_time)  last_follow_time from user_follow  group by aid,uid)t1 on a.id=t1.uid and a.aid=t1.aid
-			where a.share_type=0 
+			where a.share_type=0  and source !=0
 		<if test="power ==0">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="power ==1">
-			and (a.aid = #{aid,jdbcType=VARCHAR} or b.superior_id= #{aid,jdbcType=VARCHAR}) 
+			and  b.superior_id= #{aid,jdbcType=VARCHAR} 
 		</if>
 		<if test="power ==2">
 			and (c.superior_id = #{aid,jdbcType=VARCHAR} or b.superior_id= #{aid,jdbcType=VARCHAR}) 
@@ -454,7 +454,7 @@
 		   order by orderTime 
 		</if>
 		<if test="sort == 1"> 
-		 order by t0.create_time 
+		 order by a.create_time 
 		 </if>
 		 <if test="sortType == 1">
 		 		desc
@@ -470,12 +470,12 @@
 			left join district_glossory dg2 on d.location_city = dg2.id left join district_glossory dg3 on d.location_area = dg3.id
 			left join (select aid,uid,max(lock_time) last_sign_time from user_lock_release group by aid,uid) t0 on a.id=t0.uid and a.aid=t0.aid
 			left join (select uid,aid,max(create_time)  last_follow_time from user_follow  group by aid,uid)t1 on a.id=t1.uid and a.aid=t1.aid
-			where a.share_type=0 
+			where a.share_type=0  and source !=0
 		<if test="power ==0">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="power ==1">
-			and (a.aid = #{aid,jdbcType=VARCHAR} or b.superior_id= #{aid,jdbcType=VARCHAR}) 
+			and  b.superior_id= #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="power ==2">
 			and (c.superior_id = #{aid,jdbcType=VARCHAR} or b.superior_id= #{aid,jdbcType=VARCHAR}) 
@@ -796,7 +796,7 @@
 	<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
 		select a.id as followId, a.aid, a.create_time as followTime, a.contact_type as contactType,
 			a.result,a.guidance, b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,
-			d.name as adminName
+			d.name as adminName,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%S') as guidanceTime
 		<if test="businessProjectId != null and businessProjectId != ''"><!--  客户甲项目A所有的跟进记录 -->
 			,e.id as ufbId,e.follow_situation as followSituation,e.customer_status as customerStatus
 		</if>
@@ -854,7 +854,8 @@
 			source,
 			email,
 			identify_name as identifyName,
-			status
+			status,
+			guidance
 		from
 			user
 		where id = #{uid,jdbcType=VARCHAR}

File diff suppressed because it is too large
+ 745 - 736
src/main/java/com/goafanti/common/model/User.java


+ 62 - 39
src/main/java/com/goafanti/common/model/UserFollow.java

@@ -6,74 +6,79 @@ public class UserFollow {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.id
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private String id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.uid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private String uid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.aid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private String aid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.paid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private String paid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.result
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private String result;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.attachment_url
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private String attachmentUrl;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.create_time
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private Date createTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.ocb_id
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private String ocbId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.contact_type
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private Integer contactType;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.effective
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private Integer effective;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.time_stamp
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private Date timeStamp;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.follow_count
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private Integer followCount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.guidance
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	private String guidance;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow.guidance_time
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
+	 */
+	private Date guidanceTime;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.id
 	 * @return  the value of user_follow.id
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getId() {
 		return id;
@@ -82,7 +87,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.id
 	 * @param id  the value for user_follow.id
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setId(String id) {
 		this.id = id;
@@ -91,7 +96,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.uid
 	 * @return  the value of user_follow.uid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getUid() {
 		return uid;
@@ -100,7 +105,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.uid
 	 * @param uid  the value for user_follow.uid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setUid(String uid) {
 		this.uid = uid;
@@ -109,7 +114,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.aid
 	 * @return  the value of user_follow.aid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getAid() {
 		return aid;
@@ -118,7 +123,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.aid
 	 * @param aid  the value for user_follow.aid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setAid(String aid) {
 		this.aid = aid;
@@ -127,7 +132,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.paid
 	 * @return  the value of user_follow.paid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getPaid() {
 		return paid;
@@ -136,7 +141,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.paid
 	 * @param paid  the value for user_follow.paid
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setPaid(String paid) {
 		this.paid = paid;
@@ -145,7 +150,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.result
 	 * @return  the value of user_follow.result
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getResult() {
 		return result;
@@ -154,7 +159,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.result
 	 * @param result  the value for user_follow.result
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setResult(String result) {
 		this.result = result;
@@ -163,7 +168,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.attachment_url
 	 * @return  the value of user_follow.attachment_url
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getAttachmentUrl() {
 		return attachmentUrl;
@@ -172,7 +177,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.attachment_url
 	 * @param attachmentUrl  the value for user_follow.attachment_url
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setAttachmentUrl(String attachmentUrl) {
 		this.attachmentUrl = attachmentUrl;
@@ -181,7 +186,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.create_time
 	 * @return  the value of user_follow.create_time
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -190,7 +195,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.create_time
 	 * @param createTime  the value for user_follow.create_time
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
@@ -199,7 +204,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.ocb_id
 	 * @return  the value of user_follow.ocb_id
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getOcbId() {
 		return ocbId;
@@ -208,7 +213,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.ocb_id
 	 * @param ocbId  the value for user_follow.ocb_id
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setOcbId(String ocbId) {
 		this.ocbId = ocbId;
@@ -217,7 +222,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.contact_type
 	 * @return  the value of user_follow.contact_type
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public Integer getContactType() {
 		return contactType;
@@ -226,7 +231,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.contact_type
 	 * @param contactType  the value for user_follow.contact_type
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setContactType(Integer contactType) {
 		this.contactType = contactType;
@@ -235,7 +240,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.effective
 	 * @return  the value of user_follow.effective
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public Integer getEffective() {
 		return effective;
@@ -244,7 +249,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.effective
 	 * @param effective  the value for user_follow.effective
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setEffective(Integer effective) {
 		this.effective = effective;
@@ -253,7 +258,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.time_stamp
 	 * @return  the value of user_follow.time_stamp
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public Date getTimeStamp() {
 		return timeStamp;
@@ -262,7 +267,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.time_stamp
 	 * @param timeStamp  the value for user_follow.time_stamp
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setTimeStamp(Date timeStamp) {
 		this.timeStamp = timeStamp;
@@ -271,7 +276,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.follow_count
 	 * @return  the value of user_follow.follow_count
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public Integer getFollowCount() {
 		return followCount;
@@ -280,7 +285,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.follow_count
 	 * @param followCount  the value for user_follow.follow_count
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setFollowCount(Integer followCount) {
 		this.followCount = followCount;
@@ -289,7 +294,7 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.guidance
 	 * @return  the value of user_follow.guidance
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getGuidance() {
 		return guidance;
@@ -298,9 +303,27 @@ public class UserFollow {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.guidance
 	 * @param guidance  the value for user_follow.guidance
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setGuidance(String guidance) {
 		this.guidance = guidance;
 	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow.guidance_time
+	 * @return  the value of user_follow.guidance_time
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
+	 */
+	public Date getGuidanceTime() {
+		return guidanceTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow.guidance_time
+	 * @param guidanceTime  the value for user_follow.guidance_time
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
+	 */
+	public void setGuidanceTime(Date guidanceTime) {
+		this.guidanceTime = guidanceTime;
+	}
 }

+ 76 - 16
src/main/java/com/goafanti/common/model/UserFollowExample.java

@@ -7,23 +7,23 @@ import java.util.List;
 public class UserFollowExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public UserFollowExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -31,7 +31,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -39,7 +39,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -47,7 +47,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -55,7 +55,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -63,7 +63,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -71,7 +71,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -79,7 +79,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -89,7 +89,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -101,7 +101,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -110,7 +110,7 @@ public class UserFollowExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -120,7 +120,7 @@ public class UserFollowExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -1022,11 +1022,71 @@ public class UserFollowExample {
 			addCriterion("guidance not between", value1, value2, "guidance");
 			return (Criteria) this;
 		}
+
+		public Criteria andGuidanceTimeIsNull() {
+			addCriterion("guidance_time is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeIsNotNull() {
+			addCriterion("guidance_time is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeEqualTo(Date value) {
+			addCriterion("guidance_time =", value, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeNotEqualTo(Date value) {
+			addCriterion("guidance_time <>", value, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeGreaterThan(Date value) {
+			addCriterion("guidance_time >", value, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeGreaterThanOrEqualTo(Date value) {
+			addCriterion("guidance_time >=", value, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeLessThan(Date value) {
+			addCriterion("guidance_time <", value, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeLessThanOrEqualTo(Date value) {
+			addCriterion("guidance_time <=", value, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeIn(List<Date> values) {
+			addCriterion("guidance_time in", values, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeNotIn(List<Date> values) {
+			addCriterion("guidance_time not in", values, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeBetween(Date value1, Date value2) {
+			addCriterion("guidance_time between", value1, value2, "guidanceTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGuidanceTimeNotBetween(Date value1, Date value2) {
+			addCriterion("guidance_time not between", value1, value2, "guidanceTime");
+			return (Criteria) this;
+		}
 	}
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table user_follow
-	 * @mbg.generated  Fri Oct 09 14:59:28 CST 2020
+	 * @mbg.generated  Sat Oct 10 10:18:15 CST 2020
 	 */
 	public static class Criterion {
 		private String condition;

+ 12 - 0
src/main/java/com/goafanti/customer/bo/CustomerListOut.java

@@ -53,6 +53,10 @@ public class CustomerListOut extends CustomerListIn{
 	private Integer level;
 	
 	private String aName;
+	/**
+	 * 指导意见 0无 1有
+	 */
+	private Integer guidance;
 	
 	public String getAuditOpinion() {
 		return auditOpinion;
@@ -205,6 +209,14 @@ public class CustomerListOut extends CustomerListIn{
 		this.aName = aName;
 	}
 
+	public Integer getGuidance() {
+		return guidance;
+	}
+
+	public void setGuidance(Integer guidance) {
+		this.guidance = guidance;
+	}
+
 	
 
 }

+ 8 - 0
src/main/java/com/goafanti/customer/bo/FollowListBo.java

@@ -41,6 +41,8 @@ public class FollowListBo {
 	private Integer readOnly;
 	/** 跟进指导 **/
 	private String  guidance;
+	/** 指导时间 **/
+	private String guidanceTime;
 	
 	public String getFollowId() {
 		return followId;
@@ -126,4 +128,10 @@ public class FollowListBo {
 	public void setGuidance(String guidance) {
 		this.guidance = guidance;
 	}
+	public String getGuidanceTime() {
+		return guidanceTime;
+	}
+	public void setGuidanceTime(String guidanceTime) {
+		this.guidanceTime = guidanceTime;
+	}
 }

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

@@ -112,19 +112,25 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 	
-	/** 私有单位客户列表 **/
+	/**
+	 *  私有单位客户列表
+	 *  私有客户列表 
+	 **/
 	@RequestMapping(value = "/listPrivateOrganizationCustomer" , method = RequestMethod.POST)
 	public Result listPrivateOrganizationCustomer(CustomerListIn cli ,Integer sort,Integer sortType,Integer pageNo, Integer pageSize){
 		Result res = new Result();
+		//
 		res.setData(customerService.listPrivateOrganizationCustomer(cli, sort, sortType, 0, pageNo, pageSize));
 		return res;
 	}
 	
-	/** 跟进管理列表 **/
+	/** 跟进管理列表
+	 *  跟进列表
+	 **/
 	@RequestMapping(value = "/listFollowManagement" , method = RequestMethod.GET)
 	public Result listFollowManagement(CustomerListIn cli ,Integer sort,Integer sortType,Integer pageNo, Integer pageSize){
 		Result res = new Result();
-		res.setData(customerService.listPrivateOrganizationCustomer(cli, sort, sortType, null, pageNo, pageSize));
+		res.setData(customerService.listPrivateOrganizationCustomer(cli, sort, sortType, 1, pageNo, pageSize));
 		return res;
 	}
 	/** 
@@ -289,7 +295,7 @@ public class AdminCustomerApiController extends BaseApiController{
 	@RequestMapping(value = "/listFollowHistory", method = RequestMethod.GET)
 	public Result listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessProjectId){
 		Result res = new Result();
-		res.setData(customerService.listFollowHistory(pageNo,pageSize,uid,businessProjectId));
+		res.setData(customerService.pushListFollowHistory(pageNo,pageSize,uid,businessProjectId));
 		return res;
 	}
 	
@@ -1181,6 +1187,22 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.data(adminService.selectAdminCustomerStatistics( depId,  startTime, endTime,  pageSize,  pageNo));
 		return res;
 	}
+	
+	/**
+	 * 查看客户统计
+	 * @param depId
+	 * @param startTime
+	 * @param endTime
+	 * @param pageSize
+	 * @param pageNo
+	 * @return
+	 */
+	@RequestMapping(value = "/selectAllUser", method = RequestMethod.GET)
+	public Result selectAllUser(String depId, String startTime,String endTime, Integer pageSize, Integer pageNo) {
+		Result res = new Result();
+		res.data(adminService.selectAllUser( depId,  startTime, endTime,  pageSize,  pageNo));
+		return res;
+	}
 	/**
 	 * 查看客户日期内新增客户
 	 * @param depId

+ 9 - 11
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -69,9 +69,7 @@ public interface CustomerService {
 	/**
 	 * 私有单位客户列表查询
 	 * @param cin
-	 * @param pageSize
-	 * @param pageSize2 
-	 * @param pageNumber
+	 * @param type 0私有列表 1指导列表
 	 * @return
 	 */
 	Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli,Integer sort,Integer sortType,Integer power, Integer pageNo, Integer pageSize);
@@ -176,13 +174,7 @@ public interface CustomerService {
 	 */
 	int updatePersonalCustomer(CustomerPersonalDetailBo bo);
 	
-	/**
-	 * 查看跟进记录列表
-	 * @param pageNo
-	 * @param pageSize
-	 * @return
-	 */
-	Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessGlossoryId);
+	
 	
 	/**
 	 * 查看客户账户信息
@@ -517,6 +509,12 @@ public interface CustomerService {
 	List<userDaysBo> selectUserDays(String id);
 	
 	int addGuidance(String followId, String guidance);
-	
+	/**
+	 * 查看跟进记录列表
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<FollowListBo> pushListFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessGlossoryId);
 	
 }

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

@@ -134,7 +134,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Map<String,Object> params = disposeParams(cli);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPrivatePersonalCustomerList","selectPrivatePersonalCustomerCount",params,pageNo,pageSize);
 		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList,0);
+		setCustomerList(tmpList,0,null);
 		list.setList(tmpList);
 		return list;
 	}
@@ -169,7 +169,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli,Integer sort,Integer sortType, Integer power,
+	public Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli,Integer sort,Integer sortType, Integer type,
 			Integer pageNo,Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
 		cli.setAid(TokenManager.getAdminId());
@@ -178,7 +178,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Map<String,Object> params = disposeParams(cli);
 		params.put("sort", sort);
 		params.put("sortType",sortType);
-		if (power==null||TokenManager.hasRole(AFTConstants.SALESMAN)) {
+		if (type==0||TokenManager.hasRole(AFTConstants.SALESMAN)) {
 			params.put("power", 0);
 		}else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)) {
 			params.put("power", 1);
@@ -187,7 +187,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		}
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPrivateOrganizationCustomerList","selectPrivateOrganizationCustomerCount",params,pageNo,pageSize);
 		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList,0);
+		setCustomerList(tmpList,0,type);
 		list.setList(tmpList);
 		return list;
 	}
@@ -445,7 +445,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessProjectId) {
+	public Pagination<FollowListBo> pushListFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessProjectId) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(StringUtils.isNotBlank(uid))params.put("uid", uid);
 		if(StringUtils.isNotBlank(businessProjectId)) params.put("businessProjectId", businessProjectId);
@@ -463,9 +463,22 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			
 		}
 		page.setList(list);
+		pushGuidance(uid);
 		return page;
 	}
 
+	/**
+	 * 推动指导已读
+	 * @param uid
+	 */
+	private void pushGuidance(String uid) {
+		User u=userMapper.findUserAccountDetail(uid);
+		if (u!=null &&u.getGuidance()!=0) {
+			u.setGuidance(1);
+			userMapper.pushUserGuidance(uid,1);
+		}
+	}
+
 	@Override
 	public User findUserAccountDetail(String uid) {
 		
@@ -1302,7 +1315,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return userMapper.updateRefusedCustomer(id, nickname, mobile, societyTag);
 	}
 	
-	private void setCustomerList(List<CustomerListOut> tmpList,int i){
+	private void setCustomerList(List<CustomerListOut> tmpList,int i, Integer power){
 		Date now = new Date();
 		String s1,s2;
 		Long l1,l2;
@@ -1336,7 +1349,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			} catch (ParseException e) {
 				e.printStackTrace();
 			}
-			if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)||TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)) {
+			if (power==1) {
 				if(!clo.getAid().equals(TokenManager.getAdminId())) {
 				clo.setContacts("***");
 				clo.setContactMobile("***");
@@ -1354,7 +1367,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Map<String,Object> params = disposeParams(cli);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectSignOrganizationCustomerList","selectSignOrganizationCustomerCount",params,pageNo,pageSize);
 		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList,1);
+		setCustomerList(tmpList,1,0);
 		list.setList(tmpList);
 		return list;
 	}
@@ -1367,7 +1380,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Map<String,Object> params = disposeParams(cli);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectSignPersonalCustomerList","selectSignPersonalCustomerCount",params,pageNo,pageSize);
 		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList,0);
+		setCustomerList(tmpList,0,null);
 		list.setList(tmpList);
 		return list;
 	}
@@ -1530,7 +1543,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		params.put("sort", sort);
 		params.put("sortType",sortType);
 		List<CustomerListOut> list= userMapper.privateUnitCustomerList(params);
-		setCustomerList(list,0);
+		setCustomerList(list,0,0);
 		if (list==null || list.size()==0) return null;
 		String[] comment = {"客户名称","地区","联系人","联系电话","社会性质","客户初始时间","剩余私有天数","最新跟进时间","客户等级"};
 		String filePath = uploadPath + "/privateUnitCustomer";
@@ -1627,6 +1640,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		UserFollow uf=new UserFollow();
 		uf.setId(followId);
 		uf.setGuidance(guidance);
+		uf.setGuidanceTime(new Date());
+		userFollowMapper.pushUserGuidance(followId,1);
 		return userFollowMapper.updateByPrimaryKeySelective(uf);
 	}
 

+ 188 - 188
src/main/java/com/goafanti/permission/controller/NewRoleApiController.java

@@ -1,188 +1,188 @@
-package com.goafanti.permission.controller;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.dao.RoleMapper;
-import com.goafanti.common.model.Role;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.permission.bo.RoleBo;
-import com.goafanti.permission.service.NewRoleService;
-
-@RestController
-@RequestMapping("/api/admin")
-public class NewRoleApiController extends BaseApiController{
-	@Resource
-	private NewRoleService newRoleService;
-	@Autowired
-	RoleMapper				roleMapper;
-	
-	@RequestMapping(value = "/roles", method = RequestMethod.POST)
-	public Result roles(RoleBo role, Integer pageNo,
-			Integer pageSize) {
-		Result res = new Result();
-		res.setData(newRoleService.findRoles(role,pageNo,pageSize));
-		return res;
-	}
-	
-	@RequestMapping(value = "/role/rolePermission", method = RequestMethod.POST)
-	public Result rolePermission(String id){
-		Result res = new Result();
-		res.setData(newRoleService.selectRolePList(id));
-		return res;
-	}
-	@RequestMapping(value = "/role", method = RequestMethod.POST)
-	public Result insertRole(String data) {
-		Result res = new Result();
-		JSONObject jo = (JSONObject) JSON.parse(data);
-		if (jo != null) {
-			JSONArray permissions = jo.getJSONArray("permissions");
-			List<String> permisionIds = new ArrayList<>();
-			for (int idx = 0; idx < permissions.size(); idx++) {
-				String pid = permissions.getString(idx);
-					permisionIds.add(pid);
-			}
-			Role records = jo.toJavaObject(Role.class);
-			String newName=roleMapper.selectNameById(records.getId());
-			if(newName==null){
-				String newid=roleMapper.selectIdByName(records.getRoleName());
-				if(newid!=null){
-					res.getError().add(buildError("","角色已存在"));
-					return res;
-				}
-			}else{
-				String newid=roleMapper.selectIdByNamei(records);
-				if(newid!=null){
-					res.getError().add(buildError("","角色已存在,请更换名称"));
-					return res;
-				}
-			}
-			res.setData(newRoleService.insert(records, permisionIds));
-		} else {
-			res.getError().add(buildError("", "参数格式不正确"));
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/role/delete", method = RequestMethod.POST)
-	public Result deleteRole(String data) {
-		Result res = new Result();
-		JSONArray ja = (JSONArray) JSON.parse(data);
-		
-		if (ja != null && !ja.isEmpty()) {
-			List<String> records = new ArrayList<>();
-			for (int idx = 0; idx < ja.size(); idx++) {
-				String rid = ja.getString(idx);
-				if (rid != "1") {
-					records.add(rid);
-				}
-			}
-			int zz=roleMapper.selectCountByRoleId(records);
-			if(zz>0){
-				res.getError().add(buildError("","角色被分配不能删除"));
-				return res;
-			}
-			res.setData(newRoleService.deleteByPrimaryKeys(records));
-		} else {
-			res.getError().add(buildError("", "参数格式不正确"));
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/role/bindpermission", method = RequestMethod.POST)
-	public Result bindPermission(String rid, String pid) {
-		Result res = new Result();
-		res.setData(newRoleService.bindPermission(rid, pid));
-		return res;
-	}
-
-	@RequestMapping(value = "/role/binduser", method = RequestMethod.POST)
-	public Result bindUser(String rid, String uid) {
-		Result res = new Result();
-		res.setData(newRoleService.bindUser(rid, uid));
-		return res;
-	}
-
-	@RequestMapping(value = "/role/unbindpermission", method = RequestMethod.POST)
-	public Result unbindPermission(String rid, String pid) {
-		Result res = new Result();
-		res.setData(newRoleService.bindPermission(rid, pid));
-		return res;
-	}
-
-	@RequestMapping(value = "/role/unbinduser", method = RequestMethod.POST)
-	public Result unbindUser(String rid, String uid) {
-		Result res = new Result();
-		res.setData(newRoleService.bindUser(rid, uid));
-		return res;
-	}
-	/**
-	 * 新增角色资源
-	 * @param rid 角色ID
-	 * @param resources 资源
-	 * @return
-	 */
-	@RequestMapping(value = "/role/addResources", method = RequestMethod.POST)
-	public Result addResources(String rid, String resources) {
-		Result res = new Result();
-		if (StringUtils.isBlank(rid)) {
-			res.getError().add(buildError("","角色错误"));
-			return res;
-		}
-		if (StringUtils.isBlank(resources)) {
-			res.getError().add(buildError("","角色资源不能为空"));
-			return res;
-		}
-		
-		res.setData(newRoleService.addResources(rid, resources));
-		return res;
-	}
-	/**
-	 * 角色资源详情
-	 * @param rid 角色ID
-	 * @param resources 资源
-	 * @return
-	 */
-	@RequestMapping(value = "/role/ResourcesDetail", method = RequestMethod.POST)
-	public Result ResourcesDetail(String rid) {
-		Result res = new Result();
-		if (StringUtils.isBlank(rid)) {
-			res.getError().add(buildError("","角色错误"));
-			return res;
-		}
-		res.setData(newRoleService.ResourcesDetail(rid));
-		return res;
-	}
-	/**
-	 * 离职人员转交
-	 * @param aid 离职ID
-	 * @param transferId 转交ID
-	 * @return
-	 */
-	@RequestMapping(value = "/role/dimission", method = RequestMethod.POST)
-	public Result dimission(String aid ,String transferId) {
-		Result res = new Result();
-		if (StringUtils.isBlank(aid)) {
-			res.getError().add(buildError("","角色错误"));
-			return res;
-		}
-		if (StringUtils.isBlank(transferId)) {
-			res.getError().add(buildError("","转移角色错误"));
-			return res;
-		}
-		res.setData(newRoleService.updatedimission(aid,transferId));
-		return res;
-	}
-}
+package com.goafanti.permission.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.dao.RoleMapper;
+import com.goafanti.common.model.Role;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.permission.bo.RoleBo;
+import com.goafanti.permission.service.NewRoleService;
+
+@RestController
+@RequestMapping("/api/admin")
+public class NewRoleApiController extends BaseApiController{
+	@Resource
+	private NewRoleService newRoleService;
+	@Autowired
+	RoleMapper				roleMapper;
+	
+	@RequestMapping(value = "/roles", method = RequestMethod.POST)
+	public Result roles(RoleBo role, Integer pageNo,
+			Integer pageSize) {
+		Result res = new Result();
+		res.setData(newRoleService.findRoles(role,pageNo,pageSize));
+		return res;
+	}
+	
+	@RequestMapping(value = "/role/rolePermission", method = RequestMethod.POST)
+	public Result rolePermission(String id){
+		Result res = new Result();
+		res.setData(newRoleService.selectRolePList(id));
+		return res;
+	}
+	@RequestMapping(value = "/role", method = RequestMethod.POST)
+	public Result insertRole(String data) {
+		Result res = new Result();
+		JSONObject jo = (JSONObject) JSON.parse(data);
+		if (jo != null) {
+			JSONArray permissions = jo.getJSONArray("permissions");
+			List<String> permisionIds = new ArrayList<>();
+			for (int idx = 0; idx < permissions.size(); idx++) {
+				String pid = permissions.getString(idx);
+					if(pid!=null)permisionIds.add(pid);
+			}
+			Role records = jo.toJavaObject(Role.class);
+			String newName=roleMapper.selectNameById(records.getId());
+			if(newName==null){
+				String newid=roleMapper.selectIdByName(records.getRoleName());
+				if(newid!=null){
+					res.getError().add(buildError("","角色已存在"));
+					return res;
+				}
+			}else{
+				String newid=roleMapper.selectIdByNamei(records);
+				if(newid!=null){
+					res.getError().add(buildError("","角色已存在,请更换名称"));
+					return res;
+				}
+			}
+			res.setData(newRoleService.insert(records, permisionIds));
+		} else {
+			res.getError().add(buildError("", "参数格式不正确"));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/role/delete", method = RequestMethod.POST)
+	public Result deleteRole(String data) {
+		Result res = new Result();
+		JSONArray ja = (JSONArray) JSON.parse(data);
+		
+		if (ja != null && !ja.isEmpty()) {
+			List<String> records = new ArrayList<>();
+			for (int idx = 0; idx < ja.size(); idx++) {
+				String rid = ja.getString(idx);
+				if (rid != "1") {
+					records.add(rid);
+				}
+			}
+			int zz=roleMapper.selectCountByRoleId(records);
+			if(zz>0){
+				res.getError().add(buildError("","角色被分配不能删除"));
+				return res;
+			}
+			res.setData(newRoleService.deleteByPrimaryKeys(records));
+		} else {
+			res.getError().add(buildError("", "参数格式不正确"));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/role/bindpermission", method = RequestMethod.POST)
+	public Result bindPermission(String rid, String pid) {
+		Result res = new Result();
+		res.setData(newRoleService.bindPermission(rid, pid));
+		return res;
+	}
+
+	@RequestMapping(value = "/role/binduser", method = RequestMethod.POST)
+	public Result bindUser(String rid, String uid) {
+		Result res = new Result();
+		res.setData(newRoleService.bindUser(rid, uid));
+		return res;
+	}
+
+	@RequestMapping(value = "/role/unbindpermission", method = RequestMethod.POST)
+	public Result unbindPermission(String rid, String pid) {
+		Result res = new Result();
+		res.setData(newRoleService.bindPermission(rid, pid));
+		return res;
+	}
+
+	@RequestMapping(value = "/role/unbinduser", method = RequestMethod.POST)
+	public Result unbindUser(String rid, String uid) {
+		Result res = new Result();
+		res.setData(newRoleService.bindUser(rid, uid));
+		return res;
+	}
+	/**
+	 * 新增角色资源
+	 * @param rid 角色ID
+	 * @param resources 资源
+	 * @return
+	 */
+	@RequestMapping(value = "/role/addResources", method = RequestMethod.POST)
+	public Result addResources(String rid, String resources) {
+		Result res = new Result();
+		if (StringUtils.isBlank(rid)) {
+			res.getError().add(buildError("","角色错误"));
+			return res;
+		}
+		if (StringUtils.isBlank(resources)) {
+			res.getError().add(buildError("","角色资源不能为空"));
+			return res;
+		}
+		
+		res.setData(newRoleService.addResources(rid, resources));
+		return res;
+	}
+	/**
+	 * 角色资源详情
+	 * @param rid 角色ID
+	 * @param resources 资源
+	 * @return
+	 */
+	@RequestMapping(value = "/role/ResourcesDetail", method = RequestMethod.POST)
+	public Result ResourcesDetail(String rid) {
+		Result res = new Result();
+		if (StringUtils.isBlank(rid)) {
+			res.getError().add(buildError("","角色错误"));
+			return res;
+		}
+		res.setData(newRoleService.ResourcesDetail(rid));
+		return res;
+	}
+	/**
+	 * 离职人员转交
+	 * @param aid 离职ID
+	 * @param transferId 转交ID
+	 * @return
+	 */
+	@RequestMapping(value = "/role/dimission", method = RequestMethod.POST)
+	public Result dimission(String aid ,String transferId) {
+		Result res = new Result();
+		if (StringUtils.isBlank(aid)) {
+			res.getError().add(buildError("","角色错误"));
+			return res;
+		}
+		if (StringUtils.isBlank(transferId)) {
+			res.getError().add(buildError("","转移角色错误"));
+			return res;
+		}
+		res.setData(newRoleService.updatedimission(aid,transferId));
+		return res;
+	}
+}

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

@@ -64,12 +64,12 @@ user_remind_days=15
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-#static.host=//sb.jishutao.com:3000/1.1.49
+#static.host=//sb.jishutao.com:3000/1.1.51
 #avatar.host=//sb.jishutao.com
 
 #连测试
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.50
+static.host=//static.jishutao.com/1.1.51
 
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload

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

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