Merge branch 'dev_lzh_wms_20260120' into wms_dev
This commit is contained in:
@@ -14,10 +14,14 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
#server-addr: mhd-nacos:8848
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
#server-addr: mhd-nacos:8848
|
||||
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
|
||||
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
package com.mhd.basic.application.service.Lease;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.basic.domain.container.repository.po.ContainerPO;
|
||||
import com.mhd.basic.domain.container.repository.todo.ContainerDO;
|
||||
import com.mhd.basic.domain.container.service.ContainerDomainService;
|
||||
import com.mhd.basic.domain.lease.entity.Lease;
|
||||
import com.mhd.basic.domain.lease.repository.facade.ILeaseService;
|
||||
import com.mhd.basic.domain.lease.repository.po.LeasePO;
|
||||
import com.mhd.basic.domain.lease.repository.todo.LeaseDO;
|
||||
import com.mhd.basic.domain.lease.service.LeaseDomainService;
|
||||
import com.mhd.common.core.enums.DictCode;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.domain.SysDictData;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.system.service.ISysDictTypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租赁管理ApplicationService
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LeaseApplicationService {
|
||||
|
||||
@Autowired
|
||||
private LeaseDomainService leaseDomainService;
|
||||
|
||||
@Autowired
|
||||
private ILeaseService leaseService;
|
||||
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询租赁管理列表
|
||||
*/
|
||||
|
||||
public List<LeasePO> queryList(LeaseDO leaseDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserPo() != null){
|
||||
Long loginUserOrganizationId = loginUser.getUserPo().getOrganizationId();
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
|
||||
// 数据权限:根据organizationId来设置查询权限
|
||||
// organizationId等于2827时查询全部,其他仅查询各自组织的信息
|
||||
if (loginUserOrganizationId != null && loginUserOrganizationId.equals(2827L)) {
|
||||
// 南光组织(organizationId=2827):可以查询所有组织的数据
|
||||
// 如果前端传递了 organizationId,使用前端传递的值进行过滤
|
||||
// 如果前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据
|
||||
if (leaseDO.getOrganizationId() == null) {
|
||||
leaseDO.setOrganizationId(null);
|
||||
leaseDO.setTopOrganizationId(null);
|
||||
}
|
||||
} else {
|
||||
// 其他组织:设置organizationId,只查询当前组织的数据
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
leaseDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
// 如果前端传递了organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (leaseDO.getOrganizationId() != null && !leaseDO.getOrganizationId().equals(loginUserOrganizationId)) {
|
||||
// 前端传递了其他组织的organizationId,强制使用当前登录用户的组织ID,防止越权查询
|
||||
leaseDO.setOrganizationId(loginUserOrganizationId);
|
||||
}
|
||||
}
|
||||
}
|
||||
return leaseDomainService.queryList(leaseDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增租赁管理
|
||||
*/
|
||||
public Boolean insert(LeaseDO leaseDO) {
|
||||
// 设置当前登录用户的组织信息
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||
leaseDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
leaseDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
leaseDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
List<Lease> timeOverlapSimple = isTimeOverlapSimple(leaseDO.getCargoOwnerName(), leaseDO.getStartDate(), leaseDO.getEndDate(), null);
|
||||
if (ObjectUtil.isNotEmpty(timeOverlapSimple)) {
|
||||
throw new ServiceException("同一货主租赁信息时间不能重叠");
|
||||
}
|
||||
return leaseDomainService.insert(leaseDO);
|
||||
}
|
||||
|
||||
private List<Lease> isTimeOverlapSimple(String cargoOwnerName, Date startDate, Date endDate, Long excludeId) {
|
||||
LambdaQueryWrapper<Lease> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Lease::getCargoOwnerName, cargoOwnerName)
|
||||
.eq(Lease::getDelFlag, 1) // 只查询正常状态
|
||||
.le(Lease::getStartDate, endDate)
|
||||
.ge(Lease::getEndDate, startDate);
|
||||
if (excludeId != null) {
|
||||
wrapper.ne(Lease::getId, excludeId);
|
||||
}
|
||||
return leaseService.list(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租赁管理
|
||||
*/
|
||||
public Boolean update(LeaseDO leaseDO) {
|
||||
List<Lease> timeOverlapSimple = isTimeOverlapSimple(leaseDO.getCargoOwnerName(), leaseDO.getStartDate(), leaseDO.getEndDate(), leaseDO.getId());
|
||||
if (ObjectUtil.isNotEmpty(timeOverlapSimple)) {
|
||||
throw new ServiceException("同一货主租赁信息时间不能重叠");
|
||||
}
|
||||
return leaseDomainService.update(leaseDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租赁管理
|
||||
*/
|
||||
public boolean delete(Long[] leaseIds) {
|
||||
return leaseDomainService.delete(leaseIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租赁管理详细信息
|
||||
*/
|
||||
public LeasePO getInfo(Long leaseId)
|
||||
{
|
||||
return leaseDomainService.getInfo(leaseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 批量作废租赁
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/13 9:46
|
||||
* @param leaseIds
|
||||
* @return Boolean
|
||||
*/
|
||||
public Boolean nullifyByIds(List<Long> leaseIds){
|
||||
return leaseDomainService.nullifyByIds(leaseIds);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @description 设置数据字典键值
|
||||
// * @author ZhouGY
|
||||
// * @date 2024/4/7 14:33
|
||||
// * @param containerDO
|
||||
// */
|
||||
// private void setDataDict(LeaseDO leaseDO){
|
||||
// //翻译租赁类型
|
||||
// List<SysDictData> storageTypeDictDataList = dictTypeService.selectDictDataByType(DictCode.CONTAINER_TYPE.getCode());
|
||||
// if (null == storageTypeDictDataList) {
|
||||
// throw new ServiceException("租赁类型数据字典不存在 请联系管理员");
|
||||
// }
|
||||
// SysDictData storageTypeDictData = storageTypeDictDataList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), containerDO.getContainerType())).findAny().orElse(null);
|
||||
// if (null == storageTypeDictData) {
|
||||
// throw new ServiceException("租赁类型【" + leaseDO.getContainerType() + "】数据字典不存在 请联系管理员");
|
||||
// }
|
||||
// leaseDO.setContainerTypeName(storageTypeDictData.getDictLabel());
|
||||
// }
|
||||
}
|
||||
+24
-1
@@ -1,15 +1,22 @@
|
||||
package com.mhd.basic.application.service.batch;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.basic.domain.batch.repository.po.BatchPO;
|
||||
import com.mhd.basic.domain.batch.repository.todo.BatchDO;
|
||||
import com.mhd.basic.domain.batch.service.BatchDomainService;
|
||||
import com.mhd.basic.domain.batchDetail.entity.BatchDetail;
|
||||
import com.mhd.basic.domain.batchDetail.repository.facade.IBatchDetailService;
|
||||
import com.mhd.basic.domain.batchDetail.repository.po.BatchDetailPO;
|
||||
import com.mhd.basic.domain.pack.repository.todo.PackDO;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 批次管理ApplicationService
|
||||
@@ -22,6 +29,8 @@ import java.util.List;
|
||||
public class BatchApplicationService {
|
||||
@Autowired
|
||||
private BatchDomainService batchDomainService;
|
||||
@Autowired
|
||||
private IBatchDetailService batchDetailService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,7 +45,21 @@ public class BatchApplicationService {
|
||||
batchDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
}
|
||||
return batchDomainService.queryList(batchDO);
|
||||
List<BatchPO> batchPOS = batchDomainService.queryList(batchDO);
|
||||
for (BatchPO batchPO : batchPOS) {
|
||||
List<BatchDetail> batchDetailList = batchDetailService.list(new LambdaQueryWrapper<BatchDetail>()
|
||||
.eq(BatchDetail::getBatchId, batchPO.getBatchId())
|
||||
.eq(BatchDetail::getDelFlag, "1"));
|
||||
List<BatchDetailPO> batchDetailPOS = new ArrayList<>();
|
||||
// 逐个对象拷贝
|
||||
for (BatchDetail detail : batchDetailList) {
|
||||
BatchDetailPO detailPO = new BatchDetailPO();
|
||||
BeanUtils.copyProperties(detail, detailPO);
|
||||
batchDetailPOS.add(detailPO);
|
||||
}
|
||||
batchPO.setBatchDetailList(batchDetailPOS);
|
||||
}
|
||||
return batchPOS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
-20
@@ -79,8 +79,6 @@ public class ContainerApplicationService {
|
||||
containerDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
containerDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
//翻译库区类型
|
||||
setDataDict(containerDO);
|
||||
return containerDomainService.insert(containerDO);
|
||||
}
|
||||
|
||||
@@ -117,22 +115,4 @@ public class ContainerApplicationService {
|
||||
return containerDomainService.nullifyByIds(containerIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置数据字典键值
|
||||
* @author ZhouGY
|
||||
* @date 2024/4/7 14:33
|
||||
* @param containerDO
|
||||
*/
|
||||
private void setDataDict(ContainerDO containerDO){
|
||||
//翻译容器类型
|
||||
List<SysDictData> storageTypeDictDataList = dictTypeService.selectDictDataByType(DictCode.CONTAINER_TYPE.getCode());
|
||||
if (null == storageTypeDictDataList) {
|
||||
throw new ServiceException("容器类型数据字典不存在 请联系管理员");
|
||||
}
|
||||
SysDictData storageTypeDictData = storageTypeDictDataList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), containerDO.getContainerType())).findAny().orElse(null);
|
||||
if (null == storageTypeDictData) {
|
||||
throw new ServiceException("容器类型【" + containerDO.getContainerType() + "】数据字典不存在 请联系管理员");
|
||||
}
|
||||
containerDO.setContainerTypeName(storageTypeDictData.getDictLabel());
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -70,6 +70,7 @@ public class BatchDetailImpl extends ServiceImpl<BatchDetailMapper, BatchDetail>
|
||||
List<BatchDetail> batchDetailDbList = batchDetailMapper.selectList(new QueryWrapper<BatchDetail>().lambda()
|
||||
.eq(BatchDetail::getBatchId, batchDO.getBatchId()));
|
||||
List<BatchDetail> batchDetailListSave = new ArrayList<>();
|
||||
List<BatchDetail> batchDetailListSave2 = new ArrayList<>();
|
||||
List<BatchDetail> batchDetailListUpdates = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(batchDetailDbList)){
|
||||
Map<String, BatchDetail> batchDetailMap = batchDetailDbList.stream().collect(Collectors.toMap(BatchDetail::getBatchLabels, Function.identity()));
|
||||
@@ -96,6 +97,20 @@ public class BatchDetailImpl extends ServiceImpl<BatchDetailMapper, BatchDetail>
|
||||
batchDetailListSave.add(batchDetail);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//是空没有详情 新增
|
||||
for (BatchDetailDO batchDetailDO : batchDetailDOList) {
|
||||
BatchDetail batchDetail = new BatchDetail();
|
||||
BeanUtils.copyProperties(batchDetailDO, batchDetail);
|
||||
batchDetail.setBatchId(batchDO.getBatchId());
|
||||
batchDetail.setOrganizationId(batchDO.getOrganizationId());
|
||||
batchDetail.setOrganizationName(batchDO.getOrganizationName());
|
||||
batchDetail.setTopOrganizationId(batchDO.getTopOrganizationId());
|
||||
batchDetail.setCreateBy(userPo.getUserId());
|
||||
batchDetail.setCreateByName(userPo.getUserName());
|
||||
batchDetail.setCreateTime(new Date());
|
||||
batchDetailListSave2.add(batchDetail);
|
||||
}
|
||||
}
|
||||
//删除 之前存在 现在没有的
|
||||
List<Long> batchDetailIds = batchDetailDbList.stream().map(BatchDetail::getBatchDetailId).collect(Collectors.toList());
|
||||
@@ -113,6 +128,8 @@ public class BatchDetailImpl extends ServiceImpl<BatchDetailMapper, BatchDetail>
|
||||
//新增
|
||||
if (CollectionUtil.isNotEmpty(batchDetailListSave)){
|
||||
saveBatch(batchDetailListSave);
|
||||
}else if (CollectionUtil.isNotEmpty(batchDetailListSave2)){
|
||||
saveBatch(batchDetailListSave2);
|
||||
}
|
||||
//修改
|
||||
if (CollectionUtil.isNotEmpty(batchDetailListUpdates)){
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.mhd.basic.domain.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 租赁管理对象 container
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class Lease extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String cargoOwnerName;
|
||||
|
||||
@ApiModelProperty(value = "租赁方式(整租/散租)")
|
||||
private String leaseType;
|
||||
|
||||
@ApiModelProperty("租赁面积(m²)")
|
||||
private BigDecimal leaseArea;
|
||||
|
||||
@ApiModelProperty("开始日期")
|
||||
private Date startDate;
|
||||
|
||||
@ApiModelProperty("结束日期")
|
||||
private Date endDate;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.basic.domain.lease.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.basic.domain.lease.entity.Lease;
|
||||
import com.mhd.basic.domain.lease.repository.po.LeasePO;
|
||||
import com.mhd.basic.domain.lease.repository.todo.LeaseDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租赁管理Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
public interface ILeaseService extends IService<Lease>
|
||||
{
|
||||
/**
|
||||
* 分页查询租赁管理列表
|
||||
*/
|
||||
public List<LeasePO> queryList(LeaseDO leaseDO);
|
||||
|
||||
/**
|
||||
* 新增租赁管理
|
||||
*/
|
||||
public Boolean insert(LeaseDO leaseDO);
|
||||
|
||||
/**
|
||||
* 修改租赁管理
|
||||
*/
|
||||
public Boolean update(LeaseDO leaseDO);
|
||||
|
||||
/**
|
||||
* 批量删除租赁管理
|
||||
*/
|
||||
public Boolean delete(Long[] leaseIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询租赁管理
|
||||
*/
|
||||
public LeasePO getInfo(Long leaseId);
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.mhd.basic.domain.lease.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.basic.domain.lease.entity.Lease;
|
||||
import com.mhd.basic.domain.lease.repository.po.LeasePO;
|
||||
import com.mhd.basic.domain.lease.repository.todo.LeaseDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租赁管理Mapper接口
|
||||
*
|
||||
*/
|
||||
public interface LeaseMapper extends BaseMapper<Lease>
|
||||
{
|
||||
/**
|
||||
* 查询租赁管理列表
|
||||
*/
|
||||
public List<LeasePO> queryList(LeaseDO leaseDO);
|
||||
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.mhd.basic.domain.lease.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.basic.domain.lease.entity.Lease;
|
||||
import com.mhd.basic.domain.lease.repository.facade.ILeaseService;
|
||||
import com.mhd.basic.domain.lease.repository.mapper.LeaseMapper;
|
||||
import com.mhd.basic.domain.lease.repository.po.LeasePO;
|
||||
import com.mhd.basic.domain.lease.repository.todo.LeaseDO;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 容器管理Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
@Service
|
||||
public class LeaseImpl extends ServiceImpl<LeaseMapper, Lease> implements ILeaseService {
|
||||
@Autowired
|
||||
private LeaseMapper leaseMapper;
|
||||
|
||||
/**
|
||||
* 查询容器管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<LeasePO> queryList(LeaseDO leaseDO)
|
||||
{
|
||||
return leaseMapper.queryList(leaseDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增容器管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(LeaseDO leaseDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Lease lease = new Lease();
|
||||
BeanUtils.copyProperties(leaseDO,lease);
|
||||
return this.save(lease);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改容器管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(LeaseDO leaseDO) {
|
||||
Lease lease = new Lease();
|
||||
BeanUtils.copyProperties(leaseDO,lease);
|
||||
return this.updateById(lease);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除容器管理
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean delete(Long[] leaseIds ) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
List<Lease> list = new ArrayList<>();
|
||||
for (Long id : leaseIds) {
|
||||
Lease lease = new Lease();
|
||||
lease.setId(id);
|
||||
lease.setDelFlag(2);
|
||||
lease.setUpdateBy(loginUser.getUserid());
|
||||
lease.setUpdateByName(loginUser.getUsername());
|
||||
lease.setUpdateTime(new Date());
|
||||
list.add(lease);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改容器管理
|
||||
*/
|
||||
@Override
|
||||
public LeasePO getInfo(Long leaseId) {
|
||||
Lease lease = this.getById(leaseId);
|
||||
LeasePO leasePO = new LeasePO();
|
||||
BeanUtils.copyProperties(lease,leasePO);
|
||||
return leasePO;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @description 校验唯一
|
||||
// * @author ZhouGY
|
||||
// * @date 2024/5/9 21:10
|
||||
// * @param containerDO
|
||||
// */
|
||||
// private void verifyUniqueness(ContainerDO containerDO){
|
||||
// LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
// if (topOrganizationId == null || topOrganizationId == 0 ){
|
||||
// throw new ServiceException("获取当前登陆人组织失败!");
|
||||
// }
|
||||
// int count = leaseMapper.selectCount(new QueryWrapper<Container>().lambda()
|
||||
// .eq(Container::getTopOrganizationId, topOrganizationId)
|
||||
// .eq(Container::getContainerCode,containerDO.getContainerCode())
|
||||
// .eq(Container::getOrganizationId, containerDO.getOrganizationId())
|
||||
// .ne(containerDO.getContainerId() != null, Container::getContainerId, containerDO.getContainerId() )
|
||||
// .eq(Container::getDelFlag,1));
|
||||
// if (count > 0){
|
||||
// throw new ServiceException("容器编码【" + containerDO.getContainerCode() + "】已存在");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.basic.domain.lease.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 租赁管理对象 container
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class LeasePO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String cargoOwnerName;
|
||||
|
||||
@ApiModelProperty(value = "租赁方式(整租/散租)")
|
||||
private String leaseType;
|
||||
|
||||
@ApiModelProperty("租赁面积(m²)")
|
||||
private BigDecimal leaseArea;
|
||||
|
||||
@ApiModelProperty("开始日期")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date startDate;
|
||||
|
||||
@ApiModelProperty("结束日期")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date endDate;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.mhd.basic.domain.lease.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 租赁管理对象 container
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class LeaseDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String cargoOwnerName;
|
||||
|
||||
@ApiModelProperty(value = "租赁方式(整租/散租)")
|
||||
private String leaseType;
|
||||
|
||||
@ApiModelProperty("租赁面积(m²)")
|
||||
private BigDecimal leaseArea;
|
||||
|
||||
@ApiModelProperty("开始日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
@ApiModelProperty("结束日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
package com.mhd.basic.domain.lease.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.mhd.basic.domain.container.entity.Container;
|
||||
import com.mhd.basic.domain.container.repository.facade.IContainerService;
|
||||
import com.mhd.basic.domain.container.repository.po.ContainerPO;
|
||||
import com.mhd.basic.domain.container.repository.todo.ContainerDO;
|
||||
import com.mhd.basic.domain.lease.entity.Lease;
|
||||
import com.mhd.basic.domain.lease.repository.facade.ILeaseService;
|
||||
import com.mhd.basic.domain.lease.repository.po.LeasePO;
|
||||
import com.mhd.basic.domain.lease.repository.todo.LeaseDO;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租赁管理
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LeaseDomainService {
|
||||
|
||||
@Autowired
|
||||
private ILeaseService leaseService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询租赁管理列表
|
||||
*/
|
||||
public List<LeasePO> queryList(LeaseDO leaseDO) {
|
||||
return leaseService.queryList(leaseDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增租赁管理
|
||||
*/
|
||||
public Boolean insert(LeaseDO leaseDO) {
|
||||
|
||||
return leaseService.insert(leaseDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租赁管理
|
||||
*/
|
||||
public Boolean update(LeaseDO leaseDO) {
|
||||
return leaseService.update(leaseDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租赁管理
|
||||
*/
|
||||
public Boolean delete(Long[] leaseIds) {
|
||||
return leaseService.delete(leaseIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租赁管理详细信息
|
||||
*/
|
||||
public LeasePO getInfo(Long leaseId)
|
||||
{
|
||||
return leaseService.getInfo(leaseId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 批量作废租赁
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/13 9:46
|
||||
* @param leaseIds
|
||||
* @return Boolean
|
||||
*/
|
||||
public Boolean nullifyByIds(List<Long> leaseIds) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
return leaseService.update(new UpdateWrapper<Lease>().lambda()
|
||||
.set(Lease::getUpdateBy, loginUser.getUserid())
|
||||
.set(Lease::getUpdateTime, new Date())
|
||||
.in(Lease::getId, leaseIds)
|
||||
.eq(Lease::getDelFlag, 1));
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.mhd.basic.interfaces.assember.lease;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.mhd.basic.domain.container.repository.todo.ContainerDO;
|
||||
import com.mhd.basic.domain.lease.repository.todo.LeaseDO;
|
||||
import com.mhd.basic.interfaces.dto.container.ContainerDTO;
|
||||
import com.mhd.basic.interfaces.dto.lease.LeaseDTO;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.core.utils.IgnoreNullUtil;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 容器管理Assembler
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
public class LeaseAssembler {
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
public LeaseDO toDO(LeaseDTO leaseDTO) {
|
||||
LeaseDO leaseDO = new LeaseDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(leaseDTO, leaseDO, IgnoreNullUtil.getNullPropertyNames(leaseDTO));
|
||||
return leaseDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
public LeaseDO toDOByEdit(LeaseDTO leaseDTO) {
|
||||
LeaseDO leaseDO = new LeaseDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(leaseDTO, leaseDO, IgnoreNullUtil.getNullPropertyNames(leaseDTO));
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
if(leaseDTO.getId() != null){
|
||||
leaseDO.setUpdateBy(loginUser.getUserid());
|
||||
leaseDO.setUpdateByName(loginUser.getUsername());
|
||||
leaseDO.setUpdateTime(new Date());
|
||||
}else {
|
||||
leaseDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
leaseDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
leaseDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
leaseDO.setCreateBy(loginUser.getUserid());
|
||||
leaseDO.setCreateByName(loginUser.getUsername());
|
||||
leaseDO.setCreateTime(new Date());
|
||||
}
|
||||
return leaseDO;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.mhd.basic.interfaces.dto.lease;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租赁管理对象 container
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class LeaseDTO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String cargoOwnerName;
|
||||
|
||||
@ApiModelProperty(value = "租赁方式(整租/散租)")
|
||||
private String leaseType;
|
||||
|
||||
@ApiModelProperty("租赁面积(m²)")
|
||||
private BigDecimal leaseArea;
|
||||
|
||||
@ApiModelProperty("开始日期")
|
||||
private Date startDate;
|
||||
|
||||
@ApiModelProperty("结束日期")
|
||||
private Date endDate;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.mhd.basic.interfaces.facadeApi.lease;
|
||||
|
||||
import com.mhd.basic.application.service.Lease.LeaseApplicationService;
|
||||
import com.mhd.basic.application.service.container.ContainerApplicationService;
|
||||
import com.mhd.basic.domain.container.repository.po.ContainerPO;
|
||||
import com.mhd.basic.domain.container.repository.todo.ContainerDO;
|
||||
import com.mhd.basic.domain.lease.repository.po.LeasePO;
|
||||
import com.mhd.basic.domain.lease.repository.todo.LeaseDO;
|
||||
import com.mhd.basic.interfaces.assember.container.ContainerAssembler;
|
||||
import com.mhd.basic.interfaces.assember.lease.LeaseAssembler;
|
||||
import com.mhd.basic.interfaces.dto.container.ContainerDTO;
|
||||
import com.mhd.basic.interfaces.dto.lease.LeaseDTO;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租赁管理Api
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/LeaseApi")
|
||||
public class LeaseApi extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private LeaseApplicationService leaseApplicationService;
|
||||
|
||||
@Resource
|
||||
private LeaseAssembler leaseAssembler;
|
||||
|
||||
/**
|
||||
* 分页查询租赁管理列表
|
||||
*/
|
||||
@ApiOperation("查询租赁管理列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(LeaseDTO leaseDTO)
|
||||
{
|
||||
//转换实体
|
||||
LeaseDO leaseDO = leaseAssembler.toDO(leaseDTO);
|
||||
startPage();
|
||||
List<LeasePO> list = leaseApplicationService.queryList(leaseDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询租赁管理列表
|
||||
*/
|
||||
@ApiOperation("查询租赁管理列表")
|
||||
@GetMapping("/listByApp")
|
||||
public AjaxResult listByApp(LeaseDTO leaseDTO)
|
||||
{
|
||||
//转换实体
|
||||
LeaseDO leaseDO = leaseAssembler.toDO(leaseDTO);
|
||||
List<LeasePO> list = leaseApplicationService.queryList(leaseDO);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑租赁管理
|
||||
*/
|
||||
@ApiOperation("编辑租赁管理")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody LeaseDTO leaseDTO)
|
||||
{
|
||||
//转换实体
|
||||
LeaseDO leaseDO = leaseAssembler.toDOByEdit(leaseDTO);
|
||||
if(leaseDTO.getId() != null){
|
||||
return toAjax(leaseApplicationService.update(leaseDO));
|
||||
}else {
|
||||
return toAjax(leaseApplicationService.insert(leaseDO));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租赁管理
|
||||
*/
|
||||
@ApiOperation("批量删除租赁管理")
|
||||
@DeleteMapping("/deleteByIds/{leaseIds}")
|
||||
public AjaxResult delete(@PathVariable Long[] leaseIds)
|
||||
{
|
||||
return toAjax(leaseApplicationService.delete(leaseIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租赁管理详细信息
|
||||
*/
|
||||
@ApiOperation("获取租赁管理")
|
||||
@GetMapping(value = "/getInfo/{leaseId}")
|
||||
public AjaxResult getInfo(@PathVariable("leaseId") Long leaseId)
|
||||
{
|
||||
return AjaxResult.success(leaseApplicationService.getInfo(leaseId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量作废租赁
|
||||
*/
|
||||
@ApiOperation("批量作废租赁")
|
||||
@GetMapping("/nullifyByIds/{leaseIds}")
|
||||
public AjaxResult nullifyByIds(@PathVariable("leaseIds") List<Long> leaseIds)
|
||||
{
|
||||
return toAjax(leaseApplicationService.nullifyByIds(leaseIds));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -13,10 +13,10 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
# server-addr: 10.33.0.129:6010
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
server-addr: 10.102.192.5:6848
|
||||
# server-addr: 10.102.192.5:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
@@ -25,7 +25,7 @@ spring:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# server-addr: 10.33.0.129:6010
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
server-addr: 10.102.192.5:6848
|
||||
# server-addr: 10.102.192.5:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
<?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.mhd.basic.domain.lease.repository.mapper.LeaseMapper">
|
||||
|
||||
<resultMap type="com.mhd.basic.domain.lease.repository.po.LeasePO" id="LeaseResult">
|
||||
<!-- 租赁相关字段 -->
|
||||
<result property="id" column="id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="cargoOwnerName" column="cargo_owner_name" />
|
||||
<result property="leaseType" column="lease_type" />
|
||||
<result property="leaseArea" column="lease_area" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="remark" column="remark" />
|
||||
<!-- 继承自BaseVOEntity的字段 -->
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectLeasePo">
|
||||
select
|
||||
id,
|
||||
organization_id,
|
||||
organization_name,
|
||||
top_organization_id,
|
||||
cargo_owner_name,
|
||||
lease_type,
|
||||
lease_area,
|
||||
start_date,
|
||||
end_date,
|
||||
remark,
|
||||
create_time,
|
||||
create_by,
|
||||
create_by_name,
|
||||
update_time,
|
||||
update_by,
|
||||
update_by_name,
|
||||
del_flag
|
||||
from lease
|
||||
</sql>
|
||||
|
||||
<sql id="selectLeasePo1">
|
||||
<where>
|
||||
<!-- 租赁查询条件 -->
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="cargoOwnerName != null and cargoOwnerName != ''">
|
||||
and cargo_owner_name like concat('%', #{cargoOwnerName}, '%')
|
||||
</if>
|
||||
<if test="leaseType != null and leaseType != ''">
|
||||
and lease_type = #{leaseType}
|
||||
</if>
|
||||
<if test="leaseArea != null ">
|
||||
and lease_area = #{leaseArea}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark like concat('%', #{remark}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 创建和更新相关条件 -->
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<!-- 时间范围查询(如果需要) -->
|
||||
<if test="startDate != null and endDate != null">
|
||||
and start_date >= #{startDate} and start_date <= #{endDate}
|
||||
</if>
|
||||
|
||||
<!-- 删除标记 -->
|
||||
<choose>
|
||||
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
|
||||
<otherwise> and del_flag = 1 </otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.basic.domain.lease.repository.po.LeasePO" resultMap="LeaseResult">
|
||||
<include refid="selectLeasePo"/>
|
||||
<include refid="selectLeasePo1"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
+114
-2
@@ -170,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</where>
|
||||
and material_base_info_id in (SELECT
|
||||
DISTINCT material_base_info_id
|
||||
FROM test_szwl_wms.material_inventory
|
||||
FROM ngwl_test_wms.material_inventory
|
||||
WHERE
|
||||
allocation_quantity > 0
|
||||
AND del_flag = 1)
|
||||
@@ -178,6 +178,118 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.basic.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO" resultMap="MaterialBaseInfoResult">
|
||||
<include refid="selectMaterialBaseInfoPo"/>
|
||||
<include refid="selectMaterialBaseInfoPo1"/>
|
||||
<include refid="selectMaterialBaseInfoPo2"/>
|
||||
</select>
|
||||
|
||||
<sql id="selectMaterialBaseInfoPo2">
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and shipper_name like concat('%', #{shipperName}, '%')
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and material_code = #{materialCode}
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="barCode != null and barCode != ''">
|
||||
and bar_code = #{barCode}
|
||||
</if>
|
||||
<if test="materialClassifyCode != null and materialClassifyCode != ''">
|
||||
and material_classify_code = #{materialClassifyCode}
|
||||
</if>
|
||||
<if test="materialClassifyName != null and materialClassifyName != ''">
|
||||
and material_classify_name like concat('%', #{materialClassifyName}, '%')
|
||||
</if>
|
||||
<if test="materialType != null and materialType != ''">
|
||||
and material_type = #{materialType}
|
||||
</if>
|
||||
<if test="materialTypeName != null and materialTypeName != ''">
|
||||
and material_type_name like concat('%', #{materialTypeName}, '%')
|
||||
</if>
|
||||
<if test="unitCode != null and unitCode != ''">
|
||||
and unit_code = #{unitCode}
|
||||
</if>
|
||||
<if test="unitName != null and unitName != ''">
|
||||
and unit_name like concat('%', #{unitName}, '%')
|
||||
</if>
|
||||
<if test="packId != null ">
|
||||
and pack_id = #{packId}
|
||||
</if>
|
||||
<if test="packCode != null and packCode != ''">
|
||||
and pack_code = #{packCode}
|
||||
</if>
|
||||
<if test="packName != null and packName != ''">
|
||||
and pack_name like concat('%', #{packName}, '%')
|
||||
</if>
|
||||
<if test="brandId != null ">
|
||||
and brand_id = #{brandId}
|
||||
</if>
|
||||
<if test="brandCode != null and brandCode != ''">
|
||||
and brand_code = #{brandCode}
|
||||
</if>
|
||||
<if test="brandName != null and brandName != ''">
|
||||
and brand_name like concat('%', #{brandName}, '%')
|
||||
</if>
|
||||
<if test="shelfLife != null ">
|
||||
and shelf_life = #{shelfLife}
|
||||
</if>
|
||||
<if test="weightLimit != null ">
|
||||
and weight_limit = #{weightLimit}
|
||||
</if>
|
||||
<if test="volumeLimit != null ">
|
||||
and volume_limit = #{volumeLimit}
|
||||
</if>
|
||||
<if test="materialShape != null and materialShape != ''">
|
||||
and material_shape = #{materialShape}
|
||||
</if>
|
||||
<if test="materialShapeName != null and materialShapeName != ''">
|
||||
and material_shape_name like concat('%', #{materialShapeName}, '%')
|
||||
</if>
|
||||
<if test="materialSize != null and materialSize != ''">
|
||||
and material_size = #{materialSize}
|
||||
</if>
|
||||
<if test="materialLength != null ">
|
||||
and material_length = #{materialLength}
|
||||
</if>
|
||||
<if test="materialWidth != null ">
|
||||
and material_width = #{materialWidth}
|
||||
</if>
|
||||
<if test="materialHeight != null ">
|
||||
and material_height = #{materialHeight}
|
||||
</if>
|
||||
<if test="nullify != null ">
|
||||
and nullify = #{nullify}
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<!-- 传 1:只查公共 , 2:只查自己的 ,3:公共的和自己的 -->
|
||||
<choose>
|
||||
<when test="common != null and (common == 1 or common == 2) "> and common = #{common} </when>
|
||||
<otherwise> and (
|
||||
1 = 1
|
||||
or common = 1 )</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
|
||||
<otherwise> and del_flag = 1 </otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</sql>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user