fix:稽核

feat:建店&证照
This commit is contained in:
guohb
2024-04-25 14:54:10 +08:00
parent f4e7b49665
commit 044a54d94a
17 changed files with 204 additions and 28 deletions

View File

@@ -10,6 +10,11 @@ public interface ShopAuditInfoMapper extends Mapper<ShopAuditInfoDO> {
ShopAuditInfoDO selectBykeyAndType(@Param("shopId") Long shopId);
List<ShopAuditInfoDO> getAuditInfoList(@Param("auditIds") List<Long> auditIds);
List<ShopAuditInfoDO> getListByShopIdAndType(@Param("shopId") Long shopId,
@Param("type") Integer type);
/**
* @Auther: wangshuo
* @Date: 2024/4/23

View File

@@ -19,5 +19,21 @@
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
<where>
<if test="request.storeName != null and request.storeName != ''">
AND s.shop_name = #{request.storeName}
</if>
<if test="request.submitStartTime != null and request.submitEndTime">
AND o.create_time BETWEEN #{request.submitStartTime} AND #{request.submitEndTime}
</if>
<if test="request.regionId != null and request.regionId != ''">
AND l.region_id = #{request.regionId}
</if>
<if test="request.status != null">
AND o.submit_status = #{request.status}
</if>
</where>
</select>
</mapper>

View File

@@ -103,7 +103,7 @@
OR l.mobile = #{keyWord}
)
</if>
<if test="startTime != null and endTime != null">
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND lai.create_time BETWEEN #{startTime} AND #{endTime}
</if>
<if test="region != null and region != ''">

View File

@@ -47,4 +47,10 @@
where
shop_id = #{shopId} and deleted = 0
</select>
<select id="getListByShopIdAndType" resultType="com.cool.store.entity.ShopAuditInfoDO">
select * from xfsg_shop_audit_info
where shop_id = #{shopId}
and audit_type = #{type}
order by create_time
</select>
</mapper>

View File

@@ -1,5 +1,7 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.*;
@@ -19,36 +21,42 @@ public class ShopAuditInfoDO {
* 0-视觉验收 1-培训登记审批 2-开业运营方案 3-证照审批
*/
@Column(name = "audit_type")
@ApiModelProperty("0-视觉验收 1-培训登记审批 2-开业运营方案 3-证照审批")
private Integer auditType;
/**
* 提交人ID
*/
@Column(name = "submitted_user_id")
@ApiModelProperty("提交人ID")
private String submittedUserId;
/**
* 提交人名称
*/
@Column(name = "submitted_user_name")
@ApiModelProperty("提交人名称")
private String submittedUserName;
/**
* 结果类型 0通过,1拒绝
*/
@Column(name = "result_type")
@ApiModelProperty("结果类型 0通过,1拒绝")
private Integer resultType;
/**
* 通过原因
*/
@Column(name = "pass_reason")
@ApiModelProperty("通过原因")
private String passReason;
/**
* 拒绝原因
*/
@Column(name = "reject_reason")
@ApiModelProperty("拒绝原因")
private String rejectReason;
/**
@@ -61,6 +69,7 @@ public class ShopAuditInfoDO {
* 创建时间
*/
@Column(name = "create_time")
@ApiModelProperty("时间")
private Date createTime;
/**
@@ -75,6 +84,7 @@ public class ShopAuditInfoDO {
private Boolean deleted;
@Column(name = "data_type")
@ApiModelProperty("数据类型 0-提交 1-审批")
private Integer dataType;
/**
@@ -288,4 +298,12 @@ public class ShopAuditInfoDO {
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
public Integer getDataType() {
return dataType;
}
public void setDataType(Integer dataType) {
this.dataType = dataType;
}
}

View File

@@ -51,7 +51,7 @@ public class SysStoreAppRequest {
@Data
@ApiModel("门店信息")
public static class StoreDetail{
@ApiModelProperty("门店性质")
@ApiModelProperty("门店性质 20加盟 10直营")
private Integer storeNature;
@ApiModelProperty("门店经营者")
private Integer storeOperator;
@@ -112,6 +112,8 @@ public class SysStoreAppRequest {
private Integer storeSecurityDeposit;
@ApiModelProperty("享受加盟费和保证金优惠原因")
private String reasons;
@ApiModelProperty("品牌使用费率")
private String usageRate;
}

View File

@@ -1,11 +1,13 @@
package com.cool.store.response;
import com.cool.store.entity.LicenseTransactDO;
import com.cool.store.entity.ShopAuditInfoDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
@ApiModel("提交证照办理响应体")
@@ -83,6 +85,8 @@ public class SubmitLicenseResponse {
@ApiModelProperty("0:保存 1提交到待审核 2:未通过 3:已通过 ")
private Integer submitStatus;
@ApiModelProperty("流程记录")
private List<ShopAuditInfoDO> processRecords;
public static SubmitLicenseResponse from(LicenseTransactDO licenseTransactDO) {
if (licenseTransactDO == null) {
@@ -103,25 +107,15 @@ public class SubmitLicenseResponse {
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;
}

View File

@@ -73,6 +73,18 @@ public class SysStoreAppResponse {
@ApiModelProperty("门店邀约人姓名")
private String storeInviteesName;
@ApiModelProperty("招商姓名")
private String InvestmentName;
@ApiModelProperty("招商人id")
private String InvestmentUserId;
@ApiModelProperty("门店选址人姓名")
private String sitterName;
@ApiModelProperty("门店选址人id")
private String sitterId;
}
@Data

View File

@@ -7,9 +7,32 @@ import com.cool.store.response.SubmitLicenseResponse;
import com.github.pagehelper.PageInfo;
public interface ApplyLicenseService {
/**
* 提交证照信息
* @param request
* @return
*/
Boolean submitLicense(SubmitLicenseRequest request);
/**
* 获取默认值
* @param shopId
* @return
*/
SubmitLicenseResponse getDefault(Long shopId);
/**
* 证照审核列表
* @param request
* @return
*/
PageInfo<LicenseListResponse> licenseList(LicenseListRequest request);
/**
* 证照审核审批
* @param id
* @param status 0通过 1不通过
* @return
*/
Boolean licenseExamine(Long shopId, Integer status,String result);
}

View File

@@ -16,7 +16,7 @@ public interface CoolStoreStartFlowService {
* @param request
* @return
*/
ResponseResult newStore(NewStoreRequest request);
ResponseResult newStore(NewStoreRequest request,Long shopId);
/**
*特许经营合同

View File

@@ -68,6 +68,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
LoginUserInfo user = CurrentUserHolder.getUser();
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
shopAuditInfoDO.setDataType(0);
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
}
return true;
@@ -83,6 +84,8 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
throw new ServiceException(ErrorCodeEnum.LICENSE_NOT_EXIST);
}
SubmitLicenseResponse submitLicenseResponse = SubmitLicenseResponse.from(result);
List<ShopAuditInfoDO> listByShopIdAndType = shopAuditInfoMapper.getListByShopIdAndType(shopId, AuditTypeEnum.LICENSE_APPROVAL.getCode());
submitLicenseResponse.setProcessRecords(listByShopIdAndType);
return submitLicenseResponse;
}
@@ -114,4 +117,23 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
}
return new PageInfo<>(licenseListResponses);
}
@Override
public Boolean licenseExamine(Long shopId, Integer status,String result) {
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(shopId);
shopAuditInfoDO.setAuditType(AuditTypeEnum.LICENSE_APPROVAL.getCode());
LoginUserInfo user = CurrentUserHolder.getUser();
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
shopAuditInfoDO.setDataType(1);
shopAuditInfoDO.setResultType(status);
if (status == Constants.ZERO_INTEGER){
shopAuditInfoDO.setPassReason(result);
}else if (status == Constants.ONE_INTEGER){
shopAuditInfoDO.setRejectReason(result);
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
return null;
}
}

View File

@@ -1,8 +1,10 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.request.FranchiseAgreementRequest;
@@ -29,11 +31,14 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
@Value("${xfsg.url}")
private String xfsgUrl;
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@Resource
private HttpRestTemplateService httpRestTemplateService;
@Override
public ResponseResult newStore(NewStoreRequest request) {
public ResponseResult newStore(NewStoreRequest request,Long shopId) {
log.info("newStore param:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -46,6 +51,8 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
if (initiatingResponse.getCode() != 0L){
return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData());
}else {
//更新阶段信息
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_31,null);
return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData());
}
}

View File

@@ -4,11 +4,13 @@ import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.*;
import com.cool.store.enums.AuditEnum;
import com.cool.store.enums.AuditTypeEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.enums.prepare.newStore.BusinessDistrictEnum;
import com.cool.store.enums.prepare.newStore.OfflineCompetitorEnum;
import com.cool.store.enums.prepare.newStore.PassengerFlowEnum;
@@ -72,6 +74,9 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
@Resource
ShopInfoMapper shopInfoMapper;
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@Override
@Transactional(rollbackFor = Exception.class)
public ResponseResult submitSysBuildStore(SysStoreAppRequest request) {
@@ -92,7 +97,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(request.getLineId(), request.getShopId());//查铺位信息确定铺位所在大区、战区、门店所在省市区街道地址
//3.请求鲜丰接口
NewStoreRequest apiRequest = convertToNewStoreRequest(request,lineInfoDO,pointInfoDO);
return coolStoreStartFlowService.newStore(apiRequest);
return coolStoreStartFlowService.newStore(apiRequest,request.getShopId());
}
@Override
@@ -220,6 +225,14 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
franInfo.setPartnerNum(lineInfoDO.getPartnerNum());
franInfo.setFranchiseeMobile(lineInfoDO.getMobile());
franInfo.setFranchiseeName(lineInfoDO.getUsername());
franInfo.setInvestmentUserId(lineInfoDO.getInvestmentManager());
EnterpriseUserDO userInfoById = enterpriseUserMapper.getUserInfoById(lineInfoDO.getInvestmentManager());
franInfo.setInvestmentName(userInfoById.getName());
}
if (Objects.nonNull(pointInfoDO)){
EnterpriseUserDO locationPeople = enterpriseUserMapper.getUserInfoById(pointInfoDO.getDevelopmentManager());//门店选址人
franInfo.setSitterId(pointInfoDO.getDevelopmentManager());
franInfo.setSitterName(locationPeople.getName());
}
sysStoreAppResponse.setStoreDetail(storeDetail);
sysStoreAppResponse.setSupervisorDetail(supervisorDetail);
@@ -376,6 +389,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
String kdzBusinessId = request.getKdzBusinessId();
Long shopId = getShopId(kdzBusinessId);
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
//1.成功/失败原因
try {
shopAuditInfoDO.setShopId(shopId);
@@ -383,12 +397,14 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
LoginUserInfo user = CurrentUserHolder.getUser();
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
if (request.getAuditResult() == 0){
shopAuditInfoDO.setResultType(1);
if (request.getAuditResult() == Constants.ZERO_INTEGER){
shopAuditInfoDO.setResultType(Constants.ONE_INTEGER);
shopAuditInfoDO.setRejectReason(request.getCause());
}else if (request.getAuditResult() == 1){
shopAuditInfoDO.setResultType(0);
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
shopAuditInfoDO.setPassReason(request.getCause());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33;
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
}catch (Exception e){
@@ -396,10 +412,13 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
}finally {
//2.校验建店与加盟签约合同是否完成 并初始化后续流程数据
preparationService.contractAndBuildStoreCompletion(shopId);
//更新门店编码
ShopInfoDO shopInfoDO = new ShopInfoDO();
shopInfoDO.setId(shopId);
shopInfoDO.setStoreNum(request.getStoreNum());
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
//更新阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,null);
}
return true;
}

View File

@@ -57,7 +57,8 @@ public class SignValidateFilter implements Filter {
"/**/swagger*/**",
"/**/webjars/**",
"/xfsg/mini/program/v1/partnerManage/openArea/areaApplyQuery",
"/xfsg/*/api/audit/result"
"/xfsg/*/api/audit/result",
"/xfsg/mini/**"
);

View File

@@ -4,16 +4,16 @@ 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.response.SubmitLicenseResponse;
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 io.swagger.models.auth.In;
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 org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -34,7 +34,22 @@ public class PCApplyLicenseController {
@ApiOperation("证照办理数据回显")
@GetMapping("/default/get")
public ResponseResult getDefault(@RequestParam("shopId") Long shopId) {
public ResponseResult<SubmitLicenseResponse> getDefault(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(applyLicenseService.getDefault(shopId));
}
/**
*
* @param id
* @param status 0通过 1不通过
* @return
*/
@PostMapping(path = "/examine")
@ApiOperation("证照审批列表")
public ResponseResult licenseExamine(@RequestParam("id") Long shopId,
@RequestParam("status") Integer status,
@RequestParam("result") String result) {
return ResponseResult.success(applyLicenseService.licenseExamine(shopId,status,result));
}
}

View File

@@ -3,6 +3,7 @@ package com.cool.store.controller.webb;
import com.cool.store.request.SysStoreAppRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.SysStoreAppResponse;
import com.cool.store.service.SysStoreAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -14,7 +15,7 @@ import java.util.Map;
@RestController
@RequestMapping("/pc/sysStore")
@Api(tags = "系统建店")
@Api(tags = "PC系统建店")
@Slf4j
public class SysStoreAppController {
@@ -29,8 +30,8 @@ public class SysStoreAppController {
@GetMapping(path = "/default/get")
@ApiOperation("获取系统建店默认值")
public ResponseResult getDefaultValueSysBuildStore(@RequestParam("lineId") Long lineId,
@RequestParam("shopId") Long shopId) {
public ResponseResult<SysStoreAppResponse> getDefaultValueSysBuildStore(@RequestParam("lineId") Long lineId,
@RequestParam("shopId") Long shopId) {
return ResponseResult.success(sysStoreAppService.getDefaultValueSysBuildStore(lineId,shopId));
}

View File

@@ -0,0 +1,35 @@
package com.cool.store.controller.webc;
import com.cool.store.request.SysStoreAppRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.SysStoreAppResponse;
import com.cool.store.service.SysStoreAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/mini/sysStore")
@Api(tags = "mini系统建店")
@Slf4j
public class MiniSysStoreAppController {
@Resource
private SysStoreAppService sysStoreAppService;
@PostMapping(path = "/submit")
@ApiOperation("提交(更新) 系统建店申请")
public ResponseResult submitSysBuildStore(@RequestBody SysStoreAppRequest request) {
return sysStoreAppService.submitSysBuildStore(request);
}
@GetMapping(path = "/default/get")
@ApiOperation("获取系统建店默认值")
public ResponseResult<SysStoreAppResponse> getDefaultValueSysBuildStore(@RequestParam("lineId") Long lineId,
@RequestParam("shopId") Long shopId) {
return ResponseResult.success(sysStoreAppService.getDefaultValueSysBuildStore(lineId,shopId));
}
}