Merge remote-tracking branch 'origin/master'

This commit is contained in:
liang.chao 2025-09-04 12:51:02 +08:00
commit 11b34a6424
2 changed files with 22 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import com.bonus.material.lease.mapper.LeaseTaskMapper;
import com.bonus.material.lease.service.ILeaseTaskService;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.domain.vo.MaTypeVoLevelTwo;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.task.domain.TmTask;
import com.bonus.material.task.domain.TmTaskAgreement;
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
@ -111,6 +112,9 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
@Resource
private BmTeamMapper bmTeamMapper;
@Resource
private ITypeService typeService;
/**
* 新增领用任务
@ -1182,6 +1186,10 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
try {
//1查询整个单子是否已完成根据taskId
TmTask tmTask = tmTaskMapper.selectStatusByTaskId(leaseApplyDetails.getTaskId());
Type type = new Type();
type.setModelTitle("领料出库驳回");
type.setCode(tmTask.getCode());
type.setStyle("6");
if (tmTask.getTaskStatus() == 4) {
return AjaxResult.error("该领料任务已出库完成,不可退回");
}
@ -1194,6 +1202,10 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
if (res == 0) {
throw new ServiceException("设备状态修改失败,请联系管理员");
}
type.setTypeId(Long.parseLong(maCodeVo.getTypeId()));
type.setMaId(maCodeVo.getMaId());
type.setInputNum(BigDecimal.ONE);
typeService.updateNumAddOrSubtract(type);
}
}
//判断是领用任务还是领料任务根据newType
@ -1213,10 +1225,17 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
bean1.setTypeId(leaseApplyDetails.getTypeId());
bean1.setAlNum(leaseApplyDetails.getAlNum());
}
int res = mapper.updateInventory(bean1);
if (CollectionUtils.isEmpty(leaseApplyDetails.getMaCodeVoList())) {
// 数量设备库存修改
type.setTypeId(bean1.getTypeId());
type.setInputNum(bean1.getAlNum());
typeService.updateNumAddOrSubtract(type);
/*int res = mapper.updateInventory(bean1);
if (res == 0) {
throw new ServiceException("库存修改失败,请联系管理员");
}*/
}
int res = 0;
// 3修改任务状态tm_task
if (leaseApplyDetails.getTaskId()!= null) {
LeaseOutDetails leaseOutDetails = new LeaseOutDetails();

View File

@ -241,7 +241,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectStatusByTaskId" resultType="com.bonus.material.task.domain.TmTask">
SELECT
task_status as taskStatus
task_status as taskStatus,
code as code
FROM
tm_task
WHERE