铭牌信息查询

This commit is contained in:
mashuai 2025-06-30 14:19:47 +08:00
parent 93e1838c34
commit f58a96fd7a
6 changed files with 115 additions and 2 deletions

View File

@ -269,7 +269,11 @@ public class BmQrBoxController extends BaseController {
@ApiOperation(value = "标准箱信息查询")
@GetMapping("/getBoxInfo")
public AjaxResult getBoxInfo(BoxBindWarehouseDto info) {
try {
return qrBoxService.getBoxInfo(info);
} catch (Exception e) {
return AjaxResult.error("查询失败,请联系管理员");
}
}
/**
@ -280,6 +284,10 @@ public class BmQrBoxController extends BaseController {
@ApiOperation(value = "标准箱信息详情查询")
@GetMapping("/getBoxDetails")
public AjaxResult getBoxDetails(BoxBindWarehouseDto info) {
try {
return qrBoxService.getBoxDetails(info);
} catch (Exception e) {
return AjaxResult.error("查询失败,请联系管理员");
}
}
}

View File

@ -110,6 +110,22 @@ public class MachineController extends BaseController {
return AjaxResult.success(machineService.selectMachineByMaId(maId));
}
/**
* 获取机具设备管理详细信息
* @param machine
* @return
*/
@ApiOperation(value = "获取机具设备管理详细信息")
@RequiresPermissions("ma:machine:query")
@GetMapping(value = "/getInfoByMaCode")
public AjaxResult getInfoByMaCode(Machine machine) {
try {
return AjaxResult.success(machineService.getInfoByMaCode(machine));
} catch (Exception e) {
return error("查询失败,请联系管理员");
}
}
/**
* 新增机具设备管理
*/

View File

@ -166,4 +166,11 @@ public interface MachineMapper
Machine getLeaseInfoByQrcode(Machine machine);
List<Machine> getListByCode(Machine machine);
/**
* 根据二维码查询机具信息
* @param machine
* @return
*/
MachineVo getInfoByMaCode(Machine machine);
}

View File

@ -119,4 +119,11 @@ public interface IMachineService
AjaxResult getHisByQrcode(Machine machine);
AjaxResult getHisByCode(Machine machine);
/**
* 编码铭牌信息
* @param machine
* @return
*/
MachineVo getInfoByMaCode(Machine machine);
}

View File

@ -430,4 +430,19 @@ public class MachineServiceImpl implements IMachineService
}
/**
* 编码铭牌信息
* @param machine
* @return
*/
@Override
public MachineVo getInfoByMaCode(Machine machine) {
MachineVo machineVo = machineMapper.getInfoByMaCode(machine);
Map<String, String> machineStatus = remoteConfig.getDictValue("ma_machine_status");
if (StringUtils.isNotBlank(machineVo.getMaStatus())) {
machineVo.setStatusName(StringUtils.isBlank(machineStatus.get(machineVo.getMaStatus())) ? "" : machineStatus.get(machineVo.getMaStatus()));
}
return machineVo;
}
}

View File

@ -318,6 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null">phone = #{phone},</if>
<if test="assetsId != null">assets_id = #{assetsId},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="materialModel != null">machine_name = #{materialModel},</if>
</trim>
where ma_id = #{maId}
</update>
@ -667,4 +668,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="maId != null">and mm.ma_id = #{maId}</if>
limit 100
</select>
<select id="getInfoByMaCode" resultType="com.bonus.material.ma.domain.vo.MachineVo">
SELECT
ma.ma_id as maId,
ma.type_id as typeId,
mt4.type_name as itemType,
mt3.type_name as materialType,
mt2.type_name as materialName,
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.pre_code as preCode,
ma.ma_status as maStatus,
ma.qr_code as qrCode,
ma.buy_price as buyPrice,
ma.ma_vender as maVender,
ma.out_fac_time as outFacTime,
ma.out_fac_code as outFacCode,
ma.assets_code as assetsCode,
ma.check_man as checkMan,
ma.this_check_time as thisCheckTime,
ma.next_check_time as nextCheckTime,
ma.gps_code as gpsCode,
ma.rfid_code as rfidCode,
ma.erp_code as erpCode,
ma.transfer_code as transferCode,
ma.in_out_num as inOutNum,
tt.code as buyTask,
ma.own_house as ownHouse,
ma.company_id as companyId,
ma.create_time as createTime,
ma.update_time as updateTime,
ma.inspect_man as inspectMan,
ma.inspect_status as inspectStatus,
ma.phone as phone,
GROUP_CONCAT( DISTINCT su1.user_id ORDER BY su1.user_id SEPARATOR ',' ) AS keeperId,
GROUP_CONCAT( DISTINCT su1.nick_name ORDER BY su1.user_id SEPARATOR ',' ) AS keeperName,
GROUP_CONCAT( DISTINCT su2.user_id ORDER BY su2.user_id SEPARATOR ',' ) AS repairId,
GROUP_CONCAT( DISTINCT su2.nick_name ORDER BY su2.user_id SEPARATOR ',' ) AS repairName,
baa.asset_name as assetName,
ma.assets_id as assetsId,
ma.remark as remark
FROM
ma_machine ma
LEFT JOIN ma_type mt ON ma.type_id = mt.type_id
and mt.`level` = '4' and mt.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
and mt2.`level` = '3' and mt2.del_flag = '0'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
and mt3.`level` = '2' and mt3.del_flag = '0'
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
and mt4.`level` = '1' and mt4.del_flag = '0'
LEFT JOIN ma_type_keeper mtk on ma.type_id = mtk.type_id
LEFT JOIN sys_user su1 on mtk.user_id = su1.user_id
LEFT JOIN ma_type_repair mtr on ma.type_id = mtr.type_id
LEFT JOIN sys_user su2 on mtr.user_id = su2.user_id
LEFT JOIN bm_asset_attributes baa on ma.assets_id = baa.id
LEFT JOIN tm_task tt on tt.task_id=ma.buy_task
where ma.ma_code = #{maCode}
</select>
</mapper>