diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/controller/MaReceiveController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/controller/MaReceiveController.java index f309528..791bf62 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/controller/MaReceiveController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/controller/MaReceiveController.java @@ -21,7 +21,7 @@ import java.util.List; */ @RestController -@RequestMapping("/receive") +@RequestMapping("/base/receive") public class MaReceiveController extends BaseController { @Resource 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 0000000..84fceb3 --- /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.base.api.domain.BmStorageLog; +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.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 0000000..8676f1f --- /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 0000000..292bdec --- /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 0000000..71e8972 --- /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