From 6a2d78c315722d35d319675128b02c45c8958b20 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Fri, 22 Aug 2025 17:00:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WsMaInfoController.java | 2 +- .../codeCollection/mapper/WsMaInfoMapper.java | 2 +- .../service/WsMaInfoService.java | 2 +- .../service/impl/WsMaInfoServiceImpl.java | 6 +++--- .../codeCollection/WsMaInfoMapper.xml | 19 +++++++++---------- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/controller/WsMaInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/controller/WsMaInfoController.java index 53856fa1..cfbeecf1 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/controller/WsMaInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/controller/WsMaInfoController.java @@ -90,7 +90,7 @@ public class WsMaInfoController extends BaseController { @SysLog(title = "获取出厂厂家", businessType = OperaType.DELETE, logType = 1, module = "获取出厂厂家") @PostMapping("/updateCheckTime") public AjaxResult updateCheckTime(@RequestBody WsMaInfo info) { - return service.updateCheckTime(info.getMaCode()); + return service.updateCheckTime(info); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/mapper/WsMaInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/mapper/WsMaInfoMapper.java index c12be761..70fd247e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/mapper/WsMaInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/mapper/WsMaInfoMapper.java @@ -92,5 +92,5 @@ public interface WsMaInfoMapper { * * @return 条数 */ - int updateCheckTime(String maCode); + int updateCheckTime(WsMaInfo info); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/service/WsMaInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/service/WsMaInfoService.java index 965d6a84..6b96035d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/service/WsMaInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/service/WsMaInfoService.java @@ -84,5 +84,5 @@ public interface WsMaInfoService { * * @return 条数 */ - AjaxResult updateCheckTime(String maCode); + AjaxResult updateCheckTime(WsMaInfo info); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/service/impl/WsMaInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/service/impl/WsMaInfoServiceImpl.java index 0603b859..cb20da0c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/service/impl/WsMaInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/codeCollection/service/impl/WsMaInfoServiceImpl.java @@ -196,13 +196,13 @@ public class WsMaInfoServiceImpl implements WsMaInfoService { /** * 更新时间 * - * @param maCode + * @param info * @return 条数 */ @Override - public AjaxResult updateCheckTime(String maCode) { + public AjaxResult updateCheckTime(WsMaInfo info) { try { - int i = mapper.updateCheckTime(maCode); + int i = mapper.updateCheckTime(info); return AjaxResult.success("更新成功"); } catch (Exception e) { log.error(e.getMessage()); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/codeCollection/WsMaInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/codeCollection/WsMaInfoMapper.xml index 59663eed..5b39d59f 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/codeCollection/WsMaInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/codeCollection/WsMaInfoMapper.xml @@ -81,8 +81,8 @@ id AS id, ma_code AS maCode, ma_name AS maName, - next_check_time AS nextCheckTime, - this_check_time AS thisCheckTime, + LEFT(next_check_time, 10) AS nextCheckTime, + LEFT(this_check_time, 10) AS thisCheckTime, ma_model AS maModel, repair_man AS repairMan FROM @@ -103,8 +103,8 @@ mm.ma_id AS id, mm.ma_code AS maCode, mt1.type_name AS maName, - mm.next_check_time AS nextCheckTime, - mm.this_check_time AS thisCheckTime, + LEFT(mm.next_check_time, 10) AS nextCheckTime, + LEFT(mm.this_check_time, 10) AS thisCheckTime, mt.type_name AS maModel, mm.check_man AS repairMan FROM @@ -152,19 +152,18 @@ WHERE id = #{id} - - + UPDATE ws_ma_info - SET this_check_time = NOW(), - next_check_time = DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)), + SET this_check_time = #{thisCheckTime}, + next_check_time = #{nextCheckTime}, opt_time = NOW() WHERE ma_code = #{maCode}; UPDATE ma_machine - SET this_check_time = NOW(), - next_check_time = DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)), + SET this_check_time = #{thisCheckTime}, + next_check_time = #{nextCheckTime}, update_time = NOW() WHERE ma_code = #{maCode}