二维码代码提交

This commit is contained in:
1539530615@qq.com 2024-03-04 16:40:13 +08:00
parent 7f59083e7b
commit 60e10fcdb5
7 changed files with 124 additions and 4 deletions

View File

@ -177,13 +177,46 @@ public class MaMachine extends BaseEntity {
@ApiModelProperty(value = "仓库名称")
private String ownHouseName;
@ApiModelProperty(value = "仓库id")
private Long houseId;
@ApiModelProperty(value = "厂家名称")
private String supplier;
/**
* 检验人员
*/
private String inspectMan;
/**
* 检验结论
*/
private String inspectStatus;
/**
* 联系电话
*/
private String phone;
/**
* 领料单位
*/
private String leaseUnit;
/**
* 领料工程
*/
private String leasePro;
/**
* 领料时间
*/
private String leaseTime;
/**
* 退料单位
*/
private String backUnit;
/**
* 退料工程
*/
private String backPro;
/**
* 退料时间
*/
private String backTime;
}

View File

@ -108,7 +108,6 @@ public class LeaseOutDetailsController extends BaseController {
@Log(title = "领料出库", businessType = BusinessType.UPDATE)
@PostMapping("/submitOutRfid")
public AjaxResult submitOutRfid(@RequestBody List<LeaseOutDetails> recordList) {
return leaseOutDetailsService.submitOutRfid(recordList);
}

View File

@ -37,6 +37,13 @@ public class MaMachineController extends BaseController {
return success(list);
}
@Log(title = "根据二维码查询机具设备", businessType = BusinessType.QUERY)
@GetMapping("/getMachineByQrCode")
public AjaxResult getMachineByQrCode(MaMachine maMachine) {
MaMachine ma = maMachineService.getMachineByQrCode(maMachine);
return success(ma);
}
/**
* 根据条件进行查询机具设备管理

View File

@ -1,6 +1,8 @@
package com.bonus.sgzb.base.mapper;
import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.base.api.domain.SltAgreementApply;
import com.bonus.sgzb.base.domain.BmProjectLot;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -34,4 +36,9 @@ public interface MaMachineMapper {
List<MaMachine> getMaMachineByRfidCode(String rfidCode);
MaMachine getMachineByQrCode(MaMachine maMachine);
SltAgreementApply getLeaseProject(MaMachine ma);
SltAgreementApply getBackProject(MaMachine ma);
}

View File

@ -21,4 +21,5 @@ public interface MaMachineService {
*/
public MaMachine selectMaMachineByMaId(Long maId);
MaMachine getMachineByQrCode(MaMachine maMachine);
}

View File

@ -3,12 +3,15 @@ package com.bonus.sgzb.base.service.impl;
import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.base.api.domain.MaType;
import com.bonus.sgzb.base.api.domain.MaLabelBind;
import com.bonus.sgzb.base.api.domain.SltAgreementApply;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.base.domain.MaPropSet;
import com.bonus.sgzb.base.mapper.MaLabelBindMapper;
import com.bonus.sgzb.base.mapper.MaMachineMapper;
import com.bonus.sgzb.base.mapper.MaPropInfoMapper;
import com.bonus.sgzb.base.mapper.MaTypeMapper;
import com.bonus.sgzb.base.service.MaMachineService;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -118,4 +121,26 @@ public class MaMachineServiceImpl implements MaMachineService {
{
return maMachineMapper.selectMaMachineByMaId(maId);
}
@Override
public MaMachine getMachineByQrCode(MaMachine maMachine) {
MaMachine ma = maMachineMapper.getMachineByQrCode(maMachine);
if(ma != null){
SltAgreementApply leaseProject = maMachineMapper.getLeaseProject(ma);
SltAgreementApply backProject = maMachineMapper.getBackProject(ma);
if (leaseProject != null){
ma.setLeaseUnit(leaseProject.getUnitName());
ma.setLeasePro(leaseProject.getProjectName());
ma.setLeaseTime(leaseProject.getCreateTime());
}
if (backProject != null){
ma.setBackUnit(backProject.getUnitName());
ma.setBackPro(backProject.getProjectName());
ma.setBackTime(backProject.getCreateTime());
}
}else {
throw new ServiceException("二维码对应机具信息无效");
}
return ma;
}
}

View File

@ -299,4 +299,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMaMachineByMaIdAndMaCode" resultType="com.bonus.sgzb.base.api.domain.MaMachine">
select * from ma_machine where ma_id = #{maId} and ma_code = #{maCode}
</select>
<select id="getMachineByQrCode" resultType="com.bonus.sgzb.base.api.domain.MaMachine">
select m.ma_id, m.type_id, m.ma_code, m.pre_code, m.ma_status, dic.name maStatusName, m.qr_code, m.buy_price, m.ma_vender, m.out_fac_time, m.out_fac_code,
m.assets_code, m.check_man, m.this_check_time, m.next_check_time, m.gps_code, m.rfid_code, m.erp_code, m.transfer_code,
m.in_out_num, m.buy_task, m.own_house ,m.company_id ,mt.type_name specificationType,mt1.type_name deviceType, mt2.type_name itemType,
mmb.label_code labelCode,m.inspect_man as inspectMan,m.inspect_status as inspectStatus,m.phone as phone
from ma_machine m
left join (select id,p_id,name from sys_dic where p_id in (select id from sys_dic where value = 'ma_status')) dic on m.ma_status = dic.id
left join ma_type mt on m.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_type mt2 on mt1.parent_id = mt2.type_id
left join ma_label_bind mmb on m.ma_id = mmb.ma_id and m.type_id = mmb.type_id
where m.qr_code = #{qrCode}
</select>
<select id="getLeaseProject" resultType="com.bonus.sgzb.base.api.domain.SltAgreementApply">
select bui.unit_name as unitName,
bp.lot_name as projectName,
a.createTime as createTime
from lease_apply_info lai
left join (select parent_id as parentId,
create_time as createTime
from lease_out_details
where ma_id = #{maId}
order by create_time desc
limit 1) a on a.parentId = lai.id
left join tm_task_agreement tta on lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai on tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
WHERE a.parentId is not null
</select>
<select id="getBackProject" resultType="com.bonus.sgzb.base.api.domain.SltAgreementApply">
select bui.unit_name as unitName,
bp.lot_name as projectName,
a.createTime as createTime
from back_apply_info lai
left join (select parent_id as parentId,
create_time as createTime
from back_check_details
where ma_id = #{maId}
order by create_time desc
limit 1) a on a.parentId = lai.id
left join tm_task_agreement tta on lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai on tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
WHERE a.parentId is not null
</select>
</mapper>