fixBug
This commit is contained in:
@@ -9,6 +9,7 @@ public enum AuditTypeEnum {
|
||||
SITE_SELECTION(5, "选址"),
|
||||
UPLOAD_RENT_CONTRACT(6, "上传租赁合同"),
|
||||
PAY_FRANCHISE_FEE(7,"缴纳加盟费"),
|
||||
SIGN_FRANCHISE(8,"加盟合同签约"),
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.SystemBuildingShopDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface SystemBuildingShopMapper extends tk.mybatis.mapper.common.Mapper<SystemBuildingShopDO> {
|
||||
void updateAuditByShopId(@Param("auditId") Long auditId,
|
||||
@Param("shopId") Long shopId);
|
||||
}
|
||||
|
||||
@@ -8,5 +8,10 @@
|
||||
<sql id="Base_Column_List">
|
||||
|
||||
</sql>
|
||||
<update id="updateAuditByShopId">
|
||||
update xfsg_system_building_shop
|
||||
set audit_id = #{auditId}
|
||||
where shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -18,8 +18,10 @@ public class SignFranchiseDO {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(name = "xfsg_shop_info.id")
|
||||
@Column(name = "shop_id")
|
||||
private Long shopId;
|
||||
@Column(name = "audit_id")
|
||||
private Long auditId;
|
||||
@Column(name = "sign_type")
|
||||
private Integer signType;
|
||||
@Column(name = "brand_fee")
|
||||
|
||||
@@ -143,5 +143,14 @@ public class AddSignFranchiseResponse {
|
||||
@ApiModelProperty("享受加盟费和保证金优惠原因")
|
||||
private String reasons;
|
||||
|
||||
@ApiModelProperty("状态 0通过,1拒绝")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("原因")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty("失败时间")
|
||||
private Date resultTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,10 +7,7 @@ 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.ErrorCodeEnum;
|
||||
import com.cool.store.enums.FranchiseeTypeEnum;
|
||||
import com.cool.store.enums.SignTypeEnum;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.*;
|
||||
@@ -22,6 +19,7 @@ import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import com.cool.store.service.SignFranchiseService;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -75,6 +73,9 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
@Resource
|
||||
ShopStageInfoDAO shopStageInfoDAO;
|
||||
|
||||
@Resource
|
||||
ShopAuditInfoMapper shopAuditInfoMapper;
|
||||
|
||||
@Override
|
||||
public Boolean auditResult(AuditResultRequest request) {
|
||||
log.info("SignFranchiseServiceImpl auditResult request:{}", JSONObject.toJSONString(request));
|
||||
@@ -86,6 +87,22 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85;
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, shopSubStageStatusEnum);
|
||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||
shopAuditInfoDO.setShopId(shopId);
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.SIGN_FRANCHISE.getCode());
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
|
||||
shopAuditInfoDO.setSubmittedUserName(user.getName());
|
||||
if (request.getAuditResult() == Constants.ZERO_INTEGER){
|
||||
shopAuditInfoDO.setResultType(Constants.ONE_INTEGER);
|
||||
shopAuditInfoDO.setRejectReason(request.getCause());
|
||||
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
|
||||
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
|
||||
shopAuditInfoDO.setPassReason(request.getCause());
|
||||
}
|
||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||
Long auditId = shopAuditInfoDO.getId();
|
||||
systemBuildingShopMapper.updateAuditByShopId(auditId,shopId);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -261,6 +278,14 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
public AddSignFranchiseResponse getSignFranchise(Long shopId) {
|
||||
SignFranchiseDO signFranchiseDO = signFranchiseMapper.selectByShopId(shopId);
|
||||
AddSignFranchiseResponse response = from(signFranchiseDO, shopId);
|
||||
ShopAuditInfoDO shopAuditInfoDO = shopAuditInfoMapper.selectByPrimaryKey(signFranchiseDO.getAuditId());
|
||||
response.setStatus(shopAuditInfoDO.getResultType());
|
||||
if (shopAuditInfoDO.getResultType() == 0){
|
||||
response.setResult(shopAuditInfoDO.getPassReason());
|
||||
}else {
|
||||
response.setResult(shopAuditInfoDO.getRejectReason());
|
||||
}
|
||||
response.setResultTime(shopAuditInfoDO.getCreateTime());
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user