yanyang #22

Merged
yanyang merged 3 commits from yanyang into master 2023-03-08 11:55:50 +08:00
3 changed files with 40 additions and 0 deletions
Showing only changes of commit 4e932a09fd - Show all commits

View File

@ -168,4 +168,15 @@ public class WoPackagingBoxController {
}
@PostMapping("editSubstrateManual")
@ApiOperation("手动编辑包装箱")
@LogOperation("手动编辑包装箱")
public Result editSubstrateManual(@RequestBody WoPackagingBoxDTO dto){
woPackagingBoxService.editSubstrateManual(dto);
return new Result();
}
}

View File

@ -42,6 +42,8 @@ public interface WoPackagingBoxServiceBiz extends CrudService<WoPackagingBox, Wo
IdVo insertSubstrateManual(WoPackagingBoxDTO dto);
void editSubstrateManual(WoPackagingBoxDTO dto);
int updateIsArrivedByBoxNo(Integer isArrived, String boxNo);

View File

@ -189,6 +189,33 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
return IdVo.builder().id(box.getId()).build();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void editSubstrateManual(WoPackagingBoxDTO dto) {
//获取模组
List<WoPackagingBoxSubstrate> substrateList = dto.getSubstrateList();
for(WoPackagingBoxSubstrate substrate : substrateList){
//新增id为空 模组非空
if(ObjectUtils.isEmpty(substrate.getId()) && StringUtils.isNotBlank(substrate.getWoSubstrateId())) {
substrate.setPackagingBoxId(dto.getBoxNo());
substrate.setPowerLevel(dto.getPowerLevel());
substrate.setSapMaterial(dto.getSapMaterial());
substrate.setLineBody(dto.getLineBody());
BaseSupportUtils.setCommonField(substrate);
woPackagingBoxSubstrateServiceBiz.insert(substrate);
}
//编辑id非空 模组非空
if(ObjectUtils.isNotEmpty(substrate.getId()) && StringUtils.isNotBlank(substrate.getWoSubstrateId())) {
BaseSupportUtils.setUpdateCommonField(substrate);
woPackagingBoxSubstrateServiceBiz.updateById(substrate);
}
//删除id非空 模组为空
if(ObjectUtils.isNotEmpty(substrate.getId()) && StringUtils.isBlank(substrate.getWoSubstrateId())) {
woPackagingBoxSubstrateServiceBiz.deleteById(substrate.getId());
}
}
}
@Override
public int updateIsArrivedByBoxNo(Integer isArrived, String boxNo) {
return mapper.updateIsArrivedByBoxNo(isArrived,boxNo);