From 6f16907941d8d4ec2bf0147b6e2cbe05e379ee82 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Mon, 19 Aug 2024 16:44:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=B4=AD=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BpmPurchaseInfoController.java | 85 +++ .../purchase/domain/BpmPurchaseInfo.java | 143 +++++ .../mapper/BpmPurchaseInfoMapper.java | 67 +++ .../service/impl/BpmPurchaseInfoService.java | 71 +++ .../mapper.purchase/BpmPurchaseInfoMapper.xml | 550 ++++++++++++++++++ 5 files changed, 916 insertions(+) create mode 100644 bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmPurchaseInfoController.java create mode 100644 bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmPurchaseInfo.java create mode 100644 bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmPurchaseInfoMapper.java create mode 100644 bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmPurchaseInfoService.java create mode 100644 bonus-modules/bonus-purchase/src/main/resources/mapper.purchase/BpmPurchaseInfoMapper.xml diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmPurchaseInfoController.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmPurchaseInfoController.java new file mode 100644 index 0000000..dfb2710 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmPurchaseInfoController.java @@ -0,0 +1,85 @@ +package com.bonus.purchase.controller; +import com.bonus.common.core.domain.ResultBean; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.page.TableDataInfo; +import com.bonus.purchase.domain.BpmPurchaseInfo; +import com.bonus.purchase.service.impl.BpmPurchaseInfoService; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +/** +* 新购到货验收表bpm_purchase_info(bpm_purchase_info)表控制层 +* +* @author 阮世耀 +*/ +@RestController +@RequestMapping("/bpm_purchase_info") +public class BpmPurchaseInfoController extends BaseController { + + /** + * 服务对象 + */ + @Autowired + private BpmPurchaseInfoService bpmPurchaseInfoService; + + + /** + * 分页查询数据 + */ + @GetMapping(value = "/list") + public TableDataInfo getList(BpmPurchaseInfo bpmPurchaseInfo) { + startPage(); + List list = this.bpmPurchaseInfoService.selectAll(); + return getDataTable(list); + } + + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResultBean queryById(@PathVariable("id") Integer id) { + return ResultBean.success(this.bpmPurchaseInfoService.selectByPrimaryKey(id)); + } + + /** + * 新增数据 + * + * @param bpmPurchaseInfo 实体 + * @return 新增结果 + */ + @PostMapping(value = "/add") + public ResultBean< Boolean> add(@RequestBody BpmPurchaseInfo bpmPurchaseInfo) { + this.bpmPurchaseInfoService.insertSelective(bpmPurchaseInfo); + return ResultBean.success(true); + } + + /** + * 编辑数据 + * + * @param bpmPurchaseInfo 实体 + * @return 编辑结果 + */ + @PutMapping(value = "/update") + public ResultBean< Boolean> edit(@RequestBody BpmPurchaseInfo bpmPurchaseInfo) { + this.bpmPurchaseInfoService.updateByPrimaryKeySelective(bpmPurchaseInfo); + return ResultBean.success(true); + } + + /** + * 删除数据 + * + * @param id 主键 + * @return 删除是否成功 + */ + @PostMapping(value = "/delete/{id}") + public ResultBean< Boolean> deleteById(@PathVariable("id") Integer id) { + this.bpmPurchaseInfoService.deleteByPrimaryKey(id); + return ResultBean.success(true); + } +} diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmPurchaseInfo.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmPurchaseInfo.java new file mode 100644 index 0000000..cf672fa --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmPurchaseInfo.java @@ -0,0 +1,143 @@ +package com.bonus.purchase.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + *@PackagePath: com.bonus.purchase + *@author : 阮世耀 + *@CreateTime: 2024-08-19 16:31 + *@Description: 描述 + *@version : 1.0 +*/ +/** + * 新购到货验收表bpm_purchase_info + */ +@ApiModel(description="新购到货验收表bpm_purchase_info") +@Data +public class BpmPurchaseInfo implements Serializable { + /** + * id + */ + @ApiModelProperty(value="id") + private Integer id; + + /** + * 任务id + */ + @ApiModelProperty(value="任务id") + private Integer taskId; + + /** + * 规格id + */ + @ApiModelProperty(value="规格id") + private Integer typeId; + + /** + * 采购数量按整型存储,按1000做倍数 + */ + @ApiModelProperty(value="采购数量按整型存储,按1000做倍数") + private Integer purchaseNum; + + /** + * 验收数量按整型存储,按1000做倍数 + */ + @ApiModelProperty(value="验收数量按整型存储,按1000做倍数") + private Integer checkNum; + + /** + * 采购价(含税)按整型存储,按100做倍数 + */ + @ApiModelProperty(value="采购价(含税)按整型存储,按100做倍数") + private Integer purchasePrice; + + /** + * 采购价(不含税)按整型存储,按100做倍数 + */ + @ApiModelProperty(value="采购价(不含税)按整型存储,按100做倍数") + private Integer notaxPrice; + + /** + * 税率 + */ + @ApiModelProperty(value="税率") + private Integer taxRate; + + /** + * 供应商id + */ + @ApiModelProperty(value="供应商id") + private Integer supplierId; + + /** + * 出厂日期 + */ + @ApiModelProperty(value="出厂日期") + private Date productDate; + + /** + * 状态 + */ + @ApiModelProperty(value="状态") + private Byte status; + + /** + * 绑定数量100倍数 + */ + @ApiModelProperty(value="绑定数量100倍数") + private Integer bindNum; + + /** + * 入库数量100倍数 + */ + @ApiModelProperty(value="入库数量100倍数") + private Integer inputNum; + + /** + * 更新人 + */ + @ApiModelProperty(value="更新人") + private String updater; + + /** + * 更新时间 + */ + @ApiModelProperty(value="更新时间") + private String updateTime; + + /** + * 审核人 + */ + @ApiModelProperty(value="审核人") + private String auditor; + + /** + * 审核时间 + */ + @ApiModelProperty(value="审核时间") + private String auditTime; + + /** + * 1启用0未启用 + */ + @ApiModelProperty(value="1启用0未启用") + private Byte isActive; + + /** + * 备注 + */ + @ApiModelProperty(value="备注") + private String remark; + + /** + * 文件路径需讨论 + */ + @ApiModelProperty(value="文件路径需讨论") + private String fileUrl; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmPurchaseInfoMapper.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmPurchaseInfoMapper.java new file mode 100644 index 0000000..f662403 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmPurchaseInfoMapper.java @@ -0,0 +1,67 @@ +package com.bonus.purchase.mapper; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +import com.bonus.purchase.domain.BpmPurchaseInfo; +import org.apache.ibatis.annotations.Mapper; + +/** + *@PackagePath: com.bonus.purchase + *@author : 阮世耀 + *@CreateTime: 2024-08-19 16:31 + *@Description: 描述 + *@version : 1.0 +*/ +@Mapper +public interface BpmPurchaseInfoMapper { + + List selectAll(); + + + + /** + * delete by primary key + * @param id primaryKey + * @return deleteCount + */ + int deleteByPrimaryKey(Integer id); + + /** + * insert record to table + * @param record the record + * @return insert count + */ + int insert(BpmPurchaseInfo record); + + int insertOrUpdate(BpmPurchaseInfo record); + + int insertOrUpdateSelective(BpmPurchaseInfo record); + + /** + * insert record to table selective + * @param record the record + * @return insert count + */ + int insertSelective(BpmPurchaseInfo record); + + /** + * select by primary key + * @param id primary key + * @return object by primary key + */ + BpmPurchaseInfo selectByPrimaryKey(Integer id); + + /** + * update record selective + * @param record the updated record + * @return update count + */ + int updateByPrimaryKeySelective(BpmPurchaseInfo record); + + /** + * update record + * @param record the updated record + * @return update count + */ + int updateByPrimaryKey(BpmPurchaseInfo record); +} \ No newline at end of file diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmPurchaseInfoService.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmPurchaseInfoService.java new file mode 100644 index 0000000..d9fdf70 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmPurchaseInfoService.java @@ -0,0 +1,71 @@ +package com.bonus.purchase.service.impl; +import java.util.List; + +import com.bonus.purchase.mapper.BpmPurchaseInfoMapper; +import org.springframework.stereotype.Service; + +import org.springframework.beans.factory.annotation.Autowired; + +import com.bonus.purchase.domain.BpmPurchaseInfo; + +/** + *@PackagePath: com.bonus.purchase + *@author : 阮世耀 + *@CreateTime: 2024-08-19 16:31 + *@Description: 描述 + *@version : 1.0 +*/ +@Service +public class BpmPurchaseInfoService{ + + @Autowired + private BpmPurchaseInfoMapper bpmPurchaseInfoMapper; + + + public int deleteByPrimaryKey(Integer id) { + return bpmPurchaseInfoMapper.deleteByPrimaryKey(id); + } + + + public int insert(BpmPurchaseInfo record) { + return bpmPurchaseInfoMapper.insert(record); + } + + + public int insertOrUpdate(BpmPurchaseInfo record) { + return bpmPurchaseInfoMapper.insertOrUpdate(record); + } + + + public int insertOrUpdateSelective(BpmPurchaseInfo record) { + return bpmPurchaseInfoMapper.insertOrUpdateSelective(record); + } + + + public int insertSelective(BpmPurchaseInfo record) { + return bpmPurchaseInfoMapper.insertSelective(record); + } + + + public BpmPurchaseInfo selectByPrimaryKey(Integer id) { + return bpmPurchaseInfoMapper.selectByPrimaryKey(id); + } + + + public int updateByPrimaryKeySelective(BpmPurchaseInfo record) { + return bpmPurchaseInfoMapper.updateByPrimaryKeySelective(record); + } + + + public int updateByPrimaryKey(BpmPurchaseInfo record) { + return bpmPurchaseInfoMapper.updateByPrimaryKey(record); + } + + public List selectAll(){ + return bpmPurchaseInfoMapper.selectAll(); + } + + + + +} diff --git a/bonus-modules/bonus-purchase/src/main/resources/mapper.purchase/BpmPurchaseInfoMapper.xml b/bonus-modules/bonus-purchase/src/main/resources/mapper.purchase/BpmPurchaseInfoMapper.xml new file mode 100644 index 0000000..0f8247b --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/resources/mapper.purchase/BpmPurchaseInfoMapper.xml @@ -0,0 +1,550 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, task_id, type_id, purchase_num, check_num, purchase_price, notax_price, tax_rate, + supplier_id, product_date, `status`, bind_num, input_num, updater, update_time, auditor, + audit_time, is_active, remark, file_url + + + + + delete from bpm_purchase_info + where id = #{id,jdbcType=INTEGER} + + + + insert into bpm_purchase_info (task_id, type_id, purchase_num, + check_num, purchase_price, notax_price, + tax_rate, supplier_id, product_date, + `status`, bind_num, input_num, + updater, update_time, auditor, + audit_time, is_active, remark, + file_url) + values (#{taskId,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{purchaseNum,jdbcType=INTEGER}, + #{checkNum,jdbcType=INTEGER}, #{purchasePrice,jdbcType=INTEGER}, #{notaxPrice,jdbcType=INTEGER}, + #{taxRate,jdbcType=INTEGER}, #{supplierId,jdbcType=INTEGER}, #{productDate,jdbcType=TIMESTAMP}, + #{status,jdbcType=TINYINT}, #{bindNum,jdbcType=INTEGER}, #{inputNum,jdbcType=INTEGER}, + #{updater,jdbcType=VARCHAR}, #{updateTime,jdbcType=VARCHAR}, #{auditor,jdbcType=VARCHAR}, + #{auditTime,jdbcType=VARCHAR}, #{isActive,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, + #{fileUrl,jdbcType=VARCHAR}) + + + + insert into bpm_purchase_info + + + task_id, + + + type_id, + + + purchase_num, + + + check_num, + + + purchase_price, + + + notax_price, + + + tax_rate, + + + supplier_id, + + + product_date, + + + `status`, + + + bind_num, + + + input_num, + + + updater, + + + update_time, + + + auditor, + + + audit_time, + + + is_active, + + + remark, + + + file_url, + + + + + #{taskId,jdbcType=INTEGER}, + + + #{typeId,jdbcType=INTEGER}, + + + #{purchaseNum,jdbcType=INTEGER}, + + + #{checkNum,jdbcType=INTEGER}, + + + #{purchasePrice,jdbcType=INTEGER}, + + + #{notaxPrice,jdbcType=INTEGER}, + + + #{taxRate,jdbcType=INTEGER}, + + + #{supplierId,jdbcType=INTEGER}, + + + #{productDate,jdbcType=TIMESTAMP}, + + + #{status,jdbcType=TINYINT}, + + + #{bindNum,jdbcType=INTEGER}, + + + #{inputNum,jdbcType=INTEGER}, + + + #{updater,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=VARCHAR}, + + + #{auditor,jdbcType=VARCHAR}, + + + #{auditTime,jdbcType=VARCHAR}, + + + #{isActive,jdbcType=TINYINT}, + + + #{remark,jdbcType=VARCHAR}, + + + #{fileUrl,jdbcType=VARCHAR}, + + + + + + update bpm_purchase_info + + + task_id = #{taskId,jdbcType=INTEGER}, + + + type_id = #{typeId,jdbcType=INTEGER}, + + + purchase_num = #{purchaseNum,jdbcType=INTEGER}, + + + check_num = #{checkNum,jdbcType=INTEGER}, + + + purchase_price = #{purchasePrice,jdbcType=INTEGER}, + + + notax_price = #{notaxPrice,jdbcType=INTEGER}, + + + tax_rate = #{taxRate,jdbcType=INTEGER}, + + + supplier_id = #{supplierId,jdbcType=INTEGER}, + + + product_date = #{productDate,jdbcType=TIMESTAMP}, + + + `status` = #{status,jdbcType=TINYINT}, + + + bind_num = #{bindNum,jdbcType=INTEGER}, + + + input_num = #{inputNum,jdbcType=INTEGER}, + + + updater = #{updater,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=VARCHAR}, + + + auditor = #{auditor,jdbcType=VARCHAR}, + + + audit_time = #{auditTime,jdbcType=VARCHAR}, + + + is_active = #{isActive,jdbcType=TINYINT}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + file_url = #{fileUrl,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + + update bpm_purchase_info + set task_id = #{taskId,jdbcType=INTEGER}, + type_id = #{typeId,jdbcType=INTEGER}, + purchase_num = #{purchaseNum,jdbcType=INTEGER}, + check_num = #{checkNum,jdbcType=INTEGER}, + purchase_price = #{purchasePrice,jdbcType=INTEGER}, + notax_price = #{notaxPrice,jdbcType=INTEGER}, + tax_rate = #{taxRate,jdbcType=INTEGER}, + supplier_id = #{supplierId,jdbcType=INTEGER}, + product_date = #{productDate,jdbcType=TIMESTAMP}, + `status` = #{status,jdbcType=TINYINT}, + bind_num = #{bindNum,jdbcType=INTEGER}, + input_num = #{inputNum,jdbcType=INTEGER}, + updater = #{updater,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=VARCHAR}, + auditor = #{auditor,jdbcType=VARCHAR}, + audit_time = #{auditTime,jdbcType=VARCHAR}, + is_active = #{isActive,jdbcType=TINYINT}, + remark = #{remark,jdbcType=VARCHAR}, + file_url = #{fileUrl,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + insert into bpm_purchase_info + + + id, + + task_id, + type_id, + purchase_num, + check_num, + purchase_price, + notax_price, + tax_rate, + supplier_id, + product_date, + `status`, + bind_num, + input_num, + updater, + update_time, + auditor, + audit_time, + is_active, + remark, + file_url, + + values + + + #{id,jdbcType=INTEGER}, + + #{taskId,jdbcType=INTEGER}, + #{typeId,jdbcType=INTEGER}, + #{purchaseNum,jdbcType=INTEGER}, + #{checkNum,jdbcType=INTEGER}, + #{purchasePrice,jdbcType=INTEGER}, + #{notaxPrice,jdbcType=INTEGER}, + #{taxRate,jdbcType=INTEGER}, + #{supplierId,jdbcType=INTEGER}, + #{productDate,jdbcType=TIMESTAMP}, + #{status,jdbcType=TINYINT}, + #{bindNum,jdbcType=INTEGER}, + #{inputNum,jdbcType=INTEGER}, + #{updater,jdbcType=VARCHAR}, + #{updateTime,jdbcType=VARCHAR}, + #{auditor,jdbcType=VARCHAR}, + #{auditTime,jdbcType=VARCHAR}, + #{isActive,jdbcType=TINYINT}, + #{remark,jdbcType=VARCHAR}, + #{fileUrl,jdbcType=VARCHAR}, + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + task_id = #{taskId,jdbcType=INTEGER}, + type_id = #{typeId,jdbcType=INTEGER}, + purchase_num = #{purchaseNum,jdbcType=INTEGER}, + check_num = #{checkNum,jdbcType=INTEGER}, + purchase_price = #{purchasePrice,jdbcType=INTEGER}, + notax_price = #{notaxPrice,jdbcType=INTEGER}, + tax_rate = #{taxRate,jdbcType=INTEGER}, + supplier_id = #{supplierId,jdbcType=INTEGER}, + product_date = #{productDate,jdbcType=TIMESTAMP}, + `status` = #{status,jdbcType=TINYINT}, + bind_num = #{bindNum,jdbcType=INTEGER}, + input_num = #{inputNum,jdbcType=INTEGER}, + updater = #{updater,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=VARCHAR}, + auditor = #{auditor,jdbcType=VARCHAR}, + audit_time = #{auditTime,jdbcType=VARCHAR}, + is_active = #{isActive,jdbcType=TINYINT}, + remark = #{remark,jdbcType=VARCHAR}, + file_url = #{fileUrl,jdbcType=VARCHAR}, + + + + + insert into bpm_purchase_info + + + id, + + + task_id, + + + type_id, + + + purchase_num, + + + check_num, + + + purchase_price, + + + notax_price, + + + tax_rate, + + + supplier_id, + + + product_date, + + + `status`, + + + bind_num, + + + input_num, + + + updater, + + + update_time, + + + auditor, + + + audit_time, + + + is_active, + + + remark, + + + file_url, + + + values + + + #{id,jdbcType=INTEGER}, + + + #{taskId,jdbcType=INTEGER}, + + + #{typeId,jdbcType=INTEGER}, + + + #{purchaseNum,jdbcType=INTEGER}, + + + #{checkNum,jdbcType=INTEGER}, + + + #{purchasePrice,jdbcType=INTEGER}, + + + #{notaxPrice,jdbcType=INTEGER}, + + + #{taxRate,jdbcType=INTEGER}, + + + #{supplierId,jdbcType=INTEGER}, + + + #{productDate,jdbcType=TIMESTAMP}, + + + #{status,jdbcType=TINYINT}, + + + #{bindNum,jdbcType=INTEGER}, + + + #{inputNum,jdbcType=INTEGER}, + + + #{updater,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=VARCHAR}, + + + #{auditor,jdbcType=VARCHAR}, + + + #{auditTime,jdbcType=VARCHAR}, + + + #{isActive,jdbcType=TINYINT}, + + + #{remark,jdbcType=VARCHAR}, + + + #{fileUrl,jdbcType=VARCHAR}, + + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + + task_id = #{taskId,jdbcType=INTEGER}, + + + type_id = #{typeId,jdbcType=INTEGER}, + + + purchase_num = #{purchaseNum,jdbcType=INTEGER}, + + + check_num = #{checkNum,jdbcType=INTEGER}, + + + purchase_price = #{purchasePrice,jdbcType=INTEGER}, + + + notax_price = #{notaxPrice,jdbcType=INTEGER}, + + + tax_rate = #{taxRate,jdbcType=INTEGER}, + + + supplier_id = #{supplierId,jdbcType=INTEGER}, + + + product_date = #{productDate,jdbcType=TIMESTAMP}, + + + `status` = #{status,jdbcType=TINYINT}, + + + bind_num = #{bindNum,jdbcType=INTEGER}, + + + input_num = #{inputNum,jdbcType=INTEGER}, + + + updater = #{updater,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=VARCHAR}, + + + auditor = #{auditor,jdbcType=VARCHAR}, + + + audit_time = #{auditTime,jdbcType=VARCHAR}, + + + is_active = #{isActive,jdbcType=TINYINT}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + file_url = #{fileUrl,jdbcType=VARCHAR}, + + + + + + + \ No newline at end of file