|
|
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.autocode.util.AutoCodeUtil;
|
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ErpProductRespVO;
|
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInSaveReqVO;
|
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.ErpStockOutSaveReqVO;
|
|
|
|
|
@ -34,6 +35,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
|
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
|
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
@ -74,6 +76,9 @@ public class PlanServiceImpl implements PlanService {
|
|
|
|
|
@Resource
|
|
|
|
|
private ErpStockInService stockInService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private AutoCodeUtil autoCodeUtil;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Long createPlan(PlanSaveReqVO createReqVO) {
|
|
|
|
|
@ -81,11 +86,12 @@ public class PlanServiceImpl implements PlanService {
|
|
|
|
|
PlanDO plan = BeanUtils.toBean(createReqVO, PlanDO.class);
|
|
|
|
|
if (StringUtils.isEmpty(plan.getCode())) {
|
|
|
|
|
// 1.4 生成订单号,并校验唯一性
|
|
|
|
|
String no = noRedisDAO.generate3(MesNoRedisDAO.PLAN_NO_PREFIX);
|
|
|
|
|
if (planMapper.selectByNo(no) != null) {
|
|
|
|
|
throw exception(PLAN_NOT_EXISTS);
|
|
|
|
|
}
|
|
|
|
|
plan.setCode(no);
|
|
|
|
|
// String no = noRedisDAO.generate3(MesNoRedisDAO.PLAN_NO_PREFIX);
|
|
|
|
|
// if (planMapper.selectByNo(no) != null) {
|
|
|
|
|
// throw exception(PLAN_NOT_EXISTS);
|
|
|
|
|
// }
|
|
|
|
|
// plan.setCode(no);
|
|
|
|
|
plan.setCode(autoCodeUtil.genSerialCode("PLAN_CODE",null));
|
|
|
|
|
}
|
|
|
|
|
if(plan.getProductId()==null && plan.getTaskDetailId()!=null){
|
|
|
|
|
TaskDetailDO taskDetailDO = taskService.getTaskDetail(plan.getTaskDetailId());
|
|
|
|
|
|