现场维修

This commit is contained in:
jiang 2025-07-28 18:41:33 +08:00
parent 21bee91a10
commit bc8ce5ad71
6 changed files with 65 additions and 53 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.getId()); return service.updateCheckTime(info.getMaCode());
} }

View File

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

View File

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

View File

@ -196,13 +196,13 @@ public class WsMaInfoServiceImpl implements WsMaInfoService {
/** /**
* 更新时间 * 更新时间
* *
* @param id * @param maCode
* @return 条数 * @return 条数
*/ */
@Override @Override
public AjaxResult updateCheckTime(Integer id) { public AjaxResult updateCheckTime(String maCode) {
try { try {
int i = mapper.updateCheckTime(id); int i = mapper.updateCheckTime(maCode);
return i > 0 ? AjaxResult.success("更新成功") : AjaxResult.error("更新失败"); return i > 0 ? AjaxResult.success("更新成功") : AjaxResult.error("更新失败");
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());

View File

@ -74,6 +74,7 @@
WHERE WHERE
ma_code = #{maCode} ma_code = #{maCode}
</select> </select>
<select id="selectAll" resultMap="BaseResultMap" resultType="com.bonus.material.codeCollection.domain.WsMaInfo"> <select id="selectAll" resultMap="BaseResultMap" resultType="com.bonus.material.codeCollection.domain.WsMaInfo">
SELECT * SELECT *
FROM ws_ma_info FROM ws_ma_info
@ -116,12 +117,22 @@
opt_time = #{optTime} opt_time = #{optTime}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="updateCheckTime"> <update id="updateCheckTime">
<!-- 更新 ws_ma_info 表 -->
UPDATE ws_ma_info UPDATE ws_ma_info
SET this_check_time = DATE(now()), SET this_check_time = NOW(),
next_check_time = DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)), next_check_time = DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)),
opt_time = DATE(now()) opt_time = NOW()
WHERE id = #{id} 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)),
update_time = NOW()
WHERE ma_code = #{maCode}
</update> </update>
<delete id="deleteById" parameterType="int"> <delete id="deleteById" parameterType="int">

View File

@ -677,55 +677,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getInfoByMaCode" resultType="com.bonus.material.ma.domain.Machine"> <select id="getInfoByMaCode" resultType="com.bonus.material.ma.domain.Machine">
SELECT SELECT
ma.ma_id as maId, ma.ma_id as maId,
ma.type_id as typeId, ma.type_id as typeId,
mt2.type_name as materialName, mt2.type_name as materialName,
CASE WHEN ma.machine_name IS NOT NULL THEN ma.machine_name ELSE mt.type_name END as materialModel, CASE WHEN ma.machine_name IS NOT NULL THEN ma.machine_name ELSE mt.type_name END as materialModel,
ma.ma_code as maCode, ma.ma_code as maCode,
ma.pre_code as preCode, ma.pre_code as preCode,
sda.dict_label as maStatus, sda.dict_label as maStatus,
ma.qr_code as qrCode, ma.qr_code as qrCode,
ma.buy_price as buyPrice, ma.buy_price as buyPrice,
ma.ma_vender as maVender, msi.supplier as maVender,
ma.out_fac_time as outFacTime, ma.out_fac_time as outFacTime,
ma.out_fac_code as outFacCode, ma.out_fac_code as outFacCode,
ma.assets_code as assetsCode, ma.assets_code as assetsCode,
ma.check_man as checkMan, ma.check_man as checkMan,
ma.this_check_time as thisCheckTime, ma.this_check_time as thisCheckTime,
ma.next_check_time as nextCheckTime, ma.next_check_time as nextCheckTime,
ma.gps_code as gpsCode, ma.gps_code as gpsCode,
ma.rfid_code as rfidCode, ma.rfid_code as rfidCode,
ma.erp_code as erpCode, ma.erp_code as erpCode,
ma.transfer_code as transferCode, ma.transfer_code as transferCode,
ma.in_out_num as inOutNum, ma.in_out_num as inOutNum,
ma.own_house as ownHouse, ma.own_house as ownHouse,
ma.company_id as companyId, ma.company_id as companyId,
ma.create_time as createTime, ma.create_time as createTime,
ma.update_time as updateTime, ma.update_time as updateTime,
ma.inspect_man as inspectMan, ma.inspect_man as inspectMan,
ma.inspect_status as inspectStatus, ma.inspect_status as inspectStatus,
ma.phone as phone, ma.phone as phone,
ma.assets_id as assetsId, ma.assets_id as assetsId,
ma.remark as remark ma.remark as remark
FROM FROM
ma_machine ma ma_machine ma
LEFT JOIN ma_type mt ON ma.type_id = mt.type_id LEFT JOIN ma_type mt ON ma.type_id = mt.type_id
and mt.`level` = '4' and mt.del_flag = '0' and mt.`level` = '4' and mt.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
and mt2.`level` = '3' and mt2.del_flag = '0' and mt2.`level` = '3' and mt2.del_flag = '0'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
and mt3.`level` = '2' and mt3.del_flag = '0' and mt3.`level` = '2' and mt3.del_flag = '0'
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
and mt4.`level` = '1' and mt4.del_flag = '0' and mt4.`level` = '1' and mt4.del_flag = '0'
LEFT JOIN sys_dict_data sda on sda.dict_value = ma.ma_status LEFT JOIN sys_dict_data sda on sda.dict_value = ma.ma_status
and sda.dict_type = "ma_machine_status" and sda.dict_type = "ma_machine_status"
LEFT JOIN ma_supplier_info msi ON msi.supplier_id = ma.ma_vender
where where
1=1 1=1
<if test="maCode != null and maCode != ''"> <if test="maCode != null and maCode != ''">
and ma.ma_code LIKE CONCAT('%',#{maCode},'%') and ma.ma_code LIKE CONCAT('%',#{maCode},'%')
</if> </if>
<if test="qrCode != null and qrCode != ''"> <if test="qrCode != null and qrCode != ''">
and ma.qr_code = #{qrCode} and ma.qr_code = #{qrCode}
</if> </if>
</select> </select>