change - add提资单页面删除逻辑

master
yinq 8 hours ago
parent 3be57e51b3
commit f0a426bb72

@ -80,9 +80,9 @@ public interface MesPurchaseApplyProcessMapper {
/**
*
*
* @param purchaseApplyId ID
* @param taskCode
* @return
*/
public int deleteMesPurchaseApplyProcessDetailByTaskCode(Long purchaseApplyId);
public int deleteMesPurchaseApplyProcessDetailByTaskCode(String taskCode);
}

@ -9,6 +9,7 @@ import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.MailUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.domain.MesRaiseCapitalBom;
import com.hw.mes.service.IMesPurchaseApplyProcessDetailService;
import com.hw.mes.service.IMesRaiseCapitalBomService;
import com.hw.system.api.RemoteSysCommonService;
@ -106,8 +107,10 @@ public class MesPurchaseApplyProcessServiceImpl implements IMesPurchaseApplyProc
@Transactional
@Override
public int deleteMesPurchaseApplyProcessByPurchaseApplyIds(Long[] purchaseApplyIds) {
mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessDetailByTaskCodes(purchaseApplyIds);
return mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessByPurchaseApplyIds(purchaseApplyIds);
for (Long purchaseApplyId : purchaseApplyIds) {
this.deleteMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId);
}
return 1;
}
/**
@ -119,8 +122,17 @@ public class MesPurchaseApplyProcessServiceImpl implements IMesPurchaseApplyProc
@Transactional
@Override
public int deleteMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId) {
mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessDetailByTaskCode(purchaseApplyId);
return mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId);
MesPurchaseApplyProcess applyProcess = mesPurchaseApplyProcessMapper.selectMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId);
String taskCode = applyProcess.getTaskCode();
MesRaiseCapitalBom capitalBom = new MesRaiseCapitalBom();
capitalBom.setTaskCode(taskCode);
List<MesRaiseCapitalBom> mesRaiseCapitalBoms = mesRaiseCapitalBomService.selectMesRaiseCapitalBomList(capitalBom);
if (!mesRaiseCapitalBoms.isEmpty()) {
throw new ServiceException("请先删除对应的提资单BOM信息");
}
mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessDetailByTaskCode(taskCode);
mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId);
return 1;
}
/**

@ -167,7 +167,7 @@
</foreach>
</delete>
<delete id="deleteMesPurchaseApplyProcessDetailByTaskCode" parameterType="Long">
<delete id="deleteMesPurchaseApplyProcessDetailByTaskCode" parameterType="String">
delete
from mes_purchase_apply_process_detail
where task_code = #{taskCode}

@ -48,17 +48,18 @@
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['mes:purchaseApplyProcess:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:purchaseApplyProcess:remove']"
>删除
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->

Loading…
Cancel
Save