mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、无权限用户菜单展示错误修复;2、用户性别、板材-纹理/宽度/长度/品牌/规格/价格/备注缺省值可null修复;3、全局DefaultDBFieldHandler自动填充移除数值类型的自动填充;4、补充默认的i18文件message.properties;
This commit is contained in:
+1
@@ -43,6 +43,7 @@ public class PlateGoodDO extends BaseDO {
|
||||
/**
|
||||
* 背面颜色
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String colorBlack;
|
||||
/**
|
||||
* 纹路
|
||||
|
||||
+5
-51
@@ -28,7 +28,6 @@ import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
@@ -64,8 +63,6 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
@Resource(name = EXECUTOR_IMPOT_THREAD_POOL_TASK_EXECUTOR)
|
||||
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
||||
|
||||
private static final String EMPTY_STRING = new String();
|
||||
|
||||
public static final Double ZERO = 0.0;
|
||||
|
||||
@Override
|
||||
@@ -93,7 +90,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
PlateGoodDO updateObj = BeanUtils.toBean(updateReqVO, PlateGoodDO.class);
|
||||
|
||||
// 校验板材goods_id是否相同
|
||||
if (plateGoodMapper.isByGoodIDAndId(updateReqVO.getGoodsId(), Long.valueOf(updateReqVO.getId()))) {
|
||||
if (Boolean.TRUE.equals(plateGoodMapper.isByGoodIDAndId(updateReqVO.getGoodsId(), updateReqVO.getId()))) {
|
||||
throw new ServiceException(PLATE_GOODS_ID_NOT_SAME);
|
||||
}
|
||||
|
||||
@@ -136,9 +133,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
|
||||
@Override
|
||||
public PlateGoodDO getPlate(Long id, Long organId) {
|
||||
PlateGoodDO plate = plateGoodMapper.selectOneById(id, organId);
|
||||
return plate.setWidth(Objects.equals(plate.getWidth(), ZERO) ? null : plate.getWidth())
|
||||
.setHeight(Objects.equals(plate.getHeight(), ZERO) ? null : plate.getHeight());
|
||||
return plateGoodMapper.selectOneById(id, organId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,11 +143,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
|
||||
@Override
|
||||
public PageResult<PlateGoodDO> getPlatePage(PlatePageReqVO pageReqVO) {
|
||||
PageResult<PlateGoodDO> plateGoodDOPageResult = plateGoodMapper.selectPage(pageReqVO);
|
||||
plateGoodDOPageResult.getList().forEach(plateGoodDO -> plateGoodDO.setWidth(Objects.equals(plateGoodDO.getWidth(), ZERO) ? null : plateGoodDO.getWidth())
|
||||
.setHeight(Objects.equals(plateGoodDO.getHeight(), ZERO) ? null : plateGoodDO.getHeight())
|
||||
.setPrice(Objects.equals(plateGoodDO.getPrice(), ZERO) ? null : plateGoodDO.getPrice()));
|
||||
return plateGoodDOPageResult;
|
||||
return plateGoodMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -212,7 +203,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
// 子线程同步主线程的多数据源
|
||||
DynamicDataSourceContextHolder.push(peek);
|
||||
|
||||
List<String> goodsIds = batch.stream().map(PlateImportExcelVO::getGoodsId).collect(Collectors.toList());
|
||||
List<String> goodsIds = batch.stream().map(PlateImportExcelVO::getGoodsId).toList();
|
||||
Map<String, PlateGoodDO> plateGoodMap = plateGoodMapper.selectList(
|
||||
new LambdaQueryWrapper<PlateGoodDO>().in(PlateGoodDO::getGoodsId, goodsIds).eq(PlateGoodDO::getOrganId, organId))
|
||||
.stream().collect(Collectors.toMap(PlateGoodDO::getGoodsId, p -> p));
|
||||
@@ -257,14 +248,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
PlateGoodDO existPlate = plateGoodMap.get(importPart.getGoodsId());
|
||||
if (existPlate == null) {
|
||||
PlateGoodDO plateGoodDO = BeanUtils.toBean(importPart, PlateGoodDO.class).setOrganId(organId);
|
||||
plateGoodDO.setColorBlack(EMPTY_STRING)
|
||||
.setBrand(EMPTY_STRING)
|
||||
.setSpec(getEmpty(plateGoodDO.getSpec()))
|
||||
.setRemark(getEmpty(plateGoodDO.getRemark()))
|
||||
.setTexture(getDefaultFalse(plateGoodDO.getTexture()))
|
||||
.setHeight(getZeroDouble(plateGoodDO.getHeight()))
|
||||
.setWidth(getZeroDouble(plateGoodDO.getWidth()))
|
||||
.setOrganId(organId)
|
||||
plateGoodDO.setOrganId(organId)
|
||||
.setDeleted(false);
|
||||
insertList.add(plateGoodDO);
|
||||
} else if (!isUpdateSupport) {
|
||||
@@ -314,36 +298,6 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
return batches;
|
||||
}
|
||||
|
||||
/**
|
||||
* value为空返回0.0
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
private double getZeroDouble(Double value) {
|
||||
return ObjectUtil.defaultIfNull(value, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* value为空返回EMPTY_STRING
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
private String getEmpty(String value) {
|
||||
return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
|
||||
}
|
||||
|
||||
/**
|
||||
* value为空返回false
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
private Boolean getDefaultFalse(Boolean value) {
|
||||
return ObjectUtil.defaultIfNull(value, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportTemplate(HttpServletResponse response, String value) {
|
||||
String rootPath = getSavePath();
|
||||
|
||||
Reference in New Issue
Block a user