签约相关
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AuditFranchiseFeeRequest {
|
||||
@ApiModelProperty("原因")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty("0通过 1不通过")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("shopId")
|
||||
private Long shopId;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.AuditFranchiseFeeRequest;
|
||||
import com.cool.store.request.FranchiseFeeRequest;
|
||||
import com.cool.store.response.FranchiseFeeResponse;
|
||||
|
||||
@@ -17,4 +18,6 @@ public interface FranchiseFeeService {
|
||||
* @return
|
||||
*/
|
||||
FranchiseFeeResponse getDetail(Long shopId);
|
||||
|
||||
Boolean auditFranchiseFee(AuditFranchiseFeeRequest request);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
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.ShopStageInfoDAO;
|
||||
import com.cool.store.entity.FranchiseFeeDO;
|
||||
import com.cool.store.entity.LinePayDO;
|
||||
import com.cool.store.entity.ShopAuditInfoDO;
|
||||
import com.cool.store.enums.AuditTypeEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.mapper.FranchiseFeeMapper;
|
||||
import com.cool.store.mapper.LinePayMapper;
|
||||
import com.cool.store.mapper.ShopAuditInfoMapper;
|
||||
import com.cool.store.request.AuditFranchiseFeeRequest;
|
||||
import com.cool.store.request.FranchiseFeeRequest;
|
||||
import com.cool.store.response.FranchiseFeeResponse;
|
||||
import com.cool.store.service.FranchiseFeeService;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -23,12 +33,19 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
@Resource
|
||||
LinePayMapper linePayMapper;
|
||||
|
||||
@Resource
|
||||
ShopAuditInfoMapper shopAuditInfoMapper;
|
||||
|
||||
@Resource
|
||||
ShopStageInfoDAO shopStageInfoDAO;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean submitLicense(FranchiseFeeRequest request) {
|
||||
log.info("submitLicense request:{}", JSONObject.toJSONString(request));
|
||||
FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO();
|
||||
franchiseFeeMapper.insertSelective(franchiseFeeDO);
|
||||
return null;
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
|
||||
return franchiseFeeMapper.insertSelective(franchiseFeeDO) == 1 ? true:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,4 +58,26 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
resp.setLinePayDO(linePayDO);
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean auditFranchiseFee(AuditFranchiseFeeRequest request) {
|
||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||
shopAuditInfoDO.setShopId(request.getShopId());
|
||||
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.LICENSE_APPROVAL.getCode());
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
|
||||
shopAuditInfoDO.setSubmittedUserName(user.getName());
|
||||
shopAuditInfoDO.setDataType(1);
|
||||
shopAuditInfoDO.setResultType(request.getStatus());
|
||||
if (request.getStatus() == Constants.ZERO_INTEGER){
|
||||
shopAuditInfoDO.setPassReason(request.getResult());
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73;
|
||||
}else if (request.getStatus() == Constants.ONE_INTEGER){
|
||||
shopAuditInfoDO.setRejectReason(request.getResult());
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74;
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),shopSubStageStatusEnum);
|
||||
return shopAuditInfoMapper.insertSelective(shopAuditInfoDO) == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.request.AuditFranchiseFeeRequest;
|
||||
import com.cool.store.request.FranchiseFeeRequest;
|
||||
import com.cool.store.request.SubmitLicenseRequest;
|
||||
import com.cool.store.response.FranchiseFeeResponse;
|
||||
@@ -33,4 +34,12 @@ public class PCFranchiseFeeController {
|
||||
public ResponseResult<FranchiseFeeResponse> getDetail(@RequestParam("shopId") Long shopId) {
|
||||
return ResponseResult.success(franchiseFeeService.getDetail(shopId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("缴纳加盟费/保证金审核接口")
|
||||
@PostMapping("/audit")
|
||||
public ResponseResult auditFranchiseFee(@RequestBody AuditFranchiseFeeRequest request) {
|
||||
return ResponseResult.success(franchiseFeeService.auditFranchiseFee(request));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user