feat:证照相关
This commit is contained in:
@@ -164,6 +164,8 @@ public enum ErrorCodeEnum {
|
|||||||
|
|
||||||
LINE_PAY_FALSE(109005, "付款信息查询失败",null),
|
LINE_PAY_FALSE(109005, "付款信息查询失败",null),
|
||||||
|
|
||||||
|
LICENSE_NOT_EXIST(109006, "证照不存在",null),
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.entity.LicenseTransactDO;
|
||||||
|
import com.cool.store.request.LicenseListRequest;
|
||||||
|
import com.cool.store.response.LicenseListResponse;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ApplyLicenseMapper extends Mapper<LicenseTransactDO> {
|
||||||
|
|
||||||
|
List<LicenseListResponse> licenseList(@Param("request") LicenseListRequest request);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.ApplyLicenseMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="licenseList" resultType="com.cool.store.response.LicenseListResponse">
|
||||||
|
select
|
||||||
|
s.shop_name as storeName,
|
||||||
|
s.store_num as storeNum,
|
||||||
|
s.shop_manager_user_id as shopManagerUserId,
|
||||||
|
l.username as franchiseeName,
|
||||||
|
l.mobile as franchiseeMobile,
|
||||||
|
l.region_id AS fightRegionId,
|
||||||
|
l.investment_manager AS investmentManager,
|
||||||
|
s.supervisor_user_id AS supervisorUserId,
|
||||||
|
o.create_time as submitTime,
|
||||||
|
o.submit_status as status
|
||||||
|
FROM
|
||||||
|
xfsg_license_transact o
|
||||||
|
LEFT JOIN xfsg_shop_info s ON o.shop_id = s.id
|
||||||
|
LEFT JOIN xfsg_line_info l ON l.id = s.line_id
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.cool.store.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Table(name = "xfsg_license_transact")
|
||||||
|
@Data
|
||||||
|
public class LicenseTransactDO {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@Column(name = "shop_id")
|
||||||
|
private Long shopId;
|
||||||
|
@Column(name = "business_license")
|
||||||
|
private String businessLicense;
|
||||||
|
@Column(name = "license_type")
|
||||||
|
private Integer licenseType;
|
||||||
|
@Column(name = "license_legal_person")
|
||||||
|
private String licenseLegalPerson;
|
||||||
|
@Column(name = "credit_code")
|
||||||
|
private String creditCode;
|
||||||
|
@Column(name = "credit_url")
|
||||||
|
private String creditUrl;
|
||||||
|
@Column(name = "license_address")
|
||||||
|
private String licenseAddress;
|
||||||
|
@Column(name = "issueTime")
|
||||||
|
private Date issueTime;
|
||||||
|
@Column(name = "validity")
|
||||||
|
private Date validity;
|
||||||
|
@Column(name = "id_card_positive_credit_url")
|
||||||
|
private String idCardPositiveCreditUrl;
|
||||||
|
@Column(name = "id_card_negative_credit_url")
|
||||||
|
private String idCardNegativeCreditUrl;
|
||||||
|
@Column(name = "food_business_license_code")
|
||||||
|
private String foodBusinessLicenseCode;
|
||||||
|
@Column(name = "main_business")
|
||||||
|
private String mainBusiness;
|
||||||
|
@Column(name = "operator")
|
||||||
|
private String operator;
|
||||||
|
@Column(name = "food_license_legal_person")
|
||||||
|
private String foodLicenseLegalPerson;
|
||||||
|
@Column(name = "business_project")
|
||||||
|
private String businessProject;
|
||||||
|
@Column(name = "food_license_address")
|
||||||
|
private String foodLicenseAddress;
|
||||||
|
@Column(name = "food_business_start_time")
|
||||||
|
private Date foodBusinessStartTime;
|
||||||
|
@Column(name = "food_business_end_time")
|
||||||
|
private Date foodBusinessEndTime;
|
||||||
|
@Column(name = "food_business_license_url")
|
||||||
|
private String foodBusinessLicenseUrl;
|
||||||
|
@Column(name = "remark")
|
||||||
|
private String remark;
|
||||||
|
@Column(name = "remark_url")
|
||||||
|
private String remarkUrl;
|
||||||
|
@Column(name = "submit_status")
|
||||||
|
private Integer submitStatus;
|
||||||
|
@Column(name = "create_time")
|
||||||
|
private Date createTime;
|
||||||
|
@Column(name = "update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.cool.store.request;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("证照审批列表请求体")
|
||||||
|
public class LicenseListRequest extends PageBasicInfo {
|
||||||
|
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
@ApiModelProperty("提交申请时间")
|
||||||
|
private Long submitStartTime;
|
||||||
|
@ApiModelProperty("提交申请时间")
|
||||||
|
private Long submitEndTime;
|
||||||
|
@ApiModelProperty("所属区域")
|
||||||
|
private String regionId;
|
||||||
|
@ApiModelProperty("审核状态 1:待通过 2:未通过 3:已通过")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.request;
|
package com.cool.store.request;
|
||||||
|
|
||||||
|
import com.cool.store.entity.LicenseTransactDO;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -9,6 +10,12 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
@ApiModel("提交证照办理请求体")
|
@ApiModel("提交证照办理请求体")
|
||||||
public class SubmitLicenseRequest {
|
public class SubmitLicenseRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
@ApiModelProperty("营业执照拍照上传")
|
@ApiModelProperty("营业执照拍照上传")
|
||||||
private String licenseUrl;
|
private String licenseUrl;
|
||||||
|
|
||||||
@@ -31,7 +38,7 @@ public class SubmitLicenseRequest {
|
|||||||
private String licenseAddress;
|
private String licenseAddress;
|
||||||
|
|
||||||
@ApiModelProperty("有效期")
|
@ApiModelProperty("有效期")
|
||||||
private Object validity;
|
private Date validity;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("法人双手持身份证正面+营业执照")
|
@ApiModelProperty("法人双手持身份证正面+营业执照")
|
||||||
@@ -72,4 +79,50 @@ public class SubmitLicenseRequest {
|
|||||||
|
|
||||||
@ApiModelProperty("备注图片")
|
@ApiModelProperty("备注图片")
|
||||||
private String remarkUrl;
|
private String remarkUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("0:保存 1:提交到待审核 2:未通过 3:已通过 ")
|
||||||
|
private Integer submitStatus;
|
||||||
|
|
||||||
|
|
||||||
|
public LicenseTransactDO toLicenseTransactDO() {
|
||||||
|
LicenseTransactDO licenseTransactDO = new LicenseTransactDO();
|
||||||
|
licenseTransactDO.setLicenseType(this.licenseType);
|
||||||
|
licenseTransactDO.setLicenseLegalPerson(this.licenseLegalPerson);
|
||||||
|
licenseTransactDO.setLicenseAddress(this.licenseAddress);
|
||||||
|
licenseTransactDO.setIssueTime(this.issueTime);
|
||||||
|
licenseTransactDO.setMainBusiness(this.mainBusiness);
|
||||||
|
licenseTransactDO.setOperator(this.operator);
|
||||||
|
licenseTransactDO.setFoodLicenseLegalPerson(this.foodLicenseLegalPerson);
|
||||||
|
licenseTransactDO.setBusinessProject(this.businessProject);
|
||||||
|
licenseTransactDO.setRemark(this.remark);
|
||||||
|
licenseTransactDO.setRemarkUrl(this.remarkUrl);
|
||||||
|
// Not mapped LicenseTransactDO fields:
|
||||||
|
// shopId
|
||||||
|
licenseTransactDO.setShopId(this.shopId);
|
||||||
|
// businessLicense
|
||||||
|
licenseTransactDO.setBusinessLicense(this.licenseName);
|
||||||
|
// creditCode
|
||||||
|
licenseTransactDO.setCreditCode(this.socialCreditCode);
|
||||||
|
// creditUrl
|
||||||
|
licenseTransactDO.setCreditUrl(this.licenseUrl);
|
||||||
|
// validity
|
||||||
|
licenseTransactDO.setValidity(this.validity);
|
||||||
|
// idCardPositiveCreditUrl
|
||||||
|
licenseTransactDO.setIdCardPositiveCreditUrl(this.idCardAndLicense1);
|
||||||
|
// idCardNegativeCreditUrl
|
||||||
|
licenseTransactDO.setIdCardNegativeCreditUrl(this.idCardAndLicense2);
|
||||||
|
// foodBusinessLicenseCode
|
||||||
|
licenseTransactDO.setFoodBusinessLicenseCode(this.foodLicenseCode);
|
||||||
|
// foodLicenseAddress
|
||||||
|
licenseTransactDO.setFoodLicenseAddress(this.businessPremises);
|
||||||
|
// foodBusinessStartTime
|
||||||
|
licenseTransactDO.setFoodBusinessStartTime(this.foodLicenseStartTime);
|
||||||
|
// foodBusinessEndTime
|
||||||
|
licenseTransactDO.setFoodBusinessEndTime(this.foodLicenseEndTime);
|
||||||
|
// foodBusinessLicenseUrl
|
||||||
|
licenseTransactDO.setFoodBusinessLicenseUrl(this.getFoodLicenseUrl());
|
||||||
|
// submitStatus
|
||||||
|
licenseTransactDO.setSubmitStatus(this.submitStatus);
|
||||||
|
return licenseTransactDO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.cool.store.response;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("证照审批列表响应体")
|
||||||
|
public class LicenseListResponse {
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
@ApiModelProperty("门店编码")
|
||||||
|
private String storeNum;
|
||||||
|
@ApiModelProperty("开店负责人id")
|
||||||
|
private String shopManagerUserId;
|
||||||
|
@ApiModelProperty("开店负责人姓名")
|
||||||
|
private String shopManagerUserName;
|
||||||
|
@ApiModelProperty("加盟商姓名")
|
||||||
|
private String franchiseeName;
|
||||||
|
@ApiModelProperty("加盟商手机号")
|
||||||
|
private String franchiseeMobile;
|
||||||
|
@ApiModelProperty("所属大区")
|
||||||
|
private String bigRegion;
|
||||||
|
@ApiModelProperty("所属大区id")
|
||||||
|
private Long bigRegionId;
|
||||||
|
@ApiModelProperty("所属战区")
|
||||||
|
private String fightRegion;
|
||||||
|
@ApiModelProperty("战区id")
|
||||||
|
private Long fightRegionId;
|
||||||
|
|
||||||
|
@ApiModelProperty("招商经理id")
|
||||||
|
private String investmentManager;
|
||||||
|
@ApiModelProperty("招商经理姓名")
|
||||||
|
private String investmentManagerName;
|
||||||
|
@ApiModelProperty("督导id")
|
||||||
|
private String supervisorUserId;
|
||||||
|
@ApiModelProperty("督导姓名")
|
||||||
|
private String supervisorUserName;
|
||||||
|
@ApiModelProperty("提交申请时间")
|
||||||
|
private Date submitTime;
|
||||||
|
@ApiModelProperty("审核状态 1:待通过 2:未通过 3:已通过")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
package com.cool.store.response;
|
||||||
|
|
||||||
|
import com.cool.store.entity.LicenseTransactDO;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("提交证照办理响应体")
|
||||||
|
public class SubmitLicenseResponse {
|
||||||
|
|
||||||
|
@ApiModelProperty("主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty("营业执照拍照上传")
|
||||||
|
private String licenseUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("营业执照名称")
|
||||||
|
private String licenseName;
|
||||||
|
|
||||||
|
@ApiModelProperty("营业执照类型 0:有限责任公司 1:工体工商")
|
||||||
|
private Integer licenseType;
|
||||||
|
|
||||||
|
@ApiModelProperty("营业执照上的法人")
|
||||||
|
private String licenseLegalPerson;
|
||||||
|
|
||||||
|
@ApiModelProperty("统一社会信用代码")
|
||||||
|
private String socialCreditCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("发证日期")
|
||||||
|
private Date issueTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("营业执照经营场所")
|
||||||
|
private String licenseAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty("有效期")
|
||||||
|
private Date validity;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("法人双手持身份证正面+营业执照")
|
||||||
|
private String idCardAndLicense1;
|
||||||
|
|
||||||
|
@ApiModelProperty("法人双手持身份证反面+营业执照")
|
||||||
|
private String idCardAndLicense2;
|
||||||
|
|
||||||
|
@ApiModelProperty("食品经营许可证图片上传")
|
||||||
|
private String foodLicenseUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("经营者")
|
||||||
|
private String operator;
|
||||||
|
|
||||||
|
@ApiModelProperty("食品经营许可证上的法人")
|
||||||
|
private String foodLicenseLegalPerson;
|
||||||
|
|
||||||
|
@ApiModelProperty("食营经营场所")
|
||||||
|
private String businessPremises;
|
||||||
|
|
||||||
|
@ApiModelProperty("主体业态")
|
||||||
|
private String mainBusiness;
|
||||||
|
|
||||||
|
@ApiModelProperty("经营项目")
|
||||||
|
private String businessProject;
|
||||||
|
|
||||||
|
@ApiModelProperty("许可证编号")
|
||||||
|
private String foodLicenseCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("许可证开始时间")
|
||||||
|
private Date foodLicenseStartTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("许可证截止时间")
|
||||||
|
private Date foodLicenseEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注图片")
|
||||||
|
private String remarkUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("0:保存 1:提交到待审核 2:未通过 3:已通过 ")
|
||||||
|
private Integer submitStatus;
|
||||||
|
|
||||||
|
|
||||||
|
public static SubmitLicenseResponse from(LicenseTransactDO licenseTransactDO) {
|
||||||
|
if (licenseTransactDO == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();
|
||||||
|
submitLicenseResponse.setId(licenseTransactDO.getId());
|
||||||
|
submitLicenseResponse.setShopId(licenseTransactDO.getShopId());
|
||||||
|
submitLicenseResponse.setLicenseType(licenseTransactDO.getLicenseType());
|
||||||
|
submitLicenseResponse.setLicenseLegalPerson(licenseTransactDO.getLicenseLegalPerson());
|
||||||
|
submitLicenseResponse.setIssueTime(licenseTransactDO.getIssueTime());
|
||||||
|
submitLicenseResponse.setLicenseAddress(licenseTransactDO.getLicenseAddress());
|
||||||
|
submitLicenseResponse.setValidity(licenseTransactDO.getValidity());
|
||||||
|
submitLicenseResponse.setOperator(licenseTransactDO.getOperator());
|
||||||
|
submitLicenseResponse.setFoodLicenseLegalPerson(licenseTransactDO.getFoodLicenseLegalPerson());
|
||||||
|
submitLicenseResponse.setMainBusiness(licenseTransactDO.getMainBusiness());
|
||||||
|
submitLicenseResponse.setBusinessProject(licenseTransactDO.getBusinessProject());
|
||||||
|
submitLicenseResponse.setRemark(licenseTransactDO.getRemark());
|
||||||
|
submitLicenseResponse.setRemarkUrl(licenseTransactDO.getRemarkUrl());
|
||||||
|
submitLicenseResponse.setSubmitStatus(licenseTransactDO.getSubmitStatus());
|
||||||
|
// licenseUrl
|
||||||
|
submitLicenseResponse.setLicenseUrl(licenseTransactDO.getCreditUrl());
|
||||||
|
// licenseName
|
||||||
|
submitLicenseResponse.setLicenseName(licenseTransactDO.getBusinessLicense());
|
||||||
|
// socialCreditCode
|
||||||
|
submitLicenseResponse.setSocialCreditCode(licenseTransactDO.getCreditCode());
|
||||||
|
// idCardAndLicense1
|
||||||
|
submitLicenseResponse.setIdCardAndLicense1(licenseTransactDO.getIdCardNegativeCreditUrl());
|
||||||
|
// idCardAndLicense2
|
||||||
|
submitLicenseResponse.setIdCardAndLicense2(licenseTransactDO.getIdCardPositiveCreditUrl());
|
||||||
|
// foodLicenseUrl
|
||||||
|
submitLicenseResponse.setFoodLicenseUrl(licenseTransactDO.getFoodBusinessLicenseUrl());
|
||||||
|
// businessPremises
|
||||||
|
submitLicenseResponse.setBusinessPremises(licenseTransactDO.getFoodLicenseAddress());
|
||||||
|
// foodLicenseCode
|
||||||
|
submitLicenseResponse.setFoodLicenseCode(licenseTransactDO.getFoodBusinessLicenseCode());
|
||||||
|
// foodLicenseStartTime
|
||||||
|
submitLicenseResponse.setFoodLicenseStartTime(licenseTransactDO.getFoodBusinessStartTime());
|
||||||
|
// foodLicenseEndTime
|
||||||
|
submitLicenseResponse.setFoodLicenseEndTime(licenseTransactDO.getFoodBusinessEndTime());
|
||||||
|
return submitLicenseResponse;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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)){
|
if (Objects.nonNull(result)){
|
||||||
String address = result.address;
|
String address = result.address;
|
||||||
String registerNumber = result.registerNumber;
|
String registerNumber = result.registerNumber;
|
||||||
|
String legalPerson = result.legalPerson;//法人
|
||||||
|
String validPeriod = result.validPeriod;//有效期
|
||||||
|
String establishDate = result.establishDate;
|
||||||
BusinessLicenseInfoVO response = new BusinessLicenseInfoVO(registerNumber,address);
|
BusinessLicenseInfoVO response = new BusinessLicenseInfoVO(registerNumber,address);
|
||||||
return response;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.request.LicenseListRequest;
|
||||||
|
import com.cool.store.request.OpenAcceptanceRequest;
|
||||||
|
import com.cool.store.response.LicenseListResponse;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.ApplyLicenseService;
|
||||||
|
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pc/license")
|
||||||
|
@Api(tags = "PC证照审核")
|
||||||
|
@Slf4j
|
||||||
|
public class PCApplyLicenseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ApplyLicenseService applyLicenseService;
|
||||||
|
|
||||||
|
@GetMapping(path = "/licenseList")
|
||||||
|
@ApiOperation("证照审批列表")
|
||||||
|
public ResponseResult<PageInfo<LicenseListResponse>> licenseList(LicenseListRequest request) {
|
||||||
|
return ResponseResult.success(applyLicenseService.licenseList(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("证照办理数据回显")
|
||||||
|
@GetMapping("/default/get")
|
||||||
|
public ResponseResult getDefault(@RequestParam("shopId") Long shopId) {
|
||||||
|
return ResponseResult.success(applyLicenseService.getDefault(shopId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,31 +1,39 @@
|
|||||||
package com.cool.store.controller.webc;
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
import com.cool.store.entity.BankdocDO;
|
import com.cool.store.request.SubmitLicenseRequest;
|
||||||
import com.cool.store.request.BranchBankPageRequest;
|
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.cool.store.service.ApplyLicenseService;
|
||||||
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;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 证照办理
|
* 证照办理
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/mini/license")
|
@RequestMapping("/mini/license")
|
||||||
@Api(tags = "证照办理")
|
@Api(tags = "移动端证照办理")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ApplyLicenseController {
|
public class ApplyLicenseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ApplyLicenseService applyLicenseService;
|
||||||
|
|
||||||
@ApiOperation("证照办理提交")
|
@ApiOperation("证照办理提交")
|
||||||
@PostMapping("/submit")
|
@PostMapping("/submit")
|
||||||
public ResponseResult submitLicense() {
|
public ResponseResult submitLicense(@RequestBody SubmitLicenseRequest request) {
|
||||||
return ResponseResult.success();
|
return ResponseResult.success(applyLicenseService.submitLicense(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("证照办理数据回显")
|
||||||
|
@GetMapping("/default/get")
|
||||||
|
public ResponseResult getDefault(@RequestParam("shopId") Long shopId) {
|
||||||
|
return ResponseResult.success(applyLicenseService.getDefault(shopId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user