From aabcf7d09eb23680264332653d82153a8a043390 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 6 Aug 2024 14:56:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/base/api/domain/BmStorageLog.java | 141 +++++++++++ .../controller/BmStorageLogController.java | 54 ++++ .../system/mapper/BmStorageLogMapper.java | 25 ++ .../service/impl/BmStorageLogService.java | 57 +++++ .../mapper/system/BmStorageLogMapper.xml | 231 ++++++++++++++++++ 5 files changed, 508 insertions(+) create mode 100644 sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BmStorageLog.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/BmStorageLogController.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/BmStorageLogMapper.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/BmStorageLogService.java create mode 100644 sgzb-modules/sgzb-system/src/main/resources/mapper/system/BmStorageLogMapper.xml diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BmStorageLog.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BmStorageLog.java new file mode 100644 index 00000000..c7f03e2b --- /dev/null +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BmStorageLog.java @@ -0,0 +1,141 @@ +package com.bonus.sgzb.base.api.domain; + +import com.bonus.sgzb.common.core.annotation.Excel; +import com.bonus.sgzb.common.core.web.domain.BaseEntity; +import lombok.Getter; +import lombok.Setter; + +/** + * @author syruan + */ +@Getter +@Setter +public class BmStorageLog extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @Excel(name = "ID") + private Integer id; + + /** + * 模块名称/title标题 + */ + @Excel(name = "模块名称/title标题") + private String modelTitle; + + /** + * 接口地址/请求方法 + */ + @Excel(name = "接口地址/请求方法") + private String method; + + /** 请求方式 */ + @Excel(name = "请求方式") + private String requestMethod; + + /** + * 实例 + */ + @Excel(name = "实例/任务") + private String taskId; + + @Excel(name = "协议id") + private int agreementId; + + /** + * 任务名称 + */ + private String taskName; + + /** + * 规格id + */ + @Excel(name = "规格id") + private Integer typeId; + + /** + * 规格名称 + */ + private String typeName; + + /** + * 父级规格名称 + */ + private String typeParentName; + + + @Excel(name = "操作前库存") + private int preStoreNum; + + @Excel(name = "入库数量") + private int inNum; + + @Excel(name = "出库数量") + private int outNum; + + @Excel(name = "退库数量") + private int backNum; + + @Excel(name = "合格数量") + private int passNum; + + @Excel(name = "维修数量") + private int maintenanceNum; + + @Excel(name = "报废数量") + private int scrapNum; + + @Excel(name = "操作后库存") + private int postStoreNum; + + @Excel(name = "出库类型 0编码出库 1数量出库 2成套出库") + private String manageType; + + /** + * 响应内容/状态码/返回参数 + */ + @Excel(name = "响应内容/状态码/返回参数") + private int resultCode; + + /** + * 响应内容/状态码/返回参数 + */ + @Excel(name = "响应内容/状态码/返回参数") + private String resultMsg; + + + /** + * 创建人 + */ + @Excel(name = "创建人") + private String creator; + + /** + * 备注 + */ + @Excel(name = "备注") + private String remark; + + @Excel(name = "型号") + private String typeModelName; + + @Excel(name = "状态") + private int status; + + @Excel(name = "返回结果") + private String jsonResult; + +// private String createBy; +// private String parentId; +// private String inputNum; +// +// @Excel(name = "http返回消息") +// private String msg; +// +// @Excel(name = "http返回码") +// private String code; + +} \ No newline at end of file diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/BmStorageLogController.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/BmStorageLogController.java new file mode 100644 index 00000000..97af3137 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/BmStorageLogController.java @@ -0,0 +1,54 @@ +package com.bonus.sgzb.system.controller; + +import com.bonus.sgzb.common.core.web.controller.BaseController; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.common.core.web.page.TableDataInfo; +import com.bonus.sgzb.common.security.annotation.InnerAuth; +import com.bonus.sgzb.base.api.domain.BmStorageLog; +import com.bonus.sgzb.system.service.impl.BmStorageLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** +* (bm_storage_log)表控制层 +* +* @author syruan +*/ +@RestController +@RequestMapping("/bm_storage_logs") +public class BmStorageLogController extends BaseController { + + /** + * 服务对象 + */ + @Autowired + private BmStorageLogService bmStorageLogService; + + @GetMapping("/list") + public TableDataInfo list(BmStorageLog record) { + startPage(); + List list = bmStorageLogService.selectAll(record); + return getDataTable(list); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("selectByPrimaryKey") + public BmStorageLog selectByPrimaryKey(Integer id) { + return bmStorageLogService.selectByPrimaryKey(id); + } + + @InnerAuth + @PostMapping + public AjaxResult batchInsert(@RequestBody List bmStorageLogList) { + return toAjax(bmStorageLogService.batchInsert(bmStorageLogList)); + } + + +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/BmStorageLogMapper.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/BmStorageLogMapper.java new file mode 100644 index 00000000..8676f1fb --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/BmStorageLogMapper.java @@ -0,0 +1,25 @@ +package com.bonus.sgzb.system.mapper; + +import com.bonus.sgzb.base.api.domain.BmStorageLog; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface BmStorageLogMapper { + int deleteByPrimaryKey(Integer id); + +// int insert(BmStorageLog record); + + int batchInsert(List records); + + int insertSelective(BmStorageLog record); + + BmStorageLog selectByPrimaryKey(Integer id); + + List selectAll(BmStorageLog record); + + int updateByPrimaryKeySelective(BmStorageLog record); + + int updateByPrimaryKey(BmStorageLog record); +} \ No newline at end of file diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/BmStorageLogService.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/BmStorageLogService.java new file mode 100644 index 00000000..292bdec4 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/BmStorageLogService.java @@ -0,0 +1,57 @@ +package com.bonus.sgzb.system.service.impl; + +import com.bonus.sgzb.base.api.domain.BmStorageLog; +import com.bonus.sgzb.system.mapper.BmStorageLogMapper; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@Slf4j +public class BmStorageLogService { + + @Autowired + private BmStorageLogMapper bmStorageLogMapper; + + private static ObjectMapper objectMapper = new ObjectMapper(); + + public int deleteByPrimaryKey(Integer id) { + return bmStorageLogMapper.deleteByPrimaryKey(id); + } + +// public int insert(BmStorageLog record) { +// return bmStorageLogMapper.insert(record); +// } + + public int batchInsert(List records) { + log.info("batch insert log {}", records); + return bmStorageLogMapper.batchInsert(records); + } + + public List selectAll(BmStorageLog record) { + return bmStorageLogMapper.selectAll(record); + } + + public int insertSelective(BmStorageLog record) { + return bmStorageLogMapper.insertSelective(record); + } + + + public BmStorageLog selectByPrimaryKey(Integer id) { + return bmStorageLogMapper.selectByPrimaryKey(id); + } + + + public int updateByPrimaryKeySelective(BmStorageLog record) { + return bmStorageLogMapper.updateByPrimaryKeySelective(record); + } + + + public int updateByPrimaryKey(BmStorageLog record) { + return bmStorageLogMapper.updateByPrimaryKey(record); + } + +} diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/BmStorageLogMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/BmStorageLogMapper.xml new file mode 100644 index 00000000..afa44fb6 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/BmStorageLogMapper.xml @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, model_title, `method`, task, type_id, num, `description`, json_result, `time`, creator, + remark, `status` + + + + + + + + + delete from bm_storage_log + where id = #{id,jdbcType=INTEGER} + + + + + + + + + + + + + + + + + + + + + insert into bm_storage_log (model_title, `method`, task_id, type_id, + create_time, creator, remark, out_num, manage_type, + type_name, type_model_name, pre_store_num, in_num, + back_num, pass_num, maintenance_num, agreement_id, + scrap_num, `status`, post_store_num, result_code, result_msg, json_result + ) values + + ( + #{item.modelTitle,jdbcType=VARCHAR}, #{item.method,jdbcType=VARCHAR}, #{item.taskId,jdbcType=VARCHAR}, #{item.typeId,jdbcType=INTEGER}, + now(), #{item.creator,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.outNum,jdbcType=INTEGER}, #{item.manageType,jdbcType=VARCHAR}, + #{item.typeName,jdbcType=VARCHAR}, #{item.typeModelName,jdbcType=VARCHAR}, #{item.preStoreNum,jdbcType=INTEGER}, #{item.inNum,jdbcType=INTEGER}, + #{item.backNum,jdbcType=INTEGER}, #{item.passNum,jdbcType=INTEGER}, #{item.maintenanceNum,jdbcType=INTEGER}, #{item.agreementId,jdbcType=INTEGER}, + #{item.scrapNum,jdbcType=INTEGER}, #{item.status,jdbcType=VARCHAR}, #{item.postStoreNum,jdbcType=INTEGER}, + #{item.resultCode,jdbcType=INTEGER}, #{item.resultMsg,jdbcType=VARCHAR}, #{item.jsonResult,jdbcType=VARCHAR} + ) + + + + + + insert into bm_storage_log + + + model_title, + + + `method`, + + + task, + + + type_id, + + + num, + + + `description`, + + + json_result, + + + `time`, + + + creator, + + + remark, + + + + + #{modelTitle,jdbcType=VARCHAR}, + + + #{method,jdbcType=VARCHAR}, + + + #{task,jdbcType=VARCHAR}, + + + #{typeId,jdbcType=INTEGER}, + + + #{num,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{jsonResult,jdbcType=VARCHAR}, + + + #{time,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + + + + + update bm_storage_log + + + model_title = #{modelTitle,jdbcType=VARCHAR}, + + + `method` = #{method,jdbcType=VARCHAR}, + + + task = #{task,jdbcType=VARCHAR}, + + + type_id = #{typeId,jdbcType=INTEGER}, + + + description = #{description,jdbcType=VARCHAR}, + + + json_result = #{jsonResult,jdbcType=VARCHAR}, + + + `time` = #{time,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + + + update bm_storage_log + set model_title = #{modelTitle,jdbcType=VARCHAR}, + `method` = #{method,jdbcType=VARCHAR}, + task = #{task,jdbcType=VARCHAR}, + type_id = #{typeId,jdbcType=INTEGER}, + description = #{description,jdbcType=VARCHAR}, + json_result = #{jsonResult,jdbcType=VARCHAR}, + `time` = #{time,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + \ No newline at end of file