|
@@ -2311,28 +2311,28 @@ public class IndexController {
|
|
|
return "fail";
|
|
|
}
|
|
|
TEquipmentDesc equipmentDesc = equipmentDescService.getById(equipment.getId());
|
|
|
- if (equipmentDesc.getLanguage() == null || !(equipmentDesc.getLanguage().equals(language))) {
|
|
|
- equipmentDesc.setLanguage(language);
|
|
|
- equipmentDescService.updateById(equipmentDesc);
|
|
|
- LambdaQueryWrapper<TProduct> wrapper = Wrappers.lambdaQuery();
|
|
|
- wrapper.eq(TProduct::getEquipmentId, equipment.getId());
|
|
|
- List<TProduct> products = productService.list(wrapper);
|
|
|
- for (TProduct product : products) {
|
|
|
- String no = product.getNo();
|
|
|
- // 如果没改过名才更改
|
|
|
- if (StringUtils.isEmpty(product.getName())) {
|
|
|
- LambdaQueryWrapper<TNameDictionary> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
- lambdaQueryWrapper.eq(TNameDictionary::getLanguage, language);
|
|
|
- lambdaQueryWrapper.eq(TNameDictionary::getNo, no);
|
|
|
- TNameDictionary nameDictionary = nameDictionaryService.getOne(lambdaQueryWrapper);
|
|
|
- if (nameDictionary != null) {
|
|
|
- product.setModifyDate(new Date());
|
|
|
- product.setProductName(nameDictionary.getName());
|
|
|
- productService.updateById(product);
|
|
|
- }
|
|
|
+ equipmentDesc.setLanguage(language);
|
|
|
+ equipmentDescService.updateById(equipmentDesc);
|
|
|
+ LambdaQueryWrapper<TProduct> wrapper = Wrappers.lambdaQuery();
|
|
|
+ wrapper.eq(TProduct::getEquipmentId, equipment.getId());
|
|
|
+ List<TProduct> products = productService.list(wrapper);
|
|
|
+ for (TProduct product : products) {
|
|
|
+ String no = product.getNo();
|
|
|
+ // 如果没改过名才更改
|
|
|
+ if (StringUtils.isEmpty(product.getName())) {
|
|
|
+ LambdaQueryWrapper<TNameDictionary> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
+ lambdaQueryWrapper.eq(TNameDictionary::getLanguage, language);
|
|
|
+ lambdaQueryWrapper.eq(TNameDictionary::getNo, no);
|
|
|
+ TNameDictionary nameDictionary = nameDictionaryService.getOne(lambdaQueryWrapper);
|
|
|
+ if (nameDictionary != null) {
|
|
|
+ product.setModifyDate(new Date());
|
|
|
+ product.setProductName(nameDictionary.getName());
|
|
|
+ productService.updateById(product);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+// if (equipmentDesc.getLanguage() == null || !(equipmentDesc.getLanguage().equals(language))) {
|
|
|
+// }
|
|
|
return "success";
|
|
|
}
|
|
|
return "fail";
|