加1|自制;2|外协;3|采购

This commit is contained in:
大米 2024-01-24 11:06:57 +08:00
parent 4a9d9b5385
commit bc17c0cd3a
5 changed files with 23 additions and 16 deletions

View File

@ -16,6 +16,8 @@ public class AddVirtrualMaterialDTO {
private String materialDesc ;
private String materialCategoryCode;
private String projectType;
@ApiModelProperty("申请后返回的物料编码")
private String materialNo;
}

View File

@ -418,6 +418,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
toM.setDrawingNo(drawingNo);
toM.setMaterialDesc(materialDesc);
toM.setMaterialCategoryCode("201201");
toM.setProjectType(packageParam.getProjectType());
Map<String, AddVirtrualMaterialDTO> mMap = materialService.batchAddMaterial(ImmutableList.of(toM));
// String materialNo = materialService.addMaterial(drawingNo, materialName, materialDesc, "201201");
String materialNo=mMap.get(key).getMaterialNo();
@ -437,6 +438,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
throw new NflgBusinessException(STATE.BusinessError, "单条物料时,请选择上下级");
}
TechnologyPackageParamBuilder builder = new TechnologyPackageParamBuilder(technologyPackageParam);
builder.builder();
if (CollUtil.isNotEmpty(builder.getPackageParent())) {
this.saveOrUpdateBatch(builder.getPackageParent());
}

View File

@ -187,6 +187,9 @@ public class MaterialService {
ma.setApplyUserCode(SessionUtil.getRealName());
ma.setMaterialUnit("PC");
ma.setProcessState(10);
if(StrUtil.isNotBlank(md.getProjectType())){
ma.setProjectType(md.getProjectType());
}
resultList.add(ma);
AddMaterialMainDTO ent=new AddMaterialMainDTO();

View File

@ -146,7 +146,7 @@ public abstract class VirtualPackageBase {
parent.setSourceRowId(0L);
parent.setLastVersionIs(1);
parent.setNum(new BigDecimal(1));
parent.setDeviseName(SessionUtil.getUserCode());
parent.setDeviseUserCode(SessionUtil.getUserCode());
parent.setDeviseName(SessionUtil.getRealName());
parent.setCreatedBy(SessionUtil.getUserCode());
parent.setDeptName(SessionUtil.getDepartName());

View File

@ -178,22 +178,22 @@
</select>
<update id="updateRootState">
update t_bom_new_ebom_parent
set root_is=0,
user_root_is=0
where last_version_is = 1;
update t_bom_new_ebom_parent a set a.root_is=1 ,a.user_root_is=1 where material_no not in (select material_no from (
select b.material_no from t_bom_new_ebom_parent a
join t_bom_new_ebom_child b on a.row_id=b.parent_row_id
where a.last_version_is=1 ) b ) and last_version_is=1;
update t_bom_new_ebom_parent a left join (select material_no ,created_by from (
select b.material_no ,b.created_by from t_bom_new_ebom_parent a
update t_bom_new_ebom_parent
set root_is=0,
user_root_is=0
where last_version_is = 1;
update t_bom_new_ebom_parent a set a.root_is=1 ,a.user_root_is=1 where material_no not in (select material_no from (
select b.material_no from t_bom_new_ebom_parent a
join t_bom_new_ebom_child b on a.row_id=b.parent_row_id
where a.last_version_is=1 ) b ) t on a.material_no=t.material_no and a.created_by=t.created_by
set user_root_is=1
where a.last_version_is=1 and t.created_by is null
where a.last_version_is=1 ) b ) and last_version_is=1;
update t_bom_new_ebom_parent a left join (select material_no ,created_by from (
select b.material_no ,b.created_by from t_bom_new_ebom_parent a
join t_bom_new_ebom_child b on a.row_id=b.parent_row_id
where a.last_version_is=1 ) b ) t on a.material_no=t.material_no and a.created_by=t.created_by
set user_root_is=1
where a.last_version_is=1 and t.created_by is null
</update>