|
|
|
|
@ -23,6 +23,7 @@ import cn.iocoder.yudao.module.mes.controller.admin.deviceledger.enums.CapacityT
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.plan.vo.PlanSaveReqVO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.plan.vo.PlanStatusEnum;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.task.vo.*;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.customer.CrmCustomerDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.organization.OrganizationDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.plan.PlanDO;
|
|
|
|
|
@ -31,6 +32,7 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.task.TaskDetailDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.task.ViewTaskProductSummary;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.baogongrecord.BaogongRecordMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.calholiday.CalHolidayMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.customer.CrmCustomerMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.deviceledger.DeviceLedgerMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.organization.OrganizationMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.plan.PlanMapper;
|
|
|
|
|
@ -82,6 +84,8 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
@Resource
|
|
|
|
|
private TaskDetailMapper taskDetailMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private CrmCustomerMapper customerMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private MesNoRedisDAO noRedisDAO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -127,6 +131,7 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
public Long createTask(TaskSaveReqVO createReqVO) {
|
|
|
|
|
// 插入
|
|
|
|
|
TaskDO task = BeanUtils.toBean(createReqVO, TaskDO.class);
|
|
|
|
|
fillCustomerName(task);
|
|
|
|
|
if (StringUtils.isEmpty(task.getCode())) {
|
|
|
|
|
// 1.4 生成订单号,并校验唯一性
|
|
|
|
|
|
|
|
|
|
@ -158,6 +163,7 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
validateTaskExists(updateReqVO.getId());
|
|
|
|
|
// 更新
|
|
|
|
|
TaskDO updateObj = BeanUtils.toBean(updateReqVO, TaskDO.class);
|
|
|
|
|
fillCustomerName(updateObj);
|
|
|
|
|
taskMapper.updateById(updateObj);
|
|
|
|
|
|
|
|
|
|
// 更新子表
|
|
|
|
|
@ -186,6 +192,18 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void fillCustomerName(TaskDO task) {
|
|
|
|
|
if (task.getCustomerId() == null) {
|
|
|
|
|
task.setCustomerName(null);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
CrmCustomerDO customer = customerMapper.selectById(task.getCustomerId());
|
|
|
|
|
if (customer == null) {
|
|
|
|
|
throw exception(CUSTOMER_NOT_EXISTS);
|
|
|
|
|
}
|
|
|
|
|
task.setCustomerName(customer.getName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<TaskDO> getTaskList(Collection<Long> ids) {
|
|
|
|
|
if (CollUtil.isEmpty(ids)) {
|
|
|
|
|
|