diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java index 22627c6d..a10e444a 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java @@ -40,6 +40,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; @@ -681,7 +682,8 @@ public class UdiRelevanceController extends BaseController { if (udiProductEntity.getRelSupId() != null) { UdiRlSupEntity udiRlSupEntity = new UdiRlSupEntity(); udiRlSupEntity.setUpdateTime(new Date()); - udiRlSupEntity.setId(udiProductEntity.getId()); + udiRlSupEntity.setPrice(new BigDecimal(udiProductEntity.getPrice())); + udiRlSupEntity.setId(udiProductEntity.getRelSupId()); udiRlSupService.updateCompanyProductRelevance(udiRlSupEntity); } if (falg) { diff --git a/src/main/java/com/glxp/api/service/basic/UdiRlSupService.java b/src/main/java/com/glxp/api/service/basic/UdiRlSupService.java index 60ad8209..f4f993f9 100644 --- a/src/main/java/com/glxp/api/service/basic/UdiRlSupService.java +++ b/src/main/java/com/glxp/api/service/basic/UdiRlSupService.java @@ -30,6 +30,8 @@ public interface UdiRlSupService { int updateCompanyProductRelevance(UdiRlSupEntity companyCertEntity); + int updateCompanyProductRelevanceByUdiFk(UdiRlSupEntity companyCertEntity); + boolean insertCompanyProductRelevance(UdiRlSupEntity companyCertEntity); boolean deleteById(String id); diff --git a/src/main/java/com/glxp/api/service/basic/impl/UdiRlSupServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/UdiRlSupServiceImpl.java index 3a094437..b7b3128a 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/UdiRlSupServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/UdiRlSupServiceImpl.java @@ -1,5 +1,6 @@ package com.glxp.api.service.basic.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.basic.UdiRlSupDao; import com.glxp.api.entity.basic.UdiRlSupEntity; @@ -103,6 +104,13 @@ public class UdiRlSupServiceImpl implements UdiRlSupService { return udiRlSupDao.updateById(udiRlSupEntity); } + @Override + public int updateCompanyProductRelevanceByUdiFk(UdiRlSupEntity companyCertEntity) { + QueryWrapper ew=new QueryWrapper<>(); + ew.eq("udiRlIdFk",companyCertEntity.getUdiRlIdFk()); + return udiRlSupDao.update(companyCertEntity,ew); + } + @Override public boolean insertCompanyProductRelevance(UdiRlSupEntity udiRlSupEntity) { return udiRlSupDao.insertCompanyProductRelevance(udiRlSupEntity);