
9 changed files with 206 additions and 16 deletions
@ -0,0 +1,82 @@ |
|||||
|
package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
|
||||
|
/** |
||||
|
* @author shkstart |
||||
|
* @create 2023-05-10-11:53 |
||||
|
*/ |
||||
|
@ApiModel(value = "企业品牌信息 传输对象") |
||||
|
public class EnpBrandDto implements Dto { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
|
||||
|
@ApiModelProperty("品牌编码") |
||||
|
private String code; |
||||
|
@ApiModelProperty("品牌名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("所属企业Sid") |
||||
|
private String enpSid; |
||||
|
@ApiModelProperty("所属企业编码") |
||||
|
private String enpCode; |
||||
|
@ApiModelProperty("所属企业名称") |
||||
|
private String enpName; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getSid() { |
||||
|
return sid; |
||||
|
} |
||||
|
|
||||
|
public void setSid(String sid) { |
||||
|
this.sid = sid; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getEnpSid() { |
||||
|
return enpSid; |
||||
|
} |
||||
|
|
||||
|
public void setEnpSid(String enpSid) { |
||||
|
this.enpSid = enpSid; |
||||
|
} |
||||
|
|
||||
|
public String getEnpCode() { |
||||
|
return enpCode; |
||||
|
} |
||||
|
|
||||
|
public void setEnpCode(String enpCode) { |
||||
|
this.enpCode = enpCode; |
||||
|
} |
||||
|
|
||||
|
public String getEnpName() { |
||||
|
return enpName; |
||||
|
} |
||||
|
|
||||
|
public void setEnpName(String enpName) { |
||||
|
this.enpName = enpName; |
||||
|
} |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* @author shkstart |
||||
|
* @create 2023-05-10-15:11 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface EnpBrandMapper extends BaseMapper<EnpBrand> { |
||||
|
void deleteEnpBrandBySid(@Param("sid") String sid); |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
<?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.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrandMapper"> |
||||
|
<delete id="deleteEnpBrandBySid"> |
||||
|
delete from enp_brand where sid = #{sid} |
||||
|
</delete> |
||||
|
</mapper> |
@ -0,0 +1,41 @@ |
|||||
|
package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand; |
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @author shkstart |
||||
|
* @create 2023-05-10-11:55 |
||||
|
*/ |
||||
|
@Api("企业品牌信息") |
||||
|
@RestController |
||||
|
@RequestMapping("dbCenter/enpBrand") |
||||
|
public class EnpBrandRest { |
||||
|
|
||||
|
@Autowired |
||||
|
private EnpBrandService enpBrandService; |
||||
|
|
||||
|
@ApiOperation("新增企业品牌") |
||||
|
@RequestMapping("/save") |
||||
|
public ResultBean save(@RequestBody EnpBrandDto dto){ |
||||
|
return enpBrandService.save(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("删除该企业品牌") |
||||
|
@RequestMapping("/delete/{sid}") |
||||
|
public ResultBean delete(@PathVariable String sid){ |
||||
|
return enpBrandService.delete(sid); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("修改该企业品牌") |
||||
|
@RequestMapping("/alterEnpBrand") |
||||
|
public ResultBean alterEnpBrand(@RequestBody EnpBrandDto dto){ |
||||
|
return enpBrandService.alterEnpBrand(dto); |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @author shkstart |
||||
|
* @create 2023-05-10-15:11 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class EnpBrandService extends MybatisBaseService<EnpBrandMapper, EnpBrand> { |
||||
|
|
||||
|
@Autowired |
||||
|
private EnpBrandMapper enpBrandMapper; |
||||
|
|
||||
|
public ResultBean save(EnpBrandDto dto){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
EnpBrand enpBrand = new EnpBrand(); |
||||
|
BeanUtil.copyProperties(dto,enpBrand); |
||||
|
int insert = enpBrandMapper.insert(enpBrand); |
||||
|
if (insert == 0){ |
||||
|
return rb.setMsg("添加失败"); |
||||
|
} |
||||
|
return rb.success().setMsg("添加成功"); |
||||
|
} |
||||
|
|
||||
|
public ResultBean delete(String sid){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
enpBrandMapper.deleteEnpBrandBySid(sid); |
||||
|
return rb.success().setMsg("删除成功"); |
||||
|
} |
||||
|
|
||||
|
public ResultBean alterEnpBrand(EnpBrandDto dto){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
EnpBrand enpBrand = fetchBySid(dto.getSid()); |
||||
|
BeanUtil.copyProperties(dto,enpBrand,"id","sid"); |
||||
|
int i = enpBrandMapper.updateById(enpBrand); |
||||
|
if (i == 0){ |
||||
|
return rb.setMsg("修改失败"); |
||||
|
} |
||||
|
return rb.success().setMsg("修改成功"); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue