diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/AgreementInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/AgreementInfoController.java index 03c89dc0..154067cb 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/AgreementInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/AgreementInfoController.java @@ -97,7 +97,7 @@ public class AgreementInfoController extends BaseController { @PostMapping("/remove") public AjaxResult deleteByIds(@Validated @RequestBody AgreementInfo bean) { - return toAjax(agreementInfoService.deleteByIds(bean)); + return agreementInfoService.deleteByIds(bean); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ReturnOfMaterialsInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ReturnOfMaterialsInfoController.java index 2d44eb19..80eed8a9 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ReturnOfMaterialsInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ReturnOfMaterialsInfoController.java @@ -31,9 +31,9 @@ public class ReturnOfMaterialsInfoController extends BaseController { private ReturnOfMaterialsInfoService returnOfMaterialsInfoService; /** - * 获取协议管理列表 + * 获取机具退料入库列表 */ - @ApiOperation(value = "获取协议管理列表") + @ApiOperation(value = "获取机具退料入库列表") @GetMapping("/getReturnOfMaterialsInfoAll") public TableDataInfo getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean) { diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java index fec9683d..2cf16f0d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java @@ -194,5 +194,9 @@ public class BackApplyInfo extends BaseEntity { private String guigeCn; private String preNum; private String typeCn; + /** 前端条件查询所传工程id */ + private String proId; + /** 前端条件查询所传退料时间 */ + private String time; } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/AgreementInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/AgreementInfoMapper.java index 1bd13af5..1132fafc 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/AgreementInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/AgreementInfoMapper.java @@ -29,4 +29,6 @@ public interface AgreementInfoMapper { AgreementInfo getAgreementInfoId(AgreementInfo bean); List getInfo(AgreementInfo bean); + + int selectByagreementId(Long agreementId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/AgreementInfoService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/AgreementInfoService.java index c41d65bd..15cf5057 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/AgreementInfoService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/AgreementInfoService.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.service; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.material.domain.AgreementInfo; import java.util.List; @@ -19,7 +20,7 @@ public interface AgreementInfoService { int update(AgreementInfo bean); - int deleteByIds(AgreementInfo bean); + AjaxResult deleteByIds(AgreementInfo bean); AgreementInfo getAgreementInfoId(AgreementInfo bean); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/AgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/AgreementInfoServiceImpl.java index 89eb6874..b8dfed8e 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/AgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/AgreementInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.service.impl; +import com.bonus.sgzb.common.core.utils.StringHelper; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.material.domain.AgreementInfo; import com.bonus.sgzb.material.mapper.AgreementInfoMapper; @@ -56,8 +57,23 @@ public class AgreementInfoServiceImpl implements AgreementInfoService { } @Override - public int deleteByIds(AgreementInfo bean) { - return agreementInfoMapper.deleteByIds(bean); + public AjaxResult deleteByIds(AgreementInfo bean) { + if (bean.getAgreementId()!=null){ + //查询该协议是否存在领料任务,有的话不能删除 + int res=agreementInfoMapper.selectByagreementId(bean.getAgreementId()); + if (res>0){ + return AjaxResult.error("该协议已产生领料数据,不可删除"); + }else { + int re = agreementInfoMapper.deleteByIds(bean); + if (re>0){ + return AjaxResult.success("操作成功"); + }else { + return AjaxResult.error("操作失败"); + } + } + }else { + return AjaxResult.error("协议数据为空"); + } } @Override diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/AgreementInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/AgreementInfoMapper.xml index 80396004..598bdb14 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/AgreementInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/AgreementInfoMapper.xml @@ -144,4 +144,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE status = '1' and unit_id = #{unitId} AND project_id = #{projectId} + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml index 8f2c3ee1..426b8541 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml @@ -316,15 +316,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bpl.lot_id = #{lotId} + + and bpl.lot_id = #{proId} + and tt.task_status = #{taskStatus} and bagi.agreement_code like concat('%', #{agreementCode}, '%') - - and bai.back_time >=#{startTime} - and #{endTime} >=bai.back_time + + and bai.back_time =#{time} GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time ORDER BY bai.create_time desc