|
@@ -14,12 +14,10 @@ import com.sckw.excel.utils.DateUtil;
|
|
|
import com.sckw.manage.dao.KwmLineFreightRateMapper;
|
|
import com.sckw.manage.dao.KwmLineFreightRateMapper;
|
|
|
import com.sckw.manage.model.entity.KwmAddress;
|
|
import com.sckw.manage.model.entity.KwmAddress;
|
|
|
import com.sckw.manage.model.entity.KwmLineFreightRate;
|
|
import com.sckw.manage.model.entity.KwmLineFreightRate;
|
|
|
-import com.sckw.manage.model.vo.req.AddLineFreightRateParam;
|
|
|
|
|
-import com.sckw.manage.model.vo.req.ExportLineFreightRateParam;
|
|
|
|
|
-import com.sckw.manage.model.vo.req.SelectLineFreightRateParam;
|
|
|
|
|
-import com.sckw.manage.model.vo.req.UpdateLineFreightRateParam;
|
|
|
|
|
|
|
+import com.sckw.manage.model.vo.req.*;
|
|
|
import com.sckw.manage.model.vo.res.LineFreightRateDetail;
|
|
import com.sckw.manage.model.vo.res.LineFreightRateDetail;
|
|
|
import com.sckw.manage.model.vo.res.LineFreightRateExport;
|
|
import com.sckw.manage.model.vo.res.LineFreightRateExport;
|
|
|
|
|
+import com.sckw.manage.model.vo.res.LineFreightRateFindListResVO;
|
|
|
import com.sckw.manage.model.vo.res.LineFreightRateListResVO;
|
|
import com.sckw.manage.model.vo.res.LineFreightRateListResVO;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
@@ -35,7 +33,7 @@ import java.util.*;
|
|
|
/**
|
|
/**
|
|
|
* @author: yzc
|
|
* @author: yzc
|
|
|
* @date: 2024-03-01 09:18
|
|
* @date: 2024-03-01 09:18
|
|
|
- * @desc: 线路-运价service
|
|
|
|
|
|
|
+ * @desc: 路径service
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -51,7 +49,7 @@ public class KwmLineFreightRateService {
|
|
|
/**
|
|
/**
|
|
|
* @param addLineFreightRateParam
|
|
* @param addLineFreightRateParam
|
|
|
* @return void
|
|
* @return void
|
|
|
- * @desc 新增运价
|
|
|
|
|
|
|
+ * @desc 新增路径
|
|
|
* @author yzc
|
|
* @author yzc
|
|
|
* @date 2024/3/1 11:14
|
|
* @date 2024/3/1 11:14
|
|
|
*/
|
|
*/
|
|
@@ -73,7 +71,7 @@ public class KwmLineFreightRateService {
|
|
|
Long entId = LoginUserHolder.getEntId();
|
|
Long entId = LoginUserHolder.getEntId();
|
|
|
Long count = countByEntIdAndName(entId, addLineFreightRateParam.getName(), null);
|
|
Long count = countByEntIdAndName(entId, addLineFreightRateParam.getName(), null);
|
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
|
- throw new BusinessException("运价名称已存在,不可重复!");
|
|
|
|
|
|
|
+ throw new BusinessException("路径名称已存在,不可重复!");
|
|
|
}
|
|
}
|
|
|
KwmAddress load = addressService.getByNameAndEntId(addLineFreightRateParam.getLoadName(), entId);
|
|
KwmAddress load = addressService.getByNameAndEntId(addLineFreightRateParam.getLoadName(), entId);
|
|
|
if (Objects.isNull(load)) {
|
|
if (Objects.isNull(load)) {
|
|
@@ -96,7 +94,7 @@ public class KwmLineFreightRateService {
|
|
|
/**
|
|
/**
|
|
|
* @param param
|
|
* @param param
|
|
|
* @return void
|
|
* @return void
|
|
|
- * @desc 编辑运价
|
|
|
|
|
|
|
+ * @desc 编辑路径
|
|
|
* @author yzc
|
|
* @author yzc
|
|
|
* @date 2024/3/1 14:37
|
|
* @date 2024/3/1 14:37
|
|
|
*/
|
|
*/
|
|
@@ -117,11 +115,11 @@ public class KwmLineFreightRateService {
|
|
|
}
|
|
}
|
|
|
KwmLineFreightRate lineFreightRate = getById(param.getId());
|
|
KwmLineFreightRate lineFreightRate = getById(param.getId());
|
|
|
if (Objects.isNull(lineFreightRate)) {
|
|
if (Objects.isNull(lineFreightRate)) {
|
|
|
- throw new BusinessException("运价信息不存在!");
|
|
|
|
|
|
|
+ throw new BusinessException("路径信息不存在!");
|
|
|
}
|
|
}
|
|
|
Long count = countByEntIdAndName(entId, param.getName(), param.getId());
|
|
Long count = countByEntIdAndName(entId, param.getName(), param.getId());
|
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
|
- throw new BusinessException("运价名称已存在,不可重复!");
|
|
|
|
|
|
|
+ throw new BusinessException("路径名称已存在,不可重复!");
|
|
|
}
|
|
}
|
|
|
KwmLineFreightRate freightRate = BeanUtil.copyProperties(param, KwmLineFreightRate.class);
|
|
KwmLineFreightRate freightRate = BeanUtil.copyProperties(param, KwmLineFreightRate.class);
|
|
|
String loadName = param.getLoadName();
|
|
String loadName = param.getLoadName();
|
|
@@ -150,7 +148,7 @@ public class KwmLineFreightRateService {
|
|
|
/**
|
|
/**
|
|
|
* @param id
|
|
* @param id
|
|
|
* @return com.sckw.manage.model.vo.res.LineFreightRateDetail
|
|
* @return com.sckw.manage.model.vo.res.LineFreightRateDetail
|
|
|
- * @desc 运价详情
|
|
|
|
|
|
|
+ * @desc 路径详情
|
|
|
* @author yzc
|
|
* @author yzc
|
|
|
* @date 2024/3/1 11:18
|
|
* @date 2024/3/1 11:18
|
|
|
*/
|
|
*/
|
|
@@ -161,7 +159,7 @@ public class KwmLineFreightRateService {
|
|
|
.last("LIMIT 1");
|
|
.last("LIMIT 1");
|
|
|
KwmLineFreightRate freightRate = lineFreightRateMapper.selectOne(queryWrapper);
|
|
KwmLineFreightRate freightRate = lineFreightRateMapper.selectOne(queryWrapper);
|
|
|
if (Objects.isNull(freightRate)) {
|
|
if (Objects.isNull(freightRate)) {
|
|
|
- throw new BusinessException("运价信息不存在");
|
|
|
|
|
|
|
+ throw new BusinessException("路径信息不存在");
|
|
|
}
|
|
}
|
|
|
return BeanUtil.copyProperties(freightRate, LineFreightRateDetail.class);
|
|
return BeanUtil.copyProperties(freightRate, LineFreightRateDetail.class);
|
|
|
}
|
|
}
|
|
@@ -170,7 +168,7 @@ public class KwmLineFreightRateService {
|
|
|
/**
|
|
/**
|
|
|
* @param params
|
|
* @param params
|
|
|
* @return com.sckw.core.model.page.PageResult
|
|
* @return com.sckw.core.model.page.PageResult
|
|
|
- * @desc 运价分页列表
|
|
|
|
|
|
|
+ * @desc 路径分页列表
|
|
|
* @author yzc
|
|
* @author yzc
|
|
|
* @date 2024/3/1 16:27
|
|
* @date 2024/3/1 16:27
|
|
|
*/
|
|
*/
|
|
@@ -197,7 +195,7 @@ public class KwmLineFreightRateService {
|
|
|
/**
|
|
/**
|
|
|
* @param params
|
|
* @param params
|
|
|
* @return java.util.List<com.sckw.manage.model.vo.res.LineFreightRateExport>
|
|
* @return java.util.List<com.sckw.manage.model.vo.res.LineFreightRateExport>
|
|
|
- * @desc 运价导出
|
|
|
|
|
|
|
+ * @desc 路径导出
|
|
|
* @author yzc
|
|
* @author yzc
|
|
|
* @date 2024/3/1 16:40
|
|
* @date 2024/3/1 16:40
|
|
|
*/
|
|
*/
|
|
@@ -227,7 +225,7 @@ public class KwmLineFreightRateService {
|
|
|
/**
|
|
/**
|
|
|
* @param params
|
|
* @param params
|
|
|
* @return com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<com.sckw.manage.model.entity.KwmLineFreightRate>
|
|
* @return com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<com.sckw.manage.model.entity.KwmLineFreightRate>
|
|
|
- * @desc 构建运价查询条件
|
|
|
|
|
|
|
+ * @desc 构建路径查询条件
|
|
|
* @author yzc
|
|
* @author yzc
|
|
|
* @date 2024/3/1 16:40
|
|
* @date 2024/3/1 16:40
|
|
|
*/
|
|
*/
|
|
@@ -265,6 +263,7 @@ public class KwmLineFreightRateService {
|
|
|
* @date 2024/3/1 16:41
|
|
* @date 2024/3/1 16:41
|
|
|
*/
|
|
*/
|
|
|
public void batchDelete(List<Long> ids) {
|
|
public void batchDelete(List<Long> ids) {
|
|
|
|
|
+ //todo 关联贸易订单不可删除
|
|
|
LambdaQueryWrapper<KwmLineFreightRate> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<KwmLineFreightRate> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.in(KwmLineFreightRate::getId, ids)
|
|
wrapper.in(KwmLineFreightRate::getId, ids)
|
|
|
.eq(KwmLineFreightRate::getEntId, LoginUserHolder.getEntId())
|
|
.eq(KwmLineFreightRate::getEntId, LoginUserHolder.getEntId())
|
|
@@ -283,7 +282,7 @@ public class KwmLineFreightRateService {
|
|
|
* @param name
|
|
* @param name
|
|
|
* @param id
|
|
* @param id
|
|
|
* @return java.lang.Long
|
|
* @return java.lang.Long
|
|
|
- * @desc 根据企业ID和运价名称统计
|
|
|
|
|
|
|
+ * @desc 根据企业ID和路径名称统计
|
|
|
* @author yzc
|
|
* @author yzc
|
|
|
* @date 2024/3/1 14:50
|
|
* @date 2024/3/1 14:50
|
|
|
*/
|
|
*/
|
|
@@ -299,7 +298,7 @@ public class KwmLineFreightRateService {
|
|
|
/**
|
|
/**
|
|
|
* @param id
|
|
* @param id
|
|
|
* @return com.sckw.manage.model.entity.KwmLineFreightRate
|
|
* @return com.sckw.manage.model.entity.KwmLineFreightRate
|
|
|
- * @desc 根据id查询运价信息
|
|
|
|
|
|
|
+ * @desc 根据id查询路径信息
|
|
|
* @author yzc
|
|
* @author yzc
|
|
|
* @date 2024/3/1 16:41
|
|
* @date 2024/3/1 16:41
|
|
|
*/
|
|
*/
|
|
@@ -310,4 +309,19 @@ public class KwmLineFreightRateService {
|
|
|
return lineFreightRateMapper.selectOne(queryWrapper);
|
|
return lineFreightRateMapper.selectOne(queryWrapper);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param params
|
|
|
|
|
+ * @return java.util.List<com.sckw.manage.model.vo.res.LineFreightRateFindListResVO>
|
|
|
|
|
+ * @desc 路径下拉列表查询
|
|
|
|
|
+ * @author yzc
|
|
|
|
|
+ * @date 2024/3/4 10:15
|
|
|
|
|
+ */
|
|
|
|
|
+ public List<LineFreightRateFindListResVO> findList(LineFreightRateFindListParam params) {
|
|
|
|
|
+ LambdaQueryWrapper<KwmLineFreightRate> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq(KwmLineFreightRate::getEntId, LoginUserHolder.getEntId())
|
|
|
|
|
+ .eq(KwmLineFreightRate::getDelFlag, Global.NO)
|
|
|
|
|
+ .like(StringUtils.isNotBlank(params.getName()), KwmLineFreightRate::getName, params.getName());
|
|
|
|
|
+ List<KwmLineFreightRate> list = lineFreightRateMapper.selectList(queryWrapper);
|
|
|
|
|
+ return BeanUtil.copyToList(list, LineFreightRateFindListResVO.class);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|