/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.service.sysmgr.service;

import com.crunii.micro.common.dto.PageReq;
import com.crunii.micro.common.dto.PageRsp;
import com.crunii.micro.common.dto.Result;
import com.crunii.micro.domain.dto.Worker;
import com.crunii.micro.domain.entity.main.TsmOrg;
import com.crunii.micro.feign.client.dto.WorkerC;
import com.crunii.micro.feign.client.dto.WorkerCreateDTO;
import com.crunii.micro.service.sysmgr.api.domain.dto.worker.WorkerRoleVo;
import com.crunii.micro.service.sysmgr.dto.org.OrgIds;
import com.crunii.micro.service.sysmgr.api.domain.dto.OrgNode;
import com.crunii.micro.service.sysmgr.dto.sysmgr.*;

import java.util.List;

/**
 * @author 田平 create 2019年2月19日上午10:35:45
 */
public interface WorkerService {

	public PageRsp<WorkerInfo> pageWorker(PageReq<WorkerReq> req);

	public WorkerCreateDTO createWorker(WorkerC workerC);

	public Integer appCreateWorker(WorkerC workerC);

	Integer createWorkerInfo(WorkerC workerC);

	public void updateWorker(WorkerU workerU, String mobile, String token);

	public String doResetPwd(int loginId);

	public Result<String> doModifyPwd(int loginId, String oldPwd, String newPwd);

	public void unlockWebLoginLimit(int loginId);

	public WorkerInfo getWorkerInfo(int loginId);

	public List<WorkerInfo> getTsmWorkers(List<Integer> ids);

	/**
	 * 分页查询组织worker信息
	 *
	 * @param req   请求参数
	 * @return data
	 */
	PageRsp<PageWorkerVo> pageOrgWorker(PageReq<PageOrgWorkerDto> req);

	/**
	 * 查询数据权限下用户
	 */
	Result<List<WorkerListRspDto>> getOrgManageWorker(WorkerManageReq req);


	Result<String> createTsmWorkerOrgAll(Worker worker, TsmWorkerOrgAllReqDto tsmWorkerOrgAllReqDto);

	Result<WorkerOrgAllDto> getTsmWorkerOrgAll(Worker worker, OrgIds req);

	Result<List<TsmOrg>> getOrgByOrgId(Worker worker, OrgIds param);

	/**
	 * 根据用户id查询所属角色
	 * @param workerId
	 * @return
	 */
	Result<List<WorkerRoleVo>> getRoleListByWorkerId(Long workerId);

	/**
	 * 根据用户id查询所属组织
	 *
	 * @param workerId 用户id
	 * @return 所属组织
	 */
	Result<List<OrgNode>> getOrgListByWorkerId(Long workerId);

	/**
	 * 标签数据分页查询
	 * @return
	 */
	PageRsp<LabelResp> pageLabel(PageReq<LabelReq> req);

	/**
	 * 用户-保存签名
	 * @param reqVo 签名请求参数
	 * @return
	 */
	Boolean doSignature(Worker worker,WorkerSignatureReqVo reqVo);

	/**
	 * 生成签名二维码
	 * @param worker
	 * @return
	 */
	QrCodeRspVo getSignQrCode(Worker worker);

	/**
	 * 签名提交接口(App端)
	 * @param signSubmitReqVo
	 * @return
	 */
	void doSubmitSign(SignSubmitReqVo signSubmitReqVo);

	/**
	 * 保存邮寄地址
	 * @param reqVo
	 * @return
	 */
	Boolean doSaveDeliveryAddress(Worker worker,DeliveryAddressReqVo reqVo);

	/**
	 * 查询邮寄地址
	 * @param worker
	 * @return
	 */
	DeliveryAddressReqVo getDeliveryAddress(Worker worker);

	/**
	 * 查询APP提交的签名文件(轮询)
	 * @param worker
	 * @return
	 */
	String getSignFile(Worker worker);
	/**
	 * 查询组织下用户
	 * @param req
	 * @return
	 */
	Result<List<WorkerListRspDto>> getWorkerByOrgId(WorkerManageReq req);
	
	/**
	 * 创建用户
	 * @param workerC 入参
	 * @return WorkerCreateDTO
	 */
	Integer createWorkerCustomPwd(WorkerC workerC);

	List<WorkerListRspDto> getWorkerByDepartment(WorkerManageReq req);
}
