This commit is contained in:
hayu 2025-08-22 17:00:02 +08:00
parent 1a1febf736
commit 6a2d78c315
5 changed files with 15 additions and 16 deletions

View File

@ -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);
}

View File

@ -92,5 +92,5 @@ public interface WsMaInfoMapper {
*
* @return 条数
*/
int updateCheckTime(String maCode);
int updateCheckTime(WsMaInfo info);
}

View File

@ -84,5 +84,5 @@ public interface WsMaInfoService {
*
* @return 条数
*/
AjaxResult updateCheckTime(String maCode);
AjaxResult updateCheckTime(WsMaInfo info);
}

View File

@ -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());

View File

@ -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>
<update id="updateCheckTime">
<!-- 更新 ws_ma_info 表 -->
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};
<!-- 更新 ma_machine 表 -->
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}
</update>