Merge branch 'dev' of http://192.168.0.56:3000/bonus/devicesmgt into dev
This commit is contained in:
commit
c3d5a9e53d
|
|
@ -108,13 +108,7 @@ public class PurchaseMacodeInfoController extends BaseController {
|
||||||
@ApiOperation(value = "修改编码管理的入库状态")
|
@ApiOperation(value = "修改编码管理的入库状态")
|
||||||
@PutMapping("/manageStatus")
|
@PutMapping("/manageStatus")
|
||||||
public AjaxResult modifyManageStatus(@RequestBody MaInputVO maInputVO) throws Exception {
|
public AjaxResult modifyManageStatus(@RequestBody MaInputVO maInputVO) throws Exception {
|
||||||
int res = purchaseMacodeInfoService.modifyManageStatus(maInputVO);
|
return toAjax(purchaseMacodeInfoService.modifyManageStatus(maInputVO));
|
||||||
if (res == 0) {
|
|
||||||
return AjaxResult.error("入库单存在未绑定编码或无法绑定编码的设备,出库失败");
|
|
||||||
} else {
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
||||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||||
import com.bonus.sgzb.material.vo.MaInputVO;
|
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
@ -46,7 +45,6 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
private PurchaseCheckDetailsMapper checkDetailsMapper;
|
private PurchaseCheckDetailsMapper checkDetailsMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询新购验收编号管理
|
* 查询新购验收编号管理
|
||||||
*
|
*
|
||||||
|
|
@ -274,22 +272,16 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
String checkResult = maInputVO.getCheckResult();
|
String checkResult = maInputVO.getCheckResult();
|
||||||
List<MaInputRecord> inputRecordList = maInputVO.getInputRecordList();
|
List<MaInputRecord> inputRecordList = maInputVO.getInputRecordList();
|
||||||
for (MaInputRecord maInputRecord : inputRecordList) {
|
for (MaInputRecord maInputRecord : inputRecordList) {
|
||||||
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
|
|
||||||
purchaseMacodeInfo.setTaskId(taskId);
|
|
||||||
Long typeId = maInputRecord.getTypeId();
|
Long typeId = maInputRecord.getTypeId();
|
||||||
purchaseMacodeInfo.setTypeId(typeId);
|
|
||||||
List<PurchaseMacodeInfo> purchaseMacodeInfos = selectPutinDetailsAddTypeId(purchaseMacodeInfo);
|
|
||||||
for (PurchaseMacodeInfo macodeInfo : purchaseMacodeInfos) {
|
|
||||||
if (macodeInfo.getMaCode() == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 修改机具入库状态
|
// 修改机具入库状态
|
||||||
MaMachine maMachine = new MaMachine();
|
MaMachine maMachine = new MaMachine();
|
||||||
maMachine.setMaId(maInputRecord.getMaId());
|
maMachine.setMaId(maInputRecord.getMaId());
|
||||||
maMachine.setMaCode(maInputRecord.getMaCode());
|
maMachine.setMaCode(maInputRecord.getMaCode());
|
||||||
|
|
||||||
//修改编码管理表入库状态
|
//修改编码管理表入库状态
|
||||||
|
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
|
||||||
|
purchaseMacodeInfo.setTaskId(taskId);
|
||||||
|
purchaseMacodeInfo.setTypeId(typeId);
|
||||||
purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode());
|
purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode());
|
||||||
|
|
||||||
// 修改验收任务详细表入库数量
|
// 修改验收任务详细表入库数量
|
||||||
|
|
@ -359,10 +351,6 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<PurchaseMacodeInfo> selectPutinDetailsAddTypeId(PurchaseMacodeInfo purchaseMacodeInfo) {
|
|
||||||
return purchaseMacodeInfoMapper.selectPutinDetailsAddTypeId(purchaseMacodeInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据机具编码删除编码
|
* 根据机具编码删除编码
|
||||||
|
|
|
||||||
|
|
@ -484,77 +484,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getUseTypeTree" resultType="com.bonus.sgzb.material.domain.TypeTreeNode">
|
<select id="getUseTypeTree" resultType="com.bonus.sgzb.material.domain.TypeTreeNode">
|
||||||
WITH RECURSIVE cte AS (
|
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id,
|
mt.type_id AS typeId,
|
||||||
mt.parent_id,
|
mt.type_name AS typeName,
|
||||||
mt.type_name,
|
mt.parent_id AS parentId,
|
||||||
mt.`level`,
|
mt.unit_name AS unitNames,
|
||||||
mt.unit_name,
|
mt.company_id AS companyId,
|
||||||
mt4.num,
|
IFNULL(aa.num,0) as num,
|
||||||
mt4.company_id
|
mt.`level`
|
||||||
FROM
|
FROM
|
||||||
ma_type mt
|
ma_type mt
|
||||||
LEFT JOIN (
|
LEFT JOIN ( SELECT SUM(sai.num)as num,sai.type_id FROM slt_agreement_info sai WHERE sai.`status`='0'
|
||||||
SELECT
|
<if test="agreementId!=null and agreementId!=''">
|
||||||
subquery1.type_id AS typeId,
|
and sai.agreement_id =#{agreementId}
|
||||||
subquery1.parent_id ,
|
</if>
|
||||||
subquery1.typeName typeCode,
|
|
||||||
subquery1.out_num - COALESCE ( subquery2.audit_num, 0 ) AS num,
|
GROUP BY sai.type_id) aa on aa.type_id=mt.type_id
|
||||||
subquery1.company_id
|
|
||||||
FROM
|
|
||||||
(-- 第一个查询作为子查询
|
|
||||||
SELECT
|
|
||||||
mt.type_id,
|
|
||||||
mt.parent_id,
|
|
||||||
mt.type_name AS typeName,
|
|
||||||
mt.company_id,
|
|
||||||
SUM( lod.out_num ) AS out_num
|
|
||||||
FROM
|
|
||||||
lease_apply_info lai
|
|
||||||
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
|
|
||||||
LEFT JOIN lease_out_details lod ON lod.parent_id = lai.id
|
|
||||||
LEFT JOIN tm_task tt ON tt.task_id = tta.task_id
|
|
||||||
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id
|
|
||||||
WHERE
|
WHERE
|
||||||
tta.agreement_id = #{agreementId}
|
mt.del_flag = '0'
|
||||||
AND tt.task_type = '29'
|
|
||||||
AND mt.`level` = '4'
|
|
||||||
GROUP BY
|
|
||||||
mt.type_id
|
|
||||||
) AS subquery1
|
|
||||||
LEFT JOIN (-- 第二个查询作为子查询
|
|
||||||
SELECT
|
|
||||||
mt.type_id,
|
|
||||||
mt.parent_id,
|
|
||||||
mt.type_name,
|
|
||||||
mt.company_id,
|
|
||||||
SUM( bad.audit_num ) AS audit_num
|
|
||||||
FROM
|
|
||||||
back_apply_info bai
|
|
||||||
LEFT JOIN tm_task tt ON tt.task_id = bai.task_id
|
|
||||||
LEFT JOIN back_apply_details bad ON bad.parent_id = bai.id
|
|
||||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
|
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = bad.type_id
|
|
||||||
WHERE
|
|
||||||
tta.agreement_id = #{agreementId}
|
|
||||||
AND tt.task_type = '36'
|
|
||||||
AND mt.`level` = '4'
|
|
||||||
GROUP BY
|
|
||||||
mt.type_id
|
|
||||||
) AS subquery2 ON subquery1.type_id = subquery2.type_id
|
|
||||||
) mt4 on mt4.typeId = mt.type_id
|
|
||||||
HAVING num is not null
|
|
||||||
UNION ALL
|
|
||||||
SELECT ma_type.type_id, ma_type.parent_id,ma_type.type_name as typeCode, ma_type.`level`,ma_type.unit_name,0 as
|
|
||||||
num,ma_type.company_id
|
|
||||||
FROM ma_type
|
|
||||||
JOIN cte ON ma_type.type_id = cte.parent_id
|
|
||||||
)
|
|
||||||
SELECT type_id as typeId, parent_id as parentId,type_name as typeName,num,`level`,unit_name as unitNames,company_id as companyId
|
|
||||||
FROM cte
|
|
||||||
WHERE
|
|
||||||
1=1
|
|
||||||
<if test="level!=null and level!=''">
|
<if test="level!=null and level!=''">
|
||||||
<if test="level == 2">
|
<if test="level == 2">
|
||||||
AND level IN ('1','2')
|
AND level IN ('1','2')
|
||||||
|
|
@ -566,8 +513,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND level IN ('1','2','3','4')
|
AND level IN ('1','2','3','4')
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
GROUP BY type_id
|
|
||||||
ORDER BY type_id
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="exportList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
<select id="exportList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue