Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.LicenseListRequest;
|
||||
import com.cool.store.request.SubmitLicenseRequest;
|
||||
import com.cool.store.response.LicenseListResponse;
|
||||
import com.cool.store.response.SubmitLicenseResponse;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
public interface ApplyLicenseService {
|
||||
Boolean submitLicense(SubmitLicenseRequest request);
|
||||
|
||||
SubmitLicenseResponse getDefault(Long shopId);
|
||||
|
||||
PageInfo<LicenseListResponse> licenseList(LicenseListRequest request);
|
||||
}
|
||||
@@ -122,6 +122,9 @@ public class AliyunServiceImpl implements AliyunService {
|
||||
if (Objects.nonNull(result)){
|
||||
String address = result.address;
|
||||
String registerNumber = result.registerNumber;
|
||||
String legalPerson = result.legalPerson;//法人
|
||||
String validPeriod = result.validPeriod;//有效期
|
||||
String establishDate = result.establishDate;
|
||||
BusinessLicenseInfoVO response = new BusinessLicenseInfoVO(registerNumber,address);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.RegionDao;
|
||||
import com.cool.store.entity.LicenseTransactDO;
|
||||
import com.cool.store.entity.ShopAuditInfoDO;
|
||||
import com.cool.store.enums.AuditTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ApplyLicenseMapper;
|
||||
import com.cool.store.mapper.ShopAuditInfoMapper;
|
||||
import com.cool.store.request.LicenseListRequest;
|
||||
import com.cool.store.request.SubmitLicenseRequest;
|
||||
import com.cool.store.response.LicenseListResponse;
|
||||
import com.cool.store.response.SubmitLicenseResponse;
|
||||
import com.cool.store.service.ApplyLicenseService;
|
||||
import com.cool.store.service.RegionService;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
|
||||
@Resource
|
||||
ApplyLicenseMapper applyLicenseMapper;
|
||||
|
||||
@Resource
|
||||
ShopAuditInfoMapper shopAuditInfoMapper;
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserDAO userDAO;
|
||||
|
||||
@Resource
|
||||
private RegionService regionService;
|
||||
|
||||
@Resource
|
||||
private RegionDao regionDao;
|
||||
|
||||
@Override
|
||||
public Boolean submitLicense(SubmitLicenseRequest request) {
|
||||
log.info("submitLicense request:{}", JSONObject.toJSONString(request));
|
||||
if (Objects.isNull(request)){
|
||||
return false;
|
||||
}
|
||||
LicenseTransactDO licenseTransactDO = request.toLicenseTransactDO();
|
||||
if (request.getId() == null){
|
||||
applyLicenseMapper.insertSelective(licenseTransactDO);
|
||||
}else {
|
||||
licenseTransactDO.setId(request.getId());
|
||||
applyLicenseMapper.updateByPrimaryKeySelective(licenseTransactDO);
|
||||
}
|
||||
if (request.getSubmitStatus() == Constants.ONE_INTEGER){
|
||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||
shopAuditInfoDO.setShopId(request.getShopId());
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.LICENSE_APPROVAL.getCode());
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
|
||||
shopAuditInfoDO.setSubmittedUserName(user.getName());
|
||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SubmitLicenseResponse getDefault(Long shopId) {
|
||||
LicenseTransactDO licenseTransactDO = new LicenseTransactDO();
|
||||
licenseTransactDO.setShopId(shopId);
|
||||
LicenseTransactDO result = applyLicenseMapper.selectOne(licenseTransactDO);
|
||||
if (Objects.isNull(result)){
|
||||
throw new ServiceException(ErrorCodeEnum.LICENSE_NOT_EXIST);
|
||||
}
|
||||
SubmitLicenseResponse submitLicenseResponse = SubmitLicenseResponse.from(result);
|
||||
return submitLicenseResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<LicenseListResponse> licenseList(LicenseListRequest request) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<LicenseListResponse> licenseListResponses = applyLicenseMapper.licenseList(request);
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
for (LicenseListResponse vo : licenseListResponses) {
|
||||
userIdList.add(vo.getSupervisorUserId());
|
||||
userIdList.add(vo.getShopManagerUserId());
|
||||
userIdList.add(vo.getInvestmentManager());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(userIdList)) {
|
||||
Map<String, String> userNameMap = userDAO.getUserNameMap(userIdList);
|
||||
for (LicenseListResponse vo : licenseListResponses) {
|
||||
vo.setSupervisorUserName(userNameMap.get(vo.getSupervisorUserId()));
|
||||
vo.setShopManagerUserName(userNameMap.get(vo.getShopManagerUserId()));
|
||||
vo.setInvestmentManagerName(userNameMap.get(vo.getInvestmentManager()));
|
||||
if (vo.getFightRegionId() != null) {
|
||||
Long bigRegionIdByAreaId = regionService.getBigRegionIdByAreaId(vo.getFightRegionId());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, vo.getFightRegionId()));
|
||||
vo.setFightRegionId(vo.getFightRegionId());
|
||||
vo.setFightRegion(regionNameMap.get(vo.getFightRegionId()));
|
||||
vo.setBigRegionId(bigRegionIdByAreaId);
|
||||
vo.setBigRegion(regionNameMap.get(bigRegionIdByAreaId));
|
||||
}
|
||||
}
|
||||
}
|
||||
return new PageInfo<>(licenseListResponses);
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class PointServiceImpl implements PointService {
|
||||
@Resource
|
||||
private ShopRentInfoDAO shopRentInfoDAO;
|
||||
@Resource
|
||||
private LineAuditInfoDAO lineAuditInfoDAO;
|
||||
private ShopAuditInfoDAO shopAuditInfoDAO;
|
||||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
@Value("${mybatis.configuration.variables.enterpriseId}")
|
||||
@@ -824,7 +824,7 @@ public class PointServiceImpl implements PointService {
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus());
|
||||
if(Objects.nonNull(shopSubStageInfo.getAuditId()) && isAudit){
|
||||
//当前是审核过的状态才获取原因
|
||||
LineAuditInfoDO auditInfo = lineAuditInfoDAO.getAuditInfo(shopSubStageInfo.getAuditId());
|
||||
ShopAuditInfoDO auditInfo = shopAuditInfoDAO.getAuditInfo(shopSubStageInfo.getAuditId());
|
||||
result.setAuditInfo(AuditInfoVO.convertVO(auditInfo));
|
||||
}
|
||||
return result;
|
||||
@@ -840,7 +840,7 @@ public class PointServiceImpl implements PointService {
|
||||
if(!ShopStageEnum.SHOP_STAGE_1.getShopStage().equals(shopInfo.getShopStage())){
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
||||
}
|
||||
Long auditId = lineAuditInfoDAO.addAuditInfo(AuditRentContractRequest.convert(request, shopInfo.getPartnerId(), shopInfo.getLineId()));
|
||||
Long auditId = shopAuditInfoDAO.addAuditInfo(AuditRentContractRequest.convert(request, AuditTypeEnum.UPLOAD_RENT_CONTRACT));
|
||||
ShopSubStageStatusEnum subStageStatus = AuditResultTypeEnum.PASS.getCode().equals(request.getResultType()) ? ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23 : ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22;
|
||||
if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23.equals(subStageStatus)){
|
||||
//审核通过铺位变为已签约
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.point.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ShopAuditInfoMapper;
|
||||
import com.cool.store.request.AddShopRequest;
|
||||
import com.cool.store.request.DeleteShopRequest;
|
||||
import com.cool.store.service.ShopService;
|
||||
@@ -39,7 +40,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
@Resource
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Resource
|
||||
private LineAuditInfoDAO lineAuditInfoDAO;
|
||||
private ShopAuditInfoDAO shopAuditInfoDAO;
|
||||
@Resource
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
@Resource
|
||||
@@ -83,8 +84,8 @@ public class ShopServiceImpl implements ShopService {
|
||||
}
|
||||
}
|
||||
List<ShopStageInfoDO> shopStageInfo = shopStageInfoDAO.getShopStageInfo(shopId, shopStage);
|
||||
List<Long> auditIds = shopStageInfo.stream().map(ShopStageInfoDO::getAuditId).collect(Collectors.toList());
|
||||
List<LineAuditInfoDO> auditList = lineAuditInfoDAO.getLineAuditInfoList(auditIds);
|
||||
List<Long> auditIds = shopStageInfo.stream().filter(o->Objects.nonNull(o.getAuditId())).map(ShopStageInfoDO::getAuditId).distinct().collect(Collectors.toList());
|
||||
List<ShopAuditInfoDO> auditList = shopAuditInfoDAO.getAuditInfoList(auditIds);
|
||||
return ShopStageInfoVO.convertList(shopStageInfo, auditList);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user