Merge remote-tracking branch 'origin/master'

This commit is contained in:
bonus 2024-08-10 10:31:31 +08:00
commit 63a4ab2839
20 changed files with 728 additions and 60 deletions

View File

@ -1,9 +1,13 @@
package com.bonus.base; package com.bonus.base;
import com.bonus.common.security.annotation.EnableCustomConfig;
import com.bonus.common.security.annotation.EnableRyFeignClients;
import com.bonus.common.swagger.annotation.EnableCustomSwagger2; import com.bonus.common.swagger.annotation.EnableCustomSwagger2;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Configuration;
/** /**
* @author : 阮世耀 * @author : 阮世耀
@ -13,7 +17,9 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
* @Description: Base基础模块启动类 * @Description: Base基础模块启动类
*/ */
@EnableCustomConfig
@EnableCustomSwagger2 @EnableCustomSwagger2
@EnableRyFeignClients
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }) @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
public class BonusBaseApplication { public class BonusBaseApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -3,9 +3,14 @@ package com.bonus.base.controller;
import com.bonus.base.domain.BmAgreement; import com.bonus.base.domain.BmAgreement;
import com.bonus.base.service.BmAgreementService; import com.bonus.base.service.BmAgreementService;
import com.bonus.base.utils.ResultBean; import com.bonus.base.utils.ResultBean;
import com.bonus.common.core.constant.HttpStatus;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.page.TableDataInfo;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/** /**
* 协议管理(bm_agreement)表控制层 * 协议管理(bm_agreement)表控制层
* *
@ -13,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
*/ */
@RestController @RestController
@RequestMapping("/bm_agreement") @RequestMapping("/bm_agreement")
public class BmAgreementController { public class BmAgreementController extends BaseController {
/** /**
* 服务对象 * 服务对象
@ -21,6 +26,18 @@ public class BmAgreementController {
@Autowired @Autowired
private BmAgreementService bmAgreementService; private BmAgreementService bmAgreementService;
/**
* 分页查询
*/
@GetMapping("/list")
public TableDataInfo list(BmAgreement bmAgreement) {
startPage();
List<BmAgreement> list = this.bmAgreementService.selectAll();
return getDataTable(list);
}
/** /**
* 通过主键查询单条数据 * 通过主键查询单条数据
* *
@ -41,7 +58,7 @@ public class BmAgreementController {
@PostMapping(value = "/add") @PostMapping(value = "/add")
public ResultBean<Boolean> add(BmAgreement bmAgreement) { public ResultBean<Boolean> add(BmAgreement bmAgreement) {
int result = this.bmAgreementService.insertSelective(bmAgreement); int result = this.bmAgreementService.insertSelective(bmAgreement);
return result > 0 ? ResultBean.success(true) : ResultBean.error(0, "删除0条"); return result > 0 ? ResultBean.success(true) : ResultBean.error("删除失败");
} }
/** /**

View File

@ -19,7 +19,7 @@ import java.util.List;
* @author 阮世耀 * @author 阮世耀
*/ */
@RestController @RestController
@RequestMapping("/bm_customer_type") @RequestMapping("/unittype")
public class BmCustomerTypeController extends BaseController { public class BmCustomerTypeController extends BaseController {
/** /**
@ -28,8 +28,8 @@ public class BmCustomerTypeController extends BaseController {
@Autowired @Autowired
private BmCustomerTypeService bmCustomerTypeService; private BmCustomerTypeService bmCustomerTypeService;
@RequiresPermissions("system:customerType:list") // @RequiresPermissions("base:customerType:query")
@GetMapping("/list") @GetMapping("/getUnitTypeList")
@SysLog(title = "往来单位类型", businessType = OperaType.QUERY, logType = 1, module = "往来单位类型->分页查询", details = "往来单位类型列表") @SysLog(title = "往来单位类型", businessType = OperaType.QUERY, logType = 1, module = "往来单位类型->分页查询", details = "往来单位类型列表")
public TableDataInfo list(BmCustomerType bmCustomerType) { public TableDataInfo list(BmCustomerType bmCustomerType) {
startPage(); startPage();
@ -44,7 +44,7 @@ public class BmCustomerTypeController extends BaseController {
* @return 单条数据 * @return 单条数据
*/ */
@GetMapping("{id}") @GetMapping("{id}")
@RequiresPermissions("system:customerType:list") @RequiresPermissions("base:customerType:query")
public ResultBean<BmCustomerType> queryById(@PathVariable("id") Integer id) { public ResultBean<BmCustomerType> queryById(@PathVariable("id") Integer id) {
return ResultBean.success(this.bmCustomerTypeService.selectByPrimaryKey(id)); return ResultBean.success(this.bmCustomerTypeService.selectByPrimaryKey(id));
} }
@ -56,7 +56,7 @@ public class BmCustomerTypeController extends BaseController {
* @return 新增结果 * @return 新增结果
*/ */
@PostMapping(value = "/add") @PostMapping(value = "/add")
@RequiresPermissions("system:customerType:add") @RequiresPermissions("base:customerType:add")
public ResultBean<Boolean> add(BmCustomerType bmCustomerType) { public ResultBean<Boolean> add(BmCustomerType bmCustomerType) {
this.bmCustomerTypeService.insertSelective(bmCustomerType); this.bmCustomerTypeService.insertSelective(bmCustomerType);
return ResultBean.success(true); return ResultBean.success(true);
@ -69,7 +69,7 @@ public class BmCustomerTypeController extends BaseController {
* @return 编辑结果 * @return 编辑结果
*/ */
@PutMapping(value = "/update") @PutMapping(value = "/update")
@RequiresPermissions("system:customerType:update") @RequiresPermissions("base:customerType:edit")
public ResultBean<Boolean> edit(BmCustomerType bmCustomerType) { public ResultBean<Boolean> edit(BmCustomerType bmCustomerType) {
this.bmCustomerTypeService.updateByPrimaryKeySelective(bmCustomerType); this.bmCustomerTypeService.updateByPrimaryKeySelective(bmCustomerType);
return ResultBean.success(true); return ResultBean.success(true);
@ -81,8 +81,8 @@ public class BmCustomerTypeController extends BaseController {
* @param id 主键 * @param id 主键
* @return 删除是否成功 * @return 删除是否成功
*/ */
@PostMapping(value = "/delete/{id}") @PostMapping(value = "/del/{id}")
@RequiresPermissions("system:customerType:delete") @RequiresPermissions("base:customerType:remove")
public ResultBean<Boolean> deleteById(@PathVariable("id") Integer id) { public ResultBean<Boolean> deleteById(@PathVariable("id") Integer id) {
this.bmCustomerTypeService.deleteByPrimaryKey(id); this.bmCustomerTypeService.deleteByPrimaryKey(id);
return ResultBean.success(true); return ResultBean.success(true);

View File

@ -1,12 +1,17 @@
package com.bonus.base.controller; package com.bonus.base.controller;
import com.bonus.base.domain.BmCustomerType;
import com.bonus.base.domain.BmProject; import com.bonus.base.domain.BmProject;
import com.bonus.base.service.BmProjectService; import com.bonus.base.service.BmProjectService;
import com.bonus.base.utils.ResultBean; import com.bonus.base.utils.ResultBean;
import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.security.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/** /**
* 工程项目管理(bm_project)表控制层 * 工程项目管理(bm_project)表控制层
* *
@ -22,6 +27,21 @@ public class BmProjectController extends BaseController {
@Autowired @Autowired
private BmProjectService bmProjectService; private BmProjectService bmProjectService;
/**
* 分页查询
* @param bmCustomerType 请求条件
* @return 工程列表
*/
@GetMapping("/getProjectList")
@RequiresPermissions("base:project:query")
public TableDataInfo list(BmProject bmCustomerType) {
startPage();
List<BmProject> list = bmProjectService.selectAll();
return getDataTable(list);
}
/** /**
* 通过主键查询单条数据 * 通过主键查询单条数据
* *

View File

@ -0,0 +1,111 @@
package com.bonus.base.controller;
import com.bonus.base.domain.BmSupplier;
import com.bonus.base.service.BmSupplierService;
import com.bonus.base.utils.ResultBean;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 机具供应商管理(BmSupplier)表控制层
*
* @author mashuai
* @since 2024-08-09 13:07:22
*/
@RestController
@Api(tags = "供应商管理")
@RequestMapping("/bmSupplier")
public class BmSupplierController extends BaseController {
/**
* 服务对象
*/
@Resource
private BmSupplierService bmSupplierService;
/**
* 分页查询供应商列表
*
* @param bmSupplier 筛选条件
* @return 查询结果
*/
@ApiOperation(value = "分页查询供应商列表")
@GetMapping("/list")
public TableDataInfo queryByPage(BmSupplier bmSupplier) {
startPage();
List<BmSupplier> list = bmSupplierService.queryByPage(bmSupplier);
return getDataTable(list);
}
/**
* 通过主键查询单条数据,供修改回显数据使用
*
* @param id 主键
* @return 单条数据详情
*/
@ApiOperation(value = "查询供应商单条数据详情")
@GetMapping("/{id}")
public ResultBean<BmSupplier> queryById(@PathVariable("id") Integer id) {
return ResultBean.success(bmSupplierService.queryById(id));
}
/**
* 新增数据
*
* @param bmSupplier 实体
* @return 新增结果
*/
@ApiOperation(value = "新增供应商管理数据")
@PostMapping("/add")
public ResultBean<Boolean> add(@RequestBody BmSupplier bmSupplier) {
int result = bmSupplierService.insert(bmSupplier);
return result > 0 ? ResultBean.success(true) : ResultBean.error(0, "新增失败");
}
/**
* 编辑数据
*
* @param bmSupplier 实体
* @return 编辑结果
*/
@ApiOperation(value = "编辑供应商管理数据")
@PutMapping("/update")
public ResultBean<Boolean> edit(@RequestBody BmSupplier bmSupplier) {
int result = bmSupplierService.update(bmSupplier);
return result > 0 ? ResultBean.success(true) : ResultBean.error(0, "修改失败");
}
/**
* 单个或批量删除数据
*
* @param ids 主键
* @return 删除是否成功
*/
@ApiOperation(value = "删除供应商管理数据")
@PostMapping(value = "/delete/{ids}")
public ResultBean<Boolean> deleteById(@PathVariable("ids") Long[] ids) {
int result = bmSupplierService.deleteById(ids);
return result > 0 ? ResultBean.success(true) : ResultBean.error(0, "删除失败");
}
/**
* 导出供应商管理列表
*/
@ApiOperation(value = "导出查询机具供应商列表")
@PostMapping("/export")
public void export(HttpServletResponse response, BmSupplier bmSupplier)
{
List<BmSupplier> list = bmSupplierService.queryByPage(bmSupplier);
ExcelUtil<BmSupplier> util = new ExcelUtil<>(BmSupplier.class);
util.exportExcel(response, list, "机具供应商数据");
}
}

View File

@ -1,5 +1,6 @@
package com.bonus.base.domain; package com.bonus.base.domain;
import com.bonus.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
@ -16,9 +17,7 @@ import lombok.Data;
@ApiModel(description="协议管理") @ApiModel(description="协议管理")
@Data @Data
public class BmAgreement implements Serializable { public class BmAgreement extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value="") @ApiModelProperty(value="")
private Integer id; private Integer id;

View File

@ -0,0 +1,173 @@
package com.bonus.base.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* 机具供应商管理(BmSupplier)实体类
*
* @author mashuai
* @since 2024-08-09 13:09:16
*/
@ApiModel("机具供应商管理(BmSupplier)实体类")
public class BmSupplier implements Serializable {
private static final long serialVersionUID = -22518958223068479L;
/** 主键id */
@ApiModelProperty(value = "主键id")
private Integer id;
/** 厂家名称 */
@ApiModelProperty(value = "厂家名称")
@Excel(name = "厂家名称")
private String name;
/** 厂家地址 */
@ApiModelProperty(value = "厂家地址")
@Excel(name = "厂家地址")
private String address;
/** 法人代表 */
@ApiModelProperty(value = "法人代表")
@Excel(name = "法人代表")
private String companyMan;
/** 主要联系人 */
@ApiModelProperty(value = "主要联系人")
@Excel(name = "主要联系人")
private String mainPerson;
/** 联系电话 */
@ApiModelProperty(value = "联系电话")
@Excel(name = "联系电话")
private String phone;
/** 主要经营范围 */
@ApiModelProperty(value = "主要经营范围")
@Excel(name = "主要经营范围")
private String scopeBusiness;
/** 营业执照 */
@ApiModelProperty(value = "营业执照")
@Excel(name = "营业执照")
private String picUrl;
/** 备注 */
@ApiModelProperty(value = "备注")
@Excel(name = "备注")
private String notes;
/** 是否启用 0不启用 1启用 */
@ApiModelProperty(value = "是否启用 0不启用 1启用")
private String isActive;
/** 数据所属组织 */
@ApiModelProperty(value = "数据所属组织")
private Integer companyId;
/** 模糊查询关键字 */
@ApiModelProperty(value = "模糊查询关键字")
private String keyWord;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getCompanyMan() {
return companyMan;
}
public void setCompanyMan(String companyMan) {
this.companyMan = companyMan;
}
public String getMainPerson() {
return mainPerson;
}
public void setMainPerson(String mainPerson) {
this.mainPerson = mainPerson;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getScopeBusiness() {
return scopeBusiness;
}
public void setScopeBusiness(String scopeBusiness) {
this.scopeBusiness = scopeBusiness;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public String getIsActive() {
return isActive;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
public String getKeyWord() {
return keyWord;
}
public void setKeyWord(String keyWord) {
this.keyWord = keyWord;
}
}

View File

@ -3,6 +3,8 @@ package com.bonus.base.mapper;
import com.bonus.base.domain.BmAgreement; import com.bonus.base.domain.BmAgreement;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
*@PackagePath: com.bonus.base.mapper *@PackagePath: com.bonus.base.mapper
*@author : 阮世耀 *@author : 阮世耀
@ -44,6 +46,8 @@ public interface BmAgreementMapper {
*/ */
BmAgreement selectByPrimaryKey(Integer id); BmAgreement selectByPrimaryKey(Integer id);
List<BmAgreement> selectAll();
/** /**
* update record selective * update record selective
* @param record the updated record * @param record the updated record

View File

@ -3,6 +3,8 @@ package com.bonus.base.mapper;
import com.bonus.base.domain.BmProject; import com.bonus.base.domain.BmProject;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
*@PackagePath: com.bonus.base *@PackagePath: com.bonus.base
*@author : 阮世耀 *@author : 阮世耀
@ -44,6 +46,8 @@ public interface BmProjectMapper {
*/ */
BmProject selectByPrimaryKey(Integer id); BmProject selectByPrimaryKey(Integer id);
List<BmProject> selectAll();
/** /**
* update record selective * update record selective
* @param record the updated record * @param record the updated record

View File

@ -0,0 +1,59 @@
package com.bonus.base.mapper;
import com.bonus.base.domain.BmSupplier;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 机具供应商管理(BmSupplier)表数据库访问层
*
* @author mashuai
* @since 2024-08-09 13:26:39
*/
@Mapper
public interface BmSupplierMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
BmSupplier queryById(Integer id);
/**
* 查询指定行数据
*
* @param bmSupplier 查询条件
* @return 对象列表
*/
List<BmSupplier> queryAllByLimit(BmSupplier bmSupplier);
/**
* 新增数据
*
* @param bmSupplier 实例对象
* @return 影响行数
*/
int insert(BmSupplier bmSupplier);
/**
* 修改数据
*
* @param bmSupplier 实例对象
* @return 影响行数
*/
int update(BmSupplier bmSupplier);
/**
* 通过主键删除数据
*
* @param ids 主键
* @return 影响行数
*/
int deleteById(@Param("array") Long[] ids);
}

View File

@ -1,60 +1,67 @@
package com.bonus.base.service; package com.bonus.base.service;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.bonus.base.domain.BmAgreement; import com.bonus.base.domain.BmAgreement;
import com.bonus.base.mapper.BmAgreementMapper; import com.bonus.base.mapper.BmAgreementMapper;
import javax.annotation.Resource;
import java.util.List;
/** /**
*@PackagePath: com.bonus.base * @PackagePath: com.bonus.base
*@author : 阮世耀 * @author : 阮世耀
*@CreateTime: 2024-08-09 10:33 * @CreateTime: 2024-08-09 10:33
*@Description: 描述 * @Description: 描述
*@version : 1.0 * @version : 1.0
*/ */
@Service @Service
@DS("master")
public class BmAgreementService{ public class BmAgreementService{
@Autowired @Resource
private BmAgreementMapper bmAgreementMapper; private BmAgreementMapper bmAgreementMapper;
public List<BmAgreement> selectAll() {return bmAgreementMapper.selectAll();}
public int deleteByPrimaryKey(Integer id) { public int deleteByPrimaryKey(Integer id) {
return bmAgreementMapper.deleteByPrimaryKey(id); return bmAgreementMapper.deleteByPrimaryKey(id);
} }
public int insert(BmAgreement record) { public int insert(BmAgreement record) {
return bmAgreementMapper.insert(record); return bmAgreementMapper.insert(record);
} }
public int insertOrUpdate(BmAgreement record) { public int insertOrUpdate(BmAgreement record) {
return bmAgreementMapper.insertOrUpdate(record); return bmAgreementMapper.insertOrUpdate(record);
} }
public int insertOrUpdateSelective(BmAgreement record) { public int insertOrUpdateSelective(BmAgreement record) {
return bmAgreementMapper.insertOrUpdateSelective(record); return bmAgreementMapper.insertOrUpdateSelective(record);
} }
public int insertSelective(BmAgreement record) { public int insertSelective(BmAgreement record) {
return bmAgreementMapper.insertSelective(record); return bmAgreementMapper.insertSelective(record);
} }
public BmAgreement selectByPrimaryKey(Integer id) { public BmAgreement selectByPrimaryKey(Integer id) {
return bmAgreementMapper.selectByPrimaryKey(id); return bmAgreementMapper.selectByPrimaryKey(id);
} }
public int updateByPrimaryKeySelective(BmAgreement record) { public int updateByPrimaryKeySelective(BmAgreement record) {
return bmAgreementMapper.updateByPrimaryKeySelective(record); return bmAgreementMapper.updateByPrimaryKeySelective(record);
} }
public int updateByPrimaryKey(BmAgreement record) { public int updateByPrimaryKey(BmAgreement record) {
return bmAgreementMapper.updateByPrimaryKey(record); return bmAgreementMapper.updateByPrimaryKey(record);
} }

View File

@ -1,5 +1,6 @@
package com.bonus.base.service; package com.bonus.base.service;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -15,6 +16,7 @@ import com.bonus.base.mapper.BmCustomerTypeMapper;
* @version : 1.0 * @version : 1.0
*/ */
@Service @Service
@DS("master")
public class BmCustomerTypeService{ public class BmCustomerTypeService{
@Autowired @Autowired

View File

@ -1,5 +1,6 @@
package com.bonus.base.service; package com.bonus.base.service;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.bonus.base.mapper.BmProjectMapper; import com.bonus.base.mapper.BmProjectMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -7,6 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import com.bonus.base.domain.BmProject; import com.bonus.base.domain.BmProject;
import java.util.List;
/** /**
*@PackagePath: com.bonus.base *@PackagePath: com.bonus.base
*@author : 阮世耀 *@author : 阮世耀
@ -15,11 +18,16 @@ import com.bonus.base.domain.BmProject;
*@version : 1.0 *@version : 1.0
*/ */
@Service @Service
@DS("master")
public class BmProjectService{ public class BmProjectService{
@Autowired @Autowired
private BmProjectMapper bmProjectMapper; private BmProjectMapper bmProjectMapper;
public List<BmProject> selectAll() {
return bmProjectMapper.selectAll();
}
public int deleteByPrimaryKey(Integer id) { public int deleteByPrimaryKey(Integer id) {
return bmProjectMapper.deleteByPrimaryKey(id); return bmProjectMapper.deleteByPrimaryKey(id);
} }

View File

@ -0,0 +1,55 @@
package com.bonus.base.service;
import com.bonus.base.domain.BmSupplier;
import java.util.List;
/**
* 机具供应商管理(BmSupplier)表服务接口
*
* @author mashuai
* @since 2024-08-09 13:07:35
*/
public interface BmSupplierService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
BmSupplier queryById(Integer id);
/**
* 分页查询
*
* @param bmSupplier 筛选条件
* @return 查询结果
*/
List<BmSupplier> queryByPage(BmSupplier bmSupplier);
/**
* 新增数据
*
* @param bmSupplier 实例对象
* @return 实例对象
*/
int insert(BmSupplier bmSupplier);
/**
* 修改数据
*
* @param bmSupplier 实例对象
* @return 实例对象
*/
int update(BmSupplier bmSupplier);
/**
* 通过主键删除数据
*
* @param ids 主键
* @return 是否成功
*/
int deleteById(Long[] ids);
}

View File

@ -0,0 +1,76 @@
package com.bonus.base.service.impl;
import com.bonus.base.domain.BmSupplier;
import com.bonus.base.mapper.BmSupplierMapper;
import com.bonus.base.service.BmSupplierService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 机具供应商管理(BmSupplier)表服务实现类
*
* @author mashuai
* @since 2024-08-09 13:07:35
*/
@Service("bmSupplierService")
public class BmSupplierServiceImpl implements BmSupplierService {
@Resource
private BmSupplierMapper bmSupplierDao;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public BmSupplier queryById(Integer id) {
return bmSupplierDao.queryById(id);
}
/**
* 分页查询
*
* @param bmSupplier 筛选条件
* @return 查询结果
*/
@Override
public List<BmSupplier> queryByPage(BmSupplier bmSupplier) {
return bmSupplierDao.queryAllByLimit(bmSupplier);
}
/**
* 新增数据
*
* @param bmSupplier 实例对象
* @return 实例对象
*/
@Override
public int insert(BmSupplier bmSupplier) {
return bmSupplierDao.insert(bmSupplier);
}
/**
* 修改数据
*
* @param bmSupplier 实例对象
* @return 实例对象
*/
@Override
public int update(BmSupplier bmSupplier) {
return bmSupplierDao.update(bmSupplier);
}
/**
* 通过主键删除数据
*
* @param ids 主键
* @return 是否成功
*/
@Override
public int deleteById(Long[] ids) {
return bmSupplierDao.deleteById(ids);
}
}

View File

@ -16,7 +16,9 @@ import lombok.RequiredArgsConstructor;
public final class ResultBean<T> { public final class ResultBean<T> {
private final int code; private final int code;
private final String message; private final String message;
private final T data; private final T data;
/** /**
@ -37,7 +39,7 @@ public final class ResultBean<T> {
* @return 构建的ResultBean实例 * @return 构建的ResultBean实例
*/ */
public static <T> ResultBean<T> error(String message) { public static <T> ResultBean<T> error(String message) {
return new ResultBean<>(500, message, null); return new ResultBean<>(HttpStatus.ERROR, message, null);
} }

View File

@ -19,13 +19,13 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 192.168.0.56:8848 server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc namespace: 693e01a9-1dc4-4858-b1ae-439da3d35f66
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 192.168.0.56:8848 server-addr: 192.168.0.56:8848
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc namespace: 693e01a9-1dc4-4858-b1ae-439da3d35f66
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
shared-configs: shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -7,7 +7,6 @@
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" /> <result column="code" jdbcType="VARCHAR" property="code" />
<result column="sign_date" jdbcType="VARCHAR" property="signDate" /> <result column="sign_date" jdbcType="VARCHAR" property="signDate" />
<result column="lease_company" jdbcType="INTEGER" property="leaseCompany" />
<result column="project" jdbcType="INTEGER" property="project" /> <result column="project" jdbcType="INTEGER" property="project" />
<result column="start_time" jdbcType="VARCHAR" property="startTime" /> <result column="start_time" jdbcType="VARCHAR" property="startTime" />
<result column="lease_term" jdbcType="VARCHAR" property="leaseTerm" /> <result column="lease_term" jdbcType="VARCHAR" property="leaseTerm" />
@ -27,7 +26,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, code, sign_date, lease_company, project, start_time, lease_term, advance_charge, id, code, sign_date, project, start_time, lease_term, advance_charge,
authorizing_person, authorizing_phone, contract_number, creator, create_time, remark, authorizing_person, authorizing_phone, contract_number, creator, create_time, remark,
settlement_time, is_balance, url, is_sure, company_id, is_push settlement_time, is_balance, url, is_sure, company_id, is_push
</sql> </sql>
@ -38,6 +37,13 @@
from bm_agreement from bm_agreement
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bm_agreement
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from bm_agreement delete from bm_agreement
@ -45,15 +51,14 @@
</delete> </delete>
<insert id="insert" parameterType="com.bonus.base.domain.BmAgreement"> <insert id="insert" parameterType="com.bonus.base.domain.BmAgreement">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into bm_agreement (id, code, sign_date, insert into bm_agreement (id, code, sign_date, project, start_time,
lease_company, project, start_time,
lease_term, advance_charge, authorizing_person, lease_term, advance_charge, authorizing_person,
authorizing_phone, contract_number, creator, authorizing_phone, contract_number, creator,
create_time, remark, settlement_time, create_time, remark, settlement_time,
is_balance, url, is_sure, is_balance, url, is_sure,
company_id, is_push) company_id, is_push)
values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{signDate,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{signDate,jdbcType=VARCHAR},
#{leaseCompany,jdbcType=INTEGER}, #{project,jdbcType=INTEGER}, #{startTime,jdbcType=VARCHAR}, #{project,jdbcType=INTEGER}, #{startTime,jdbcType=VARCHAR},
#{leaseTerm,jdbcType=VARCHAR}, #{advanceCharge,jdbcType=VARCHAR}, #{authorizingPerson,jdbcType=VARCHAR}, #{leaseTerm,jdbcType=VARCHAR}, #{advanceCharge,jdbcType=VARCHAR}, #{authorizingPerson,jdbcType=VARCHAR},
#{authorizingPhone,jdbcType=VARCHAR}, #{contractNumber,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{authorizingPhone,jdbcType=VARCHAR}, #{contractNumber,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},
#{createTime,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{settlementTime,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{settlementTime,jdbcType=VARCHAR},
@ -73,9 +78,7 @@
<if test="signDate != null and signDate != ''"> <if test="signDate != null and signDate != ''">
sign_date, sign_date,
</if> </if>
<if test="leaseCompany != null">
lease_company,
</if>
<if test="project != null"> <if test="project != null">
project, project,
</if> </if>
@ -135,9 +138,6 @@
<if test="signDate != null and signDate != ''"> <if test="signDate != null and signDate != ''">
#{signDate,jdbcType=VARCHAR}, #{signDate,jdbcType=VARCHAR},
</if> </if>
<if test="leaseCompany != null">
#{leaseCompany,jdbcType=INTEGER},
</if>
<if test="project != null"> <if test="project != null">
#{project,jdbcType=INTEGER}, #{project,jdbcType=INTEGER},
</if> </if>
@ -198,9 +198,6 @@
<if test="signDate != null and signDate != ''"> <if test="signDate != null and signDate != ''">
sign_date = #{signDate,jdbcType=VARCHAR}, sign_date = #{signDate,jdbcType=VARCHAR},
</if> </if>
<if test="leaseCompany != null">
lease_company = #{leaseCompany,jdbcType=INTEGER},
</if>
<if test="project != null"> <if test="project != null">
project = #{project,jdbcType=INTEGER}, project = #{project,jdbcType=INTEGER},
</if> </if>
@ -257,7 +254,6 @@
update bm_agreement update bm_agreement
set code = #{code,jdbcType=VARCHAR}, set code = #{code,jdbcType=VARCHAR},
sign_date = #{signDate,jdbcType=VARCHAR}, sign_date = #{signDate,jdbcType=VARCHAR},
lease_company = #{leaseCompany,jdbcType=INTEGER},
project = #{project,jdbcType=INTEGER}, project = #{project,jdbcType=INTEGER},
start_time = #{startTime,jdbcType=VARCHAR}, start_time = #{startTime,jdbcType=VARCHAR},
lease_term = #{leaseTerm,jdbcType=VARCHAR}, lease_term = #{leaseTerm,jdbcType=VARCHAR},
@ -279,12 +275,12 @@
<insert id="insertOrUpdate" parameterType="com.bonus.base.domain.BmAgreement"> <insert id="insertOrUpdate" parameterType="com.bonus.base.domain.BmAgreement">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into bm_agreement insert into bm_agreement
(id, code, sign_date, lease_company, project, start_time, lease_term, advance_charge, (id, code, sign_date, project, start_time, lease_term, advance_charge,
authorizing_person, authorizing_phone, contract_number, creator, create_time, remark, authorizing_person, authorizing_phone, contract_number, creator, create_time, remark,
settlement_time, is_balance, url, is_sure, company_id, is_push) settlement_time, is_balance, url, is_sure, company_id, is_push)
values values
(#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{signDate,jdbcType=VARCHAR}, (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{signDate,jdbcType=VARCHAR},
#{leaseCompany,jdbcType=INTEGER}, #{project,jdbcType=INTEGER}, #{startTime,jdbcType=VARCHAR}, #{project,jdbcType=INTEGER}, #{startTime,jdbcType=VARCHAR},
#{leaseTerm,jdbcType=VARCHAR}, #{advanceCharge,jdbcType=VARCHAR}, #{authorizingPerson,jdbcType=VARCHAR}, #{leaseTerm,jdbcType=VARCHAR}, #{advanceCharge,jdbcType=VARCHAR}, #{authorizingPerson,jdbcType=VARCHAR},
#{authorizingPhone,jdbcType=VARCHAR}, #{contractNumber,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{authorizingPhone,jdbcType=VARCHAR}, #{contractNumber,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},
#{createTime,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{settlementTime,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{settlementTime,jdbcType=VARCHAR},
@ -294,8 +290,8 @@
id = #{id,jdbcType=INTEGER}, id = #{id,jdbcType=INTEGER},
code = #{code,jdbcType=VARCHAR}, code = #{code,jdbcType=VARCHAR},
sign_date = #{signDate,jdbcType=VARCHAR}, sign_date = #{signDate,jdbcType=VARCHAR},
lease_company = #{leaseCompany,jdbcType=INTEGER},
project = #{project,jdbcType=INTEGER}, project = #{project,jdbcType=INTEGER},
start_time = #{startTime,jdbcType=VARCHAR}, start_time = #{startTime,jdbcType=VARCHAR},
lease_term = #{leaseTerm,jdbcType=VARCHAR}, lease_term = #{leaseTerm,jdbcType=VARCHAR},
advance_charge = #{advanceCharge,jdbcType=VARCHAR}, advance_charge = #{advanceCharge,jdbcType=VARCHAR},
@ -325,9 +321,6 @@
<if test="signDate != null and signDate != ''"> <if test="signDate != null and signDate != ''">
sign_date, sign_date,
</if> </if>
<if test="leaseCompany != null">
lease_company,
</if>
<if test="project != null"> <if test="project != null">
project, project,
</if> </if>
@ -388,9 +381,6 @@
<if test="signDate != null and signDate != ''"> <if test="signDate != null and signDate != ''">
#{signDate,jdbcType=VARCHAR}, #{signDate,jdbcType=VARCHAR},
</if> </if>
<if test="leaseCompany != null">
#{leaseCompany,jdbcType=INTEGER},
</if>
<if test="project != null"> <if test="project != null">
#{project,jdbcType=INTEGER}, #{project,jdbcType=INTEGER},
</if> </if>
@ -451,9 +441,6 @@
<if test="signDate != null and signDate != ''"> <if test="signDate != null and signDate != ''">
sign_date = #{signDate,jdbcType=VARCHAR}, sign_date = #{signDate,jdbcType=VARCHAR},
</if> </if>
<if test="leaseCompany != null">
lease_company = #{leaseCompany,jdbcType=INTEGER},
</if>
<if test="project != null"> <if test="project != null">
project = #{project,jdbcType=INTEGER}, project = #{project,jdbcType=INTEGER},
</if> </if>
@ -504,4 +491,5 @@
</if> </if>
</trim> </trim>
</insert> </insert>
</mapper> </mapper>

View File

@ -49,6 +49,14 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="selectAll" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from bm_project
where is_active = '1'
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from bm_project delete from bm_project
@ -71,7 +79,7 @@
#{phone,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{remarks,jdbcType=VARCHAR}, #{materialClerk,jdbcType=VARCHAR}, #{clerkPhone,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{materialClerk,jdbcType=VARCHAR}, #{clerkPhone,jdbcType=VARCHAR},
#{voltageClass,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{isBalanceEnd,jdbcType=CHAR}, #{voltageClass,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{isBalanceEnd,jdbcType=CHAR},
#{time,jdbcType=VARCHAR}, #{isActive,jdbcType=VARCHAR}, #{lon,jdbcType=VARCHAR}, #{time,jdbcType=VARCHAR}, '1', #{lon,jdbcType=VARCHAR},
#{lat,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, #{impUnit,jdbcType=VARCHAR}, #{lat,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, #{impUnit,jdbcType=VARCHAR},
#{deptName,jdbcType=VARCHAR}, #{proId,jdbcType=VARCHAR}, #{deptId,jdbcType=INTEGER}, #{deptName,jdbcType=VARCHAR}, #{proId,jdbcType=VARCHAR}, #{deptId,jdbcType=INTEGER},
#{cvo,jdbcType=VARCHAR}, #{stats,jdbcType=VARCHAR}, #{htzt,jdbcType=VARCHAR}) #{cvo,jdbcType=VARCHAR}, #{stats,jdbcType=VARCHAR}, #{htzt,jdbcType=VARCHAR})

View File

@ -0,0 +1,129 @@
<?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.bonus.base.mapper.BmSupplierMapper">
<resultMap type="com.bonus.base.domain.BmSupplier" id="BmSupplierMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="address" column="address" jdbcType="VARCHAR"/>
<result property="companyMan" column="company_man" jdbcType="VARCHAR"/>
<result property="mainPerson" column="main_person" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="scopeBusiness" column="scope_business" jdbcType="VARCHAR"/>
<result property="notes" column="notes" jdbcType="VARCHAR"/>
<result property="picUrl" column="pic_url" jdbcType="VARCHAR"/>
<result property="isActive" column="is_active" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="INTEGER"/>
</resultMap>
<sql id="selectMaSupplierInfoVo">
select id, name, address, company_man, main_person, phone, scope_business, notes, pic_url, is_active, company_id
from bm_supplier
</sql>
<!--查询单个-->
<select id="queryById" resultMap="BmSupplierMap">
<include refid="selectMaSupplierInfoVo"/>
where id = #{id} and is_active = 1
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="BmSupplierMap">
<include refid="selectMaSupplierInfoVo"/>
where
1 = 1 and is_active = 1
<if test="companyId != null">
AND company_id = #{companyId}
</if>
<if test="keyWord!= null">
AND (
`name` LIKE CONCAT('%',#{keyWord},'%')
OR address LIKE CONCAT('%',#{keyWord},'%')
OR company_man LIKE CONCAT('%',#{keyWord},'%')
OR main_person LIKE CONCAT('%',#{keyWord},'%')
OR phone LIKE CONCAT('%',#{keyWord},'%')
OR scope_business LIKE CONCAT('%',#{keyWord},'%')
OR notes LIKE CONCAT('%',#{keyWord},'%')
OR pic_url LIKE CONCAT('%',#{keyWord},'%')
)
</if>
ORDER BY id DESC
</select>
<insert id="insert">
insert into bm_supplier(
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="address != null">address,</if>
<if test="companyMan != null">company_man,</if>
<if test="mainPerson != null">main_person,</if>
<if test="phone != null">phone,</if>
<if test="scopeBusiness != null">scope_business,</if>
<if test="notes != null">notes,</if>
<if test="picUrl != null">pic_url,</if>
<if test="isActive != null">is_active,</if>
<if test="companyId != null">company_id</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="address != null">#{address},</if>
<if test="companyMan != null">#{companyMan},</if>
<if test="mainPerson != null">#{mainPerson},</if>
<if test="phone != null">#{phone},</if>
<if test="scopeBusiness != null">#{scopeBusiness},</if>
<if test="notes != null">#{notes},</if>
<if test="picUrl != null">#{picUrl},</if>
"1",
<if test="companyId != null">#{companyId}</if>
</trim>
</insert>
<!--通过主键修改数据-->
<update id="update">
update bm_supplier
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="address != null">
address = #{address},
</if>
<if test="companyMan != null">
company_man = #{companyMan},
</if>
<if test="mainPerson != null">
main_person = #{mainPerson},
</if>
<if test="phone != null">
phone = #{phone},
</if>
<if test="scopeBusiness != null">
scope_business = #{scopeBusiness},
</if>
<if test="notes != null">
notes = #{notes},
</if>
<if test="picUrl != null">
pic_url = #{picUrl},
</if>
<if test="isActive != null">
is_active = #{isActive},
</if>
<if test="companyId != null">
company_id = #{companyId},
</if>
</trim>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
update bm_supplier set is_active = 0 where id in
<foreach item="supplierId" collection="array" open="(" separator="," close=")">
#{supplierId}
</foreach>
</delete>
</mapper>