联调同步。

master
Tom Li 2 weeks ago
parent 7b284dc530
commit 1c0767d144
  1. 12
      src/main/java/org/springblade/modules/jinchao/controller/CustomerController.java
  2. 54
      src/main/java/org/springblade/modules/jinchao/controller/ProductController.java
  3. 7
      src/main/java/org/springblade/modules/jinchao/controller/ProductObjController.java
  4. 7
      src/main/java/org/springblade/modules/jinchao/pojo/entity/BizPriceEntity.java
  5. 5
      src/main/java/org/springblade/modules/jinchao/pojo/entity/ProductEntity.java
  6. 24
      src/main/java/org/springblade/modules/jinchao/pojo/vo/CustomerVO.java
  7. 4
      src/main/java/org/springblade/modules/jinchao/service/ICustomerService.java
  8. 46
      src/main/java/org/springblade/modules/jinchao/service/impl/CustomerServiceImpl.java
  9. 39
      src/main/java/org/springblade/modules/jinchao/service/impl/ProductServiceImpl.java

@ -33,15 +33,14 @@ import lombok.AllArgsConstructor;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.modules.jinchao.constant.BaseCol; import org.springblade.modules.jinchao.constant.BaseCol;
import org.springblade.modules.jinchao.pojo.request.CustomerSearch; import org.springblade.modules.jinchao.pojo.request.CustomerSearch;
import org.springblade.modules.jinchao.pojo.request.CustomerSubmit; import org.springblade.modules.jinchao.pojo.request.CustomerSubmit;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -80,9 +79,12 @@ public class CustomerController extends BladeController {
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入customer") @Operation(summary = "详情", description = "传入customer")
public R<CustomerVO> detail(CustomerEntity customer) { public R<CustomerSubmit> detail(CustomerEntity customer) {
CustomerEntity detail = service.getOne(Condition.getQueryWrapper(customer)); CustomerEntity detail = service.getOne(Condition.getQueryWrapper(customer));
return R.data(CustomerWrapper.build().entityVO(detail)); CustomerSubmit submit = new CustomerSubmit();
BeanUtils.copyProperties(detail, submit);
service.setVoValueDetail(submit);
return R.data(submit);
} }
/** /**
@ -100,7 +102,7 @@ public class CustomerController extends BladeController {
.orderByDesc(BaseCol.CREATE_TIME) .orderByDesc(BaseCol.CREATE_TIME)
); );
IPage<CustomerVO> pagesVo = CustomerWrapper.build().pageVO(pages); IPage<CustomerVO> pagesVo = CustomerWrapper.build().pageVO(pages);
pagesVo.getRecords().stream().peek(service::setVoValue).collect(Collectors.toList()); pagesVo.getRecords().stream().peek(service::setVoValueMain).collect(Collectors.toList());
return R.data(pagesVo); return R.data(pagesVo);
} }

@ -29,6 +29,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import jakarta.annotation.Resource;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@ -37,8 +38,11 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.modules.jinchao.constant.BaseCol;
import org.springblade.modules.jinchao.constant.ProductConst; import org.springblade.modules.jinchao.constant.ProductConst;
import org.springblade.modules.jinchao.pojo.entity.BizPriceEntity;
import org.springblade.modules.jinchao.pojo.vo.ProductVO; import org.springblade.modules.jinchao.pojo.vo.ProductVO;
import org.springblade.modules.jinchao.service.IBizPriceService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -53,6 +57,7 @@ import org.springblade.core.excel.util.ExcelUtil;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
@ -68,7 +73,10 @@ import jakarta.servlet.http.HttpServletResponse;
@Tag(name = "[产品]", description = "[产品]接口") @Tag(name = "[产品]", description = "[产品]接口")
public class ProductController extends BladeController { public class ProductController extends BladeController {
private final IProductService service; @Resource
private IProductService service;
@Resource
private IBizPriceService bizPriceService;
/** /**
* [产品] 详情 * [产品] 详情
@ -157,24 +165,38 @@ public class ProductController extends BladeController {
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@Operation(summary = "批量新增或修改", description = "ProductEntity List") @Operation(summary = "批量新增或修改", description = "ProductEntity List")
public R submitBat(@Valid @RequestBody List<ProductVO> vos) { public R submitBat(@Valid @RequestBody List<ProductVO> vos) {
// todo:删除的情况
//
if (vos != null && !vos.isEmpty()) { if (vos != null && !vos.isEmpty()) {
for (ProductVO vo : vos) { for (ProductVO vo : vos) {
if (vo != null && Objects.equals(vo.getBizType(), ProductConst.TYPE_PRICE_CUSTOM)) { final Integer bizType = vo.getBizType();
// 跳过 if (Objects.equals(bizType, ProductConst.TYPE_PRICE_STANDARD)) { // 标准价
continue; if (Objects.requireNonNull(vo).getId() == null || vo.getId() == 0L) {
} // 新增check
if (Objects.requireNonNull(vo).getId() == null || vo.getId() == 0L) { if (service.existsCode(vo.getCode())) {
// 新增check return R.fail("已经存在此code");
if (service.existsCode(vo.getCode())) { }
return R.fail("已经存在此code"); if (service.existsNameCn(vo.getNameCn())) {
} return R.fail("已经存在此nameCn");
if (service.existsNameCn(vo.getNameCn())) { }
return R.fail("已经存在此nameCn"); // 新增
service.save(vo);
} else {
service.updateById(vo);
} }
// 新增 } else if (Objects.equals(bizType, ProductConst.TYPE_PRICE_CUSTOM)) { // 指定价
service.save(vo); QueryWrapper<BizPriceEntity> qw = new QueryWrapper<BizPriceEntity>()
} else { .eq(BaseCol.ID, vo.getBizPriceId());
service.updateById(vo); Optional<BizPriceEntity> opt = bizPriceService.getOneOpt(qw);
opt.ifPresent(
bp -> {
bp.setSaleUserId(vo.getSaleUserId());
bp.setCustomerId(vo.getCustomerId());
bp.setBizPrice(vo.getBizPrice());
bizPriceService.save(bp);
}
);
} }
} }
} }

@ -41,6 +41,7 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.modules.jinchao.constant.BaseCol;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -94,7 +95,11 @@ public class ProductObjController extends BladeController {
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@Operation(summary = "list分页", description = "传入productObj") @Operation(summary = "list分页", description = "传入productObj")
public R<IPage<ProductObjVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> productObj, Query query) { public R<IPage<ProductObjVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> productObj, Query query) {
IPage<ProductObjEntity> pages = productObjService.page(Condition.getPage(query), Condition.getQueryWrapper(productObj, ProductObjEntity.class)); IPage<ProductObjEntity> pages = productObjService.page(
Condition.getPage(query),
Condition.getQueryWrapper(productObj, ProductObjEntity.class)
.orderByAsc(BaseCol.ID)
);
return R.data(ProductObjWrapper.build().pageVO(pages)); return R.data(ProductObjWrapper.build().pageVO(pages));
} }

@ -30,6 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity; import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial; import java.io.Serial;
/** /**
@ -47,6 +48,8 @@ public class BizPriceEntity extends TenantEntity {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String COL_PRODUCT_ID = "product_id";
/** /**
* [产品]id * [产品]id
*/ */
@ -63,8 +66,8 @@ public class BizPriceEntity extends TenantEntity {
@Schema(description = "[客户]id") @Schema(description = "[客户]id")
private Long customerId; private Long customerId;
/** /**
* 特定用户价格 * 特定业务员价格
*/ */
@Schema(description = "特定用户价格") @Schema(description = "特定业务员价格")
private Double bizPrice; private Double bizPrice;
} }

@ -30,6 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity; import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial; import java.io.Serial;
/** /**
@ -47,6 +48,10 @@ public class ProductEntity extends TenantEntity {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String COL_CODE = "code";
public static final String COL_NAME_CN = "name_cn";
/** /**
* 编号 * 编号
*/ */

@ -32,6 +32,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.io.Serial; import java.io.Serial;
import java.time.LocalDateTime;
/** /**
* [客户] 视图实体类 * [客户] 视图实体类
@ -46,22 +47,39 @@ public class CustomerVO extends CustomerEntity {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 创建人 真名
*/
@Schema(description = "创建人 真名")
private String createUserRealName;
/** /**
* 所属国家dict * 所属国家dict
*/ */
@Schema(description = "所属国家dict") @Schema(description = "所属国家dict")
private String countryValue; private String countryValue;
/** /**
* 客户来源dict * 客户来源dict
*/ */
@Schema(description = "客户来源dict") @Schema(description = "客户来源dict")
private String fromTypeValue; private String fromTypeValue;
/** /**
* 主要[客户联系人] * 主要[客户联系人]
*/ */
@Schema(description = "主要[客户联系人]") @Schema(description = "主要[客户联系人]")
private ContactEntity contactMain; private ContactEntity contactMain;
/**
* 最近订单状态
*/
@Schema(description = "最近订单状态")
private Integer lastOrderStatus = 2;
/**
* 最近订单状态
*/
@Schema(description = "最近订单状态")
private String lastOrderStatusValue = "已付款";
/**
* 最近成交时间
*/
@Schema(description = "最近成交时间")
private LocalDateTime lastOrderDealDateTime = LocalDateTime.now();
} }

@ -69,5 +69,7 @@ public interface ICustomerService extends BaseService<CustomerEntity> {
R<List<CustomerEntity>> listForSelect(); R<List<CustomerEntity>> listForSelect();
void setVoValue(CustomerVO vo); void setVoValueMain(CustomerVO vo);
void setVoValueDetail(CustomerSubmit submit);
} }

@ -41,7 +41,9 @@ import org.springblade.modules.jinchao.excel.CustomerExcel;
import org.springblade.modules.jinchao.mapper.CustomerMapper; import org.springblade.modules.jinchao.mapper.CustomerMapper;
import org.springblade.modules.jinchao.service.IContactService; import org.springblade.modules.jinchao.service.IContactService;
import org.springblade.modules.jinchao.service.ICustomerService; import org.springblade.modules.jinchao.service.ICustomerService;
import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.service.IDictService; import org.springblade.modules.system.service.IDictService;
import org.springblade.modules.system.service.IUserService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
@ -70,6 +72,8 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerMapper, Custome
private IContactService contactService; private IContactService contactService;
@Resource @Resource
private IDictService dictService; private IDictService dictService;
@Resource
private IUserService userService;
@Override @Override
public IPage<CustomerVO> selectCustomerPage(IPage<CustomerVO> page, CustomerVO customer) { public IPage<CustomerVO> selectCustomerPage(IPage<CustomerVO> page, CustomerVO customer) {
@ -91,19 +95,19 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerMapper, Custome
if (submit.getContacts() == null || submit.getContacts().isEmpty()) { if (submit.getContacts() == null || submit.getContacts().isEmpty()) {
return R.fail("contacts为空"); return R.fail("contacts为空");
} }
CustomerEntity cu = new CustomerEntity(); CustomerEntity c = new CustomerEntity();
BeanUtils.copyProperties(submit, cu); BeanUtils.copyProperties(submit, c);
boolean save = save(cu); boolean save = save(c);
for (int i = 0; i < submit.getContacts().size(); i++) { for (int i = 0; i < submit.getContacts().size(); i++) {
ContactEntity co = submit.getContacts().get(i); ContactEntity co = submit.getContacts().get(i);
co.setId(null); co.setId(null);
if (i == 1) { if (i == 0) {
co.setContactType(ContactConst.TYPE_MAIN); co.setContactType(ContactConst.TYPE_MAIN);
} else { } else {
co.setContactType(ContactConst.TYPE_SECONDARY); co.setContactType(ContactConst.TYPE_SECONDARY);
} }
co.setSort(i); co.setSort(i + 1);
co.setCustomerId(cu.getId()); co.setCustomerId(c.getId());
} }
contactService.saveBatch(submit.getContacts()); contactService.saveBatch(submit.getContacts());
return R.status(save); return R.status(save);
@ -116,25 +120,29 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerMapper, Custome
} }
CustomerEntity cu = new CustomerEntity(); CustomerEntity cu = new CustomerEntity();
BeanUtils.copyProperties(submit, cu); BeanUtils.copyProperties(submit, cu);
boolean save = updateById(cu); // 更新客户
boolean update = updateById(cu);
// List<ContactEntity> existList = contactService.list(
// new QueryWrapper<ContactEntity>().eq("", "")
// );
for (int i = 0; i < submit.getContacts().size(); i++) { for (int i = 0; i < submit.getContacts().size(); i++) {
ContactEntity co = submit.getContacts().get(i); ContactEntity co = submit.getContacts().get(i);
co.setCustomerId(cu.getId()); co.setCustomerId(cu.getId());
if (co.getSort() == null || co.getSort() == 0L) { if (co.getSort() == null || co.getSort() == 0L) {
co.setSort(i); co.setSort(i + 1);
} }
if (co.getContactType() == null || co.getContactType() == 0L) { if (co.getContactType() == null || co.getContactType() == 0L) {
co.setContactType(ContactConst.TYPE_SECONDARY); co.setContactType(ContactConst.TYPE_SECONDARY);
} }
} }
contactService.saveOrUpdateBatch(submit.getContacts()); contactService.saveOrUpdateBatch(submit.getContacts());
return R.status(save); return R.status(update);
} }
@Override @Override
public IPage<CustomerVO> search(IPage<CustomerVO> page, CustomerSearch search) { public IPage<CustomerVO> search(IPage<CustomerVO> page, CustomerSearch search) {
IPage<CustomerVO> pagesVo = page.setRecords(baseMapper.searchPage(page, search)); IPage<CustomerVO> pagesVo = page.setRecords(baseMapper.searchPage(page, search));
pagesVo.getRecords().stream().peek(this::setVoValue).collect(Collectors.toList()); pagesVo.getRecords().stream().peek(this::setVoValueMain).collect(Collectors.toList());
return pagesVo; return pagesVo;
} }
@ -147,7 +155,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerMapper, Custome
} }
@Override @Override
public void setVoValue(CustomerVO vo) { public void setVoValueMain(CustomerVO vo) {
vo.setCountryValue(dictService.getValue(ContactConst.DICT_CUSTOMER_COUNTRY, vo.getCountry())); vo.setCountryValue(dictService.getValue(ContactConst.DICT_CUSTOMER_COUNTRY, vo.getCountry()));
vo.setFromTypeValue(dictService.getValue(ContactConst.DICT_CUSTOMER_FROM_TYPE, vo.getFromType())); vo.setFromTypeValue(dictService.getValue(ContactConst.DICT_CUSTOMER_FROM_TYPE, vo.getFromType()));
{ {
@ -160,5 +168,21 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerMapper, Custome
vo.setContactMain(contactF); vo.setContactMain(contactF);
} }
} }
{
User uC = userService.getById(vo.getCreateUser());
if (uC != null) {
vo.setCreateUserRealName(uC.getRealName());
}
}
}
@Override
public void setVoValueDetail(CustomerSubmit submit) {
List<ContactEntity> list = contactService.list(
new QueryWrapper<ContactEntity>()
.eq("customer_id", submit.getId())
.orderByAsc("sort")
);
submit.setContacts(list);
} }
} }

@ -79,7 +79,7 @@ public class ProductServiceImpl extends BaseServiceImpl<ProductMapper, ProductEn
private ICustomerService customerService; private ICustomerService customerService;
@Override @Override
public IPage<org.springblade.modules.jinchao.pojo.vo.ProductVO> selectProductPage(IPage<org.springblade.modules.jinchao.pojo.vo.ProductVO> page, org.springblade.modules.jinchao.pojo.vo.ProductVO product) { public IPage<ProductVO> selectProductPage(IPage<ProductVO> page, ProductVO product) {
return page.setRecords(baseMapper.selectProductPage(page, product)); return page.setRecords(baseMapper.selectProductPage(page, product));
} }
@ -101,30 +101,35 @@ public class ProductServiceImpl extends BaseServiceImpl<ProductMapper, ProductEn
IPage<ProductVO> pagesVo = ProductWrapper.build().pageVO(pages); IPage<ProductVO> pagesVo = ProductWrapper.build().pageVO(pages);
ListIterator<ProductVO> it = pagesVo.getRecords().listIterator(); ListIterator<ProductVO> it = pagesVo.getRecords().listIterator();
while (it.hasNext()) { while (it.hasNext()) {
ProductVO vo = it.next(); ProductVO vo1 = it.next();
vo.setBizType(ProductConst.TYPE_PRICE_STANDARD); // 默认
vo1.setBizType(ProductConst.TYPE_PRICE_STANDARD);
// TYPE_PRICE_CUSTOM 数据是拼接上的 // TYPE_PRICE_CUSTOM 数据是拼接上的
long count = bizPriceService.count( long count = bizPriceService.count(
new QueryWrapper<BizPriceEntity>().eq("product_id", vo.getId()) new QueryWrapper<BizPriceEntity>().eq(BizPriceEntity.COL_PRODUCT_ID, vo1.getId())
); );
if (count != 0L) { if (count != 0L) {
List<BizPriceEntity> listBP = bizPriceService.listByProductId(vo.getId()); List<BizPriceEntity> listBP = bizPriceService.listByProductId(vo1.getId());
listBP.forEach(bp -> { listBP.forEach(bp -> {
log.info("bp = {}", bp);
ProductVO vo2 = new ProductVO(); ProductVO vo2 = new ProductVO();
BeanUtils.copyProperties(vo, vo2); BeanUtils.copyProperties(vo1, vo2);
vo2.setId(vo1.getId());
// 特定价
vo2.setBizType(ProductConst.TYPE_PRICE_CUSTOM); vo2.setBizType(ProductConst.TYPE_PRICE_CUSTOM);
vo2.setBizPriceId(bp.getId()); vo2.setBizPriceId(bp.getId());
BeanUtils.copyProperties(bp, vo2); BeanUtils.copyProperties(bp, vo2);
User u = userService.getById(vo2.getSaleUserId()); //
if (u != null) { CustomerEntity customer = customerService.getById(bp.getCustomerId());
vo2.setSaleUserRealName(u.getRealName()); if (customer != null) {
vo2.setBizRemark("客户:" + customer.getCompanyName());
vo2.setCustomerCompanyName(customer.getCompanyName());
} }
CustomerEntity c = customerService.getById(vo2.getCustomerId()); {
if (c != null) { User u = userService.getById(vo2.getSaleUserId());
vo2.setCustomerCompanyName(c.getCompanyName()); if (u != null) {
vo2.setSaleUserRealName(u.getRealName());
}
} }
vo2.setBizRemark("客户:" + customerService.getById(bp.getCustomerId()).getCompanyName());
it.add(vo2); it.add(vo2);
}); });
} else { } else {
@ -136,12 +141,12 @@ public class ProductServiceImpl extends BaseServiceImpl<ProductMapper, ProductEn
@Override @Override
public Boolean existsCode(String code) { public Boolean existsCode(String code) {
return baseMapper.exists(new QueryWrapper<ProductEntity>().eq("code", code)); return baseMapper.exists(new QueryWrapper<ProductEntity>().eq(ProductEntity.COL_CODE, code));
} }
@Override @Override
public Boolean existsNameCn(String nameCn) { public Boolean existsNameCn(String nameCn) {
return baseMapper.exists(new QueryWrapper<ProductEntity>().eq("name_cn", nameCn)); return baseMapper.exists(new QueryWrapper<ProductEntity>().eq(ProductEntity.COL_NAME_CN, nameCn));
} }
/** /**
@ -162,7 +167,7 @@ public class ProductServiceImpl extends BaseServiceImpl<ProductMapper, ProductEn
public R<List<ProductVO>> oneKeyMatch(List<ProductVO> list) { public R<List<ProductVO>> oneKeyMatch(List<ProductVO> list) {
List<ProductVO> listNew = list.stream() List<ProductVO> listNew = list.stream()
.map(vo -> { .map(vo -> {
ProductEntity pFind = getOne(new QueryWrapper<ProductEntity>().eq("name_cn", vo.getNameCn())); ProductEntity pFind = getOne(new QueryWrapper<ProductEntity>().eq(ProductEntity.COL_NAME_CN, vo.getNameCn()));
if (pFind != null) { if (pFind != null) {
ProductVO voNew = new ProductVO(); ProductVO voNew = new ProductVO();
BeanUtils.copyProperties(pFind, voNew); BeanUtils.copyProperties(pFind, voNew);

Loading…
Cancel
Save