|
|
@ -185,6 +185,37 @@ public class RohsController { |
|
|
return R.ok(); |
|
|
return R.ok(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 仅更新材料明细(用于编辑页签即时保存) |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("/updateMaterials") |
|
|
|
|
|
@Transactional |
|
|
|
|
|
public R updateMaterials(@RequestBody RohsEntity rohs) { |
|
|
|
|
|
if (StringUtils.isBlank(rohs.getSite()) || StringUtils.isBlank(rohs.getReferenceNo())) { |
|
|
|
|
|
return R.error("工厂(site)和序列号(referenceNo)不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
RohsEntity exists = rohsService.getDetail(rohs.getSite(), rohs.getReferenceNo()); |
|
|
|
|
|
if (exists == null) { |
|
|
|
|
|
return R.error("未找到对应RoHs单据"); |
|
|
|
|
|
} |
|
|
|
|
|
if ("已完成".equals(exists.getStatus())) { |
|
|
|
|
|
return R.error("已完成状态的单据不允许修改材料"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rohsService.saveOrUpdateMaterials(rohs); |
|
|
|
|
|
|
|
|
|
|
|
RohsEntity updateEntity = new RohsEntity(); |
|
|
|
|
|
if (rohs.getMaterialList() != null && !rohs.getMaterialList().isEmpty()) { |
|
|
|
|
|
updateEntity.setIfsPartNo(rohs.getMaterialList().get(0).getTestPartNo()); |
|
|
|
|
|
} else { |
|
|
|
|
|
updateEntity.setIfsPartNo(null); |
|
|
|
|
|
} |
|
|
|
|
|
QueryWrapper<RohsEntity> updateWrapper = new QueryWrapper<>(); |
|
|
|
|
|
updateWrapper.eq("site", rohs.getSite()).eq("reference_no", rohs.getReferenceNo()); |
|
|
|
|
|
rohsService.update(updateEntity, updateWrapper); |
|
|
|
|
|
return R.ok(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 下达 |
|
|
* 下达 |
|
|
*/ |
|
|
*/ |
|
|
|