证照办理默认值调整为鲜丰获取
This commit is contained in:
@@ -34,4 +34,13 @@ public enum LicenseTypeEnum {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static LicenseTypeEnum matchName(String name) {
|
||||||
|
for (LicenseTypeEnum type : LicenseTypeEnum.values()) {
|
||||||
|
if (type.getMessage().equals(name)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,165 @@
|
|||||||
|
package com.cool.store.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GetStoreInfoByCodeResponse {
|
||||||
|
/**
|
||||||
|
* 返回结果代码
|
||||||
|
* 结果代码
|
||||||
|
*/
|
||||||
|
private Integer code;
|
||||||
|
/**
|
||||||
|
* 返回结果数据
|
||||||
|
* 结果数据
|
||||||
|
*/
|
||||||
|
private InnerData data;
|
||||||
|
/**
|
||||||
|
* 提示信息
|
||||||
|
*/
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class InnerData {
|
||||||
|
/**
|
||||||
|
* 开店状态:0=关店1=开店
|
||||||
|
*/
|
||||||
|
private String closeTime;
|
||||||
|
/**
|
||||||
|
* 加盟商编码
|
||||||
|
*/
|
||||||
|
private String franchiseeId;
|
||||||
|
/**
|
||||||
|
* 开店状态:0=关店1=开店
|
||||||
|
*/
|
||||||
|
private Long hdStatus;
|
||||||
|
/**
|
||||||
|
* 维度
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
/**
|
||||||
|
* 门店开业时间
|
||||||
|
*/
|
||||||
|
private String openDate;
|
||||||
|
/**
|
||||||
|
* 开店状态:0=关店1=开店
|
||||||
|
*/
|
||||||
|
private String openTime;
|
||||||
|
/**
|
||||||
|
* 门店地址
|
||||||
|
*/
|
||||||
|
private String storeAdd;
|
||||||
|
/**
|
||||||
|
* 小区
|
||||||
|
*/
|
||||||
|
private String storeArea;
|
||||||
|
/**
|
||||||
|
* 门店代码
|
||||||
|
*/
|
||||||
|
private String storeCode;
|
||||||
|
/**
|
||||||
|
* 大区
|
||||||
|
*/
|
||||||
|
private String storeCompany;
|
||||||
|
/**
|
||||||
|
* 门店证照信息
|
||||||
|
*/
|
||||||
|
private StoreDocument storeDocument;
|
||||||
|
/**
|
||||||
|
* 战区
|
||||||
|
*/
|
||||||
|
private String storeLarge;
|
||||||
|
/**
|
||||||
|
* 门店名称
|
||||||
|
*/
|
||||||
|
private String storeName;
|
||||||
|
/**
|
||||||
|
* 门店性质
|
||||||
|
*/
|
||||||
|
private String storeType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class StoreDocument {
|
||||||
|
/**
|
||||||
|
* 营业执照经营场所/住所
|
||||||
|
*/
|
||||||
|
private String storeBusinessAdd;
|
||||||
|
/**
|
||||||
|
* 营业执照发证日期
|
||||||
|
*/
|
||||||
|
private String storeBusinessDate;
|
||||||
|
/**
|
||||||
|
* 营业执照图片
|
||||||
|
*/
|
||||||
|
private String storeBusinessImg;
|
||||||
|
/**
|
||||||
|
* 营业执照名称
|
||||||
|
*/
|
||||||
|
private String storeBusinessName;
|
||||||
|
/**
|
||||||
|
* 营业执照统一社会信用代码
|
||||||
|
*/
|
||||||
|
private String storeBusinessNumber;
|
||||||
|
/**
|
||||||
|
* 营业执照类型
|
||||||
|
*/
|
||||||
|
private String storeBusinessType;
|
||||||
|
/**
|
||||||
|
* 营业执照有效期, 非OCR识别,手填。9=长期有效,非长期有效则为具体日期,例:2026-06-01
|
||||||
|
*/
|
||||||
|
private String storeBusinessValidPeriod;
|
||||||
|
/**
|
||||||
|
* 门店代码
|
||||||
|
*/
|
||||||
|
private String storeCode;
|
||||||
|
/**
|
||||||
|
* 营业执照经营者/法人
|
||||||
|
*/
|
||||||
|
private String storeDirector;
|
||||||
|
/**
|
||||||
|
* 食品流通经营许可证编号
|
||||||
|
*/
|
||||||
|
private String storeFoodLicense;
|
||||||
|
/**
|
||||||
|
* 食品流通/经营许可证有效期开始日期
|
||||||
|
*/
|
||||||
|
private String storeFoodLicenseBeginDate;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证经营场所
|
||||||
|
*/
|
||||||
|
private String storeFoodLicenseBusinessAddress;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证经营项目
|
||||||
|
*/
|
||||||
|
private String storeFoodLicenseBusinessScope;
|
||||||
|
/**
|
||||||
|
* 食品流通/经营许可证有效期结束日期
|
||||||
|
*/
|
||||||
|
private String storeFoodLicenseEndDate;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证照片
|
||||||
|
*/
|
||||||
|
private String storeFoodLicenseImg;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证法定代表人(负责人)
|
||||||
|
*/
|
||||||
|
private String storeFoodLicenseLegalRepresentative;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证主体业态
|
||||||
|
*/
|
||||||
|
private String storeFoodLicenseMainBusiness;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证经营者名称
|
||||||
|
*/
|
||||||
|
private String storeFoodLicenseOperatorName;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String storeRemark;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.cool.store.response;
|
package com.cool.store.response;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.cool.store.entity.LicenseTransactDO;
|
import com.cool.store.entity.LicenseTransactDO;
|
||||||
import com.cool.store.entity.ShopAuditInfoDO;
|
import com.cool.store.entity.ShopAuditInfoDO;
|
||||||
|
import com.cool.store.enums.LicenseTypeEnum;
|
||||||
import com.cool.store.vo.ShopAuditInfoVO;
|
import com.cool.store.vo.ShopAuditInfoVO;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@@ -9,6 +11,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("提交证照办理响应体")
|
@ApiModel("提交证照办理响应体")
|
||||||
@@ -89,8 +92,43 @@ public class SubmitLicenseResponse {
|
|||||||
@ApiModelProperty("流程记录")
|
@ApiModelProperty("流程记录")
|
||||||
private List<ShopAuditInfoVO> processRecords;
|
private List<ShopAuditInfoVO> processRecords;
|
||||||
|
|
||||||
|
public static SubmitLicenseResponse from(GetStoreInfoByCodeResponse storeInfoCode){
|
||||||
|
if (Objects.isNull(storeInfoCode)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
GetStoreInfoByCodeResponse.InnerData data = storeInfoCode.getData();
|
||||||
|
GetStoreInfoByCodeResponse.StoreDocument storeDocument = data.getStoreDocument();
|
||||||
|
boolean storeBusinessValidPeriod = storeDocument.getStoreBusinessValidPeriod().equals("9");
|
||||||
|
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();
|
||||||
|
submitLicenseResponse.setId(null);
|
||||||
|
submitLicenseResponse.setShopId(null);
|
||||||
|
submitLicenseResponse.setLicenseType(LicenseTypeEnum.matchName(storeDocument.getStoreBusinessType()).getCode());
|
||||||
|
submitLicenseResponse.setLicenseLegalPerson(storeDocument.getStoreDirector());
|
||||||
|
submitLicenseResponse.setIssueTime(DateUtil.parseTime(storeDocument.getStoreBusinessDate()));
|
||||||
|
submitLicenseResponse.setLicenseAddress(storeDocument.getStoreBusinessAdd());
|
||||||
|
submitLicenseResponse.setValidity(storeBusinessValidPeriod ? null : DateUtil.parseTime(storeDocument.getStoreBusinessValidPeriod()));
|
||||||
|
submitLicenseResponse.setOperator(storeDocument.getStoreDirector());
|
||||||
|
submitLicenseResponse.setFoodLicenseLegalPerson(storeDocument.getStoreFoodLicenseOperatorName());
|
||||||
|
submitLicenseResponse.setMainBusiness(storeDocument.getStoreFoodLicenseMainBusiness());
|
||||||
|
submitLicenseResponse.setBusinessProject(storeDocument.getStoreFoodLicenseBusinessScope());
|
||||||
|
submitLicenseResponse.setRemark(storeDocument.getStoreRemark());
|
||||||
|
submitLicenseResponse.setRemarkUrl(null);
|
||||||
|
submitLicenseResponse.setSubmitStatus(null);
|
||||||
|
submitLicenseResponse.setLicenseUrl(storeDocument.getStoreBusinessImg());
|
||||||
|
submitLicenseResponse.setLicenseName(storeDocument.getStoreBusinessName());
|
||||||
|
submitLicenseResponse.setSocialCreditCode(storeDocument.getStoreBusinessNumber());
|
||||||
|
submitLicenseResponse.setIdCardAndLicense1(null);
|
||||||
|
submitLicenseResponse.setIdCardAndLicense2(null);
|
||||||
|
submitLicenseResponse.setFoodLicenseUrl(storeDocument.getStoreFoodLicenseImg());
|
||||||
|
submitLicenseResponse.setBusinessPremises(storeDocument.getStoreFoodLicenseBusinessAddress());
|
||||||
|
submitLicenseResponse.setFoodLicenseCode(storeDocument.getStoreFoodLicense());
|
||||||
|
submitLicenseResponse.setFoodLicenseStartTime(DateUtil.parseTime(storeDocument.getStoreFoodLicenseBeginDate()));
|
||||||
|
submitLicenseResponse.setFoodLicenseEndTime(DateUtil.parseTime(storeDocument.getStoreFoodLicenseEndDate()));
|
||||||
|
return submitLicenseResponse;
|
||||||
|
}
|
||||||
|
|
||||||
public static SubmitLicenseResponse from(LicenseTransactDO licenseTransactDO) {
|
public static SubmitLicenseResponse from(LicenseTransactDO licenseTransactDO) {
|
||||||
if (licenseTransactDO == null) {
|
if (Objects.isNull(licenseTransactDO)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();
|
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.cool.store.service;
|
|||||||
|
|
||||||
import com.cool.store.request.FranchiseAgreementRequest;
|
import com.cool.store.request.FranchiseAgreementRequest;
|
||||||
import com.cool.store.request.NewStoreRequest;
|
import com.cool.store.request.NewStoreRequest;
|
||||||
|
import com.cool.store.response.GetStoreInfoByCodeResponse;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,4 +34,11 @@ public interface CoolStoreStartFlowService {
|
|||||||
*/
|
*/
|
||||||
Boolean getFirstOrder(String shopCode);
|
Boolean getFirstOrder(String shopCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取证照信息
|
||||||
|
* @param storeNum
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
GetStoreInfoByCodeResponse getStoreInfoCode(String storeNum);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.cool.store.dao.ShopStageInfoDAO;
|
|||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.entity.LicenseTransactDO;
|
import com.cool.store.entity.LicenseTransactDO;
|
||||||
import com.cool.store.entity.ShopAuditInfoDO;
|
import com.cool.store.entity.ShopAuditInfoDO;
|
||||||
|
import com.cool.store.entity.ShopInfoDO;
|
||||||
import com.cool.store.enums.AuditTypeEnum;
|
import com.cool.store.enums.AuditTypeEnum;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||||
@@ -16,16 +17,18 @@ import com.cool.store.exception.ServiceException;
|
|||||||
import com.cool.store.mapper.ApplyLicenseMapper;
|
import com.cool.store.mapper.ApplyLicenseMapper;
|
||||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||||
import com.cool.store.mapper.ShopAuditInfoMapper;
|
import com.cool.store.mapper.ShopAuditInfoMapper;
|
||||||
|
import com.cool.store.mapper.ShopInfoMapper;
|
||||||
import com.cool.store.request.LicenseListRequest;
|
import com.cool.store.request.LicenseListRequest;
|
||||||
import com.cool.store.request.SubmitLicenseRequest;
|
import com.cool.store.request.SubmitLicenseRequest;
|
||||||
|
import com.cool.store.response.GetStoreInfoByCodeResponse;
|
||||||
import com.cool.store.response.LicenseListResponse;
|
import com.cool.store.response.LicenseListResponse;
|
||||||
import com.cool.store.response.SubmitLicenseResponse;
|
import com.cool.store.response.SubmitLicenseResponse;
|
||||||
import com.cool.store.service.ApplyLicenseService;
|
import com.cool.store.service.ApplyLicenseService;
|
||||||
|
import com.cool.store.service.CoolStoreStartFlowService;
|
||||||
import com.cool.store.service.RegionService;
|
import com.cool.store.service.RegionService;
|
||||||
import com.cool.store.utils.StringUtil;
|
import com.cool.store.utils.StringUtil;
|
||||||
import com.cool.store.utils.poi.StringUtils;
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
import com.cool.store.utils.poi.constant.Constants;
|
import com.cool.store.utils.poi.constant.Constants;
|
||||||
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
|
||||||
import com.cool.store.vo.ShopAuditInfoVO;
|
import com.cool.store.vo.ShopAuditInfoVO;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
@@ -63,21 +66,27 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
@Resource
|
@Resource
|
||||||
EnterpriseUserMapper userMapper;
|
EnterpriseUserMapper userMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
CoolStoreStartFlowService coolStoreStartFlowService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ShopInfoMapper shopInfoMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean submitLicense(SubmitLicenseRequest request) {
|
public Boolean submitLicense(SubmitLicenseRequest request) {
|
||||||
log.info("submitLicense request:{}", JSONObject.toJSONString(request));
|
log.info("submitLicense request:{}", JSONObject.toJSONString(request));
|
||||||
if (Objects.isNull(request)){
|
if (Objects.isNull(request)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LicenseTransactDO licenseTransactDO = request.toLicenseTransactDO();
|
LicenseTransactDO licenseTransactDO = request.toLicenseTransactDO();
|
||||||
if (request.getId() == null){
|
if (request.getId() == null) {
|
||||||
applyLicenseMapper.insertSelective(licenseTransactDO);
|
applyLicenseMapper.insertSelective(licenseTransactDO);
|
||||||
}else {
|
} else {
|
||||||
licenseTransactDO.setId(request.getId());
|
licenseTransactDO.setId(request.getId());
|
||||||
applyLicenseMapper.updateByPrimaryKeySelective(licenseTransactDO);
|
applyLicenseMapper.updateByPrimaryKeySelective(licenseTransactDO);
|
||||||
}
|
}
|
||||||
if (request.getSubmitStatus() == Constants.ONE_INTEGER){
|
if (request.getSubmitStatus() == Constants.ONE_INTEGER) {
|
||||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||||
shopAuditInfoDO.setShopId(request.getShopId());
|
shopAuditInfoDO.setShopId(request.getShopId());
|
||||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.LICENSE_APPROVAL.getCode());
|
shopAuditInfoDO.setAuditType(AuditTypeEnum.LICENSE_APPROVAL.getCode());
|
||||||
@@ -86,7 +95,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
shopAuditInfoDO.setSubmittedUserName(user.getName());
|
shopAuditInfoDO.setSubmittedUserName(user.getName());
|
||||||
shopAuditInfoDO.setDataType(0);
|
shopAuditInfoDO.setDataType(0);
|
||||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_41,null);
|
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_41, null);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -94,33 +103,42 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SubmitLicenseResponse getDefault(Long shopId) {
|
public SubmitLicenseResponse getDefault(Long shopId) {
|
||||||
LicenseTransactDO licenseTransactDO = new LicenseTransactDO();
|
//1.如果已经提交过证照信息,直接查询后组装数据返回
|
||||||
licenseTransactDO.setShopId(shopId);
|
LicenseTransactDO result = applyLicenseMapper.selectByShopId(shopId);
|
||||||
LicenseTransactDO result = applyLicenseMapper.selectOne(licenseTransactDO);
|
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();
|
||||||
if (Objects.isNull(result)){
|
if (Objects.nonNull(result)){
|
||||||
throw new ServiceException(ErrorCodeEnum.LICENSE_NOT_EXIST);
|
submitLicenseResponse = SubmitLicenseResponse.from(result);
|
||||||
|
List<ShopAuditInfoVO> listByShopIdAndType = shopAuditInfoMapper.getListByShopIdAndType(shopId, AuditTypeEnum.LICENSE_APPROVAL.getCode());
|
||||||
|
List<String> userIds = listByShopIdAndType.stream().map(ShopAuditInfoVO::getSubmittedUserId).collect(Collectors.toList());
|
||||||
|
List<EnterpriseUserDO> userInfoByUserIds = new ArrayList<>();
|
||||||
|
if (CollectionUtils.isNotEmpty(userIds)) {
|
||||||
|
userInfoByUserIds = userMapper.getUserInfoByUserIds(userIds);
|
||||||
|
Map<String, String> userAvatarMap = userInfoByUserIds.stream()
|
||||||
|
.filter(item -> StringUtil.isNotBlank(item.getUserId()) && StringUtil.isNotBlank(item.getAvatar()))
|
||||||
|
.collect(Collectors.toMap(k -> k.getUserId(), v -> v.getAvatar()));
|
||||||
|
listByShopIdAndType.stream().forEach(item -> {
|
||||||
|
String avatar = userAvatarMap.get(item.getSubmittedUserId());
|
||||||
|
if (StringUtils.isBlank(avatar)) {
|
||||||
|
item.setAvatar(Constants.AVATAR_DEFAULT);
|
||||||
|
} else {
|
||||||
|
item.setAvatar(avatar);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
submitLicenseResponse.setProcessRecords(listByShopIdAndType);
|
||||||
|
return submitLicenseResponse;
|
||||||
}
|
}
|
||||||
SubmitLicenseResponse submitLicenseResponse = SubmitLicenseResponse.from(result);
|
//2.未查到证照信息,所以查询鲜丰的默认值
|
||||||
List<ShopAuditInfoVO> listByShopIdAndType = shopAuditInfoMapper.getListByShopIdAndType(shopId, AuditTypeEnum.LICENSE_APPROVAL.getCode());
|
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
|
||||||
List<String> userIds = listByShopIdAndType.stream().map(ShopAuditInfoVO::getSubmittedUserId).collect(Collectors.toList());
|
if (Objects.nonNull(shopInfoDO.getStoreNum())) {
|
||||||
List<EnterpriseUserDO> userInfoByUserIds = new ArrayList<>();
|
GetStoreInfoByCodeResponse storeInfoCode = coolStoreStartFlowService.getStoreInfoCode(shopInfoDO.getStoreNum());
|
||||||
|
if (Objects.nonNull(storeInfoCode) && Objects.nonNull(storeInfoCode.getData()) && storeInfoCode.getCode() == 0) {
|
||||||
if (CollectionUtils.isNotEmpty(userIds)){
|
submitLicenseResponse = SubmitLicenseResponse.from(storeInfoCode);
|
||||||
userInfoByUserIds = userMapper.getUserInfoByUserIds(userIds);
|
return submitLicenseResponse;
|
||||||
Map<String, String> userAvatarMap = userInfoByUserIds.stream()
|
}
|
||||||
.filter(item -> StringUtil.isNotBlank(item.getUserId()) && StringUtil.isNotBlank(item.getAvatar()))
|
|
||||||
.collect(Collectors.toMap(k -> k.getUserId(), v -> v.getAvatar()));
|
|
||||||
listByShopIdAndType.stream().forEach( item -> {
|
|
||||||
String avatar = userAvatarMap.get(item.getSubmittedUserId());
|
|
||||||
if (StringUtils.isBlank(avatar)){
|
|
||||||
item.setAvatar(Constants.AVATAR_DEFAULT);
|
|
||||||
}else {
|
|
||||||
item.setAvatar(avatar);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
submitLicenseResponse.setProcessRecords(listByShopIdAndType);
|
//3.既没有提交数据,也没有在鲜丰端查到证照信息,则返回空自由填写
|
||||||
return submitLicenseResponse;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -154,7 +172,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean licenseExamine(Long shopId, Integer status,String result) {
|
public Boolean licenseExamine(Long shopId, Integer status, String result) {
|
||||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||||
shopAuditInfoDO.setShopId(shopId);
|
shopAuditInfoDO.setShopId(shopId);
|
||||||
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
|
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
|
||||||
@@ -166,11 +184,11 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
shopAuditInfoDO.setResultType(status);
|
shopAuditInfoDO.setResultType(status);
|
||||||
LicenseTransactDO licenseTransactDO = new LicenseTransactDO();
|
LicenseTransactDO licenseTransactDO = new LicenseTransactDO();
|
||||||
licenseTransactDO.setShopId(shopId);
|
licenseTransactDO.setShopId(shopId);
|
||||||
if (status == Constants.ZERO_INTEGER){
|
if (status == Constants.ZERO_INTEGER) {
|
||||||
shopAuditInfoDO.setPassReason(result);
|
shopAuditInfoDO.setPassReason(result);
|
||||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_43;
|
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_43;
|
||||||
licenseTransactDO.setSubmitStatus(3);
|
licenseTransactDO.setSubmitStatus(3);
|
||||||
}else if (status == Constants.ONE_INTEGER){
|
} else if (status == Constants.ONE_INTEGER) {
|
||||||
licenseTransactDO.setSubmitStatus(2);
|
licenseTransactDO.setSubmitStatus(2);
|
||||||
shopAuditInfoDO.setRejectReason(result);
|
shopAuditInfoDO.setRejectReason(result);
|
||||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_42;
|
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_42;
|
||||||
@@ -179,7 +197,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
//插入操作/意见
|
//插入操作/意见
|
||||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||||
//更新阶段状态
|
//更新阶段状态
|
||||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId,shopSubStageStatusEnum,null);
|
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum, null);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ import com.cool.store.exception.ServiceException;
|
|||||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||||
import com.cool.store.request.FranchiseAgreementRequest;
|
import com.cool.store.request.FranchiseAgreementRequest;
|
||||||
import com.cool.store.request.NewStoreRequest;
|
import com.cool.store.request.NewStoreRequest;
|
||||||
|
import com.cool.store.response.GetStoreInfoByCodeResponse;
|
||||||
import com.cool.store.response.InitiatingResponse;
|
import com.cool.store.response.InitiatingResponse;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.CoolStoreStartFlowService;
|
import com.cool.store.service.CoolStoreStartFlowService;
|
||||||
import com.cool.store.utils.SecureUtil;
|
import com.cool.store.utils.SecureUtil;
|
||||||
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
import com.cool.store.utils.poi.constant.Constants;
|
import com.cool.store.utils.poi.constant.Constants;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -102,6 +104,24 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
|||||||
throw new ServiceException(ErrorCodeEnum. GET_FIRST_ORDER);
|
throw new ServiceException(ErrorCodeEnum. GET_FIRST_ORDER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GetStoreInfoByCodeResponse getStoreInfoCode(String storeNum) {
|
||||||
|
log.info("getStoreInfoCode storeNum:{}",storeNum);
|
||||||
|
if (StringUtils.isBlank(storeNum)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.STORE_NUM_NOT_FOUND);
|
||||||
|
}
|
||||||
|
Map<String, Object> requestMap = new HashMap<>();
|
||||||
|
fillSignatureInfo(requestMap);
|
||||||
|
requestMap.put("storeCode",storeNum);
|
||||||
|
String url = xfsgUrl + Constants.GET_STORE_INFO_BY_CODE + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||||
|
GetStoreInfoByCodeResponse response = httpRestTemplateService.getForObject(url, GetStoreInfoByCodeResponse.class, requestMap);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void fillSignatureInfo(Map<String, Object> requestMap) {
|
private void fillSignatureInfo(Map<String, Object> requestMap) {
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
String signature = SecureUtil.getSignature(timestamp);
|
String signature = SecureUtil.getSignature(timestamp);
|
||||||
|
|||||||
@@ -178,6 +178,8 @@ public class Constants
|
|||||||
|
|
||||||
public static final String FRANCHISE_AGREEMENT_PERSON = "/api/coolstore/start-flow/franchise-agreement-person";
|
public static final String FRANCHISE_AGREEMENT_PERSON = "/api/coolstore/start-flow/franchise-agreement-person";
|
||||||
|
|
||||||
|
public static final String GET_STORE_INFO_BY_CODE = "/api/kdz/get-store-info-by-code";
|
||||||
|
|
||||||
// 员工详细信息数据接口
|
// 员工详细信息数据接口
|
||||||
public static final String GET_USER_INFO_BY_CODE = "/api/kdz/get-user-info-by-code";
|
public static final String GET_USER_INFO_BY_CODE = "/api/kdz/get-user-info-by-code";
|
||||||
// 加盟商信息数据接口
|
// 加盟商信息数据接口
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.cool.store.response.LicenseListResponse;
|
|||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.response.SubmitLicenseResponse;
|
import com.cool.store.response.SubmitLicenseResponse;
|
||||||
import com.cool.store.service.ApplyLicenseService;
|
import com.cool.store.service.ApplyLicenseService;
|
||||||
|
import com.cool.store.service.CoolStoreStartFlowService;
|
||||||
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -51,5 +52,4 @@ public class PCApplyLicenseController {
|
|||||||
@RequestParam("result") String result) {
|
@RequestParam("result") String result) {
|
||||||
return ResponseResult.success(applyLicenseService.licenseExamine(shopId,status,result));
|
return ResponseResult.success(applyLicenseService.licenseExamine(shopId,status,result));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.cool.store.controller.webc;
|
|||||||
import com.cool.store.request.SubmitLicenseRequest;
|
import com.cool.store.request.SubmitLicenseRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.ApplyLicenseService;
|
import com.cool.store.service.ApplyLicenseService;
|
||||||
|
import com.cool.store.service.CoolStoreStartFlowService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -38,7 +39,7 @@ public class ApplyLicenseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param id
|
* @param
|
||||||
* @param status 0通过 1不通过
|
* @param status 0通过 1不通过
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -49,5 +50,4 @@ public class ApplyLicenseController {
|
|||||||
@RequestParam("result") String result) {
|
@RequestParam("result") String result) {
|
||||||
return ResponseResult.success(applyLicenseService.licenseExamine(shopId,status,result));
|
return ResponseResult.success(applyLicenseService.licenseExamine(shopId,status,result));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user