Commit 7c26f6cd authored by 赵啸非's avatar 赵啸非

添加产品升级功能

parent 08576119
......@@ -8,6 +8,7 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.base.system.message.MessageProducer;
import com.mortals.xhx.common.code.LogTypeEnum;
import com.mortals.xhx.module.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......@@ -35,6 +36,13 @@ public class DeviceLogServiceImpl extends AbstractCRUDServiceImpl<DeviceLogDao,
@Autowired
private MessageProducer messageProducer;
@Override
protected void saveBefore(DeviceLogEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
}
@Override
protected void findAfter(DeviceLogEntity params, PageInfo pageInfo, Context context, List<DeviceLogEntity> list) throws AppException {
list.stream().forEach(item -> {
......
package com.mortals.xhx.module.product.service.impl;
import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.model.ProductVersionQuery;
import com.mortals.xhx.module.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -12,17 +16,27 @@ import org.springframework.util.ObjectUtils;
import java.util.Date;
/**
* ProductVersionService
* 产品客户端版本 service实现
*
* @author zxfei
* @date 2022-08-22
*/
* ProductVersionService
* 产品客户端版本 service实现
*
* @author zxfei
* @date 2022-08-22
*/
@Service("productVersionService")
public class ProductVersionServiceImpl extends AbstractCRUDServiceImpl<ProductVersionDao, ProductVersionEntity, Long> implements ProductVersionService {
@Autowired
private ProductService productService;
@Override
protected void saveBefore(ProductVersionEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
if (!ObjectUtils.isEmpty(entity.getProductId())) {
ProductEntity productEntity = productService.get(entity.getProductId(), context);
if (!ObjectUtils.isEmpty(productEntity)) {
entity.setProductName(productEntity.getProductName());
entity.setProductCode(productEntity.getProductCode());
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment