加1|自制;2|外协;3|采购
This commit is contained in:
parent
e728f1d2af
commit
71e5c2aec4
|
|
@ -29,6 +29,14 @@ public class TechnologyPackageParam {
|
|||
@NotNull(message = "项目类别不能为空")
|
||||
private String projectType;
|
||||
|
||||
@ApiModelProperty("图号")
|
||||
private String drawingNo;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String materialDesc;
|
||||
|
||||
@ApiModelProperty("工艺包类型rowId(创建工艺包时用)")
|
||||
private Long technologyPackageTypeRowId;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import cn.hutool.extra.spring.SpringUtil;
|
|||
import com.alibaba.excel.enums.BooleanEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
|
@ -385,9 +386,9 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
VUtils.isTure(Objects.isNull(packageParam.getTechnologyPackageTypeRowId())).throwMessage("请选择工艺包类型");
|
||||
BomNewTechnologyPackageTypeEntity technologyPackageTypeEntity = technologyPackageTypeService.getById(packageParam.getTechnologyPackageTypeRowId());
|
||||
//单条物料
|
||||
String drawingNo = "";
|
||||
String materialName = "";
|
||||
String materialDesc = "";
|
||||
String drawingNo = packageParam.getDrawingNo();
|
||||
String materialName = packageParam.getMaterialName();
|
||||
String materialDesc = packageParam.getMaterialDesc();
|
||||
BomNewPbomParentVO result = null;
|
||||
if (packageParam.getRowIds().size() == 1) {
|
||||
BomNewPbomChildEntity child = pbomChildService.getById(packageParam.getRowIds().get(0));
|
||||
|
|
@ -399,7 +400,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
materialMainService.intiMaterialInfo(ImmutableList.of(result));
|
||||
VUtils.isTure(StrUtil.isBlank(result.getMaterialCategoryCode()) || !result.getMaterialCategoryCode().startsWith("20")).throwMessage("插入工艺包的物料需时制作物料");
|
||||
|
||||
drawingNo = StrUtil.join("", result.getDrawingNo(), technologyPackageTypeEntity.getDrawingNoSuffix());
|
||||
// drawingNo = StrUtil.join("", result.getDrawingNo(), technologyPackageTypeEntity.getDrawingNoSuffix());
|
||||
// 检查改图号是否已存在主数据中
|
||||
List<MaterialMainEntity> materials = materialMainService.lambdaQuery().eq(MaterialMainEntity::getDrawingNo, drawingNo).list();
|
||||
|
||||
|
|
@ -408,11 +409,18 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
}
|
||||
|
||||
|
||||
materialName = StrUtil.join("", result.getMaterialName(), technologyPackageTypeEntity.getRemark());
|
||||
materialDesc = StrUtil.join(" ", materialName, drawingNo);
|
||||
|
||||
String materialNo = materialService.addMaterial(drawingNo, materialName, materialDesc, "201201");
|
||||
|
||||
// materialName = StrUtil.join("", result.getMaterialName(), technologyPackageTypeEntity.getRemark());
|
||||
// materialDesc = StrUtil.join(" ", materialName, drawingNo);
|
||||
AddVirtrualMaterialDTO toM =new AddVirtrualMaterialDTO();
|
||||
String key=String.valueOf(IdWorker.getId()) ;
|
||||
toM.setKey(key);
|
||||
toM.setMaterialName(materialName);
|
||||
toM.setDrawingNo(drawingNo);
|
||||
toM.setMaterialDesc(materialDesc);
|
||||
toM.setMaterialCategoryCode("201201");
|
||||
Map<String, AddVirtrualMaterialDTO> mMap = materialService.batchAddMaterial(ImmutableList.of(toM));
|
||||
// String materialNo = materialService.addMaterial(drawingNo, materialName, materialDesc, "201201");
|
||||
String materialNo=mMap.get(key).getMaterialNo();
|
||||
return materialMainService.getMaterialBaseInfo(ImmutableList.of(materialNo)).get(0);
|
||||
}
|
||||
|
||||
|
|
@ -804,7 +812,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
this.getBaseMapper().bomRelease(state, SessionUtil.getUserName(), bomRowIds);
|
||||
//同步sap
|
||||
// saySyncDEMO();
|
||||
// importSap(parent,allBom);
|
||||
importSap(parent,allBom);
|
||||
//
|
||||
} catch (Exception ex) {
|
||||
throw new NflgBusinessException(STATE.BusinessError, "发布Pbom失败:" + ex.getMessage());
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
<!--获取已发布列表-->
|
||||
<select id="releaseListByPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO">
|
||||
select * , row_id as bomRowId
|
||||
from t_bom_new_pbom_parent where status >= 4
|
||||
from t_bom_new_pbom_parent where root_is=1 and status >= 4
|
||||
<if test="query.startDate== null">
|
||||
and release_time > DATE_SUB(release_time, INTERVAL 4 DAY)
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue