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

master
yinq 9 hours ago
parent 3be57e51b3
commit f0a426bb72

@ -80,9 +80,9 @@ public interface MesPurchaseApplyProcessMapper {
/** /**
* *
* *
* @param purchaseApplyId ID * @param taskCode
* @return * @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.DateUtils;
import com.hw.common.core.utils.MailUtils; import com.hw.common.core.utils.MailUtils;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.domain.MesRaiseCapitalBom;
import com.hw.mes.service.IMesPurchaseApplyProcessDetailService; import com.hw.mes.service.IMesPurchaseApplyProcessDetailService;
import com.hw.mes.service.IMesRaiseCapitalBomService; import com.hw.mes.service.IMesRaiseCapitalBomService;
import com.hw.system.api.RemoteSysCommonService; import com.hw.system.api.RemoteSysCommonService;
@ -106,8 +107,10 @@ public class MesPurchaseApplyProcessServiceImpl implements IMesPurchaseApplyProc
@Transactional @Transactional
@Override @Override
public int deleteMesPurchaseApplyProcessByPurchaseApplyIds(Long[] purchaseApplyIds) { public int deleteMesPurchaseApplyProcessByPurchaseApplyIds(Long[] purchaseApplyIds) {
mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessDetailByTaskCodes(purchaseApplyIds); for (Long purchaseApplyId : purchaseApplyIds) {
return mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessByPurchaseApplyIds(purchaseApplyIds); this.deleteMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId);
}
return 1;
} }
/** /**
@ -119,8 +122,17 @@ public class MesPurchaseApplyProcessServiceImpl implements IMesPurchaseApplyProc
@Transactional @Transactional
@Override @Override
public int deleteMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId) { public int deleteMesPurchaseApplyProcessByPurchaseApplyId(Long purchaseApplyId) {
mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessDetailByTaskCode(purchaseApplyId); MesPurchaseApplyProcess applyProcess = mesPurchaseApplyProcessMapper.selectMesPurchaseApplyProcessByPurchaseApplyId(purchaseApplyId);
return mesPurchaseApplyProcessMapper.deleteMesPurchaseApplyProcessByPurchaseApplyId(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> </foreach>
</delete> </delete>
<delete id="deleteMesPurchaseApplyProcessDetailByTaskCode" parameterType="Long"> <delete id="deleteMesPurchaseApplyProcessDetailByTaskCode" parameterType="String">
delete delete
from mes_purchase_apply_process_detail from mes_purchase_apply_process_detail
where task_code = #{taskCode} where task_code = #{taskCode}

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

Loading…
Cancel
Save