Commit e26618fb authored by hezhen's avatar hezhen

修改商家入驻

parent 990ff4fa
package com.github.wxiaoqi.security.admin.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Data
@Table(name = "branch_company_level")
public class BranchCompanyLevel {
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键id")
private Integer id;
@ApiModelProperty("等级名称")
private String name;
@ApiModelProperty("图标")
private String icon;
@ApiModelProperty("等级")
private Integer level;
@ApiModelProperty("利润抽成比例")
@Column(name = "profit_ratio")
private Integer profitRatio;
@Column(name = "crt_time")
private Long crtTime;
@Column(name = "upd_time")
private Long updTime;
@Column(name = "is_del")
private Integer isDel;
}
\ No newline at end of file
......@@ -52,4 +52,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
}
}
}
package com.github.wxiaoqi.security.admin.biz;
import com.github.wxiaoqi.security.admin.entity.BranchCompanyLevel;
import com.github.wxiaoqi.security.admin.mapper.BranchCompanyLevelMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
@Service
@Slf4j
public class BranchCompanyLevelBiz extends BaseBiz<BranchCompanyLevelMapper, BranchCompanyLevel>{
public ObjectRestResponse addOrUpd(BranchCompanyLevel branchCompanyLevel){
Integer id = branchCompanyLevel.getId() == null ? 0 :branchCompanyLevel.getId();
if (id > 0 ){
updateSelectiveById(branchCompanyLevel);
}else {
insertSelective(branchCompanyLevel);
}
return ObjectRestResponse.succ();
}
public List<BranchCompanyLevel> getList(){
Example example=new Example(BranchCompanyLevel.class);
example.createCriteria().andEqualTo("isDel",0);
return selectByExample(example);
}
}
package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.entity.BranchCompanyLevel;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;
public interface BranchCompanyLevelMapper extends Mapper<BranchCompanyLevel>, SelectByIdListMapper<BranchCompanyLevel,Integer> {
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.rest.admin;
import com.github.wxiaoqi.security.admin.biz.BranchCompanyLevelBiz;
import com.github.wxiaoqi.security.admin.biz.CompanyInfoBiz;
import com.github.wxiaoqi.security.admin.entity.BranchCompanyLevel;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping("backstage/companyLevel")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
@Api(tags = {"商家申请"})
public class AdminBranchCompanyLevelController extends BaseController<BranchCompanyLevelBiz, BranchCompanyLevel> {
@Autowired
CompanyInfoBiz companyInfoBiz;
@GetMapping("getList")
@ApiModelProperty("店铺等级列表")
public ObjectRestResponse getList() {
return ObjectRestResponse.succ( baseBiz.getList());
}
@PostMapping("addOrUpd")
@ApiModelProperty("店铺等级更新")
public ObjectRestResponse addOrUpd(@RequestBody BranchCompanyLevel branchCompanyLevel) {
return baseBiz.addOrUpd(branchCompanyLevel);
}
}
......@@ -33,7 +33,7 @@ public class AdminCompanyInfoController extends BaseController<CompanyInfoApplyB
@GetMapping("apply/selectList")
@ApiModelProperty("商家入驻申请")
public ObjectRestResponse applySelectList(CompanyApplyFindDTO companyApplyFindDTO) {
return ObjectRestResponse.succ( baseBiz.selectList(companyApplyFindDTO));
return baseBiz.selectList(companyApplyFindDTO);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment