|
|
@@ -1,400 +0,0 @@
|
|
|
-package com.ylx.massage.service.impl;
|
|
|
-
|
|
|
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
|
|
-import com.ylx.common.core.domain.model.LoginUser;
|
|
|
-import com.ylx.massage.domain.MaTechnician;
|
|
|
-import com.ylx.massage.domain.MerchantApplyFile;
|
|
|
-import com.ylx.massage.domain.dto.MerchantProfileAuditDTO;
|
|
|
-import com.ylx.massage.domain.dto.MerchantApplyFileDto;
|
|
|
-import com.ylx.massage.domain.dto.MerchantApplyFileRequestDto;
|
|
|
-import com.ylx.massage.domain.vo.MaTechnicianCertificateVO;
|
|
|
-import com.ylx.massage.domain.vo.MerchantProfileVO;
|
|
|
-import com.ylx.massage.mapper.MaTechnicianMapper;
|
|
|
-import com.ylx.massage.mapper.MerchantApplyFileMapper;
|
|
|
-import org.apache.ibatis.builder.MapperBuilderAssistant;
|
|
|
-import org.apache.ibatis.session.Configuration;
|
|
|
-import org.junit.jupiter.api.Test;
|
|
|
-import org.mockito.ArgumentCaptor;
|
|
|
-import org.springframework.test.util.ReflectionTestUtils;
|
|
|
-
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.time.LocalDate;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
-import static org.junit.jupiter.api.Assertions.assertIterableEquals;
|
|
|
-import static org.junit.jupiter.api.Assertions.assertNull;
|
|
|
-import static org.junit.jupiter.api.Assertions.assertThrows;
|
|
|
-import static org.mockito.ArgumentMatchers.any;
|
|
|
-import static org.mockito.ArgumentMatchers.isNull;
|
|
|
-import static org.mockito.Mockito.mock;
|
|
|
-import static org.mockito.Mockito.never;
|
|
|
-import static org.mockito.Mockito.times;
|
|
|
-import static org.mockito.Mockito.verify;
|
|
|
-import static org.mockito.Mockito.when;
|
|
|
-
|
|
|
-public class MaTechnicianServiceImplTest {
|
|
|
-
|
|
|
- @Test
|
|
|
- public void updateTechnicianAcceptsGroupedApplyFiles() {
|
|
|
- initTableInfo(MaTechnician.class);
|
|
|
- initTableInfo(MerchantApplyFile.class);
|
|
|
-
|
|
|
- MaTechnicianMapper technicianMapper = mock(MaTechnicianMapper.class);
|
|
|
- MerchantApplyFileMapper applyFileMapper = mock(MerchantApplyFileMapper.class);
|
|
|
- when(technicianMapper.update(isNull(), any(Wrapper.class))).thenReturn(1);
|
|
|
- when(applyFileMapper.delete(any(Wrapper.class))).thenReturn(1);
|
|
|
- when(technicianMapper.selectById(11)).thenReturn(buildMerchant(11));
|
|
|
- when(applyFileMapper.selectCount(any(Wrapper.class))).thenReturn(0L);
|
|
|
-
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- ReflectionTestUtils.setField(service, "maTechnicianMapper", technicianMapper);
|
|
|
- ReflectionTestUtils.setField(service, "merchantApplyFileMapper", applyFileMapper);
|
|
|
-
|
|
|
- MerchantApplyFileRequestDto request = new MerchantApplyFileRequestDto();
|
|
|
- MaTechnician technician = new MaTechnician();
|
|
|
- technician.setId(11);
|
|
|
- technician.setTeNickName("Ctrlv");
|
|
|
- technician.setTeBrief("飞洒范德萨");
|
|
|
- request.setTechnician(technician);
|
|
|
-
|
|
|
- MerchantApplyFileDto group = new MerchantApplyFileDto();
|
|
|
- group.setFileType("1");
|
|
|
- MerchantApplyFileDto file = new MerchantApplyFileDto();
|
|
|
- file.setFileName("形象照");
|
|
|
- file.setFileUrl("http://192.168.1.190:8087/profile/upload/2026/06/22/1782124578606_20260622183619A003.jpeg");
|
|
|
- file.setContentType("jpeg");
|
|
|
- file.setFileSize(new BigDecimal("54.45"));
|
|
|
- group.setFiles(Collections.singletonList(file));
|
|
|
- request.setReq(Collections.singletonList(group));
|
|
|
-
|
|
|
- service.updateTechnician(request);
|
|
|
-
|
|
|
- ArgumentCaptor<MerchantApplyFile> fileCaptor = ArgumentCaptor.forClass(MerchantApplyFile.class);
|
|
|
- verify(applyFileMapper).insert(fileCaptor.capture());
|
|
|
- MerchantApplyFile savedFile = fileCaptor.getValue();
|
|
|
- assertEquals(11, savedFile.getMerchantId());
|
|
|
- assertEquals("1", savedFile.getFileType());
|
|
|
- assertEquals("形象照", savedFile.getFileName());
|
|
|
- assertEquals(file.getFileUrl(), savedFile.getFileUrl());
|
|
|
- assertEquals(0, savedFile.getAuditStatus());
|
|
|
- assertNull(savedFile.getId());
|
|
|
- verify(applyFileMapper, never()).delete(any(Wrapper.class));
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void updateTechnicianReplacesMultipleFilesOfSameType() {
|
|
|
- initTableInfo(MaTechnician.class);
|
|
|
- initTableInfo(MerchantApplyFile.class);
|
|
|
-
|
|
|
- MaTechnicianMapper technicianMapper = mock(MaTechnicianMapper.class);
|
|
|
- MerchantApplyFileMapper applyFileMapper = mock(MerchantApplyFileMapper.class);
|
|
|
- when(technicianMapper.update(isNull(), any(Wrapper.class))).thenReturn(1);
|
|
|
- when(applyFileMapper.delete(any(Wrapper.class))).thenReturn(2);
|
|
|
- when(technicianMapper.selectById(11)).thenReturn(buildMerchant(11));
|
|
|
- when(applyFileMapper.selectCount(any(Wrapper.class))).thenReturn(0L);
|
|
|
-
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- ReflectionTestUtils.setField(service, "maTechnicianMapper", technicianMapper);
|
|
|
- ReflectionTestUtils.setField(service, "merchantApplyFileMapper", applyFileMapper);
|
|
|
-
|
|
|
- MerchantApplyFileRequestDto request = new MerchantApplyFileRequestDto();
|
|
|
- MaTechnician technician = new MaTechnician();
|
|
|
- technician.setId(11);
|
|
|
- technician.setTeNickName("Ctrlv");
|
|
|
- technician.setTeBrief("飞洒范德萨");
|
|
|
- request.setTechnician(technician);
|
|
|
-
|
|
|
- MerchantApplyFileDto group = new MerchantApplyFileDto();
|
|
|
- group.setFileType("2");
|
|
|
- group.setFiles(Arrays.asList(
|
|
|
- buildApplyFile("生活照1", "http://192.168.1.190:8087/profile/upload/2026/06/03/life1.png"),
|
|
|
- buildApplyFile("生活照2", "http://192.168.1.190:8087/profile/upload/2026/06/03/life2.png")
|
|
|
- ));
|
|
|
- request.setReq(Collections.singletonList(group));
|
|
|
-
|
|
|
- service.updateTechnician(request);
|
|
|
-
|
|
|
- verify(applyFileMapper, never()).delete(any(Wrapper.class));
|
|
|
- verify(applyFileMapper, never()).updateById(any(MerchantApplyFile.class));
|
|
|
- ArgumentCaptor<MerchantApplyFile> fileCaptor = ArgumentCaptor.forClass(MerchantApplyFile.class);
|
|
|
- verify(applyFileMapper, times(2)).insert(fileCaptor.capture());
|
|
|
- List<MerchantApplyFile> savedFiles = fileCaptor.getAllValues();
|
|
|
- assertEquals("生活照1", savedFiles.get(0).getFileName());
|
|
|
- assertEquals("生活照2", savedFiles.get(1).getFileName());
|
|
|
- assertEquals("2", savedFiles.get(0).getFileType());
|
|
|
- assertEquals("2", savedFiles.get(1).getFileType());
|
|
|
- assertEquals(11, savedFiles.get(0).getMerchantId());
|
|
|
- assertEquals(11, savedFiles.get(1).getMerchantId());
|
|
|
- assertEquals(0, savedFiles.get(0).getAuditStatus());
|
|
|
- assertEquals(0, savedFiles.get(1).getAuditStatus());
|
|
|
- assertNull(savedFiles.get(0).getId());
|
|
|
- assertNull(savedFiles.get(1).getId());
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void updateTechnicianRejectsWhenSameFileTypeIsPending() {
|
|
|
- initTableInfo(MaTechnician.class);
|
|
|
- initTableInfo(MerchantApplyFile.class);
|
|
|
-
|
|
|
- MaTechnicianMapper technicianMapper = mock(MaTechnicianMapper.class);
|
|
|
- MerchantApplyFileMapper applyFileMapper = mock(MerchantApplyFileMapper.class);
|
|
|
- when(technicianMapper.selectById(11)).thenReturn(buildMerchant(11));
|
|
|
- when(applyFileMapper.selectCount(any(Wrapper.class))).thenReturn(1L);
|
|
|
-
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- ReflectionTestUtils.setField(service, "maTechnicianMapper", technicianMapper);
|
|
|
- ReflectionTestUtils.setField(service, "merchantApplyFileMapper", applyFileMapper);
|
|
|
-
|
|
|
- MerchantApplyFileRequestDto request = buildBaseRequest();
|
|
|
- MerchantApplyFileDto group = new MerchantApplyFileDto();
|
|
|
- group.setFileType("1");
|
|
|
- group.setFiles(Collections.singletonList(buildApplyFile("avatar", "http://host/new.png")));
|
|
|
- request.setReq(Collections.singletonList(group));
|
|
|
-
|
|
|
- assertThrows(RuntimeException.class, () -> service.updateTechnician(request));
|
|
|
-
|
|
|
- verify(applyFileMapper, never()).insert(any(MerchantApplyFile.class));
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void getMerchantProfileHidesApprovedStatusAndShowsPendingStatus() {
|
|
|
- initTableInfo(MaTechnician.class);
|
|
|
- initTableInfo(MerchantApplyFile.class);
|
|
|
-
|
|
|
- MaTechnician merchant = buildMerchant(11);
|
|
|
- merchant.setTeNickName("oldNick");
|
|
|
- merchant.setPendingTeNickName("newNick");
|
|
|
- merchant.setTeNickNameAuditStatus(0);
|
|
|
-
|
|
|
- MaTechnicianMapper technicianMapper = mock(MaTechnicianMapper.class);
|
|
|
- MerchantApplyFileMapper applyFileMapper = mock(MerchantApplyFileMapper.class);
|
|
|
- when(technicianMapper.selectById(11)).thenReturn(merchant);
|
|
|
- when(applyFileMapper.selectList(any(Wrapper.class))).thenReturn(Arrays.asList(
|
|
|
- buildMerchantApplyFile("1", "approved-avatar", 1),
|
|
|
- buildMerchantApplyFile("1", "pending-avatar", 0)
|
|
|
- ));
|
|
|
-
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- ReflectionTestUtils.setField(service, "maTechnicianMapper", technicianMapper);
|
|
|
- ReflectionTestUtils.setField(service, "merchantApplyFileMapper", applyFileMapper);
|
|
|
-
|
|
|
- MerchantProfileVO profile = service.getMerchantProfile(11);
|
|
|
-
|
|
|
- assertEquals("oldNick", profile.getNickName().getValue());
|
|
|
- assertEquals("newNick", profile.getNickName().getPendingValue());
|
|
|
- assertEquals(0, profile.getNickName().getAuditStatus());
|
|
|
- assertNull(profile.getBrief().getAuditStatus());
|
|
|
- assertEquals(1, profile.getFileGroups().get(0).getOfficialFiles().size());
|
|
|
- assertEquals(1, profile.getFileGroups().get(0).getPendingFiles().size());
|
|
|
- assertEquals(0, profile.getFileGroups().get(0).getAuditStatus());
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void auditMerchantProfileApprovesAllPendingProfileData() {
|
|
|
- initTableInfo(MaTechnician.class);
|
|
|
- initTableInfo(MerchantApplyFile.class);
|
|
|
-
|
|
|
- MaTechnician merchant = buildMerchant(11);
|
|
|
- merchant.setPendingTeNickName("newNick");
|
|
|
- merchant.setTeNickNameAuditStatus(0);
|
|
|
- merchant.setPendingTeBrief("newBrief");
|
|
|
- merchant.setTeBriefAuditStatus(0);
|
|
|
-
|
|
|
- MaTechnicianMapper technicianMapper = mock(MaTechnicianMapper.class);
|
|
|
- MerchantApplyFileMapper applyFileMapper = mock(MerchantApplyFileMapper.class);
|
|
|
- when(technicianMapper.selectById(11)).thenReturn(merchant);
|
|
|
- when(technicianMapper.update(isNull(), any(Wrapper.class))).thenReturn(1);
|
|
|
- when(applyFileMapper.selectList(any(Wrapper.class))).thenReturn(Arrays.asList(
|
|
|
- buildMerchantApplyFile("1", "pending-avatar", 0),
|
|
|
- buildMerchantApplyFile("2", "pending-life", 0)
|
|
|
- ));
|
|
|
- when(applyFileMapper.update(isNull(), any(Wrapper.class))).thenReturn(1);
|
|
|
-
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- ReflectionTestUtils.setField(service, "maTechnicianMapper", technicianMapper);
|
|
|
- ReflectionTestUtils.setField(service, "merchantApplyFileMapper", applyFileMapper);
|
|
|
-
|
|
|
- MerchantProfileAuditDTO auditDTO = new MerchantProfileAuditDTO();
|
|
|
- auditDTO.setAuditStatus(2);
|
|
|
- auditDTO.setIdCardExpirationDate(LocalDate.of(2027, 1, 1));
|
|
|
- auditDTO.setHealthCertificateExpirationDate(LocalDate.of(2027, 1, 1));
|
|
|
- auditDTO.setQualificationCertificateExpirationDate(LocalDate.of(2027, 1, 1));
|
|
|
-
|
|
|
- int rows = service.auditMerchantProfile(11, auditDTO, (LoginUser) null);
|
|
|
-
|
|
|
- assertEquals(3, rows);
|
|
|
- verify(technicianMapper, times(1)).update(isNull(), any(Wrapper.class));
|
|
|
- verify(applyFileMapper, times(2)).update(isNull(), any(Wrapper.class));
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void auditMerchantProfileRejectsAllPendingProfileData() {
|
|
|
- initTableInfo(MaTechnician.class);
|
|
|
- initTableInfo(MerchantApplyFile.class);
|
|
|
-
|
|
|
- MaTechnician merchant = buildMerchant(11);
|
|
|
- merchant.setPendingTeNickName("newNick");
|
|
|
- merchant.setTeNickNameAuditStatus(0);
|
|
|
-
|
|
|
- MaTechnicianMapper technicianMapper = mock(MaTechnicianMapper.class);
|
|
|
- MerchantApplyFileMapper applyFileMapper = mock(MerchantApplyFileMapper.class);
|
|
|
- when(technicianMapper.selectById(11)).thenReturn(merchant);
|
|
|
- when(technicianMapper.update(isNull(), any(Wrapper.class))).thenReturn(1);
|
|
|
- when(applyFileMapper.selectList(any(Wrapper.class))).thenReturn(Collections.singletonList(
|
|
|
- buildMerchantApplyFile("1", "pending-avatar", 0)
|
|
|
- ));
|
|
|
- when(applyFileMapper.update(isNull(), any(Wrapper.class))).thenReturn(1);
|
|
|
-
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- ReflectionTestUtils.setField(service, "maTechnicianMapper", technicianMapper);
|
|
|
- ReflectionTestUtils.setField(service, "merchantApplyFileMapper", applyFileMapper);
|
|
|
-
|
|
|
- MerchantProfileAuditDTO auditDTO = new MerchantProfileAuditDTO();
|
|
|
- auditDTO.setAuditStatus(3);
|
|
|
- auditDTO.setAuditRemark("bad");
|
|
|
-
|
|
|
- int rows = service.auditMerchantProfile(11, auditDTO, (LoginUser) null);
|
|
|
-
|
|
|
- assertEquals(2, rows);
|
|
|
- verify(technicianMapper, times(1)).update(isNull(), any(Wrapper.class));
|
|
|
- verify(applyFileMapper, times(1)).update(isNull(), any(Wrapper.class));
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void updateTechnicianRejectsBlankNickName() {
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- MerchantApplyFileRequestDto request = buildBaseRequest();
|
|
|
- request.getTechnician().setTeNickName(" ");
|
|
|
-
|
|
|
- RuntimeException exception = assertThrows(RuntimeException.class, () -> service.updateTechnician(request));
|
|
|
-
|
|
|
- assertEquals("昵称不能为空", exception.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void updateTechnicianRejectsBlankBrief() {
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- MerchantApplyFileRequestDto request = buildBaseRequest();
|
|
|
- request.getTechnician().setTeBrief(" ");
|
|
|
-
|
|
|
- RuntimeException exception = assertThrows(RuntimeException.class, () -> service.updateTechnician(request));
|
|
|
-
|
|
|
- assertEquals("简介不能为空", exception.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void updateTechnicianRejectsEmptyFileGroup() {
|
|
|
- initTableInfo(MaTechnician.class);
|
|
|
-
|
|
|
- MaTechnicianMapper technicianMapper = mock(MaTechnicianMapper.class);
|
|
|
- when(technicianMapper.update(isNull(), any(Wrapper.class))).thenReturn(1);
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- ReflectionTestUtils.setField(service, "maTechnicianMapper", technicianMapper);
|
|
|
-
|
|
|
- MerchantApplyFileRequestDto request = buildBaseRequest();
|
|
|
- MerchantApplyFileDto group = new MerchantApplyFileDto();
|
|
|
- group.setFileType("2");
|
|
|
- group.setFiles(Collections.emptyList());
|
|
|
- request.setReq(Collections.singletonList(group));
|
|
|
-
|
|
|
- RuntimeException exception = assertThrows(RuntimeException.class, () -> service.updateTechnician(request));
|
|
|
-
|
|
|
- assertEquals("文件列表不能为空", exception.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void selectMerchantCertificateReturnsEveryFileFieldAsList() {
|
|
|
- initTableInfo(MerchantApplyFile.class);
|
|
|
-
|
|
|
- MerchantApplyFileMapper applyFileMapper = mock(MerchantApplyFileMapper.class);
|
|
|
- when(applyFileMapper.selectList(any(Wrapper.class))).thenReturn(Arrays.asList(
|
|
|
- buildMerchantApplyFile("1", "avatar-1"),
|
|
|
- buildMerchantApplyFile("1", "avatar-2"),
|
|
|
- buildMerchantApplyFile("2", "life-1"),
|
|
|
- buildMerchantApplyFile("2", "life-2"),
|
|
|
- buildMerchantApplyFile("3", "promotion-1"),
|
|
|
- buildMerchantApplyFile("4", "front-1"),
|
|
|
- buildMerchantApplyFile("5", "back-1"),
|
|
|
- buildMerchantApplyFile("6", "handheld-1"),
|
|
|
- buildMerchantApplyFile("7", "health-1"),
|
|
|
- buildMerchantApplyFile("8", "qualification-1"),
|
|
|
- buildMerchantApplyFile("9", "crime-1"),
|
|
|
- buildMerchantApplyFile("10", "commitment-pdf-1"),
|
|
|
- buildMerchantApplyFile("11", "commitment-audio-1"),
|
|
|
- buildMerchantApplyFile("12", "commitment-video-1"),
|
|
|
- buildMerchantApplyFile("12", "commitment-video-2")
|
|
|
- ));
|
|
|
- MaTechnicianServiceImpl service = new MaTechnicianServiceImpl();
|
|
|
- ReflectionTestUtils.setField(service, "merchantApplyFileMapper", applyFileMapper);
|
|
|
-
|
|
|
- MaTechnicianCertificateVO certificate = service.selectMerchantCertificate(11);
|
|
|
-
|
|
|
- assertEquals(11, certificate.getMerchantId());
|
|
|
- assertIterableEquals(Arrays.asList("avatar-1", "avatar-2"), certificate.getAvatar());
|
|
|
- assertIterableEquals(Arrays.asList("life-1", "life-2"), certificate.getLifePhotos());
|
|
|
- assertIterableEquals(Collections.singletonList("promotion-1"), certificate.getPromotionVideo());
|
|
|
- assertIterableEquals(Collections.singletonList("front-1"), certificate.getIdCardFrout());
|
|
|
- assertIterableEquals(Collections.singletonList("back-1"), certificate.getIdCardBack());
|
|
|
- assertIterableEquals(Collections.singletonList("handheld-1"), certificate.getIdCardHandheld());
|
|
|
- assertIterableEquals(Collections.singletonList("health-1"), certificate.getHealthCertificate());
|
|
|
- assertIterableEquals(Collections.singletonList("qualification-1"), certificate.getQualificationCertificate());
|
|
|
- assertIterableEquals(Collections.singletonList("crime-1"), certificate.getNoCrimeRecord());
|
|
|
- assertIterableEquals(Collections.singletonList("commitment-pdf-1"), certificate.getCommitmentPdf());
|
|
|
- assertIterableEquals(Collections.singletonList("commitment-audio-1"), certificate.getCommitmentAudio());
|
|
|
- assertIterableEquals(Arrays.asList("commitment-video-1", "commitment-video-2"), certificate.getCommitmentVideo());
|
|
|
- verify(applyFileMapper, times(1)).selectList(any(Wrapper.class));
|
|
|
- }
|
|
|
-
|
|
|
- private MerchantApplyFileRequestDto buildBaseRequest() {
|
|
|
- MerchantApplyFileRequestDto request = new MerchantApplyFileRequestDto();
|
|
|
- MaTechnician technician = new MaTechnician();
|
|
|
- technician.setId(11);
|
|
|
- technician.setTeNickName("Ctrlv");
|
|
|
- technician.setTeBrief("飞洒范德萨");
|
|
|
- request.setTechnician(technician);
|
|
|
- return request;
|
|
|
- }
|
|
|
-
|
|
|
- private MerchantApplyFileDto buildApplyFile(String fileName, String fileUrl) {
|
|
|
- MerchantApplyFileDto file = new MerchantApplyFileDto();
|
|
|
- file.setFileName(fileName);
|
|
|
- file.setFileUrl(fileUrl);
|
|
|
- file.setContentType("image/png");
|
|
|
- file.setFileSize(new BigDecimal("0.73"));
|
|
|
- return file;
|
|
|
- }
|
|
|
-
|
|
|
- private MerchantApplyFile buildMerchantApplyFile(String fileType, String fileUrl) {
|
|
|
- MerchantApplyFile file = new MerchantApplyFile();
|
|
|
- file.setMerchantId(11);
|
|
|
- file.setFileType(fileType);
|
|
|
- file.setFileUrl(fileUrl);
|
|
|
- return file;
|
|
|
- }
|
|
|
-
|
|
|
- private MerchantApplyFile buildMerchantApplyFile(String fileType, String fileUrl, Integer auditStatus) {
|
|
|
- MerchantApplyFile file = buildMerchantApplyFile(fileType, fileUrl);
|
|
|
- file.setAuditStatus(auditStatus);
|
|
|
- return file;
|
|
|
- }
|
|
|
-
|
|
|
- private MaTechnician buildMerchant(Integer merchantId) {
|
|
|
- MaTechnician merchant = new MaTechnician();
|
|
|
- merchant.setId(merchantId);
|
|
|
- merchant.setIsDelete(0);
|
|
|
- merchant.setTeNickName("Ctrlv");
|
|
|
- merchant.setTeBrief("brief");
|
|
|
- return merchant;
|
|
|
- }
|
|
|
-
|
|
|
- private void initTableInfo(Class<?> entityClass) {
|
|
|
- if (TableInfoHelper.getTableInfo(entityClass) == null) {
|
|
|
- MapperBuilderAssistant assistant = new MapperBuilderAssistant(new Configuration(), "");
|
|
|
- TableInfoHelper.initTableInfo(assistant, entityClass);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|