From 77c740164cc827f1aaffea9a30c62c360bf55224 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Fri, 12 Apr 2024 16:19:28 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E7=89=A9=E8=B5=84LOG=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/system/api/RemoteLogService.java | 12 ++ .../sgzb/system/api/domain/BmNumLogs.java | 85 +++++++++ .../api/factory/RemoteLogFallbackFactory.java | 6 + .../sgzb/auth/controller/TokenController.java | 1 + .../controller/BmNumLogsController.java | 54 ++++++ .../sgzb/material/mapper/BmNumLogsMapper.java | 23 +++ .../service/impl/BmNumLogsService.java | 50 +++++ .../mapper/material/BmNumLogsMapper.xml | 172 ++++++++++++++++++ .../material/ScrapApplyDetailsMapper.xml | 8 + .../controller/SysOperlogController.java | 4 +- 10 files changed, 413 insertions(+), 2 deletions(-) create mode 100644 sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/BmNumLogs.java create mode 100644 sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BmNumLogsController.java create mode 100644 sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BmNumLogsMapper.java create mode 100644 sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BmNumLogsService.java create mode 100644 sgzb-modules/sgzb-material/src/main/resources/mapper/material/BmNumLogsMapper.xml diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/RemoteLogService.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/RemoteLogService.java index 20ab7c1b..bfb0168f 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/RemoteLogService.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/RemoteLogService.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.system.api; +import com.bonus.sgzb.system.api.domain.BmNumLogs; import com.bonus.sgzb.system.api.domain.SysOperLog; import com.bonus.sgzb.system.api.factory.RemoteLogFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -29,6 +30,17 @@ public interface RemoteLogService @PostMapping("/operlog") public R saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception; + /** + * 保存物资记录日志 + * @param bmNumLogs 物资信息 + * @param source 请求来源 + * @return 结果 + * @throws Exception 异常信息 + */ + @PostMapping("/bm_num_logs") + public R saveNumberLog(@RequestBody BmNumLogs bmNumLogs, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception; + + /** * 保存访问记录 * diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/BmNumLogs.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/BmNumLogs.java new file mode 100644 index 00000000..dd10acdd --- /dev/null +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/BmNumLogs.java @@ -0,0 +1,85 @@ +package com.bonus.sgzb.system.api.domain; + +import java.time.LocalDateTime; + +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 BmNumLogs 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 task; + + /** + * 规格id + */ + @Excel(name = "规格id") + private Integer typeId; + + /** + * 描述/请求参数/实体 + */ + @Excel(name = "描述/请求参数/实体") + private String description; + + /** + * 响应内容/状态码/返回参数 + */ + @Excel(name = "响应内容/状态码/返回参数") + private String jsonResult; + + /** + * 请求时间 + */ + @Excel(name = "请求时间") + private LocalDateTime time; + + /** + * 创建人 + */ + @Excel(name = "创建人") + private String creator; + + /** + * 备注 + */ + @Excel(name = "备注") + private String remark; + + /** + * 状态: 默认0, 其他值则为异常 + */ + @Excel(name = "状态") + private Byte status; + +} \ No newline at end of file diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/factory/RemoteLogFallbackFactory.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/factory/RemoteLogFallbackFactory.java index 19045eef..f25abcec 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/factory/RemoteLogFallbackFactory.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/factory/RemoteLogFallbackFactory.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.system.api.factory; +import com.bonus.sgzb.system.api.domain.BmNumLogs; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; @@ -31,6 +32,11 @@ public class RemoteLogFallbackFactory implements FallbackFactory saveNumberLog(BmNumLogs bmNumLogs, String source) throws Exception { + return R.fail("保存物资库存日志失败:" + throwable.getMessage()); + } + @Override public R saveLogininfor(SysLogininfor sysLogininfor, String source) { diff --git a/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java b/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java index 516d7fc1..644a0d17 100644 --- a/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java +++ b/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java @@ -33,6 +33,7 @@ import java.util.Map; @RestController @Slf4j public class TokenController { + @Autowired private TokenService tokenService; diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BmNumLogsController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BmNumLogsController.java new file mode 100644 index 00000000..c6dc4e47 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BmNumLogsController.java @@ -0,0 +1,54 @@ +package com.bonus.sgzb.material.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.system.api.domain.BmNumLogs; +import com.bonus.sgzb.material.service.impl.BmNumLogsService; +import org.springframework.web.bind.annotation.*; + +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +/** +* (bm_num_logs)表控制层 +* +* @author syruan +*/ +@RestController +@RequestMapping("/bm_num_logs") +public class BmNumLogsController extends BaseController { + + /** + * 服务对象 + */ + @Autowired + private BmNumLogsService bmNumLogsService; + + @GetMapping("/list") + public TableDataInfo list() { + startPage(); + List list = bmNumLogsService.selectAll(); + return getDataTable(list); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("selectByPrimaryKey") + public BmNumLogs selectByPrimaryKey(Integer id) { + return bmNumLogsService.selectByPrimaryKey(id); + } + + @InnerAuth + @PostMapping + public AjaxResult add(@RequestBody BmNumLogs bmNumLogs) { + return toAjax(bmNumLogsService.insert(bmNumLogs)); + } + + +} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BmNumLogsMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BmNumLogsMapper.java new file mode 100644 index 00000000..ef417e9d --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BmNumLogsMapper.java @@ -0,0 +1,23 @@ +package com.bonus.sgzb.material.mapper; + +import com.bonus.sgzb.system.api.domain.BmNumLogs; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface BmNumLogsMapper { + int deleteByPrimaryKey(Integer id); + + int insert(BmNumLogs record); + + int insertSelective(BmNumLogs record); + + BmNumLogs selectByPrimaryKey(Integer id); + + List selectAll(); + + int updateByPrimaryKeySelective(BmNumLogs record); + + int updateByPrimaryKey(BmNumLogs record); +} \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BmNumLogsService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BmNumLogsService.java new file mode 100644 index 00000000..3b1044e8 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BmNumLogsService.java @@ -0,0 +1,50 @@ +package com.bonus.sgzb.material.service.impl; + +import org.springframework.stereotype.Service; + +import org.springframework.beans.factory.annotation.Autowired; + +import com.bonus.sgzb.system.api.domain.BmNumLogs; +import com.bonus.sgzb.material.mapper.BmNumLogsMapper; + +import java.util.List; + +@Service +public class BmNumLogsService{ + + @Autowired + private BmNumLogsMapper bmNumLogsMapper; + + public int deleteByPrimaryKey(Integer id) { + return bmNumLogsMapper.deleteByPrimaryKey(id); + } + + + public int insert(BmNumLogs record) { + return bmNumLogsMapper.insert(record); + } + + public List selectAll() { + return bmNumLogsMapper.selectAll(); + } + + public int insertSelective(BmNumLogs record) { + return bmNumLogsMapper.insertSelective(record); + } + + + public BmNumLogs selectByPrimaryKey(Integer id) { + return bmNumLogsMapper.selectByPrimaryKey(id); + } + + + public int updateByPrimaryKeySelective(BmNumLogs record) { + return bmNumLogsMapper.updateByPrimaryKeySelective(record); + } + + + public int updateByPrimaryKey(BmNumLogs record) { + return bmNumLogsMapper.updateByPrimaryKey(record); + } + +} diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BmNumLogsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BmNumLogsMapper.xml new file mode 100644 index 00000000..f85c75fc --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BmNumLogsMapper.xml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + id, model_title, `method`, task, type_id, description, json_result, `time`, creator, + remark, status + + + + + + + + + + delete from bm_num_logs + where id = #{id,jdbcType=INTEGER} + + + + + insert into bm_num_logs (model_title, `method`, task, + type_id, description, json_result, + `time`, creator, remark + ) + values (#{modelTitle,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{task,jdbcType=VARCHAR}, + #{typeId,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{jsonResult,jdbcType=VARCHAR}, + #{time,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} + ) + + + + + insert into bm_num_logs + + + model_title, + + + `method`, + + + task, + + + type_id, + + + description, + + + json_result, + + + `time`, + + + creator, + + + remark, + + + + + #{modelTitle,jdbcType=VARCHAR}, + + + #{method,jdbcType=VARCHAR}, + + + #{task,jdbcType=VARCHAR}, + + + #{typeId,jdbcType=INTEGER}, + + + #{description,jdbcType=VARCHAR}, + + + #{jsonResult,jdbcType=VARCHAR}, + + + #{time,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + + + + + update bm_num_logs + + + 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_num_logs + 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 diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml index 1bf7e402..2ab763d8 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml @@ -319,10 +319,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) t GROUP BY task_id + + + + + + + + SELECT @@ -919,6 +925,9 @@ ORDER BY bcd.create_time DESC + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml index 5a9b8d45..a92c6c29 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml @@ -281,7 +281,7 @@ UPDATE ma_machine SET - ma_status = '16' , create_time = NOW() + ma_status = '16',create_time = NOW() type_id = #{record.typeId} diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml index efc7f17d..48d3908a 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml @@ -967,4 +967,10 @@ and lad.type_id = #{typeId} + diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java index b3720591..97bd6221 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java @@ -133,4 +133,10 @@ public interface BackApplyMapper { List selectIdByTaskId(Integer taskId); int getUseNumByTypeId(String typeId); + + int getManageType(String typeId); + + int getLeaseOutNum(String typeId); + + int getbackCheckNum(String typeId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java index 17871e9c..1fb4e9a3 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java @@ -375,7 +375,16 @@ public class BackApplyServiceImpl implements BackApplyService { @Override public int getUseNumByTypeId(String typeId) { - return backApplyMapper.getUseNumByTypeId(typeId); + int manageType = backApplyMapper.getManageType(typeId); + if (manageType == 0) { + // 编码入库的机具 + return backApplyMapper.getUseNumByTypeId(typeId); + } else { + // 数量入库的机具 + int leaseOutNum = backApplyMapper.getLeaseOutNum(typeId); + int backCheckNum = backApplyMapper.getbackCheckNum(typeId); + return leaseOutNum - backCheckNum; + } } } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml index e926037d..f6052927 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml @@ -815,5 +815,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + \ No newline at end of file From 77c6616c6476756f394494eed2701d58011a8b15 Mon Sep 17 00:00:00 2001 From: "liang.chao" Date: Mon, 15 Apr 2024 16:42:26 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E9=80=80=E6=96=99=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java index d79e712e..b0c0a4df 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java @@ -546,7 +546,7 @@ public class TmTaskServiceImpl implements TmTaskService { // 去查询领料任务详情表 List leaseApplyDetails = tmTaskMapper.getLeaseApplyDetailsCq(leaseApplyInfo); if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) { - tmTaskMapper.getMaTypeDetails(leaseApplyDetails); +// tmTaskMapper.getMaTypeDetails(leaseApplyDetails); listLeaseDetails.addAll(leaseApplyDetails); } } From c93b3fa75a184130d59104dccb9899da66dbb381 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Mon, 15 Apr 2024 17:47:54 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E9=80=80=E6=96=99=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E6=92=A4=E5=9B=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/api/claimAndRefund/return.js | 10 +++++++++ .../claimAndRefund/return/returnInDetail.vue | 22 ++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/sgzb-ui/src/api/claimAndRefund/return.js b/sgzb-ui/src/api/claimAndRefund/return.js index 1cee4bdf..f984573c 100644 --- a/sgzb-ui/src/api/claimAndRefund/return.js +++ b/sgzb-ui/src/api/claimAndRefund/return.js @@ -202,6 +202,16 @@ export function getRecord(query) { params: query }) } + +// 退料接收 撤回操作 +export function revoke(data) { + return request({ + url: 'base/backReceive/revoke', + method: 'post', + data: data + }) +} + // 退料接收 完成接收 export function endBack(data) { return request({ diff --git a/sgzb-ui/src/views/claimAndRefund/return/returnInDetail.vue b/sgzb-ui/src/views/claimAndRefund/return/returnInDetail.vue index 75419576..bb64f1d2 100644 --- a/sgzb-ui/src/views/claimAndRefund/return/returnInDetail.vue +++ b/sgzb-ui/src/views/claimAndRefund/return/returnInDetail.vue @@ -93,9 +93,9 @@ 数量退料 - + @@ -240,7 +240,7 @@