This commit is contained in:
mashuai 2025-02-26 12:54:19 +08:00
parent e97baeffca
commit 30cf876bae
4 changed files with 26 additions and 6 deletions

View File

@ -64,7 +64,7 @@ public class BackReceiveController extends BaseController {
* @return * @return
*/ */
@Log(title = "退料接收明细", businessType = BusinessType.QUERY) @Log(title = "退料接收明细", businessType = BusinessType.QUERY)
@GetMapping("getDetailsReceiveList") @GetMapping("/getDetailsReceiveList")
public AjaxResult getDetailsReceiveList(BackApplyInfo record) { public AjaxResult getDetailsReceiveList(BackApplyInfo record) {
return backReceiveService.getDetailsReceiveList(record); return backReceiveService.getDetailsReceiveList(record);
} }

View File

@ -17,9 +17,10 @@ import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.utils.HttpHelper; import com.bonus.sgzb.common.core.utils.HttpHelper;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.material.domain.TypeTreeNode;
import com.bonus.sgzb.material.mapper.BackApplyMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -50,6 +51,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
@Resource @Resource
private TmTaskMapper tmTaskMapper; private TmTaskMapper tmTaskMapper;
@Autowired
private BackApplyMapper backApplyMapper;
@Override @Override
@ -506,12 +510,26 @@ public class BackReceiveServiceImpl implements BackReceiveService {
public AjaxResult getDetailsReceiveList(BackApplyInfo record) { public AjaxResult getDetailsReceiveList(BackApplyInfo record) {
BackApplyInfo backApplyInfo = new BackApplyInfo(); BackApplyInfo backApplyInfo = new BackApplyInfo();
List<BackApplyInfo> backApplyInfos = backReceiveMapper.getbackReceiveList(record); List<BackApplyInfo> backApplyInfos = backReceiveMapper.getbackReceiveList(record);
List<TypeTreeNode> useTypeTree = new ArrayList<>();
if (!CollectionUtils.isEmpty(backApplyInfos)) { if (!CollectionUtils.isEmpty(backApplyInfos)) {
backApplyInfos.get(0).setProjectId(Long.valueOf(backApplyInfos.get(0).getLotId()));
backApplyInfo.setBackApplyInfo(backApplyInfos.get(0)); backApplyInfo.setBackApplyInfo(backApplyInfos.get(0));
record.setId(backApplyInfos.get(0).getId()); record.setId(backApplyInfos.get(0).getId());
record.setAgreementId(backApplyInfos.get(0).getAgreementId());
useTypeTree = backApplyMapper.getUseTypeTreeL4(record);
} }
List<BackApplyInfo> backApplyInfoList = receiveView(record); List<BackApplyInfo> backApplyInfoList = receiveView(record);
if (!CollectionUtils.isEmpty(backApplyInfoList)) { if (!CollectionUtils.isEmpty(backApplyInfoList) && !CollectionUtils.isEmpty(useTypeTree)) {
for (TypeTreeNode typeTreeNode : useTypeTree) {
for (BackApplyInfo applyInfo : backApplyInfoList) {
if (String.valueOf(typeTreeNode.getTypeId()).equals(applyInfo.getModelId())) {
applyInfo.setUnitNames(typeTreeNode.getUnitNames());
applyInfo.setTypeId(String.valueOf(typeTreeNode.getTypeId()));
applyInfo.setUseNum(typeTreeNode.getNum());
}
}
}
backApplyInfo.setBackApplyDetails(backApplyInfoList); backApplyInfo.setBackApplyDetails(backApplyInfoList);
} }
return AjaxResult.success(backApplyInfo); return AjaxResult.success(backApplyInfo);

View File

@ -615,7 +615,8 @@
tta.agreement_id AS agreementId, tta.agreement_id AS agreementId,
GROUP_CONCAT( DISTINCT mt2.type_id ) AS typeId, GROUP_CONCAT( DISTINCT mt2.type_id ) AS typeId,
GROUP_CONCAT(bad.id) as badId, GROUP_CONCAT(bad.id) as badId,
GROUP_CONCAT( mt2.type_name, '' ) AS typeName GROUP_CONCAT( mt2.type_name, '' ) AS typeName,
bai.remark AS remark
FROM FROM
back_apply_info bai back_apply_info bai
LEFT JOIN back_apply_details bad ON bad.parent_id = bai.id LEFT JOIN back_apply_details bad ON bad.parent_id = bai.id
@ -693,7 +694,8 @@
IFNULL(bb.finished_back_num, 0) as finished_back_num, IFNULL(bb.finished_back_num, 0) as finished_back_num,
mt.manage_type as manageType, mt.manage_type as manageType,
mtk.user_id, mtk.user_id,
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code` CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`,
bad.remark as remark
FROM FROM
back_apply_details bad back_apply_details bad
LEFT JOIN back_apply_info bai on bai.id=bad.parent_id LEFT JOIN back_apply_info bai on bai.id=bad.parent_id

View File

@ -592,7 +592,7 @@
LEFT join lease_apply_info lai on lai.id = lad.parennt_id LEFT join lease_apply_info lai on lai.id = lad.parennt_id
LEFT join tm_task tt on lai.task_id = tt.task_id LEFT join tm_task tt on lai.task_id = tt.task_id
LEFT join tm_task_agreement tta on tta.task_id = tt.task_id LEFT join tm_task_agreement tta on tta.task_id = tt.task_id
where tta.agreement_id = #{agreementId} where tta.agreement_id = #{agreementId} and lad.`status` = '2'
group by lad.type_id group by lad.type_id
</select> </select>
</mapper> </mapper>