Bläddra i källkod

修改我的客户列表

anderx 1 år sedan
förälder
incheckning
60b5d2f641

+ 30 - 0
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2421,4 +2421,34 @@ inner join(
 	  left join user_follow e on a.ufid =e.id
 		where main_status =1 and a.uid = #{id}
 	</select>
+
+	<select id="selectMyUserList" resultType="com.goafanti.customer.bo.SelectMyUserOut">
+		SELECT a.id,a.nickname ,a.share_type as shareType,a.new_channel as newChannel,a.sign_bills as signBills,
+		       a.sign_time as signTime,d.name as adminName ,b.org_code as orgCode
+		from `user` a left join organization_identity b on a.id=b.uid left join user_mid c on a.id =c.uid
+					  left join admin d on a.aid=d.id
+		<if test="type==1">
+		inner join (SELECT b.uid
+			from public_release a left join public_release_details b on a.id=b.prid
+			where aid= #{aid} and status =2
+			group by b.uid )t0 on a.id=t0.uid
+		</if>
+		where a.`type` =1 and a.status =0 and a.share_type in (0,1,4)
+		  and a.aid = #{aid}
+		<if test="page_sql != null">
+			${page_sql}
+		</if>
+	</select>
+	<select id="selectMyUserCount" resultType="integer">
+		SELECT count(*)
+		from `user` a
+	<if test="type==1">
+		inner join (SELECT b.uid
+		from public_release a left join public_release_details b on a.id=b.prid
+		where aid= #{aid} and status =2
+		group by b.uid )t0 on a.id=t0.uid
+	</if>
+		where a.`type` =1 and a.status =0 and a.share_type in (0,1,4)
+		and a.aid = #{aid}
+	</select>
 </mapper>

+ 35 - 0
src/main/java/com/goafanti/customer/bo/SelectMyUserBo.java

@@ -0,0 +1,35 @@
+package com.goafanti.customer.bo;
+
+public class SelectMyUserBo {
+
+    /**
+     *  0=所有,1=公出过的企业
+     */
+    private Integer type;
+    private Integer pageNo;
+    private Integer pageSize;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+}

+ 83 - 0
src/main/java/com/goafanti/customer/bo/SelectMyUserOut.java

@@ -0,0 +1,83 @@
+package com.goafanti.customer.bo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+
+public class SelectMyUserOut {
+
+    private String id;
+    private String nickname;
+    private Integer shareType;
+    private Integer newChannel;
+    private Integer signBills;
+    private Date signTime;
+    private String adminName;
+    private String orgCode;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+
+    public Integer getShareType() {
+        return shareType;
+    }
+
+    public void setShareType(Integer shareType) {
+        this.shareType = shareType;
+    }
+
+    public Integer getNewChannel() {
+        return newChannel;
+    }
+
+    public void setNewChannel(Integer newChannel) {
+        this.newChannel = newChannel;
+    }
+
+    public Integer getSignBills() {
+        return signBills;
+    }
+
+    public void setSignBills(Integer signBills) {
+        this.signBills = signBills;
+    }
+
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    public Date getSignTime() {
+        return signTime;
+    }
+
+    public void setSignTime(Date signTime) {
+        this.signTime = signTime;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getOrgCode() {
+        return orgCode;
+    }
+
+    public void setOrgCode(String orgCode) {
+        this.orgCode = orgCode;
+    }
+}

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

@@ -1618,6 +1618,30 @@ public class AdminCustomerApiController extends BaseApiController{
 		return customerService.importExcel(file);
 	}
 
+	/**
+	 * 获取我的客户列表
+	 * @param in
+	 * @return
+	 */
+	@GetMapping("/selectMyUser")
+	public Result<Pagination<SelectMyUserOut>> selectMyUser(SelectMyUserBo in ){
+		Result res = new Result();
+		res.data(customerService.selectMyUser(in));
+		return res;
+	}
+
+	/**
+	 * 获取我的客户信息
+	 * @param in
+	 * @return
+	 */
+	@GetMapping("/selectMyUserDetails")
+	public Result<Pagination<SelectMyUserOut>> selectMyUserDetails(String id ){
+		Result res = new Result();
+		res.data(customerService.selectMyUserDetails(id));
+		return res;
+	}
+
 
 	/**
 	 * 客户公出情况

+ 3 - 0
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -591,6 +591,9 @@ public interface CustomerService {
 
 	Object getRestrictCustomerByName(String name);
 
+    Object selectMyUser(SelectMyUserBo in);
+
+	Object selectMyUserDetails(String id);
 	UserArchivesDetails selectUserByUid(String id);
 
 	List<PublicReleaseListBo> getPublicReleaseList(String uid);

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

@@ -3140,7 +3140,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
     }
 
 
-    private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
+	private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
 		List<InputExcelUser> res=new ArrayList<>();
 		List<InputExcelUser> list2=new ArrayList<>();
 		int i = 0;
@@ -3176,4 +3176,20 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return res;
 	}
 
+
+	@Override
+	public Pagination<SelectMyUserOut> selectMyUser(SelectMyUserBo in) {
+		Map<String, Object> params = new HashMap<>();
+		if (in.getType() != null) params.put("type", in.getType());
+		params.put("aid", TokenManager.getAdminId());
+		Pagination<SelectMyUserOut> list = (Pagination<SelectMyUserOut>) findPage("selectMyUserList",
+				"selectMyUserCount", params, in.getPageNo(), in.getPageSize());
+		return list;
+	}
+
+	@Override
+	public Object selectMyUserDetails(String id) {
+		return null;
+	}
+
 }