修改物质供货总计划逻辑
This commit is contained in:
@ -1,30 +1,29 @@
|
||||
package org.dromara.bidding.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.bidding.domain.BusBiddingLimitVersions;
|
||||
import org.dromara.bidding.domain.bo.BusBiddingLimitVersionsBo;
|
||||
import org.dromara.bidding.domain.vo.BusBiddingLimitVersionsVo;
|
||||
import org.dromara.bidding.mapper.BusBiddingLimitVersionsMapper;
|
||||
import org.dromara.bidding.service.IBusBiddingLimitVersionsService;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.bidding.domain.bo.BusBiddingLimitVersionsBo;
|
||||
import org.dromara.bidding.domain.vo.BusBiddingLimitVersionsVo;
|
||||
import org.dromara.bidding.domain.BusBiddingLimitVersions;
|
||||
import org.dromara.bidding.mapper.BusBiddingLimitVersionsMapper;
|
||||
import org.dromara.bidding.service.IBusBiddingLimitVersionsService;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 成本- 投标版本Service业务层处理
|
||||
@ -46,7 +45,7 @@ public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLi
|
||||
* @return 成本- 投标版本
|
||||
*/
|
||||
@Override
|
||||
public BusBiddingLimitVersionsVo queryById(Long id){
|
||||
public BusBiddingLimitVersionsVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@ -120,7 +119,7 @@ public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLi
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusBiddingLimitVersions entity){
|
||||
private void validEntityBeforeSave(BusBiddingLimitVersions entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@ -133,7 +132,7 @@ public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLi
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
@ -147,7 +146,7 @@ public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLi
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('biddingLimitList')")
|
||||
@EventListener(condition = "#processEvent.flowCode.endsWith('biddingLimitList')")
|
||||
public void processPlansHandlErequipmentList(ProcessEvent processEvent) {
|
||||
log.info("物资设备清单审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
@ -177,7 +176,7 @@ public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLi
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('biddingLimitList')")
|
||||
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('biddingLimitList')")
|
||||
public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("物资设备清单审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
@ -1,32 +1,33 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanAuditBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.MasterDataReq;
|
||||
import org.dromara.cailiaoshebei.domain.bo.TotalsupplyplanQueryListReq;
|
||||
import org.dromara.cailiaoshebei.domain.dto.MasterDataReqDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanAuditVo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划
|
||||
@ -82,6 +83,16 @@ public class BusTotalsupplyplanController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "物资-总供应计划", BusTotalsupplyplanVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入物资-总供应计划数据
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:import")
|
||||
@Log(title = "物资-总供应计划", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/import")
|
||||
public R<Void> importData(@RequestPart("file") MultipartFile file) {
|
||||
return toAjax(busTotalsupplyplanService.importData(file));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-总供应计划详细信息
|
||||
*
|
||||
@ -90,7 +101,7 @@ public class BusTotalsupplyplanController extends BaseController {
|
||||
@SaCheckPermission("design:totalsupplyplan:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusTotalsupplyplanVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busTotalsupplyplanService.queryById(id));
|
||||
}
|
||||
|
||||
@ -116,6 +127,17 @@ public class BusTotalsupplyplanController extends BaseController {
|
||||
return toAjax(busTotalsupplyplanService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改物资-总供应计划
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:batchEdit")
|
||||
@Log(title = "物资-总供应计划", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/batchEdit")
|
||||
public R<Void> batchEdit(@Validated(EditGroup.class) @RequestBody List<BusTotalsupplyplanBo> boList) {
|
||||
return toAjax(busTotalsupplyplanService.updateBatch(boList));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 删除物资-总供应计划
|
||||
// *
|
||||
|
@ -1,14 +1,14 @@
|
||||
package org.dromara.cailiaoshebei.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划对象 bus_totalsupplyplan
|
||||
@ -35,6 +35,16 @@ public class BusTotalsupplyplan extends BaseEntity {
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 批次父ID
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
|
@ -1,15 +1,14 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
@ -43,48 +42,49 @@ public class BusTotalsupplyplanVo implements Serializable {
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 批次父ID
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
@ExcelProperty(value = "编制日期")
|
||||
private Date compileDate;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@ExcelProperty(value = "计划编号")
|
||||
private String planNumber;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@ExcelProperty(value = "编号")
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelProperty(value = "名称")
|
||||
@ExcelProperty(value = "工程或费用名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
@ExcelProperty(value = "材质")
|
||||
private String texture;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ -97,34 +97,39 @@ public class BusTotalsupplyplanVo implements Serializable {
|
||||
@ExcelProperty(value = "品牌")
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
@ExcelProperty(value = "材质")
|
||||
private String texture;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
@ExcelProperty(value = "质量标准")
|
||||
private String qualityStandard;
|
||||
|
||||
/**
|
||||
* 预计使用日期
|
||||
*/
|
||||
@ExcelProperty(value = "预计使用日期")
|
||||
private Date dateService;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
@ExcelProperty(value = "交货地点")
|
||||
private String deliveryPoints;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
@ExcelProperty(value = "使用部位")
|
||||
private String partUsed;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
@ExcelProperty(value = "交货地点")
|
||||
private String deliveryPoints;
|
||||
|
||||
/**
|
||||
* 预计使用日期
|
||||
*/
|
||||
@ExcelProperty(value = "预计使用日期")
|
||||
private Date dateService;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
|
@ -1,14 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.MasterDataReq;
|
||||
import org.dromara.cailiaoshebei.domain.dto.MasterDataReqDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -18,7 +19,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface IBusTotalsupplyplanService extends IService<BusTotalsupplyplan>{
|
||||
public interface IBusTotalsupplyplanService extends IService<BusTotalsupplyplan> {
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划
|
||||
@ -78,4 +79,20 @@ public interface IBusTotalsupplyplanService extends IService<BusTotalsupplyplan>
|
||||
* @return 主数据列表
|
||||
*/
|
||||
MasterDataReqDto masterData(MasterDataReq bo);
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*
|
||||
* @param boList 批量更新
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
Boolean updateBatch(List<BusTotalsupplyplanBo> boList);
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*
|
||||
* @param file 导入数据
|
||||
* @return 是否导入成功
|
||||
*/
|
||||
Boolean importData(MultipartFile file);
|
||||
}
|
||||
|
@ -1,34 +1,40 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelReader;
|
||||
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.MasterDataReq;
|
||||
import org.dromara.cailiaoshebei.domain.dto.MasterDataReqDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.cailiaoshebei.mapper.BusTotalsupplyplanMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.excel.core.DefaultExcelListener;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import org.dromara.cailiaoshebei.mapper.BusTotalsupplyplanMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划Service业务层处理
|
||||
@ -39,14 +45,11 @@ import java.util.Collection;
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplyplanMapper, BusTotalsupplyplan> implements IBusTotalsupplyplanService {
|
||||
|
||||
private final BusTotalsupplyplanMapper baseMapper;
|
||||
public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplyplanMapper, BusTotalsupplyplan>
|
||||
implements IBusTotalsupplyplanService {
|
||||
|
||||
private final IBusTotalsupplyplanAuditService busTotalsupplyplanAuditService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划
|
||||
*
|
||||
@ -54,7 +57,7 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
* @return 物资-总供应计划
|
||||
*/
|
||||
@Override
|
||||
public BusTotalsupplyplanVo queryById(Long id){
|
||||
public BusTotalsupplyplanVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@ -80,20 +83,34 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
*/
|
||||
@Override
|
||||
public List<BusTotalsupplyplanVo> queryList(BusTotalsupplyplanBo bo) {
|
||||
// 1. 先构建查询条件(MyBatis Plus 的 LambdaQueryWrapper)
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = buildQueryWrapper(bo);
|
||||
// 2. 查出所有 pid(有子节点的 sid)
|
||||
List<String> parentIds = baseMapper.selectList(
|
||||
Wrappers.<BusTotalsupplyplan>lambdaQuery()
|
||||
.select(BusTotalsupplyplan::getPid)
|
||||
.isNotNull(BusTotalsupplyplan::getPid)
|
||||
).stream()
|
||||
.map(BusTotalsupplyplan::getPid)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.toList();
|
||||
// 3. 在查询条件的基础上,加上 notIn 过滤(排除父节点,只取叶子节点)
|
||||
lqw.notIn(!parentIds.isEmpty(), BusTotalsupplyplan::getSid, parentIds);
|
||||
// 4. 查询叶子节点
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusTotalsupplyplan> buildQueryWrapper(BusTotalsupplyplanBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusTotalsupplyplan::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTexture()), BusTotalsupplyplan::getTexture, bo.getTexture());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBrand()), BusTotalsupplyplan::getBrand, bo.getBrand());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQualityStandard()), BusTotalsupplyplan::getQualityStandard, bo.getQualityStandard());
|
||||
lqw.eq(bo.getDateService() != null, BusTotalsupplyplan::getDateService, bo.getDateService());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeliveryPoints()), BusTotalsupplyplan::getDeliveryPoints, bo.getDeliveryPoints());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPartUsed()), BusTotalsupplyplan::getPartUsed, bo.getPartUsed());
|
||||
lqw.orderByAsc(BusTotalsupplyplan::getId);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@ -130,7 +147,7 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusTotalsupplyplan entity){
|
||||
private void validEntityBeforeSave(BusTotalsupplyplan entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@ -143,7 +160,7 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
@ -162,6 +179,78 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
return masterDataReqDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*
|
||||
* @param boList 批量更新
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateBatch(List<BusTotalsupplyplanBo> boList) {
|
||||
List<BusTotalsupplyplan> list = BeanUtil.copyToList(boList, BusTotalsupplyplan.class);
|
||||
for (BusTotalsupplyplan busTotalsupplyplan : list) {
|
||||
validEntityBeforeSave(busTotalsupplyplan);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*
|
||||
* @param file 导入数据
|
||||
* @return 是否导入成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean importData(MultipartFile file) {
|
||||
// 检查文件是否为空
|
||||
if (file == null || file.isEmpty()) {
|
||||
throw new ServiceException("上传文件不能为空", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
// 检查文件大小
|
||||
if (file.getSize() == 0) {
|
||||
throw new ServiceException("上传文件不能为空文件", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
// 检查文件名
|
||||
if (file.getOriginalFilename() == null || file.getOriginalFilename().isEmpty()) {
|
||||
throw new ServiceException("文件名不能为空", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
try {
|
||||
// 使用EasyExcel读取所有sheet
|
||||
List<BusTotalsupplyplanVo> allData = new ArrayList<>();
|
||||
// 创建Excel读取监听器
|
||||
DefaultExcelListener<BusTotalsupplyplanVo> listener = new DefaultExcelListener<>(false);
|
||||
// 读取Excel文件
|
||||
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), BusTotalsupplyplanVo.class, listener).build();
|
||||
// 获取所有sheet
|
||||
List<ReadSheet> sheetList = excelReader.excelExecutor().sheetList();
|
||||
// 遍历所有sheet
|
||||
for (ReadSheet readSheet : sheetList) {
|
||||
// 为每个sheet创建新的监听器实例
|
||||
DefaultExcelListener<BusTotalsupplyplanVo> sheetListener = new DefaultExcelListener<>(false);
|
||||
// 读取当前sheet数据
|
||||
EasyExcel.read(file.getInputStream(), BusTotalsupplyplanVo.class, sheetListener)
|
||||
.sheet(readSheet.getSheetNo())
|
||||
.doRead();
|
||||
// 将当前sheet的数据添加到总数据中
|
||||
allData.addAll(sheetListener.getExcelResult().getList());
|
||||
}
|
||||
// 关闭读取器
|
||||
excelReader.finish();
|
||||
if (allData.isEmpty()) {
|
||||
throw new ServiceException("未读取到有效数据", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
// 处理导入的数据
|
||||
List<BusTotalsupplyplan> list = BeanUtil.copyToList(allData, BusTotalsupplyplan.class);
|
||||
// 批量更新
|
||||
return this.updateBatchById(list);
|
||||
} catch (Exception e) {
|
||||
log.error("物资供货总计划,导入Excel文件失败", e);
|
||||
throw new ServiceException("导入失败: " + e.getMessage(), HttpStatus.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
@ -169,7 +258,7 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
@EventListener(condition = "#processEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
public void processPlansHandler(ProcessEvent processEvent) {
|
||||
log.info("物资总供应计划审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
@ -190,7 +279,7 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("物资总供应计划审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
@ -570,8 +570,8 @@ public class MatMaterialIssueServiceImpl extends ServiceImpl<MatMaterialIssueMap
|
||||
MatMaterialIssueItemWordDto itemDto = new MatMaterialIssueItemWordDto();
|
||||
BeanUtils.copyProperties(item, itemDto);
|
||||
itemDto.setNo(i);
|
||||
itemDto.setIssuedQuantity(item.getIssuedQuantity().intValue());
|
||||
itemDto.setRemainingQuantity(item.getRemainingQuantity().intValue());
|
||||
itemDto.setIssuedQuantity(item.getIssuedQuantity() != null ? item.getIssuedQuantity().intValue() : 0);
|
||||
itemDto.setRemainingQuantity(item.getRemainingQuantity() != null ? item.getRemainingQuantity().intValue() : 0);
|
||||
itemDto.setStockQuantity(item.getStockQuantity().intValue());
|
||||
dtoItems.add(itemDto);
|
||||
}
|
||||
|
@ -1,33 +1,31 @@
|
||||
package org.dromara.patch.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.patch.domain.bo.PdMasterProgressReq;
|
||||
import org.dromara.patch.domain.vo.PdMasterProgressVo;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.patch.domain.vo.PdMasterVo;
|
||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||
import org.dromara.patch.service.IPdMasterService;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||
import org.dromara.patch.domain.bo.PdMasterProgressReq;
|
||||
import org.dromara.patch.domain.vo.PdMasterProgressVo;
|
||||
import org.dromara.patch.domain.vo.PdMasterVo;
|
||||
import org.dromara.patch.service.IPdMasterService;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 派单
|
||||
@ -63,14 +61,14 @@ public class PdMasterController extends BaseController {
|
||||
return toAjax(pdMasterService.addProgress(progress));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 修改进度详情
|
||||
// */
|
||||
// @SaCheckPermission("patch:master:editProgress")
|
||||
// @PutMapping("/editProgress")
|
||||
// public R<Void> editProgress(@Validated @RequestBody PdMasterProgressVo progress) {
|
||||
// return toAjax(pdMasterService.editProgress(progress));
|
||||
// }
|
||||
/**
|
||||
* 修改进度详情
|
||||
*/
|
||||
@SaCheckPermission("patch:master:editProgress")
|
||||
@PutMapping("/editProgress")
|
||||
public R<Void> editProgress(@Validated @RequestBody PdMasterProgressVo progress) {
|
||||
return toAjax(pdMasterService.editProgress(progress));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除进度详情
|
||||
@ -84,6 +82,7 @@ public class PdMasterController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询派单进度详情列表
|
||||
*
|
||||
* @param masterId 派单主表ID
|
||||
* @return 进度详情列表
|
||||
*/
|
||||
@ -94,6 +93,7 @@ public class PdMasterController extends BaseController {
|
||||
@PathVariable Long masterId) {
|
||||
return R.ok(pdMasterService.queryProgressList(masterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询派单列表
|
||||
*/
|
||||
@ -122,7 +122,7 @@ public class PdMasterController extends BaseController {
|
||||
@SaCheckPermission("patch:master:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<PdMasterVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
@PathVariable Long id) {
|
||||
return R.ok(pdMasterService.queryById(id));
|
||||
}
|
||||
|
||||
|
@ -50,8 +50,6 @@ public class PgsProgressCategoryController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IPgsProgressCategoryService pgsProgressCategoryService;
|
||||
@Resource
|
||||
private IFacMatrixService matrixService;
|
||||
|
||||
/**
|
||||
* 查询进度类别列表
|
||||
@ -96,7 +94,6 @@ public class PgsProgressCategoryController extends BaseController {
|
||||
|
||||
LambdaQueryWrapper<PgsProgressCategory> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//根据projectid拿到整个数据
|
||||
queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PgsProgressCategory::getProjectId, projectId.get("projectId"));
|
||||
List<PgsProgressCategory> list = pgsProgressCategoryService.list(queryWrapper);
|
||||
List<Long> ids = new ArrayList<>();
|
||||
|
@ -2,6 +2,7 @@ package org.dromara.system.controller.system;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.core.domain.R;
|
||||
@ -56,6 +57,16 @@ public class SysDeptController extends BaseController {
|
||||
return R.ok(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目id获取部门树以及岗位列表
|
||||
*/
|
||||
@SaCheckPermission("system:dept:listTree")
|
||||
@GetMapping("/list/tree")
|
||||
public R<List<Tree<Long>>> listTreeByProjectId() {
|
||||
List<Tree<Long>> tree = deptService.buildDeptTree();
|
||||
return R.ok(tree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门编号获取详细信息
|
||||
*
|
||||
|
@ -36,6 +36,13 @@ public interface ISysDeptService {
|
||||
*/
|
||||
List<Tree<Long>> buildDeptTreeSelect(List<SysDeptVo> depts);
|
||||
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
List<Tree<Long>> buildDeptTree();
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
*
|
||||
|
@ -21,11 +21,13 @@ import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
import org.dromara.common.redis.utils.CacheUtils;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.system.domain.SysDept;
|
||||
import org.dromara.system.domain.SysPost;
|
||||
import org.dromara.system.domain.SysRole;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.system.domain.bo.SysDeptBo;
|
||||
import org.dromara.system.domain.enums.SysDeptTypeEnum;
|
||||
import org.dromara.system.domain.vo.SysDeptVo;
|
||||
import org.dromara.system.domain.vo.SysPostVo;
|
||||
import org.dromara.system.mapper.SysDeptMapper;
|
||||
import org.dromara.system.mapper.SysPostMapper;
|
||||
import org.dromara.system.mapper.SysRoleMapper;
|
||||
@ -38,6 +40,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
@ -133,30 +136,17 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @return 下拉树结构列表
|
||||
*//*
|
||||
*/
|
||||
@Override
|
||||
public List<Tree<Long>> buildDeptTreeByProjectId(Long projectId) {
|
||||
SysDept dept = baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<>(SysDept.class)
|
||||
.eq(SysDept::getProjectId, projectId)
|
||||
.eq(SysDept::getDeptType, SysDeptTypeEnum.PROJECT.getCode())
|
||||
.eq(SysDept::getStatus, SystemConstants.NORMAL)
|
||||
);
|
||||
if (dept == null) {
|
||||
return List.of();
|
||||
public List<Tree<Long>> buildDeptTree() {
|
||||
List<SysDeptVo> deptVoList = baseMapper.selectVoList();
|
||||
if (CollUtil.isEmpty(deptVoList)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
List<Long> deptIds = Stream.concat(
|
||||
Arrays.stream(dept.getAncestors().split(","))
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.map(Long::parseLong),
|
||||
Stream.of(dept.getDeptId())
|
||||
).toList();
|
||||
List<SysDeptVo> deptVoList = baseMapper.selectVoByIds(deptIds);
|
||||
List<SysPostVo> postVos = postMapper.selectVoList(
|
||||
new LambdaQueryWrapper<>(SysPost.class)
|
||||
.in(SysPost::getDeptId, deptIds)
|
||||
.in(SysPost::getDeptId, deptVoList.stream().map(SysDeptVo::getDeptId).collect(Collectors.toSet()))
|
||||
.eq(SysPost::getStatus, SystemConstants.NORMAL)
|
||||
);
|
||||
Map<Long, List<SysPostVo>> postVoMap = postVos.stream().collect(Collectors.groupingBy(SysPostVo::getDeptId));
|
||||
@ -182,7 +172,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
||||
}
|
||||
}
|
||||
return treeList;
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
|
Reference in New Issue
Block a user