Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@ -88,24 +88,26 @@ public class BusMaterialbatchdemandplanServiceImpl extends ServiceImpl<BusMateri
|
||||
@Override
|
||||
public TableDataInfo<BusMaterialbatchdemandplanVo> queryPageList(BusMaterialbatchdemandplanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusMaterialbatchdemandplan> lqw = buildQueryWrapper(bo);
|
||||
BusBiddingPlanBo bo1 = new BusBiddingPlanBo();
|
||||
bo1.setProjectId(bo.getProjectId());
|
||||
bo1.setType("2");
|
||||
bo1.setWinningBidderId(bo.getSupplierId());
|
||||
List<BusBillofquantitiesLimitListVo> busBiddingPlanVos = busBiddingPlanService.getBillofquantitiesLimitListVo(bo1);
|
||||
if (busBiddingPlanVos == null || busBiddingPlanVos.isEmpty()) {
|
||||
throw new ServiceException("该供应商暂无材料");
|
||||
}
|
||||
Set<String> hashSet = new HashSet<>();
|
||||
busBiddingPlanVos.stream().forEach(vo -> {
|
||||
hashSet.add(vo.getName()+"+"+vo.getSpecification());
|
||||
});
|
||||
Page<BusMaterialbatchdemandplanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
List<BusMaterialbatchdemandplanVo> list = result.getRecords().stream().filter(vo -> {
|
||||
String key = vo.getName() + "+" + vo.getSpecification(); // 拼接字符串(需与 Set 中格式一致)
|
||||
return hashSet.contains(key); // 仅保留 Set 中存在的数据
|
||||
}).toList();
|
||||
result.setRecords(list);
|
||||
if (bo.getSupplierId()!=null){
|
||||
BusBiddingPlanBo bo1 = new BusBiddingPlanBo();
|
||||
bo1.setProjectId(bo.getProjectId());
|
||||
bo1.setType("2");
|
||||
bo1.setWinningBidderId(bo.getSupplierId());
|
||||
List<BusBillofquantitiesLimitListVo> busBiddingPlanVos = busBiddingPlanService.getBillofquantitiesLimitListVo(bo1);
|
||||
if (busBiddingPlanVos == null || busBiddingPlanVos.isEmpty()) {
|
||||
throw new ServiceException("该供应商暂无材料");
|
||||
}
|
||||
Set<String> hashSet = new HashSet<>();
|
||||
busBiddingPlanVos.stream().forEach(vo -> {
|
||||
hashSet.add(vo.getName()+"+"+vo.getSpecification());
|
||||
});
|
||||
List<BusMaterialbatchdemandplanVo> list = result.getRecords().stream().filter(vo -> {
|
||||
String key = vo.getName() + "+" + vo.getSpecification(); // 拼接字符串(需与 Set 中格式一致)
|
||||
return hashSet.contains(key); // 仅保留 Set 中存在的数据
|
||||
}).toList();
|
||||
result.setRecords(list);
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
@ -224,6 +224,21 @@ public class PdfBoxQrCodeGenerator {
|
||||
// 二维码大小比例(页面宽高中较小值的20%)
|
||||
private static final float QR_SIZE_RATIO = 0.2f;
|
||||
|
||||
// 二维码大小比例(页面宽高中较小值的20%)
|
||||
private static final float QR_SIZE = 60.0f;
|
||||
|
||||
// 竖坐标
|
||||
private static final float V_QR_X = 232.0f;
|
||||
|
||||
// 竖坐标
|
||||
private static final float V_QR_Y = 679.5f;
|
||||
|
||||
// 横坐标
|
||||
private static final float H_QR_X = 1116.5f;
|
||||
|
||||
// 横坐标
|
||||
private static final float H_QR_Y = 34.0f;
|
||||
|
||||
public static ByteArrayOutputStream addQRCodeToPDFOnAllPages(String srcPdf, byte[] qrCodeBytes, boolean isChangeFile)
|
||||
throws IOException {
|
||||
|
||||
@ -256,6 +271,10 @@ public class PdfBoxQrCodeGenerator {
|
||||
int numberOfPages = pdfDoc.getNumberOfPages();
|
||||
|
||||
for (int pageNum = 1; pageNum <= numberOfPages; pageNum++) {
|
||||
if (pageNum == 1 && isChangeFile) {
|
||||
continue;
|
||||
}
|
||||
|
||||
PdfPage page = pdfDoc.getPage(pageNum);
|
||||
|
||||
// 获取页面的所有边界框信息
|
||||
@ -266,25 +285,33 @@ public class PdfBoxQrCodeGenerator {
|
||||
Rectangle visibleArea = (cropBox != null) ? cropBox : mediaBox;
|
||||
|
||||
// 计算页面宽高中较小的值
|
||||
float minDimension = Math.min(visibleArea.getWidth(), visibleArea.getHeight());
|
||||
// float minDimension = Math.min(visibleArea.getWidth(), visibleArea.getHeight());
|
||||
|
||||
// 动态计算二维码大小(页面宽高中较小值的20%)
|
||||
float qrSize = minDimension * QR_SIZE_RATIO;
|
||||
// float qrSize = minDimension * QR_SIZE_RATIO;
|
||||
|
||||
// 输出页面尺寸信息
|
||||
System.out.println("页面 " + pageNum + " 尺寸: " + visibleArea.getWidth() + "x" + visibleArea.getHeight());
|
||||
System.out.println("页面 " + pageNum + " 二维码大小 (点): " + qrSize);
|
||||
// System.out.println("页面 " + pageNum + " 尺寸: " + visibleArea.getWidth() + "x" + visibleArea.getHeight());
|
||||
// System.out.println("页面 " + pageNum + " 二维码大小 (点): " + qrSize);
|
||||
|
||||
// 计算左上角的位置(PDF坐标系:原点在左下角)
|
||||
float qrX = visibleArea.getLeft() + MARGIN;
|
||||
float qrY = visibleArea.getTop() - qrSize - MARGIN;
|
||||
// float qrX = visibleArea.getLeft() + MARGIN;
|
||||
// float qrY = visibleArea.getTop() - qrSize - MARGIN;
|
||||
|
||||
// 打印二维码位置信息
|
||||
System.out.println("页面 " + pageNum + " 左上角二维码位置: x=" + qrX + ", y=" + qrY);
|
||||
|
||||
// System.out.println("页面 " + pageNum + " 左上角二维码位置: x=" + qrX + ", y=" + qrY);
|
||||
float qrX;
|
||||
float qrY;
|
||||
if (visibleArea.getWidth() > visibleArea.getHeight()) {
|
||||
qrX = H_QR_X;
|
||||
qrY = H_QR_Y;
|
||||
} else {
|
||||
qrX = V_QR_X;
|
||||
qrY = V_QR_Y;
|
||||
}
|
||||
try {
|
||||
// 使用Canvas API添加左上角二维码
|
||||
addQRCodeWithCanvas(pdfDoc, page, qrCodeBytes, qrX, qrY, qrSize);
|
||||
addQRCodeWithCanvas(pdfDoc, page, qrCodeBytes, qrX, qrY, QR_SIZE);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("在页面 " + pageNum + " 添加二维码时出错: " + e.getMessage());
|
||||
|
@ -16,6 +16,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.dromara.common.websocket.dto.WebSocketMessageDto;
|
||||
import org.dromara.common.websocket.utils.WebSocketUtils;
|
||||
import org.dromara.gps.domain.GpsManmachine;
|
||||
import org.dromara.gps.domain.bo.GpsEquipmentSonBo;
|
||||
import org.dromara.gps.domain.vo.GpsProjectVo;
|
||||
@ -39,6 +41,7 @@ import org.dromara.gps.service.IGpsEquipmentService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.Duration;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -212,8 +215,8 @@ public class GpsEquipmentServiceImpl extends ServiceImpl<GpsEquipmentMapper, Gps
|
||||
GpsEquipmentSonBo gpsEquipmentSon = JSONUtil.toBean(device, GpsEquipmentSonBo.class);
|
||||
|
||||
JSONObject location = device.getJSONObject("location");
|
||||
gpsEquipmentSon.setLocLatitude(location.getBigDecimal("latitude"));
|
||||
gpsEquipmentSon.setLocLongitude(location.getBigDecimal("longitude"));
|
||||
gpsEquipmentSon.setLocLatitude(location.getBigDecimal("latitude").divide(new BigDecimal("1000000"),6, RoundingMode.HALF_UP));
|
||||
gpsEquipmentSon.setLocLongitude(location.getBigDecimal("longitude").divide(new BigDecimal("1000000"),6, RoundingMode.HALF_UP));
|
||||
if (equipment != null) {
|
||||
gpsEquipmentSon.setProjectId(equipment.getProjectId());
|
||||
}
|
||||
@ -234,11 +237,52 @@ public class GpsEquipmentServiceImpl extends ServiceImpl<GpsEquipmentMapper, Gps
|
||||
|
||||
gpsEquipmentSonService.insertByBo(gpsEquipmentSon);
|
||||
//保存到redis,如果存在则更新存活时间
|
||||
|
||||
// --------------------------
|
||||
// 发布String类型订阅消息
|
||||
// --------------------------
|
||||
// 1. 构造需要推送的消息内容(String类型)
|
||||
String pushContent = buildPushMessage(gpsEquipmentSon);
|
||||
|
||||
// WebSocketUtils.publishAll(pushContent);
|
||||
// 2. 发布消息(根据是否有用户ID决定发送给指定用户或广播)
|
||||
if (equipment != null && equipment.getUserId() != null) {
|
||||
// 发送给指定用户(equipment.getUserId())
|
||||
WebSocketMessageDto messageDto = new WebSocketMessageDto();
|
||||
messageDto.setMessage(pushContent);
|
||||
messageDto.setSessionKeys(Collections.singletonList(equipment.getUserId()));
|
||||
WebSocketUtils.publishMessage(messageDto);
|
||||
} else {
|
||||
// 无用户ID则广播给所有在线客户端
|
||||
WebSocketUtils.publishAll(pushContent);
|
||||
}
|
||||
}
|
||||
// 保存到Redis并设置过期监听
|
||||
updateDeviceAliveStatus(gpsEquipment.getClientId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建推送消息内容(String类型)
|
||||
*/
|
||||
private String buildPushMessage(GpsEquipmentSonBo sonBo) {
|
||||
// 构造消息对象(包含关键信息)
|
||||
JSONObject messageObj = new JSONObject();
|
||||
messageObj.put("type", "GPS_DATA_UPDATE"); // 消息类型
|
||||
messageObj.put("clientId", sonBo.getClientId()); // 设备唯一标识
|
||||
messageObj.put("projectId", sonBo.getProjectId()); // 项目ID
|
||||
messageObj.put("userId", sonBo.getUserId()); // 关联用户ID
|
||||
|
||||
// 位置信息
|
||||
JSONObject locationObj = new JSONObject();
|
||||
locationObj.put("latitude", sonBo.getLocLatitude()); // 纬度
|
||||
locationObj.put("longitude", sonBo.getLocLongitude()); // 经度
|
||||
locationObj.put("altitude", sonBo.getLocAltitude()); // 海拔
|
||||
messageObj.put("location", locationObj);
|
||||
|
||||
// 转换为String类型返回
|
||||
return messageObj.toString();
|
||||
}
|
||||
|
||||
|
||||
private static final int DEVICE_ALIVE_TIMEOUT = 120; // 5分钟
|
||||
/**
|
||||
|
@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
@ -141,6 +142,7 @@ public class BusEnterRoadController extends BaseController {
|
||||
return busEnterRoad;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
Collections.reverse(busEnterRoads);
|
||||
busEnterRoadService.saveBatch(busEnterRoads);
|
||||
},
|
||||
projectId,
|
||||
|
@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
@ -132,6 +133,7 @@ public class BusLandBlockController extends BaseController {
|
||||
return busLandBlock;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
Collections.reverse(busLandBlocks);
|
||||
busLandBlockService.saveBatch(busLandBlocks);
|
||||
},
|
||||
projectId,
|
||||
|
@ -17,6 +17,8 @@ import org.dromara.tender.domain.bo.BusBillofquantitiesLimitListBo;
|
||||
import org.dromara.tender.domain.bo.TenderAllVersionNumbersReq;
|
||||
import org.dromara.tender.domain.vo.BusBLimitListVersionsVo;
|
||||
import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListVo;
|
||||
import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListWuZiVo;
|
||||
import org.dromara.tender.enums.LimitListTypeEnum;
|
||||
import org.dromara.tender.service.IBusBillofquantitiesLimitListService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -89,8 +91,13 @@ public class BusTenderPlanLimitListController extends BaseController {
|
||||
@Log(title = "限价一览", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusBillofquantitiesLimitListBo bo, HttpServletResponse response) {
|
||||
List<BusBillofquantitiesLimitListVo> list = busBillofquantitiesLimitListService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "限价一览", BusBillofquantitiesLimitListVo.class, response);
|
||||
if (LimitListTypeEnum.SUB_COMPANY.getCode().equals(bo.getType())){
|
||||
List<BusBillofquantitiesLimitListVo> list = busBillofquantitiesLimitListService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "限价一览", BusBillofquantitiesLimitListVo.class, response);
|
||||
}else {
|
||||
List<BusBillofquantitiesLimitListWuZiVo> list = busBillofquantitiesLimitListService.queryVoList(bo);
|
||||
ExcelUtil.exportExcel(list, "限价一览", BusBillofquantitiesLimitListWuZiVo.class, response);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,6 +99,15 @@ public class BusBillofquantitiesLimitList extends BaseEntity {
|
||||
* 总价
|
||||
*/
|
||||
// private BigDecimal price;
|
||||
/**
|
||||
* 供应单位
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractNumber;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
@ -95,6 +95,16 @@ public class BusBillofquantitiesLimitListBo extends BaseEntity {
|
||||
*/
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 供应单位
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractNumber;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
|
@ -135,5 +135,10 @@ public class BusBiddingPlanVo implements Serializable {
|
||||
*/
|
||||
private Long winningBidderId;
|
||||
|
||||
/**
|
||||
* 招标文件数量
|
||||
*/
|
||||
private Long annexCount;
|
||||
|
||||
|
||||
}
|
||||
|
@ -135,6 +135,16 @@ public class BusBillofquantitiesLimitListVo implements Serializable {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 供应单位
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractNumber;
|
||||
|
||||
/**
|
||||
* 子节点
|
||||
*/
|
||||
|
@ -0,0 +1,153 @@
|
||||
package org.dromara.tender.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.tender.domain.BusBillofquantitiesLimitList;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 限价一览视图对象 bus_billofquantities_limit_list
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusBillofquantitiesLimitList.class)
|
||||
public class BusBillofquantitiesLimitListWuZiVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@ExcelProperty(value = "版本号")
|
||||
private String versions;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
@ExcelProperty(value = "表名")
|
||||
private String sheet;
|
||||
|
||||
/**
|
||||
* 子ID
|
||||
*/
|
||||
@ExcelProperty(value = "子ID")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 父ID
|
||||
*/
|
||||
@ExcelProperty(value = "父ID")
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@ExcelProperty(value = "编号")
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@ExcelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ColumnWidth(50)
|
||||
@ExcelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
private BigDecimal useQuantity;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@ExcelProperty(value = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
@ExcelProperty(value = "税率(%)")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
// @ExcelProperty(value = "总价")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 供应单位
|
||||
*/
|
||||
@ExcelProperty(value = "供应单位")
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
@ExcelProperty(value = "合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 子节点
|
||||
*/
|
||||
private List<BusBillofquantitiesLimitListWuZiVo> children = new ArrayList<>();
|
||||
|
||||
}
|
@ -67,4 +67,6 @@ public interface IBusBiddingPlanAnnexService extends IService<BusBiddingPlanAnne
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
Long getCount(Long id);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListWuZiVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -109,4 +110,6 @@ public interface IBusBillofquantitiesLimitListService extends IService<BusBillof
|
||||
BusBillofquantitiesLimitListVo queryBySId(String pid);
|
||||
|
||||
List<BusBillofquantitiesLimitListVo> queryVoByIds(List<Long> ids);
|
||||
|
||||
List<BusBillofquantitiesLimitListWuZiVo> queryVoList(BusBillofquantitiesLimitListBo bo);
|
||||
}
|
||||
|
@ -130,4 +130,9 @@ public class BusBiddingPlanAnnexServiceImpl extends ServiceImpl<BusBiddingPlanAn
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getCount(Long id) {
|
||||
return baseMapper.selectCount(new LambdaQueryWrapper<BusBiddingPlanAnnex>().eq(BusBiddingPlanAnnex::getBiddingPlanId,id));
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ public class BusBiddingPlanServiceImpl extends ServiceImpl<BusBiddingPlanMapper,
|
||||
public TableDataInfo<BusBiddingPlanVo> queryPageList(BusBiddingPlanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBiddingPlan> lqw = buildQueryWrapper(bo);
|
||||
Page<BusBiddingPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(item -> item.setAnnexCount(busBiddingPlanAnnexService.getCount(item.getId())));
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@ -195,6 +196,9 @@ public class BusBiddingPlanServiceImpl extends ServiceImpl<BusBiddingPlanMapper,
|
||||
if ((bo.getBidFile() == null || bo.getBidFile().isEmpty()) && (bo.getContractPrice() != null ||bo.getWinningBidderId() != null)){
|
||||
throw new ServiceException("中标文件未上传");
|
||||
}
|
||||
if (bo.getPrice()!=null && bo.getContractPrice()!=null && bo.getContractPrice().compareTo(bo.getPrice()) >0){
|
||||
throw new ServiceException("合同金额不能超过总价");
|
||||
}
|
||||
}
|
||||
}
|
||||
// validEntityBeforeSave(update);
|
||||
|
@ -22,10 +22,12 @@ import org.dromara.tender.domain.bo.BusBillofquantitiesLimitListBo;
|
||||
import org.dromara.tender.domain.bo.TenderAllVersionNumbersReq;
|
||||
import org.dromara.tender.domain.vo.BusBLimitListVersionsVo;
|
||||
import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListVo;
|
||||
import org.dromara.tender.domain.vo.BusBillofquantitiesLimitListWuZiVo;
|
||||
import org.dromara.tender.enums.LimitListTypeEnum;
|
||||
import org.dromara.tender.mapper.BusBillofquantitiesLimitListMapper;
|
||||
import org.dromara.tender.service.IBusBLimitListVersionsService;
|
||||
import org.dromara.tender.service.IBusBillofquantitiesLimitListService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -193,7 +195,6 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl<BusBill
|
||||
if (bo.getType().equals(LimitListTypeEnum.COMPANY.getCode())){
|
||||
listVoList = baseMapper.selectByBoByType(bo);
|
||||
}else {
|
||||
|
||||
listVoList = baseMapper.selectByBo(bo);
|
||||
}
|
||||
//过滤数量和单价为空的数据并计算总价
|
||||
@ -255,7 +256,7 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl<BusBill
|
||||
file, // 上传的文件
|
||||
1, // 跳过1行(表头)
|
||||
0, // 从第0列开始
|
||||
14, // 到第5列结束
|
||||
16, // 到第5列结束
|
||||
BusBillofquantitiesLimitListBo.class // 目标实体类
|
||||
);
|
||||
List<BusBillofquantitiesLimitList> busBillofquantities = new ArrayList<BusBillofquantitiesLimitList>();
|
||||
@ -270,6 +271,10 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl<BusBill
|
||||
limitList.setType(bo.getType());
|
||||
limitList.setUnitPrice(item.getUnitPrice());
|
||||
limitList.setTaxRate(item.getTaxRate());
|
||||
if (LimitListTypeEnum.SPECIAL.getCode().equals(bo.getType())){
|
||||
limitList.setSupplier(item.getSupplier());
|
||||
limitList.setContractNumber(item.getContractNumber());
|
||||
}
|
||||
busBillofquantities.add(limitList);
|
||||
});
|
||||
if (CollUtil.isEmpty(busBillofquantities)) {
|
||||
@ -303,6 +308,19 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl<BusBill
|
||||
return baseMapper.selectVoByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusBillofquantitiesLimitListWuZiVo> queryVoList(BusBillofquantitiesLimitListBo bo) {
|
||||
LambdaQueryWrapper<BusBillofquantitiesLimitList> lqw = buildQueryWrapper(bo);
|
||||
List<BusBillofquantitiesLimitListVo> listVoList = baseMapper.selectVoList(lqw);
|
||||
List<BusBillofquantitiesLimitListWuZiVo> wuZiVoArrayList = new ArrayList<>();
|
||||
listVoList.forEach(item -> {
|
||||
BusBillofquantitiesLimitListWuZiVo vo = new BusBillofquantitiesLimitListWuZiVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
wuZiVoArrayList.add(vo);
|
||||
});
|
||||
return wuZiVoArrayList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归构建树形结构
|
||||
*
|
||||
|
@ -97,6 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
bbll.quantity as quantity,
|
||||
bbll.unit_price as unitPrice,
|
||||
bbll.tax_rate as taxRate,
|
||||
bbll.supplier as supplier,
|
||||
bbll.contract_number as contractNumber,
|
||||
bbll.remark as remark,
|
||||
SUM(btpll.num) AS useQuantity
|
||||
FROM
|
||||
@ -138,6 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
bbll.quantity as quantity,
|
||||
bbll.tax_rate as taxRate,
|
||||
bbll.unit_price as unitPrice,
|
||||
bbll.supplier as supplier,
|
||||
bbll.contract_number as contractNumber,
|
||||
bbll.remark as remark,
|
||||
SUM(btpll.num) AS useQuantity
|
||||
FROM
|
||||
|
@ -205,7 +205,7 @@ public class WorkflowGlobalListener implements GlobalListener {
|
||||
//给处理人发消息重新统计数据
|
||||
|
||||
if (task != null) {
|
||||
flwCommonService.sendCountMessage(task.getId());
|
||||
flwCommonService.sendCountMessage(task);
|
||||
}
|
||||
// 只有办理或者退回的时候才执行消息通知和抄送
|
||||
if (TaskStatusEnum.PASS.getStatus().equals(flowParams.getHisStatus())
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.workflow.service;
|
||||
|
||||
import org.dromara.warm.flow.core.entity.Task;
|
||||
import org.dromara.workflow.domain.bo.FlowCopyBo;
|
||||
|
||||
import java.util.List;
|
||||
@ -32,7 +33,7 @@ public interface IFlwCommonService {
|
||||
/**
|
||||
* 发送统计消息
|
||||
*/
|
||||
void sendCountMessage(Long taskId);
|
||||
void sendCountMessage(Task task);
|
||||
|
||||
/**
|
||||
* 发送抄送消息
|
||||
|
@ -15,21 +15,30 @@ import org.dromara.common.sse.config.SseProperties;
|
||||
import org.dromara.common.sse.dto.SeeMessageContentDto;
|
||||
import org.dromara.common.sse.dto.SseMessageDto;
|
||||
import org.dromara.common.sse.utils.SseMessageUtils;
|
||||
import org.dromara.warm.flow.core.FlowEngine;
|
||||
import org.dromara.warm.flow.core.entity.Definition;
|
||||
import org.dromara.warm.flow.core.entity.Node;
|
||||
import org.dromara.warm.flow.core.entity.Task;
|
||||
import org.dromara.warm.flow.core.enums.SkipType;
|
||||
import org.dromara.warm.flow.core.service.DefService;
|
||||
import org.dromara.warm.flow.core.service.NodeService;
|
||||
import org.dromara.warm.flow.core.service.UserService;
|
||||
import org.dromara.warm.flow.orm.entity.FlowDefinition;
|
||||
import org.dromara.warm.flow.orm.entity.FlowNode;
|
||||
import org.dromara.warm.flow.orm.entity.FlowTask;
|
||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||
import org.dromara.workflow.common.enums.MessageTypeEnum;
|
||||
import org.dromara.workflow.domain.bo.FlowCopyBo;
|
||||
import org.dromara.workflow.service.IFlwCommonService;
|
||||
import org.dromara.workflow.service.IFlwDefinitionService;
|
||||
import org.dromara.workflow.service.IFlwTaskAssigneeService;
|
||||
import org.dromara.workflow.service.IFlwTaskService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@ -59,9 +68,9 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
|
||||
return List.of();
|
||||
}
|
||||
IFlwTaskAssigneeService taskAssigneeService = SpringUtils.getBean(IFlwTaskAssigneeService.class);
|
||||
String processedBys = CollUtil.join(permissionList, StringUtils.SEPARATOR);
|
||||
String processedBys = CollUtil.join(permissionList, StringUtils.SEPARATOR);
|
||||
// 根据 processedBy 前缀判断处理人类型,分别获取用户列表
|
||||
List<UserDTO> users = taskAssigneeService.fetchUsersByStorageIds(processedBys,null);
|
||||
List<UserDTO> users = taskAssigneeService.fetchUsersByStorageIds(processedBys, null);
|
||||
|
||||
return StreamUtils.toList(users, userDTO -> String.valueOf(userDTO.getUserId()));
|
||||
}
|
||||
@ -75,7 +84,7 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
|
||||
* @param message 消息内容,为空则发送默认配置的消息内容
|
||||
*/
|
||||
@Override
|
||||
public void sendMessage(String flowName,String flowCode, Long instId, List<String> messageType, String message) {
|
||||
public void sendMessage(String flowName, String flowCode, Long instId, List<String> messageType, String message) {
|
||||
IFlwTaskService flwTaskService = SpringUtils.getBean(IFlwTaskService.class);
|
||||
List<UserDTO> userList = new ArrayList<>();
|
||||
List<FlowTask> list = flwTaskService.selectByInstId(instId);
|
||||
@ -126,11 +135,28 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void sendCountMessage(Long taskId) {
|
||||
@Override
|
||||
public void sendCountMessage(Task task) {
|
||||
IFlwTaskService flwTaskService = SpringUtils.getBean(IFlwTaskService.class);
|
||||
IFlwTaskAssigneeService flwTaskAssigneeService = SpringUtils.getBean(IFlwTaskAssigneeService.class);
|
||||
|
||||
DefService defService = FlowEngine.defService();
|
||||
Definition definition = defService.getById(task.getDefinitionId());
|
||||
|
||||
FlowNode byNodeCode = flwTaskService.getByNodeCode(task.getNodeCode(), task.getDefinitionId());
|
||||
String permissionFlag = byNodeCode.getPermissionFlag();
|
||||
if(permissionFlag == null){
|
||||
return;
|
||||
}
|
||||
|
||||
permissionFlag = permissionFlag.replace("@@", ",");
|
||||
String flowCode = definition.getFlowCode();
|
||||
String projectId = flowCode.split("_")[0];
|
||||
List<UserDTO> users = flwTaskAssigneeService.fetchUsersByStorageIds(permissionFlag, Long.valueOf(projectId));
|
||||
|
||||
|
||||
List<UserDTO> userList = new ArrayList<>();
|
||||
List<UserDTO> users = flwTaskService.currentTaskAllUser(taskId);
|
||||
|
||||
if (CollUtil.isNotEmpty(users)) {
|
||||
userList.addAll(users);
|
||||
}
|
||||
@ -145,10 +171,9 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void sendCopyMessage(String flowName, String flowCode, List<FlowCopyBo> flowCopyList) {
|
||||
if(CollUtil.isEmpty(flowCopyList)){
|
||||
if (CollUtil.isEmpty(flowCopyList)) {
|
||||
return;
|
||||
}
|
||||
SseMessageDto dto = new SseMessageDto();
|
||||
|
Reference in New Issue
Block a user