|
@@ -547,6 +547,15 @@ public class IndexController {
|
|
|
query1.eq(TEquipment::getClientId,clientId);
|
|
|
TEquipment equipment = equipmentService.getOne(query1);
|
|
|
Long equipmentId = equipment.getId();
|
|
|
+ // 如果存在旧花型,就删除重新创建
|
|
|
+ LambdaQueryWrapper<TProduct> queryProduct = Wrappers.lambdaQuery();
|
|
|
+ queryProduct.eq(TProduct::getEquipmentId,equipment.getId());
|
|
|
+ List<TProduct> productList = productService.list(queryProduct);
|
|
|
+ if (productList.size() > 0) {
|
|
|
+ for(TProduct product : productList){
|
|
|
+ productService.removeById(product.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
if(StringUtils.isEmpty(machineType) || machineType.equals("0")) {
|
|
|
if(equipmentApply.getEquimentType()!=null&&equipmentApply.getEquimentType().equals("MG280")){
|
|
|
saveProductMG280(equipmentId);
|
|
@@ -1832,7 +1841,7 @@ public class IndexController {
|
|
|
String managerId = AdminUtils.encrypt(false, adminId);
|
|
|
if(StringUtils.isEmpty(equipment.getManagerId())||!equipment.getManagerId().equals(managerId)){
|
|
|
equipment.setManagerId(managerId);
|
|
|
- equipmentService.save(equipment);
|
|
|
+ equipmentService.updateById(equipment);
|
|
|
}
|
|
|
return managerId;
|
|
|
}
|
|
@@ -1929,6 +1938,7 @@ public class IndexController {
|
|
|
TEquipment equipment = list.get(0);
|
|
|
if (equipment != null&&equipment.getId()!=null) {
|
|
|
TProduct product = productService.getById(productId);
|
|
|
+ product.setModifyDate(new Date());
|
|
|
product.setName(oldProductName);
|
|
|
product.setProductName(newProductName);
|
|
|
productService.updateById(product);
|