This commit is contained in:
parent
71098f6fb5
commit
2625956e09
|
|
@ -148,6 +148,21 @@ public class OptionalEbomApi extends BaseApi {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PutMapping("updateOptionRemark")
|
||||
@ApiOperation("更改选项备注")
|
||||
public ResultVO<Boolean> updateOptionRemark(@RequestBody OptionalEbomSubmitEditDTO.OptionalEbomImportChildSubmitDTO input) {
|
||||
if(input.getRowId()==null ){
|
||||
return ResultVO.error(STATE.ParamErr, "操作数据为空");
|
||||
}
|
||||
optionalEbomImportChildService.updateRemark(input);
|
||||
return ResultVO.success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PutMapping("updateOptionStatus")
|
||||
@ApiOperation("更改选项状态")
|
||||
public ResultVO<Boolean> updateOptionStatus(@RequestBody OptionalEbomUpdateDTO input) {
|
||||
|
|
@ -201,13 +216,14 @@ public class OptionalEbomApi extends BaseApi {
|
|||
}
|
||||
if(Objects.equals(dto.getPartType() , OptionalBomConstant.PartTypeEnum.PART_TYPE_CHECBOX.getValue())){
|
||||
dto.setParentRowId(null);
|
||||
OptionalEbomConfigEntity entity= optionalEbomConfigService.getById(dto.getRootRowId());
|
||||
|
||||
if(entity!=null){
|
||||
dto.setRootRowId(entity.getParentRowId());
|
||||
}
|
||||
|
||||
}
|
||||
OptionalEbomConfigEntity entity= optionalEbomConfigService.getById(dto.getRootRowId());
|
||||
if(entity!=null){
|
||||
dto.setRootRowId(entity.getParentRowId());
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public interface MaterialMainMapper extends BaseMapper<MaterialMainEntity> {
|
|||
|
||||
List<BaseMaterialVO> getMaterialByAnyNo(@Param("drawingNos") List<String> drawingNos);
|
||||
|
||||
List<BaseMaterialVO> initMaterialForMaterialNo(@Param("materialNo") List<String> drawingNos);
|
||||
|
||||
List<String> getUserPost(@Param("userRowId") Long userRowId);
|
||||
|
||||
Integer getUserMultiplantFacRoleCount(@Param("userRowId") Long userRowId);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
public class OptionalEbomSubmitEditDTO {
|
||||
|
||||
@ApiModelProperty(value = "设备数据")
|
||||
private OptionalEbomMainSubmitDTO deviceInfo;
|
||||
private OptionalEbomMarkSubmitDTO deviceInfo;
|
||||
@ApiModelProperty(value = "标配数据")
|
||||
private List<OptionalEbomImportChildSubmitDTO> options;
|
||||
|
||||
|
|
@ -23,15 +23,21 @@ public class OptionalEbomSubmitEditDTO {
|
|||
private Long rowId;
|
||||
@ApiModelProperty(value = "是否标配(0 否 1是)")
|
||||
private Integer chooseStatus;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remak;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class OptionalEbomMainSubmitDTO{
|
||||
public static class OptionalEbomMarkSubmitDTO{
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long rowId;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1398,7 +1398,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
CheckEBomException.checkMaterialNoInMain(dto.getDatas());
|
||||
|
||||
List<BomNewEbomParentVO> checkBom = new ArrayList<>();
|
||||
|
||||
|
||||
List<BomNewEbomParentVO> childList=getChild(dto.getParent().getBomRowId());
|
||||
|
||||
|
|
@ -1444,15 +1444,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
|
||||
|
||||
checkBom.addAll(union);
|
||||
checkBom.addAll(union2);
|
||||
checkBom.addAll(tmp2);
|
||||
|
||||
|
||||
checkBom.add(dto.getParent());
|
||||
|
||||
checkBomException(checkBom, Arrays.asList(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue()));
|
||||
|
||||
|
||||
|
||||
List<BomNewEbomParentVO> returnList=new ArrayList<>();
|
||||
|
|
@ -1470,8 +1461,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
|
||||
item.setTotalWeight(NumberUtil.mul(item.getUnitWeight(), item.getNum()));
|
||||
if(Objects.isNull(item.getMaterialNo())) {
|
||||
BeanUtil.copyProperties(item,groupList.get(item.getRowId()).get(0));
|
||||
if(StrUtil.isBlank(item.getMaterialNo())) {
|
||||
BeanUtil.copyProperties(groupList.get(item.getRowId()).get(0),item);
|
||||
}
|
||||
});
|
||||
returnList.addAll(union);
|
||||
|
|
@ -1515,7 +1506,13 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
returnList.addAll(tmp2);
|
||||
}
|
||||
|
||||
List<BomNewEbomParentVO> checkBom = new ArrayList<>();
|
||||
|
||||
checkBom.addAll(union);
|
||||
checkBom.addAll(union2);
|
||||
checkBom.addAll(tmp2);
|
||||
checkBom.add(dto.getParent());
|
||||
checkBomException(checkBom, Arrays.asList(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue()));
|
||||
|
||||
return returnList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,7 +224,16 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
|||
return null;
|
||||
|
||||
}
|
||||
public List<BaseMaterialVO> initMaterialForMaterialNo(List<String> materialNo) {
|
||||
|
||||
if (CollUtil.isNotEmpty(materialNo)) {
|
||||
List<BaseMaterialVO> materialList = SpringUtil.getBean(MaterialMainMapper.class).initMaterialForMaterialNo(materialNo);
|
||||
return materialList;
|
||||
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public List<BaseMaterialVO> getExceptStatList(List<String> materialNos,List<Integer> states) {
|
||||
if (CollUtil.isNotEmpty(materialNos)) {
|
||||
|
|
|
|||
|
|
@ -17,9 +17,11 @@ import com.nflg.product.bomnew.mapper.master.OptionalEbomImportChildMapper;
|
|||
import com.nflg.product.bomnew.pojo.dto.OptionalEbomImportChildAddDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.OptionalEbomImportChildDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.OptionalEbomMainDelDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.OptionalEbomSubmitEditDTO;
|
||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigREntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomImportChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomImportEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomMainEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.OptionalEbomImportChildQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.OptionalEbomConfigRVO;
|
||||
|
|
@ -70,6 +72,13 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
|||
|
||||
}
|
||||
|
||||
OptionalEbomMainEntity deviceEntity= SpringUtil.getBean(OptionalEbomMainService.class).getById(dto.getRootRowId());
|
||||
if(deviceEntity==null){
|
||||
throw new NflgBusinessException(STATE.BusinessError, "rootRowId对应设备信息未找到");
|
||||
}
|
||||
|
||||
|
||||
|
||||
String nos = dto.getDrawingNo();
|
||||
|
||||
List<OptionalEbomImportChildEntity> optionList = null;
|
||||
|
|
@ -81,15 +90,22 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
|||
optionList.add(entity);
|
||||
} else {
|
||||
//先统一后分割
|
||||
String[] array = nos.replace(";", ";")
|
||||
|
||||
|
||||
String strMaterial= nos.replace(";", ";")
|
||||
.replace(" ",";")
|
||||
.replace(",",";")
|
||||
.replace(",",";")
|
||||
.split(";");
|
||||
List<String> listNo = Arrays.stream(array).collect(Collectors.toList());
|
||||
List<BaseMaterialVO> materialListVo = SpringUtil.getBean(MaterialMainService.class).initMaterialForAnyNo(listNo);
|
||||
.replace(",",";");
|
||||
strMaterial=strMaterial.replace("\n","").trim();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
List<String> listNo = StrUtil.splitTrim(strMaterial,";");
|
||||
List<BaseMaterialVO> materialListVo = SpringUtil.getBean(MaterialMainService.class).initMaterialForMaterialNo(listNo);
|
||||
if (CollectionUtil.isEmpty(materialListVo)) {
|
||||
throw new NflgBusinessException(STATE.BusinessError, "未查询到图号/物料相关数据");
|
||||
throw new NflgBusinessException(STATE.BusinessError, "未查询到物料相关数据");
|
||||
}
|
||||
optionList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||
}, materialListVo);
|
||||
|
|
@ -133,7 +149,7 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
|||
if (childEntity == null) {
|
||||
|
||||
item.setCreatedTime(DateUtil.now());
|
||||
// item.setUpdatedTime(new Date());
|
||||
|
||||
save(item);
|
||||
} else {
|
||||
// item.setRowId(childEntity.getRowId());
|
||||
|
|
@ -161,6 +177,17 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
|||
return this.updateById(entity);
|
||||
|
||||
}
|
||||
public void updateRemark(OptionalEbomSubmitEditDTO.OptionalEbomImportChildSubmitDTO dto) {
|
||||
|
||||
OptionalEbomImportChildEntity entity = new OptionalEbomImportChildEntity();
|
||||
entity.setRowId(dto.getRowId());
|
||||
entity.setRemak(dto.getRemak());
|
||||
|
||||
this.updateById(entity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// public Boolean updateBatchChoose(List<OptionalEbomImportChildVO> list){
|
||||
// List<OptionalEbomImportChildEntity> entityLists= Convert.toList(OptionalEbomImportChildEntity.class,list);
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ public class OptionalExcelService {
|
|||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchExcelToRepertory(OptionalEbomImportExcelDTO ebomImportExcelDTO) {
|
||||
|
||||
OptionalEbomMainEntity optionalEbomMainEntity = Convert.convert(new TypeReference<OptionalEbomMainEntity>() {
|
||||
|
|
@ -481,35 +481,6 @@ public class OptionalExcelService {
|
|||
|
||||
optionalEbomImportChildService.insertOptionAction(item);
|
||||
|
||||
// QueryWrapper<OptionalEbomImportChildEntity> queryWrapper3 = new QueryWrapper<>();
|
||||
// // 同一个机型下不可以存在相同的物料信息(物料编号),如果是“无”的情况,需同一个机型+同一个选项来做唯一判断
|
||||
// if (StrUtil.isEmpty(item.getMaterialNo()) && item.getMaterialName().equals("无")) {
|
||||
//
|
||||
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getRootRowId, optionalEbomMainEntity.getRowId());
|
||||
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getParentRowId, childOptionEntity.getParentRowId());
|
||||
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getIsDel, 0);
|
||||
//
|
||||
// } else {
|
||||
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getRootRowId, optionalEbomMainEntity.getRowId());
|
||||
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getMaterialNo, item.getMaterialNo());
|
||||
// queryWrapper3.lambda().eq(OptionalEbomImportChildEntity::getIsDel, 0);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// OptionalEbomImportChildEntity childEntity = optionalEbomImportChildService.getOne(queryWrapper3);
|
||||
// if (childEntity == null) {
|
||||
// item.setParentRowId(childOptionEntity.getRowId());
|
||||
// item.setRootRowId(optionalEbomMainEntity.getRowId());
|
||||
// item.setCreatedBy(SessionUtil.getUserCode());
|
||||
// // item.setCreatedTime(new Date());
|
||||
// // item.setUpdatedTime(new Date());
|
||||
// optionalEbomImportChildService.save(item);
|
||||
// } else {
|
||||
// item.setRowId(childEntity.getRowId());
|
||||
// optionalEbomImportChildService.updateById(item);
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@
|
|||
GROUP BY t1.bom_row_id
|
||||
</select>
|
||||
|
||||
<!--向上递归查找-->
|
||||
<select id="searchList" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
||||
<![CDATA[
|
||||
select T1.*, IFNULL(T2.back_status, 0) as back_status
|
||||
|
|
|
|||
|
|
@ -135,6 +135,21 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="initMaterialForMaterialNo" resultType="com.nflg.product.bomnew.pojo.vo.BaseMaterialVO">
|
||||
select a.row_id as materialRowId, material_no, material_name, material_desc, procure_type, project_type, material_state,drawing_no,a.material_category_code ,material_get_type,drawing_no
|
||||
,material_texture as material ,material_texture ,material_weight,b.rel_category_code,b.category_name,material_unit
|
||||
from t_material_main a join t_material_category b on a.material_category_code=b.category_code
|
||||
where
|
||||
material_no in
|
||||
<foreach collection="materialNo" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--获取用户角色-->
|
||||
<select id="getUserPost" resultType="java.lang.String">
|
||||
SELECT distinct b.post_name from t_authority_role_user a
|
||||
|
|
|
|||
Loading…
Reference in New Issue