@@ -16,6 +16,7 @@ import cn.com.taiji.core.model.comm.protocol.ats.ocr.*; | |||
import cn.com.taiji.core.repo.jpa.comm.OcrResultRepo; | |||
import cn.com.taiji.core.repo.jpa.log.OperateLogRepo; | |||
import cn.com.taiji.core.repo.jpa.user.AccountInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.user.StaffRepo; | |||
import cn.com.taiji.iaw.model.MyFinals; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.context.request.RequestContextHolder; | |||
@@ -23,7 +24,6 @@ import org.springframework.web.context.request.ServletRequestAttributes; | |||
import javax.servlet.http.HttpServletRequest; | |||
import java.io.IOException; | |||
import java.time.LocalDateTime; | |||
import java.time.format.DateTimeFormatter; | |||
public abstract class AbstractIawManager extends AbstractCommManager { | |||
@@ -36,7 +36,7 @@ public abstract class AbstractIawManager extends AbstractCommManager { | |||
@Autowired | |||
protected MinioUtil minioUtil; | |||
protected Boolean isManager(String identityType, String agencyId) throws ManagerException { | |||
protected Boolean isManager(String identityType, String agencyId) { | |||
if ("MANAGER".equals(identityType) || MyFinals.QTZL_AGENCY_ID.equals(agencyId)){ | |||
return true; | |||
} |
@@ -11,6 +11,7 @@ import cn.com.taiji.core.model.comm.protocol.ias.ass.AssOrderCancelRequest; | |||
import cn.com.taiji.core.repo.jpa.ass.AssOrderinfoRepo; | |||
import cn.com.taiji.core.repo.jpa.issue.IssueProductPromotionRepo; | |||
import cn.com.taiji.core.repo.jpa.issue.IssueProductRepo; | |||
import cn.com.taiji.core.repo.jpa.user.StaffRepo; | |||
import cn.com.taiji.core.repo.request.ass.AssOrderinfoPageRequest; | |||
import cn.com.taiji.iaw.dto.CommRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.AssOrderinfoPageRequestDTO; | |||
@@ -41,6 +42,8 @@ public class AssOrderinfoManagerImpl extends AbstractIawManager implements AssOr | |||
private IssueProductPromotionRepo issueProductPromotionRepo; | |||
@Autowired | |||
private IssueProductRepo issueProductRepo; | |||
@Autowired | |||
private StaffRepo staffRepo; | |||
@Override |
@@ -64,6 +64,8 @@ public class VehicleChangeMangerImpl extends AbstractIawManager implements Vehic | |||
private AssAgencyConfigRepo assAgencyConfigRepo; | |||
@Autowired | |||
private AssDeviceUpgradeRepo assDeviceUpgradeRepo; | |||
@Autowired | |||
private StaffRepo staffRepo; | |||
@Override |
@@ -14,7 +14,7 @@ import cn.com.taiji.iaw.dto.comm.*; | |||
*/ | |||
public interface SatisfactionManager { | |||
Pagination page(SatisfactionPageRequestDTO dto) throws ServiceHandleException; | |||
Pagination page(SatisfactionPageRequestDTO dto) throws ManagerException; | |||
SatisfactionInfoResponseDTO view(SatisfactionInfoRequestDTO dto) throws ManagerException; | |||
@@ -12,6 +12,7 @@ import cn.com.taiji.core.repo.jpa.user.StaffRepo; | |||
import cn.com.taiji.core.repo.request.operation.SatisfactionPageRequest; | |||
import cn.com.taiji.iaw.dto.comm.*; | |||
import cn.com.taiji.iaw.manager.AbstractCommManager; | |||
import cn.com.taiji.iaw.manager.AbstractIawManager; | |||
import cn.com.taiji.iaw.model.MyFinals; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -26,7 +27,7 @@ import org.springframework.transaction.annotation.Transactional; | |||
* @version: 1.0 | |||
*/ | |||
@Service | |||
public class SatisfactionManagerImpl extends AbstractCommManager implements SatisfactionManager{ | |||
public class SatisfactionManagerImpl extends AbstractIawManager implements SatisfactionManager{ | |||
@Autowired | |||
private SatisfactionRepo repo; | |||
@@ -34,7 +35,7 @@ public class SatisfactionManagerImpl extends AbstractCommManager implements Sati | |||
private StaffRepo staffRepo; | |||
@Override | |||
public Pagination page(SatisfactionPageRequestDTO reqDto) throws ServiceHandleException { | |||
public Pagination page(SatisfactionPageRequestDTO reqDto) throws ManagerException { | |||
SatisfactionPageRequest pageRequest = new SatisfactionPageRequest(); | |||
BeanTools.copyProperties(reqDto, pageRequest); | |||
if (SourceType.SERVICE_HALL.equals(reqDto.getOrderSource())){ | |||
@@ -42,7 +43,7 @@ public class SatisfactionManagerImpl extends AbstractCommManager implements Sati | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(reqDto.getAccessToken())); | |||
if (staff != null){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(reqDto.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} |
@@ -106,7 +106,7 @@ public class VehicleInfoManagerImpl extends AbstractIawManager implements Vehicl | |||
if (staff == null){ | |||
throw new ManagerException("为获取到当前员工账号!"); | |||
} | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(staff.getAgencyId())){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
cardInfos = cardInfoRepo.listByVehicleId(dto.getVehicleId()); | |||
obuInfos = obuInfoRepo.listByVehicleId(dto.getVehicleId()); | |||
}else { | |||
@@ -143,7 +143,7 @@ public class VehicleInfoManagerImpl extends AbstractIawManager implements Vehicl | |||
if (staff == null){ | |||
throw new ManagerException("为获取到当前员工账号!"); | |||
} | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(staff.getAgencyId())){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
cardInfos = cardInfoRepo.listByVehicleId(dto.getVehicleId()); | |||
}else { | |||
cardInfos = cardInfoRepo.listByAgencyIdAndVehicleId(findAgencyIdByToken(dto.getAccessToken()),dto.getVehicleId()); |
@@ -31,7 +31,7 @@ public abstract class AbstractInvwManager extends AbstractCommManager{ | |||
@Autowired | |||
private AccountInfoRepo accountInfoRepo; | |||
protected Boolean isManager(String identityType, String agencyId) throws ManagerException { | |||
protected Boolean isManager(String identityType, String agencyId) { | |||
if ("MANAGER".equals(identityType) || MyFinals.QTZL_AGENCY_ID.equals(agencyId)){ | |||
return true; | |||
} |
@@ -126,7 +126,7 @@ public class InvwCardDetailsManagerImpl extends AbstractInvwManager implements I | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(dto.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} |
@@ -14,7 +14,7 @@ import cn.com.taiji.invw.dto.enter.*; | |||
*/ | |||
public interface InvwEnterApplyManager { | |||
Pagination page(InvwEnterApplyPageRequestDTO req) throws ServiceHandleException; | |||
Pagination page(InvwEnterApplyPageRequestDTO req) throws ManagerException; | |||
InvwEnterApplyAddResponseDTO apply(InvwEnterApplyAddRequestDTO dto) throws ManagerException; | |||
@@ -66,12 +66,12 @@ public class InvwEnterApplyManagerImpl extends AbstractInvwManager implements In | |||
@Override | |||
public Pagination page(InvwEnterApplyPageRequestDTO req) throws ServiceHandleException { | |||
public Pagination page(InvwEnterApplyPageRequestDTO req) throws ManagerException { | |||
InvwEnterApplyPageRequest pageRequest = copyProperties(req, new InvwEnterApplyPageRequest()); | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(req.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(req.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} |
@@ -16,7 +16,7 @@ import cn.com.taiji.invw.dto.obu.*; | |||
*/ | |||
public interface InvwObuDetailsManager { | |||
Pagination page(InvwObuDetailsPageRequestDTO dto) throws ServiceHandleException; | |||
Pagination page(InvwObuDetailsPageRequestDTO dto) throws ManagerException; | |||
InvwObuDetailsRemoveResponseDTO remove(InvwObuDetailsRemoveRequestDTO dto) throws ManagerException; | |||
@@ -59,12 +59,12 @@ public class InvwObuDetailsManagerImpl extends AbstractInvwManager implements In | |||
@Override | |||
public Pagination page(InvwObuDetailsPageRequestDTO dto) throws ServiceHandleException { | |||
public Pagination page(InvwObuDetailsPageRequestDTO dto) throws ManagerException { | |||
InvwObuDetailsPageRequest pageRequest = copyProperties(dto, new InvwObuDetailsPageRequest()); | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(staff.getAgencyId())){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} | |||
@@ -147,7 +147,7 @@ public class InvwObuDetailsManagerImpl extends AbstractInvwManager implements In | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(dto.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} |
@@ -54,7 +54,7 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
// 如果不是管理员,已及非黔通的只能查询本渠道的仓库 | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
req.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(staff.getAgencyId())){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
req.setAgencyId(null); | |||
} | |||
} |
@@ -35,13 +35,13 @@ public class IssueOrderRefundController extends MyValidController { | |||
@ApiOperation(value = "退费分页查询") | |||
@PostMapping("/page") | |||
public ApiResponse<Pagination> page(@Valid @RequestBody IssueOrderRefundPageRequestDTO dto) throws ServiceHandleException { | |||
public ApiResponse<Pagination> page(@Valid @RequestBody IssueOrderRefundPageRequestDTO dto) throws ManagerException { | |||
return ApiResponse.of(manager.page(dto)); | |||
} | |||
@ApiOperation(value = "退费确认管理-查看") | |||
@PostMapping("/view") | |||
public ApiResponse<IssueOrderRefundViewResponseDTO> view(@Valid @RequestBody IssueOrderRefundViewRequestDTO dto) throws ServiceHandleException { | |||
public ApiResponse<IssueOrderRefundViewResponseDTO> view(@Valid @RequestBody IssueOrderRefundViewRequestDTO dto) throws ManagerException { | |||
return ApiResponse.of(manager.view(dto)); | |||
} | |||
@@ -35,7 +35,7 @@ public abstract class AbstractManagewManager extends AbstractCommManager { | |||
@Autowired | |||
protected IssueOrderinfoRepo issueOrderinfoRepo; | |||
protected Boolean isManager(String identityType, String agencyId) throws ManagerException { | |||
protected Boolean isManager(String identityType, String agencyId) { | |||
if ("MANAGER".equals(identityType) || MyFinals.QTZL_AGENCY_ID.equals(agencyId)){ | |||
return true; | |||
} |
@@ -44,7 +44,7 @@ public class AssOrderinfoManagerImpl extends AbstractManagewManager implements A | |||
throw new ManagerException("为获取到当前员工账号!"); | |||
} | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(staff.getAgencyId())){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
return repo.page(pageRequest).convertResult(this::toModel); |
@@ -61,7 +61,7 @@ public class AssRefundApplyInfoManagerImpl extends AbstractManagewManager implem | |||
throw new ManagerException("为获取到当前员工账号!"); | |||
} | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(staff.getAgencyId())){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
return refundApplyInfoRepo.page(pageRequest); |
@@ -14,7 +14,7 @@ import cn.com.taiji.managew.dto.issueOrder.*; | |||
*/ | |||
public interface IssueOrderRefundManager { | |||
Pagination page(IssueOrderRefundPageRequestDTO dto) throws ServiceHandleException; | |||
Pagination page(IssueOrderRefundPageRequestDTO dto) throws ManagerException; | |||
IssueOrderRefundViewResponseDTO view(IssueOrderRefundViewRequestDTO dto); | |||
@@ -48,13 +48,13 @@ public class IssueOrderRefundManagerImpl extends AbstractManagewManager implemen | |||
@Override | |||
public Pagination page(IssueOrderRefundPageRequestDTO dto) throws ServiceHandleException { | |||
public Pagination page(IssueOrderRefundPageRequestDTO dto) throws ManagerException { | |||
IssueOrderRefundPageRequest pageRequest = copyProperties(dto, new IssueOrderRefundPageRequest()); | |||
pageRequest.setSettlew(false); | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(dto.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} | |||
@@ -104,7 +104,7 @@ public class IssueOrderRefundManagerImpl extends AbstractManagewManager implemen | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(dto.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} |
@@ -16,7 +16,7 @@ import cn.com.taiji.managew.dto.operation.satisfactiono.SatisfactionPageRequestD | |||
*/ | |||
public interface SatisfactionManager { | |||
Pagination page(SatisfactionPageRequestDTO dto) throws ServiceHandleException; | |||
Pagination page(SatisfactionPageRequestDTO dto) throws ManagerException; | |||
SatisfactionInfoResponseDTO view(SatisfactionInfoRequestDTO dto) throws ManagerException; | |||
} |
@@ -13,7 +13,9 @@ import cn.com.taiji.managew.dto.operation.satisfactiono.SatisfactionInfoRequestD | |||
import cn.com.taiji.managew.dto.operation.satisfactiono.SatisfactionInfoResponseDTO; | |||
import cn.com.taiji.managew.dto.operation.satisfactiono.SatisfactionPageRequestDTO; | |||
import cn.com.taiji.managew.manager.AbstractCommManager; | |||
import cn.com.taiji.managew.manager.AbstractManagewManager; | |||
import cn.com.taiji.managew.model.MyFinals; | |||
import org.apache.catalina.Manager; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -25,7 +27,7 @@ import org.springframework.stereotype.Service; | |||
* @version: 1.0 | |||
*/ | |||
@Service | |||
public class SatisfactionManagerImpl extends AbstractCommManager implements SatisfactionManager { | |||
public class SatisfactionManagerImpl extends AbstractManagewManager implements SatisfactionManager { | |||
@Autowired | |||
private SatisfactionRepo repo; | |||
@@ -33,14 +35,14 @@ public class SatisfactionManagerImpl extends AbstractCommManager implements Sati | |||
private StaffRepo staffRepo; | |||
@Override | |||
public Pagination page(SatisfactionPageRequestDTO dto) throws ServiceHandleException { | |||
public Pagination page(SatisfactionPageRequestDTO dto) throws ManagerException { | |||
SatisfactionPageRequest pageRequest = new SatisfactionPageRequest(); | |||
BeanTools.copyProperties(dto, pageRequest); | |||
// 判断入口路径,微信端只查自己的openId | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (staff != null){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(dto.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} |
@@ -1,5 +1,6 @@ | |||
package cn.com.taiji.settlew.manager; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.pub.IPTools; | |||
import cn.com.taiji.common.pub.TimeTools; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
@@ -8,6 +9,7 @@ import cn.com.taiji.core.entity.log.OperateLog; | |||
import cn.com.taiji.core.entity.user.AccountInfo; | |||
import cn.com.taiji.core.repo.jpa.log.OperateLogRepo; | |||
import cn.com.taiji.core.repo.jpa.user.AccountInfoRepo; | |||
import cn.com.taiji.settlew.model.MyFinals; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.context.request.RequestContextHolder; | |||
import org.springframework.web.context.request.ServletRequestAttributes; | |||
@@ -27,6 +29,13 @@ public abstract class AbstractSettlewManager extends AbstractCommManager{ | |||
@Autowired | |||
private AccountInfoRepo accountInfoRepo; | |||
protected Boolean isManager(String identityType, String agencyId){ | |||
if ("MANAGER".equals(identityType) || MyFinals.QTZL_AGENCY_ID.equals(agencyId)){ | |||
return true; | |||
} | |||
return false; | |||
} | |||
// 操作日志记录 | |||
protected void persistOperateLog(OperateType operateType, String operatorDataId, SourceType source, | |||
String openId, String msg) { |
@@ -59,7 +59,7 @@ public class IssueOrderRefundManagerImpl extends AbstractSettlewManager implemen | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(dto.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} | |||
@@ -119,7 +119,7 @@ public class IssueOrderRefundManagerImpl extends AbstractSettlewManager implemen | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType()) || MyFinals.QTZL_AGENCY_ID.equals(findAgencyIdByToken(dto.getAccessToken()))){ | |||
if (isManager(staff.getIdentityType(), staff.getAgencyId())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} |