|
@@ -17,11 +17,13 @@ import com.ylx.massage.domain.MaProject;
|
|
|
import com.ylx.massage.domain.MaTeProject;
|
|
import com.ylx.massage.domain.MaTeProject;
|
|
|
import com.ylx.massage.domain.dto.MaProjectSaveDto;
|
|
import com.ylx.massage.domain.dto.MaProjectSaveDto;
|
|
|
import com.ylx.massage.domain.dto.MaTechnicianAuditQueryDTO;
|
|
import com.ylx.massage.domain.dto.MaTechnicianAuditQueryDTO;
|
|
|
|
|
+import com.ylx.massage.domain.dto.MaTechnicianAuditSubmitDTO;
|
|
|
import com.ylx.massage.domain.dto.MaTechnicianMerchantAddDTO;
|
|
import com.ylx.massage.domain.dto.MaTechnicianMerchantAddDTO;
|
|
|
import com.ylx.massage.domain.dto.MaTechnicianMerchantQueryDTO;
|
|
import com.ylx.massage.domain.dto.MaTechnicianMerchantQueryDTO;
|
|
|
import com.ylx.massage.domain.dto.MassageMerchantRecommendDto;
|
|
import com.ylx.massage.domain.dto.MassageMerchantRecommendDto;
|
|
|
import com.ylx.massage.domain.vo.MaTechnicianAppAddVo;
|
|
import com.ylx.massage.domain.vo.MaTechnicianAppAddVo;
|
|
|
import com.ylx.massage.domain.vo.MaTechnicianAuditListVO;
|
|
import com.ylx.massage.domain.vo.MaTechnicianAuditListVO;
|
|
|
|
|
+import com.ylx.massage.domain.vo.MaTechnicianCertificateVO;
|
|
|
import com.ylx.massage.domain.vo.MaTechnicianMerchantDetailVO;
|
|
import com.ylx.massage.domain.vo.MaTechnicianMerchantDetailVO;
|
|
|
import com.ylx.massage.domain.vo.MaTechnicianMerchantListVO;
|
|
import com.ylx.massage.domain.vo.MaTechnicianMerchantListVO;
|
|
|
import com.ylx.massage.domain.vo.MerchantVo;
|
|
import com.ylx.massage.domain.vo.MerchantVo;
|
|
@@ -54,6 +56,10 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
private static final int ENABLED = 1;
|
|
private static final int ENABLED = 1;
|
|
|
private static final int DEFAULT_AGE = 18;
|
|
private static final int DEFAULT_AGE = 18;
|
|
|
private static final int AUDIT_APPROVED = 2;
|
|
private static final int AUDIT_APPROVED = 2;
|
|
|
|
|
+ private static final int AUDIT_WAIT_ENTER = 0;
|
|
|
|
|
+ private static final int AUDIT_WAIT_REVIEW = 1;
|
|
|
|
|
+ private static final int AUDIT_REJECTED = 3;
|
|
|
|
|
+ private static final int AUDIT_REMARK_MAX_LENGTH = 500;
|
|
|
private static final int NS_STATUS_NOT_ON_DUTY = -1;
|
|
private static final int NS_STATUS_NOT_ON_DUTY = -1;
|
|
|
private static final int DEFAULT_STAT_VALUE = 0;
|
|
private static final int DEFAULT_STAT_VALUE = 0;
|
|
|
private static final Integer NOT_DELETED = 0;
|
|
private static final Integer NOT_DELETED = 0;
|
|
@@ -272,11 +278,11 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public int updateMerchant(Long id, MaTechnicianMerchantAddDTO dto, LoginUser loginUser) {
|
|
|
|
|
|
|
+ public int updateMerchant(Integer id, MaTechnicianMerchantAddDTO dto, LoginUser loginUser) {
|
|
|
if (id == null) {
|
|
if (id == null) {
|
|
|
throw new ServiceException("商户ID不能为空");
|
|
throw new ServiceException("商户ID不能为空");
|
|
|
}
|
|
}
|
|
|
- MaTechnician existsMerchant = maTechnicianMapper.selectMerchantById(id.intValue());
|
|
|
|
|
|
|
+ MaTechnician existsMerchant = maTechnicianMapper.selectMerchantById(id);
|
|
|
if (existsMerchant == null || !NOT_DELETED.equals(existsMerchant.getIsDelete())) {
|
|
if (existsMerchant == null || !NOT_DELETED.equals(existsMerchant.getIsDelete())) {
|
|
|
throw new ServiceException("商户不存在或已删除");
|
|
throw new ServiceException("商户不存在或已删除");
|
|
|
}
|
|
}
|
|
@@ -358,14 +364,14 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
* @param technicianId 商户ID
|
|
* @param technicianId 商户ID
|
|
|
* @param projectIds 服务项目ID集合
|
|
* @param projectIds 服务项目ID集合
|
|
|
*/
|
|
*/
|
|
|
- private void replaceProjectRelations(Long technicianId, Set<Long> projectIds) {
|
|
|
|
|
|
|
+ private void replaceProjectRelations(Integer technicianId, Set<Long> projectIds) {
|
|
|
if (technicianId == null) {
|
|
if (technicianId == null) {
|
|
|
throw new ServiceException("商户ID不能为空");
|
|
throw new ServiceException("商户ID不能为空");
|
|
|
}
|
|
}
|
|
|
- maTeProjectMapper.deleteByTechnicianId(technicianId);
|
|
|
|
|
|
|
+ maTeProjectMapper.deleteByTechnicianId(technicianId.longValue());
|
|
|
for (Long projectId : projectIds) {
|
|
for (Long projectId : projectIds) {
|
|
|
MaTeProject relation = new MaTeProject();
|
|
MaTeProject relation = new MaTeProject();
|
|
|
- relation.setTeId(technicianId);
|
|
|
|
|
|
|
+ relation.setTeId(technicianId.longValue());
|
|
|
relation.setProjectId(projectId);
|
|
relation.setProjectId(projectId);
|
|
|
int rows = maTeProjectMapper.insert(relation);
|
|
int rows = maTeProjectMapper.insert(relation);
|
|
|
if (rows <= 0) {
|
|
if (rows <= 0) {
|
|
@@ -390,6 +396,59 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
return maTechnicianMapper.selectMerchantAuditList(pageParam, dto);
|
|
return maTechnicianMapper.selectMerchantAuditList(pageParam, dto);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商户入驻审核。
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id 商户ID
|
|
|
|
|
+ * @param dto 审核提交参数
|
|
|
|
|
+ * @param loginUser 当前登录用户
|
|
|
|
|
+ * @return 结果
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public int submitMerchantAudit(Integer id, MaTechnicianAuditSubmitDTO dto, LoginUser loginUser) {
|
|
|
|
|
+ if (id == null) {
|
|
|
|
|
+ throw new ServiceException("商户ID不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dto == null) {
|
|
|
|
|
+ throw new ServiceException("审核参数不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ checkEnumValue(dto.getAuditStatus(), "审核意见", AUDIT_APPROVED, AUDIT_REJECTED);
|
|
|
|
|
+ String auditRemark = dto.getAuditRemark() == null ? "" : dto.getAuditRemark().trim();
|
|
|
|
|
+ if (dto.getAuditStatus() == AUDIT_REJECTED && StringUtils.isBlank(auditRemark)) {
|
|
|
|
|
+ throw new ServiceException("审核驳回时审核备注不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (auditRemark.length() > AUDIT_REMARK_MAX_LENGTH) {
|
|
|
|
|
+ throw new ServiceException("审核备注长度不能超过" + AUDIT_REMARK_MAX_LENGTH + "个字符");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MaTechnician existsMerchant = maTechnicianMapper.selectMerchantById(id);
|
|
|
|
|
+ if (existsMerchant == null || !NOT_DELETED.equals(existsMerchant.getIsDelete())) {
|
|
|
|
|
+ throw new ServiceException("商户不存在或已删除");
|
|
|
|
|
+ }
|
|
|
|
|
+ Integer currentAuditStatus = existsMerchant.getAuditStatus();
|
|
|
|
|
+ if (currentAuditStatus == null || (currentAuditStatus != AUDIT_WAIT_ENTER)) {
|
|
|
|
|
+ throw new ServiceException("当前商户状态不能审核");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MaTechnician maTechnician = new MaTechnician();
|
|
|
|
|
+ maTechnician.setId(id);
|
|
|
|
|
+ // 修改为1:待审核
|
|
|
|
|
+ maTechnician.setAuditStatus(1);
|
|
|
|
|
+ maTechnician.setAuditRemark(auditRemark);
|
|
|
|
|
+ maTechnician.setApproveTime(DateUtils.getNowDate());
|
|
|
|
|
+ if (loginUser != null && loginUser.getUser() != null) {
|
|
|
|
|
+ maTechnician.setUpdateBy(loginUser.getUser().getUserName());
|
|
|
|
|
+ }
|
|
|
|
|
+ maTechnician.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
+
|
|
|
|
|
+ int rows = maTechnicianMapper.submitMerchantAuditById(maTechnician);
|
|
|
|
|
+ if (rows <= 0) {
|
|
|
|
|
+ throw new ServiceException("提交商户审核失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ return rows;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 后台查询商户列表
|
|
* 后台查询商户列表
|
|
|
*
|
|
*
|
|
@@ -422,6 +481,36 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
return detail;
|
|
return detail;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 后台查询商户证照
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id 商户ID
|
|
|
|
|
+ * @return 商户证照
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public MaTechnicianCertificateVO selectMerchantCertificate(Integer id) {
|
|
|
|
|
+ if (id == null) {
|
|
|
|
|
+ throw new ServiceException("商户ID不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ MaTechnician merchant = maTechnicianMapper.selectMerchantCertificateById(id);
|
|
|
|
|
+ if (merchant == null || !NOT_DELETED.equals(merchant.getIsDelete())) {
|
|
|
|
|
+ throw new ServiceException("商户不存在或已删除");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MaTechnicianCertificateVO certificate = new MaTechnicianCertificateVO();
|
|
|
|
|
+ certificate.setMerchantId(merchant.getId());
|
|
|
|
|
+ certificate.setAvatar(merchant.getAvatar());
|
|
|
|
|
+ certificate.setLifePhotos(merchant.getLifePhotos());
|
|
|
|
|
+ certificate.setIdCard(merchant.getIdCard());
|
|
|
|
|
+ certificate.setHealthCertificate(merchant.getHealthCertificate());
|
|
|
|
|
+ certificate.setQualificationCertificate(merchant.getQualificationCertificate());
|
|
|
|
|
+ certificate.setNoCrimeRecord(merchant.getNoCrimeRecord());
|
|
|
|
|
+ certificate.setCommitmentPdf(merchant.getCommitmentPdf());
|
|
|
|
|
+ certificate.setCommitmentVideo(merchant.getCommitmentVideo());
|
|
|
|
|
+ certificate.setCommitmentAudio(merchant.getCommitmentAudio());
|
|
|
|
|
+ return certificate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改技师
|
|
* 修改技师
|
|
|
*
|
|
*
|
|
@@ -612,7 +701,7 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
* @param technicianId
|
|
* @param technicianId
|
|
|
* @param projectIds
|
|
* @param projectIds
|
|
|
*/
|
|
*/
|
|
|
- private void insertProjectRelations(Long technicianId, Set<Long> projectIds) {
|
|
|
|
|
|
|
+ private void insertProjectRelations(Integer technicianId, Set<Long> projectIds) {
|
|
|
if (technicianId == null) {
|
|
if (technicianId == null) {
|
|
|
throw new ServiceException("商户ID不能为空");
|
|
throw new ServiceException("商户ID不能为空");
|
|
|
}
|
|
}
|
|
@@ -620,7 +709,7 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
List<MaTeProject> relations = new ArrayList<>();
|
|
List<MaTeProject> relations = new ArrayList<>();
|
|
|
for (Long projectId : projectIds) {
|
|
for (Long projectId : projectIds) {
|
|
|
MaTeProject relation = new MaTeProject();
|
|
MaTeProject relation = new MaTeProject();
|
|
|
- relation.setTeId(technicianId);
|
|
|
|
|
|
|
+ relation.setTeId(technicianId.longValue());
|
|
|
relation.setProjectId(projectId);
|
|
relation.setProjectId(projectId);
|
|
|
relations.add(relation);
|
|
relations.add(relation);
|
|
|
}
|
|
}
|