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 = "获取出厂厂家") @SysLog(title = "获取出厂厂家", businessType = OperaType.DELETE, logType = 1, module = "获取出厂厂家")
@PostMapping("/updateCheckTime") @PostMapping("/updateCheckTime")
public AjaxResult updateCheckTime(@RequestBody WsMaInfo info) { 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 条数 * @return 条数
*/ */
int updateCheckTime(String maCode); int updateCheckTime(WsMaInfo info);
} }

View File

@ -84,5 +84,5 @@ public interface WsMaInfoService {
* *
* @return 条数 * @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 条数 * @return 条数
*/ */
@Override @Override
public AjaxResult updateCheckTime(String maCode) { public AjaxResult updateCheckTime(WsMaInfo info) {
try { try {
int i = mapper.updateCheckTime(maCode); int i = mapper.updateCheckTime(info);
return AjaxResult.success("更新成功"); return AjaxResult.success("更新成功");
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());

View File

@ -81,8 +81,8 @@
id AS id, id AS id,
ma_code AS maCode, ma_code AS maCode,
ma_name AS maName, ma_name AS maName,
next_check_time AS nextCheckTime, LEFT(next_check_time, 10) AS nextCheckTime,
this_check_time AS thisCheckTime, LEFT(this_check_time, 10) AS thisCheckTime,
ma_model AS maModel, ma_model AS maModel,
repair_man AS repairMan repair_man AS repairMan
FROM FROM
@ -103,8 +103,8 @@
mm.ma_id AS id, mm.ma_id AS id,
mm.ma_code AS maCode, mm.ma_code AS maCode,
mt1.type_name AS maName, mt1.type_name AS maName,
mm.next_check_time AS nextCheckTime, LEFT(mm.next_check_time, 10) AS nextCheckTime,
mm.this_check_time AS thisCheckTime, LEFT(mm.this_check_time, 10) AS thisCheckTime,
mt.type_name AS maModel, mt.type_name AS maModel,
mm.check_man AS repairMan mm.check_man AS repairMan
FROM FROM
@ -152,19 +152,18 @@
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="updateCheckTime">
<update id="updateCheckTime">
<!-- 更新 ws_ma_info 表 --> <!-- 更新 ws_ma_info 表 -->
UPDATE ws_ma_info UPDATE ws_ma_info
SET this_check_time = NOW(), SET this_check_time = #{thisCheckTime},
next_check_time = DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)), next_check_time = #{nextCheckTime},
opt_time = NOW() opt_time = NOW()
WHERE ma_code = #{maCode}; WHERE ma_code = #{maCode};
<!-- 更新 ma_machine 表 --> <!-- 更新 ma_machine 表 -->
UPDATE ma_machine UPDATE ma_machine
SET this_check_time = NOW(), SET this_check_time = #{thisCheckTime},
next_check_time = DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)), next_check_time = #{nextCheckTime},
update_time = NOW() update_time = NOW()
WHERE ma_code = #{maCode} WHERE ma_code = #{maCode}
</update> </update>