编码查询、二维码查询领料单位查询优化
This commit is contained in:
parent
2687a26327
commit
074d9d7a81
|
|
@ -310,4 +310,11 @@ public interface MachineMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
LeaseApplyInfo getBackUnitAndProjectBySlt(LeaseApplyInfo leaseInfoBack);
|
LeaseApplyInfo getBackUnitAndProjectBySlt(LeaseApplyInfo leaseInfoBack);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据maId查询最新的领料数据
|
||||||
|
* @param machine
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LeaseApplyInfo getLeaseDataByMaId(Machine machine);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -555,17 +555,21 @@ public class MachineServiceImpl implements IMachineService
|
||||||
Machine scrapTime = machineMapper.getScrapTimeByQrcode(machine);
|
Machine scrapTime = machineMapper.getScrapTimeByQrcode(machine);
|
||||||
baseInfo.setScrapTime(scrapTime != null ? scrapTime.getScrapTime() : "暂无");
|
baseInfo.setScrapTime(scrapTime != null ? scrapTime.getScrapTime() : "暂无");
|
||||||
// 查询领料任务
|
// 查询领料任务
|
||||||
LeaseApplyInfo leaseInfo = machineMapper.getLeaseParentId(machine);
|
LeaseApplyInfo leaseInfo = machineMapper.getLeaseDataByMaId(machine);
|
||||||
if (leaseInfo == null || leaseInfo.getParentId() == null) {
|
baseInfo.setLeaseTime(leaseInfo.getLeaseTime());
|
||||||
baseInfo.setLeaseTime(null);
|
baseInfo.setLeaseUnit(leaseInfo.getUnitName());
|
||||||
baseInfo.setLeaseUnit(null);
|
baseInfo.setLeaseProject(leaseInfo.getProjectName());
|
||||||
baseInfo.setLeaseProject(null);
|
// LeaseApplyInfo leaseInfo = machineMapper.getLeaseParentId(machine);
|
||||||
} else {
|
// if (leaseInfo == null || leaseInfo.getParentId() == null) {
|
||||||
LeaseApplyInfo leaseDetail = machineMapper.getLeaseUnitAndProject(leaseInfo);
|
// baseInfo.setLeaseTime(null);
|
||||||
baseInfo.setLeaseTime(String.valueOf(leaseInfo.getLeaseTime()));
|
// baseInfo.setLeaseUnit(null);
|
||||||
baseInfo.setLeaseUnit(leaseDetail.getUnitName());
|
// baseInfo.setLeaseProject(null);
|
||||||
baseInfo.setLeaseProject(leaseDetail.getProjectName());
|
// } else {
|
||||||
}
|
// LeaseApplyInfo leaseDetail = machineMapper.getLeaseUnitAndProject(leaseInfo);
|
||||||
|
// baseInfo.setLeaseTime(String.valueOf(leaseInfo.getLeaseTime()));
|
||||||
|
// baseInfo.setLeaseUnit(leaseDetail.getUnitName());
|
||||||
|
// baseInfo.setLeaseProject(leaseDetail.getProjectName());
|
||||||
|
// }
|
||||||
// 查询退料任务
|
// 查询退料任务
|
||||||
LeaseApplyInfo leaseInfoBack = machineMapper.getBackParentId(machine);
|
LeaseApplyInfo leaseInfoBack = machineMapper.getBackParentId(machine);
|
||||||
if (leaseInfoBack == null || leaseInfoBack.getParentId() == null) {
|
if (leaseInfoBack == null || leaseInfoBack.getParentId() == null) {
|
||||||
|
|
|
||||||
|
|
@ -478,6 +478,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND bu.del_flag = '0'
|
AND bu.del_flag = '0'
|
||||||
WHERE
|
WHERE
|
||||||
sai.`status`= 0 and mm.qr_code = #{qrCode} and sai.is_slt = '0'
|
sai.`status`= 0 and mm.qr_code = #{qrCode} and sai.is_slt = '0'
|
||||||
|
and sai.source='1'
|
||||||
and mtr.user_id = #{userId}
|
and mtr.user_id = #{userId}
|
||||||
<if test="unitId != null">
|
<if test="unitId != null">
|
||||||
AND ba.unit_id = #{unitId}
|
AND ba.unit_id = #{unitId}
|
||||||
|
|
@ -2199,6 +2200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
||||||
AND bu.del_flag = '0'
|
AND bu.del_flag = '0'
|
||||||
WHERE sai.`status`=0
|
WHERE sai.`status`=0
|
||||||
|
and sai.source='1'
|
||||||
and mm.ma_id = #{maId}
|
and mm.ma_id = #{maId}
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -1363,6 +1363,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ORDER BY sai.end_time DESC
|
ORDER BY sai.end_time DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getLeaseDataByMaId" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||||
|
SELECT bu.unit_name AS unitName,
|
||||||
|
bp.pro_name AS projectName,
|
||||||
|
DATE_FORMAT(sai.start_time, '%Y-%m-%d') AS leaseTime
|
||||||
|
FROM slt_agreement_info sai
|
||||||
|
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
|
||||||
|
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
||||||
|
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
|
||||||
|
WHERE sai.source = '1'
|
||||||
|
AND sai.ma_id = #{maId}
|
||||||
|
ORDER BY sai.start_time DESC LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertMaStatusLog">
|
<insert id="insertMaStatusLog">
|
||||||
insert into update_ma_status_log
|
insert into update_ma_status_log
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue