二维码查询开发

This commit is contained in:
bonus 2025-06-25 15:40:06 +08:00
parent ed0cc6355d
commit 40543b9091
9 changed files with 200 additions and 25 deletions

View File

@ -166,4 +166,6 @@ public interface ILeaseApplyInfoService {
* @return
*/
AjaxResult useExamine(LeaseApplyInfo leaseApplyInfo);
}

View File

@ -573,6 +573,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
}
/**
* 插入领料任务详情数据
* @param leaseApplyDetailsList

View File

@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.basic.domain.BmQrcodeInfo;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.domain.vo.MachineVo;
@ -265,4 +266,17 @@ public class MachineController extends BaseController {
{
return toAjax(machineService.editAssetsCode(machine));
}
/**
* 根据qrcode查询机具历史信息
* @param machine
* @return
*/
@GetMapping("/getHisByQrcode")
public AjaxResult getHisByQrcode(Machine machine) {
return machineService.getHisByQrcode(machine);
}
}

View File

@ -210,4 +210,27 @@ public class Machine extends BaseEntity
@ApiModelProperty(value = "集合")
private List<SampleSync> samples;
@ApiModelProperty(value = "入库时间")
private String inTime;
@ApiModelProperty(value = "服务工程数")
private int serviceNum;
@ApiModelProperty(value = "检验次数")
private int checkNum;
@ApiModelProperty(value = "报废时间")
private String scrapTime;
@ApiModelProperty(value = "领料单位")
private String leaseUnit;
@ApiModelProperty(value = "领料工程")
private String leaseProject;
@ApiModelProperty(value = "领料时间")
private String leaseTime;
@ApiModelProperty(value = "退料单位")
private String backUnit;
@ApiModelProperty(value = "退料工程")
private String backProject;
@ApiModelProperty(value = "退料时间")
private String backTime;
@ApiModelProperty(value = "任务")
private Integer taskId;
}

View File

@ -152,4 +152,16 @@ public interface MachineMapper
Machine selectMachineByQrCode(Machine ma);
Machine getInfoByQrcode(Machine machine);
Machine getInTimeByQrcode(Machine machine);
Machine getServiceNumByQrcode(Machine machine);
Machine getCheckNumByQrcode(Machine machine);
Machine getScrapTimeByQrcode(Machine machine);
Machine getLeaseInfoByQrcode(Machine machine);
}

View File

@ -116,4 +116,5 @@ public interface IMachineService
*/
public int editAssetsCode(Machine machine);
AjaxResult getHisByQrcode(Machine machine);
}

View File

@ -309,4 +309,58 @@ public class MachineServiceImpl implements IMachineService
return machineMapper.editAssetsCode(machine);
}
@Override
public AjaxResult getHisByQrcode(Machine machine) {
//1根据二维码查询基础信息
Machine baseInfo = machineMapper.getInfoByQrcode(machine);
machine.setMaId(baseInfo.getMaId());
//2根据二维码查询初次入库时间
Machine inTime = machineMapper.getInTimeByQrcode(machine);
//服务工程次数检验次数
Machine serviceNum = machineMapper.getServiceNumByQrcode(machine);
//更换配件次数
Machine checkNum = machineMapper.getCheckNumByQrcode(machine);
//报废时间
Machine scrapTime = machineMapper.getScrapTimeByQrcode(machine);
//3根据机具id查询领退工程
Machine leaseInfo = machineMapper.getLeaseInfoByQrcode(machine);
if (inTime != null){
Integer taskId = inTime.getTaskId();
if(taskId != null){
baseInfo.setInTime(inTime.getInTime()+"新购");
}else{
baseInfo.setInTime(inTime.getInTime());
}
}
if(serviceNum != null){
baseInfo.setServiceNum(serviceNum.getServiceNum());
}else{
baseInfo.setServiceNum(0);
}
if(checkNum != null){
baseInfo.setCheckNum(checkNum.getCheckNum());
}else{
baseInfo.setCheckNum(0);
}
if (scrapTime != null){
baseInfo.setScrapTime(scrapTime.getScrapTime());
}else{
baseInfo.setScrapTime("暂无");
}
if(leaseInfo != null){
baseInfo.setLeaseTime(leaseInfo.getLeaseTime());
baseInfo.setLeaseUnit(leaseInfo.getLeaseUnit());
baseInfo.setLeaseProject(leaseInfo.getLeaseProject());
baseInfo.setBackTime(leaseInfo.getBackTime());
baseInfo.setBackUnit(leaseInfo.getBackUnit());
baseInfo.setBackProject(leaseInfo.getBackProject());
}
return success(baseInfo);
}
}

View File

@ -530,4 +530,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
mm.qr_code = #{qrCode}
</select>
<select id="getInfoByQrcode" resultMap="MachineResult">
SELECT
mm.ma_id as maId,
mt2.type_name as maName,
mt.type_name as maModel,
mm.ma_code as maCode,
mm.qr_code as qrCode,
mm.type_id as typeId,
sd.dict_label as maStatus,
mm.qr_code as qrCode,
mm.ma_vender as maVender,
mm.out_fac_time as outFacTime,
mm.out_fac_code as outFacCode,
mm.assets_code as assetsCode,
mm.check_man as checkMan,
mm.this_check_time as thisCheckTime,
mm.next_check_time as nextCheckTime,
mm.in_out_num as inOutNum
FROM
ma_machine mm
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
LEFT JOIN sys_dict_data sd on mm.ma_status = sd.dict_value and sd.dict_type = "ma_machine_status"
where mm.qr_code = #{qrCode}
</select>
<select id="getInTimeByQrcode" resultMap="MachineResult">
SELECT
bqi.qr_code as qrCode,
bqi.task_id as taskId,
LEFT(bqi.create_time,10) as inTime
FROM
bm_qrcode_info bqi
WHERE bqi.qr_code = #{qrCode}
</select>
<select id="getServiceNumByQrcode" resultMap="MachineResult">
SELECT
COUNT(DISTINCT sai.agreement_id) as serviceNum
FROM slt_agreement_info sai
WHERE sai.ma_id = #{maId}
</select>
<select id="getCheckNumByQrcode" resultMap="MachineResult">
SELECT
COUNT(rp.ma_id ) as checkNum
FROM
repair_part_details rp
WHERE rp.ma_id = #{maId} and rp.is_ds = 0
</select>
<select id="getScrapTimeByQrcode" resultMap="MachineResult">
SELECT
sd.ma_id,
sd.task_id,
sd.ledger_time
FROM
scrap_apply_details sd
WHERE sd.ma_id = #{maId}
</select>
<select id="getLeaseInfoByQrcode" resultMap="MachineResult">
</select>
</mapper>