瀏覽代碼

userw 员工创建人,修改人、渠道查询只能查自己

master
chenchaod 1 周之前
父節點
當前提交
f068dc19fc

+ 3
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/AbstractUserwManager.java 查看文件

@@ -32,6 +32,9 @@ public abstract class AbstractUserwManager extends AbstractCommManager {
@Autowired
private AccountInfoRepo accountInfoRepo;

//黔通渠道编号
public static String QTZL_AGENCY_ID = "52010106004";

/**
* type:1-身份证-人像面 2-身份证-国徽面 3-行驶证前页 4-行驶证背页 5-营业执照
* imagePath:图片地址

+ 1
- 1
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/agency/AgencyManager.java 查看文件

@@ -17,7 +17,7 @@ import java.util.List;
* @description:渠道管理
*/
public interface AgencyManager {
Pagination page(AgencyPageRequestDTO reqDto);
Pagination page(AgencyPageRequestDTO reqDto) throws ServiceHandleException;

AgencyDetailsResponseDTO details(AgencyDetailsRequestDTO reqDto) throws ManagerException;


+ 7
- 2
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/agency/AgencyManagerImpl.java 查看文件

@@ -1,6 +1,5 @@
package cn.com.taiji.userw.manager.agency;

import cn.com.taiji.common.manager.AbstractManager;
import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.com.taiji.common.model.StringKeyValue;
@@ -43,6 +42,7 @@ import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;


/**
* @Author:ChenChao
* @Date:2025/5/19 21:55
@@ -64,8 +64,13 @@ public class AgencyManagerImpl extends AbstractUserwManager implements AgencyMan
private StaffRepo staffRepo;

@Override
public Pagination page(AgencyPageRequestDTO reqDto) {
public Pagination page(AgencyPageRequestDTO reqDto) throws ServiceHandleException {
AgencyPageRequest request = copyProperties(reqDto, new AgencyPageRequest());
String agencyId = findAgencyIdByToken(reqDto.getAccessToken());
if (!QTZL_AGENCY_ID.equals(agencyId)){
//非黔通员工,只能看自己渠道网点
request.setAgencyId(agencyId);
}
return qtkAgencyRepo.page(request).convertResult(this::covert);
}


+ 6
- 1
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/excel/listener/StaffRegisterDataListener.java 查看文件

@@ -28,10 +28,12 @@ public class StaffRegisterDataListener implements ReadListener<StaffRegisterData
private StaffRepo staffRepo;
private Set<StaffRegisterData> errors = new HashSet<>();
private List<StaffRegisterData> result = new ArrayList<>();
private String opneId;

public StaffRegisterDataListener(AccountInfoRepo accountInfoRepo, StaffRepo staffRepo) {
public StaffRegisterDataListener(AccountInfoRepo accountInfoRepo, StaffRepo staffRepo,String openId) {
this.accountInfoRepo = accountInfoRepo;
this.staffRepo = staffRepo;
this.opneId = openId;
}

@Override
@@ -99,7 +101,10 @@ public class StaffRegisterDataListener implements ReadListener<StaffRegisterData
//添加身份标识,是否脱敏
staff.setIdentityType("NORMAL"); //默认普通员工
staff.setDesensitization(1);
staff.setCreateOpenId(opneId);
}
staff.setUpdateOpenId(opneId);
staff.setUpdateTime(LocalDateTime.now());
staff.setAgencyId(data.getAgencyId());
staff.setServiceHallId(data.getServiceHallId());
staff.setStaffName(data.getName());

+ 1
- 2
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/serviceHall/ServiceHallManagerImpl.java 查看文件

@@ -61,8 +61,7 @@ public class ServiceHallManagerImpl extends AbstractUserwManager implements Serv
@Autowired
private MinioUtil minioUtil;

//黔通渠道编号
public static String QTZL_AGENCY_ID = "52010106004";


@Override
public Pagination query(ServiceHallPageRequestDTO reqDto) throws ServiceHandleException {

+ 25
- 2
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/system/StaffManagerImpl.java 查看文件

@@ -29,6 +29,7 @@ import cn.com.taiji.core.repo.jpa.user.AccountUserRoleRepo;
import cn.com.taiji.core.repo.jpa.user.StaffRepo;
import cn.com.taiji.core.repo.jpa.user.UserRoleRepo;
import cn.com.taiji.userw.dto.system.*;
import cn.com.taiji.userw.manager.AbstractUserwManager;
import cn.com.taiji.userw.manager.excel.listener.StaffRegisterDataListener;
import cn.com.taiji.userw.model.excel.ServiceHallRegisterData;
import cn.com.taiji.userw.model.excel.StaffRegisterData;
@@ -57,7 +58,7 @@ import static cn.com.taiji.core.manager.tools.SystemFinals.commonStaffId;
import static cn.com.taiji.core.manager.tools.SystemFinals.staffIdentityTypeId;

@Service
public class StaffManagerImpl extends RedisCacheManager implements StaffManager {
public class StaffManagerImpl extends AbstractUserwManager implements StaffManager {

@Autowired
private DictTypeUtil dictTypeUtil;
@@ -89,8 +90,14 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager
throw new ManagerException("传入的员工身份标识不合规,请前往字典管理进行核实!");
StaffPageRequest queryRequest = new StaffPageRequest();
copyProperties(dto, queryRequest);
//渠道迷糊查出id

String agencyId = findAgencyIdByToken(dto.getAccessToken());
if (!QTZL_AGENCY_ID.equals(agencyId)){
//非黔通员工,只能看自己渠道网点
queryRequest.setAgencyIds(Lists.newArrayList(agencyId));
} else
if (hasText(dto.getAgencyName())) {
//渠道迷糊查出id
List<String> agencyIds = agencyRepo.listByName("%"+dto.getAgencyName()+"%");
queryRequest.setAgencyIds(agencyIds);
}
@@ -122,6 +129,7 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager

@Override
public String add(StaffAddRequestDTO dto) throws ManagerException {
String openId = findOpenIdByToken(dto.getAccessToken());
AccountInfo accountInfo = accountInfoRepo.findByAccount(dto.getMobile());
if (accountInfo == null) throw new ManagerException("该手机号码未注册,无法进行用户账号与员工绑定!");
valid(dto.getMobile(), dto.getAgencyId(), dto.getServiceHallId(), dto.getIdentityType(),null);
@@ -139,6 +147,8 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager
//添加身份标识,是否脱敏
staff.setIdentityType(dto.getIdentityType());
staff.setDesensitization(dto.getDesensitization());
staff.setCreateOpenId(openId);
staff.setUpdateOpenId(openId);
if (hasText(accountInfo.getOpenId())) staff.setOpenId(accountInfo.getOpenId());
//员工表新增
staffRepo.save(staff);
@@ -147,6 +157,7 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager

@Override
public String change(StaffChangeRequestDTO dto) throws ManagerException {
String openId = findOpenIdByToken(dto.getAccessToken());
AccountInfo accountInfo = accountInfoRepo.findByAccount(dto.getMobile());
if (accountInfo == null) throw new ManagerException("该手机号码未注册,无法进行用户账号与员工绑定!");
if (commonStaffId.equals(dto.getId())) throw new ManagerException("该员工不存在");
@@ -162,6 +173,8 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager
//修改手机号码、修改工号(现在是工号默认是手机号码)
staff.setMobile(dto.getMobile());
staff.setStaffId(dto.getMobile());
staff.setUpdateTime(LocalDateTime.now());
staff.setUpdateOpenId(openId);
//更新openId
if (hasText(accountInfo.getOpenId())) staff.setOpenId(accountInfo.getOpenId());
staffRepo.save(staff);
@@ -197,6 +210,8 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager
StaffStatus staffStatus = StaffStatus.findByCode(dto.getStatus());
if (staffStatus == null) throw new ManagerException("该员工状态不存在,请传入有效值");
staff.setStatus(dto.getStatus());
staff.setUpdateTime(LocalDateTime.now());
staff.setUpdateOpenId(openId);
staffRepo.save(staff);
if (staffStatus == StaffStatus.DISABLE) deleteTokenByOpenId(staff.getOpenId());
saveStaffChangeLog(staff.getStaffId(), dto.getRemark(), openId, StaffChangeType.STATUS);
@@ -505,6 +520,14 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager
}
}
staffVo.setStaffOpenId(staff.getOpenId());
Staff staffCreat = staffRepo.findByOpenId(staff.getCreateOpenId());
if(staffCreat != null) {
staffVo.setCreateName(staffCreat.getStaffName());
}
Staff staffUpdate = staffRepo.findByOpenId(staff.getUpdateOpenId());
if(staffUpdate != null) {
staffVo.setUpdateName(staffUpdate.getStaffName());
}
return staffVo;
}


+ 1
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/model/agency/CenterAgencyPageModel.java 查看文件

@@ -14,6 +14,7 @@ import java.time.LocalDateTime;
@Data
@ApiModel(description = "中心渠道分页信息")
public class CenterAgencyPageModel {
private String id;

@ApiModelProperty(value = "中心渠道编号")
private String centerAgencyId;

+ 1
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/model/agency/QtkAgencyModelDetails.java 查看文件

@@ -12,6 +12,7 @@ import java.time.LocalDateTime;
@Data
@ApiModel(description = "渠道信息")
public class QtkAgencyModelDetails {
private String id;
@ApiModelProperty(value = "协议编号")
private String issuerId = "520101";//发行方编号
@ApiModelProperty(value = "渠道编号")

+ 1
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/model/serviceHall/CenterServicePageModel.java 查看文件

@@ -14,6 +14,7 @@ import java.time.LocalDateTime;
@ApiModel(description = "中心网点分页信息")
@Data
public class CenterServicePageModel {
private String id;

@ApiModelProperty(value = "中心网点编号")
private String centerServiceHallId;

+ 4
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/model/system/StaffVo.java 查看文件

@@ -1,6 +1,7 @@
package cn.com.taiji.userw.model.system;

import cn.com.taiji.common.model.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@@ -27,4 +28,7 @@ public class StaffVo extends BaseModel {
private Integer desensitization;// 员工身份标识 1:脱敏 2:不脱敏 不填值,则默认脱敏
private String realNameAuthentication;// 0,已实名,1未实名
private String staffOpenId;

private String createName;//添加人名称
private String updateName;//修改人名称
}

+ 1
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/model/wx/CarParentPageModel.java 查看文件

@@ -21,6 +21,7 @@ import java.time.LocalDateTime;
@Data
@ApiModel(description = "车主签约父表分页信息")
public class CarParentPageModel {
private String id;
@ApiModelProperty(value = "描述")
private String info;//描述
@ApiModelProperty(value = "商户号")

Loading…
取消
儲存