mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
sonarqube质量修复
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.planItem;
|
||||
package com.cf.imes.module.executor.dal.mysql.planitem;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
+8
-18
@@ -42,7 +42,7 @@ import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.PLATE_IMPORT_INTERRUPT_ERROR;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.PLATE_IMPORT_QUERY_INTERRUPT_ERROR;
|
||||
import static com.cf.imes.module.executor.framework.executor.config.ExecutorThreadPoolConfiguration.EXECUTOR_IMPOT_THREAD_POOL_TASK_EXECUTOR;
|
||||
@@ -89,7 +89,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
public Long createPlate(PlateSaveReqVO createReqVO) {
|
||||
PlateGoodDO plate = BeanUtils.toBean(createReqVO, PlateGoodDO.class);
|
||||
|
||||
Long organId = getOrganId(BASE_PLATE_CREATE_PERMISSION, getLoginUser().getId(), plate.getOrganId());
|
||||
Long organId = getOrganId(BASE_PLATE_CREATE_PERMISSION, getLoginUserId(), plate.getOrganId());
|
||||
// 判断板材是否存在
|
||||
validateGoodExists(plate.getGoodsId(), organId);
|
||||
|
||||
@@ -106,7 +106,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updatePlate(PlateSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
Long organId = getOrganId(BASE_PLATE_UPDATE_PERMISSION, getLoginUser().getId(), updateReqVO.getOrganId());
|
||||
Long organId = getOrganId(BASE_PLATE_UPDATE_PERMISSION, getLoginUserId(), updateReqVO.getOrganId());
|
||||
if (updateReqVO.getId() == null) {
|
||||
throw exception(ErrorCodeConstants.PLATE_NOT_EXISTS);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
public void deletePlate(Long id, Long organId) {
|
||||
// 校验存在
|
||||
validatePlateExists(id,
|
||||
getOrganId(BASE_PLATE_DELETE_PERMISSION, getLoginUser().getId(), organId));
|
||||
getOrganId(BASE_PLATE_DELETE_PERMISSION, getLoginUserId(), organId));
|
||||
// 删除
|
||||
plateGoodMapper.deleteById(id);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
|
||||
@Override
|
||||
public PlateGoodDO getPlateGoods(String id) {
|
||||
Long organId = getOrganId(BASE_PLATE_QUERY_PERMISSION, getLoginUser().getId(), null);
|
||||
Long organId = getOrganId(BASE_PLATE_QUERY_PERMISSION, getLoginUserId(), null);
|
||||
return plateGoodMapper.selectByGoodID(id, organId , false);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
// pageReqVO.setOrganId(OrganContextHolder.getOrganId());
|
||||
// }
|
||||
// if (pageReqVO.getOrganId() == null || pageReqVO.getOrganId() == 0) {
|
||||
pageReqVO.setOrganId(getOrganId(BASE_PLATE_QUERY_PERMISSION, getLoginUser().getId(), pageReqVO.getOrganId()));
|
||||
pageReqVO.setOrganId(getOrganId(BASE_PLATE_QUERY_PERMISSION, getLoginUserId(), pageReqVO.getOrganId()));
|
||||
// }
|
||||
PageResult<PlateGoodDO> plateGoodDOPageResult = plateGoodMapper.selectPage(pageReqVO);
|
||||
plateGoodDOPageResult.getList().forEach(plateGoodDO -> plateGoodDO.setWidth(Objects.equals(plateGoodDO.getWidth(), ZERO) ? null : plateGoodDO.getWidth())
|
||||
@@ -204,7 +204,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
@Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入
|
||||
public void importPlateList(List<PlateImportExcelVO> importPlates, boolean isUpdateSupport, Long organId) {
|
||||
|
||||
organId = getOrganId(BASE_PLATE_IMPORT_PERMISSION, getLoginUser().getId(), organId);
|
||||
organId = getOrganId(BASE_PLATE_IMPORT_PERMISSION, getLoginUserId(), organId);
|
||||
|
||||
// 批量插入集合
|
||||
List<PlateGoodDO> insertList = new CopyOnWriteArrayList<>();
|
||||
@@ -364,16 +364,6 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
|
||||
}
|
||||
|
||||
/**
|
||||
* value为空返回0.0
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
private double getZeroDouble(Double value) {
|
||||
return ObjectUtil.defaultIfNull(value, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* value为空返回false
|
||||
*
|
||||
@@ -400,7 +390,7 @@ public class PlateManageServiceImpl implements PlateManageService {
|
||||
@OrganIgnore
|
||||
public Set<String> getOrgPlateGoodsId(Long organId) {
|
||||
return plateGoodMapper.selectList(new LambdaQueryWrapper<PlateGoodDO>()
|
||||
.eq(PlateGoodDO::getOrganId, getOrganId(BASE_PLATE_IMPORT_PERMISSION, getLoginUser().getId(), organId))
|
||||
.eq(PlateGoodDO::getOrganId, getOrganId(BASE_PLATE_IMPORT_PERMISSION, getLoginUserId(), organId))
|
||||
.eq(PlateGoodDO::getDeleted, false)
|
||||
.select(PlateGoodDO::getGoodsId))
|
||||
.stream().map(PlateGoodDO::getGoodsId).collect(Collectors.toSet());
|
||||
|
||||
+7
-9
@@ -60,7 +60,7 @@ import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderGroup.OrderGroupMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planItem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planitem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.remainplaten.RemainPlateMapper;
|
||||
@@ -165,7 +165,6 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
private static final String FIELD_SORT = " order by createTime desc ";
|
||||
private static final String FIELD_IS_OPTIMIZED = " op.is_optimized";
|
||||
private static final String FIELD_PLAN_CONFIG_ID = "planConfigId";
|
||||
private static final String FIELD_PROCESS_ID = "processId";
|
||||
private static final String FIELD_UPDATETIME = "updateTime";
|
||||
|
||||
private static final String ES_ORDER_MODEL_DATA_ERROR = "生产单板材造型信息ES文档查询数据异常: ";
|
||||
@@ -1246,8 +1245,8 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
if(CharSequenceUtil.isNotBlank(goodsIdList)){
|
||||
|
||||
filterSql = " SELECT orderId,goodsId FROM " + ORDER_PLATE_MODEL.getIndex() + " WHERE "
|
||||
+ "isOptimized = false " +
|
||||
filterSql = " SELECT orderId,goodsId FROM " + ORDER_PLATE_MODEL.getIndex()
|
||||
+ " WHERE isOptimized = false " +
|
||||
"and ( orderId in ( " + orderIds + " ) and goodsId in ( " + goodsIdList + " ) )"
|
||||
+ logicalOperator
|
||||
+ config
|
||||
@@ -1255,9 +1254,8 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
}else {
|
||||
|
||||
filterSql = "SELECT orderId,goodsId FROM " + ORDER_PLATE_MODEL.getIndex() + " WHERE "
|
||||
+ " " +
|
||||
" ( orderId in ( " + orderIds + "))"
|
||||
filterSql = "SELECT orderId,goodsId FROM " + ORDER_PLATE_MODEL.getIndex()
|
||||
+ " WHERE ( orderId in ( " + orderIds + "))"
|
||||
+ logicalOperator
|
||||
+ config
|
||||
+ FIELD_SORT;
|
||||
@@ -1265,8 +1263,8 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
}
|
||||
}else {
|
||||
|
||||
filterSql = "SELECT orderId,goodsId FROM " + ORDER_PLATE_MODEL.getIndex() + " WHERE "
|
||||
+ "isOptimized = false and "
|
||||
filterSql = "SELECT orderId,goodsId FROM " + ORDER_PLATE_MODEL.getIndex()
|
||||
+ " WHERE isOptimized = false and "
|
||||
+ config
|
||||
+ FIELD_SORT;
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ import com.cf.imes.module.executor.dal.mysql.orderParts.PartsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.pack.OrderPackageMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.pack.OrderPrepackagedMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planItem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planitem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper;
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planItem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planitem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.remainplaten.RemainPlateMapper;
|
||||
import com.cf.imes.module.executor.enums.ErrorCodeConstants;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.planItem.PlanItemMapper">
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.planitem.PlanItemMapper">
|
||||
|
||||
|
||||
<resultMap id="OrderPageMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
|
||||
|
||||
Reference in New Issue
Block a user